/* Dartsity: the stage event page. Everything is prefixed .ds so it can't
   reach into the rest of the site.

   The weight here comes from depth rather than effects: a lit background with
   a vignette, cards that are physical objects with a gradient and a cast
   shadow, a floor under the row, and photography given room to carry colour. */

.ds {
  --gold: #c9a961;
  --gold-hi: #e3c98c;
  --ds-ink: #f2f2f2;
  --ds-dim: #96948f;
  --ds-faint: #67655f;
  --ds-line: #2a2724;
  position: relative;
  color: var(--ds-ink);
  background: #0a0a0b;
}
.ds * { box-sizing: border-box; }

/* A fine grain over the whole page. Flat black reads as an empty div; a
   little tooth reads as a printed surface. */
.ds::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: .042; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter>\
<rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.ds-kicker {
  font-size: clamp(11px, 1.05vw, 13px); letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-hi); margin: 0 0 18px;
}
.ds-tagline {
  color: var(--ds-dim); margin: 0;
  font-size: clamp(15px, 2.1vw, 21px); letter-spacing: -.005em;
}

/* ------------------------------------------------------------- the stage */

.ds-stage {
  position: relative;
  min-height: calc(100svh - var(--ds-top, 50px));
  display: grid; place-items: center;
  padding: 40px 20px 66px;
  isolation: isolate;
}
/* Lit from above, dark at the corners. */
.ds-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(130% 78% at 50% -14%, rgba(201,169,97,.13) 0%, rgba(201,169,97,.04) 34%, transparent 62%),
    radial-gradient(120% 92% at 50% 42%, #141414 0%, #0b0b0c 58%, #060607 100%);
}
.ds-stage-inner {
  position: relative; text-align: center;
  width: 100%; max-width: min(1180px, 100%); min-width: 0;
}

/* A solid gold bar above the date. One decisive mark beats ten faint ones. */
.ds-mark {
  width: 54px; height: 3px; margin: 0 auto 20px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
}

/* ---------------------------------------------------------------------
   The masthead face.

   Anton is a condensed display face, so it carries far more weight across
   the width than a bold text face does. To try another, change the name in
   BOTH places: here and in the <link> at the top of
   layouts/_default/dartsity.html.

     "Anton"          heavy and condensed, the sports-poster option
     "Archivo Black"  heavy and wider, more newspaper than poster
     "Oswald"         condensed and lighter, more restrained

   font-weight stays at 800 so the fallback is heavy if the font
   fails to load; font-synthesis-weight stops the browser faux-bolding a
   face that only has one weight.
   --------------------------------------------------------------------- */
.ds-title {
  font-family: "Anton", "D-DIN PRO", system-ui, sans-serif;
  font-synthesis-weight: none;
  /* Bounded by the window's height as well as its width, so a big title can
     never push the line-up off a short screen. */
  font-size: max(52px, min(13.5vw, 18.5vh, 184px));
  line-height: 1.02; padding-bottom: .06em;   /* room for a descender */
  letter-spacing: .006em; font-weight: 800; text-transform: uppercase;
  margin: 0 0 18px; color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,.6);
}

/* The billing line, as a poster would set it. */
.ds-billing {
  margin: 14px 0 0; font-size: clamp(10.5px, 1.05vw, 12.5px);
  letter-spacing: .2em; text-transform: uppercase; color: var(--ds-faint);
}
.ds-billing span { color: var(--ds-dim); }
.ds-billing i { font-style: normal; color: var(--gold); margin: 0 10px; }

.ds-venue {
  margin: 10px 0 0; font-size: clamp(12px, 1.2vw, 14px);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ds-dim);
}

/* ------------------------------------------------------------- the cast */

.ds-cast-wrap {
  --cast-h: clamp(150px, 27vh, 300px);
  position: relative;
  margin: clamp(26px, 4vh, 48px) 0 clamp(16px, 2.2vh, 26px);
}

.ds-cast {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: flex-end; justify-content: center;
}

/* Set out like bowling pins seen from the front: the captain at the point,
   and every step out from him is a row further back. Further back means
   smaller, higher up, dimmer, and behind its neighbour. --d is how many
   steps out a seat is; the template works it out from the captain's place. */
.ds-cast-fig {
  /* Bounded on purpose: a bad --d once produced a 33-million-pixel page, and
     the layout should degrade to something sane rather than explode. */
  --fig-h: clamp(40px, calc(var(--cast-h) * (1 - var(--d, 0) * .09)), var(--cast-h));
  position: relative;
  z-index: var(--z, 1);
  /* An explicit box both ways. A photo of any shape sits inside it rather
     than deciding its size, so no figure can collapse. */
  height: var(--fig-h);
  width: calc(var(--fig-h) * .72);
  margin-inline: calc(var(--cast-h) * -.085);     /* tuck behind the one in front */
  /* Every figure stands on the floor line. The sense of rows going back
     comes from the scale and the dimming, not from lifting them off it. */
  margin-bottom: 0;
  color: #3a3a3a;                                 /* the silhouette's fill */
  filter: drop-shadow(0 18px 20px rgba(0,0,0,.8))
          brightness(clamp(.3, calc(1 - var(--d, 0) * .16), 1));
}
.ds-cast-fig > img,
.ds-cast-fig > .ds-sil,
.ds-cast-fig > .ds-sil-fallback > .ds-sil {
  width: 100%; height: 100%; display: block;
  object-fit: contain; object-position: bottom center;
}
.ds-cast-fig.is-named { color: #2e2e2e; }

/* The placeholder only appears if a named player's photo is missing. */
.ds-sil-fallback { display: none; }
.ds-cast-fig.img-missing > .ds-sil-fallback { display: block; width: 100%; height: 100%; }

/* The floor. Nothing is measured: this element sits directly under the cast,
   so its top edge is the baseline the figures stand on. */
.ds-floor { position: relative; height: 0; }
.ds-floor::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 1080px); height: 110px; pointer-events: none;
  background:
    radial-gradient(62% 110% at 50% 0%, rgba(201,169,97,.16), transparent 72%),
    linear-gradient(90deg, transparent, rgba(201,169,97,.36) 22%, rgba(201,169,97,.36) 78%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 0 2px, rgba(0,0,0,.20) 2px, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0 2px, rgba(0,0,0,.20) 2px, transparent 82%);
}

/* Names in their own row, one equal column per seat, so overlapping figures
   never push their labels into each other. */
.ds-cast-names {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr));
  gap: 4px;
}
.ds-cast-names li { text-align: center; min-width: 0; }
.ds-cast-role {
  margin: 0 0 3px; font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ds-faint);
}
.ds-cast-names .is-named .ds-cast-role { color: var(--gold); }
.ds-cast-name {
  margin: 0; font-size: clamp(10px, 1.15vw, 13px); line-height: 1.25; color: var(--ds-dim);
}
.ds-cast-names .is-named .ds-cast-name { color: #fff; font-weight: 650; }

.ds-blurb {
  max-width: 58ch; margin: 0 auto; color: var(--ds-dim);
  font-size: clamp(13.5px, 1.6vw, 15.5px); line-height: 1.75;
}

.ds-countdown {
  display: inline-block; margin: clamp(14px, 2vh, 24px) 0 0;
  padding: 7px 16px; border: 1px solid rgba(201,169,97,.32); border-radius: 2px;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-hi); font-variant-numeric: tabular-nums;
  background: rgba(201,169,97,.045);
  min-height: 1.2em;
}
.ds-countdown:empty { display: none; }

.ds-scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 3px;
  color: var(--ds-faint); text-decoration: none;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
}
.ds-scroll-cue:hover { color: var(--gold); }

/* ------------------------------------------------------- a player section */

.ds-player {
  position: relative;
  min-height: calc(100svh - var(--ds-top, 50px));
  display: grid; place-items: center;
  padding: 84px 20px;
  border-top: 1px solid #1c1a18;
  background:
    radial-gradient(90% 70% at 22% 46%, rgba(201,169,97,.055), transparent 62%),
    linear-gradient(180deg, #0c0c0d, #090909);
}
.ds-player.is-tbd { background: linear-gradient(180deg, #0a0a0b, #080808); }

.ds-player-inner {
  width: 100%; max-width: min(1040px, 100%); min-width: 0;
  display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px); align-items: center;
}

.ds-player-art {
  position: relative;
  aspect-ratio: 3 / 4; border-radius: 2px; overflow: hidden;
  border: 1px solid #343129;
  background: linear-gradient(180deg, #1b1a18, #0e0e0f);
  box-shadow: 0 36px 70px -32px rgba(0,0,0,1), inset 0 1px 0 rgba(255,255,255,.05);
  display: grid; place-items: end center; color: #2a2a2b;
}
.ds-player-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-player:not(.is-tbd) .ds-player-art { border-color: rgba(201,169,97,.4); }
.ds-player:not(.is-tbd) .ds-player-art::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.ds-player-role {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
.ds-player.is-tbd .ds-player-role { color: var(--ds-faint); }

/* The site stylesheet sets every h2 uppercase and gold. A name reads better
   as a name, so this page states its own. */
.ds-player-name {
  font-size: clamp(32px, 5.6vw, 64px); line-height: 1.04; padding-bottom: .04em;
  letter-spacing: -.028em; font-weight: 750;
  text-transform: none; color: #fff; margin: 0 0 18px;
}
.ds-player.is-tbd .ds-player-name { color: #6d6b67; font-weight: 500; }

.ds-player-blurb {
  color: var(--ds-dim); line-height: 1.75; margin: 0 0 28px;
  max-width: 54ch; font-size: clamp(14px, 1.65vw, 16px);
}

/* Nickname under the name, the way a darts bill sets it. */
.ds-player-nickname {
  margin: -8px 0 14px; color: var(--gold-hi);
  font-size: clamp(16px, 2.1vw, 23px); font-style: italic; letter-spacing: -.01em;
}

/* Hometown and current order of merit place, on one line. */
.ds-player-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 20px; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ds-dim);
}
.ds-player-meta span + span::before {
  content: "/"; color: var(--gold); margin-right: 10px;
}
.ds-player-meta:empty { display: none; }

/* The gold and purple stars, borrowed from the player profiles so they read
   the same in both places. */
.ds-awards {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin: 22px 0 0; padding-top: 18px;
  border-top: 1px solid #211f1d;
}


/* ------------------------------------------------------------ the outro */

.ds-outro {
  position: relative;
  min-height: 60svh; display: grid; place-items: center; text-align: center;
  padding: 84px 20px; border-top: 1px solid #1c1a18;
  background:
    radial-gradient(120% 90% at 50% 120%, rgba(201,169,97,.12), transparent 60%),
    linear-gradient(180deg, #090909, #0d0d0e);
}
.ds-outro h2 {
  font-family: "Anton", "D-DIN PRO", system-ui, sans-serif;
  font-synthesis-weight: none;
  font-size: max(44px, min(11vw, 18vh, 150px)); margin: 0 0 14px;
  line-height: 1.02; padding-bottom: .06em;
  letter-spacing: .006em; text-transform: uppercase; color: #fff; font-weight: 800;
}

/* ------------------------------------------- arriving as you scroll past */

/* The cast arrives once on load, left to right. This is a plain CSS
   animation with backwards fill, so the figures are on screen whether or not
   any script runs. */
@keyframes ds-rise { from { opacity: 0; transform: translateY(16px); } }
.ds-cast-fig {
  animation: ds-rise .55s cubic-bezier(.22,.7,.3,1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.ds-reveal { opacity: 0; transform: translateY(22px); }
.ds-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .55s ease, transform .6s cubic-bezier(.22,.7,.3,1);
}
.ds-player-body.ds-reveal.is-in { transition-delay: .1s; }

/* --------------------------------------------- laptops and short windows */

/* A 768-tall screen can't take the full-size masthead and the line-up at
   once, so everything steps down together rather than the page overflowing. */
@media (max-height: 940px) {
  .ds-stage { padding: 26px 20px 54px; }
  .ds-title { font-size: max(46px, min(12vw, 16vh, 150px)); margin-bottom: 12px; }
  .ds-kicker { margin-bottom: 14px; }
  .ds-mark { margin-bottom: 14px; }
  .ds-cast-wrap {
    --cast-h: clamp(126px, 21vh, 230px);
    margin: clamp(14px, 2.2vh, 30px) 0 clamp(10px, 1.6vh, 20px);
  }
  .ds-cast-names { margin-top: 20px; }
  .ds-blurb { font-size: 13.5px; line-height: 1.6; }
  .ds-countdown { margin-top: 14px; padding: 6px 14px; }
}

/* ----------------------------------------------------------------- phone */

@media (max-width: 760px) {
  .ds-player-inner { grid-template-columns: 1fr; gap: 26px; }
  .ds-player-art { max-width: 250px; margin: 0 auto; }
  .ds-player-body { text-align: center; }
  .ds-player-blurb { margin-left: auto; margin-right: auto; }
  .ds-player-meta, .ds-awards { justify-content: center; }
  .ds-billing i { margin: 0 6px; }
  /* Seven across is too wide for a phone, so the cast and its names scroll
     together as one block and keep their alignment. */
  .ds-cast-wrap {
    /* Sideways only. Setting overflow-x alone makes the browser allow
       vertical scrolling here too, and touch-action keeps an up-and-down
       swipe scrolling the page rather than being caught by this strip. */
    overflow-x: auto; overflow-y: hidden;
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;      /* no back-swipe at the ends */
    -webkit-overflow-scrolling: touch;
    /* fade the figures out at the edges instead of slicing them off */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  .ds-cast, .ds-cast-names, .ds-floor { min-width: 620px; }
  .ds-cast-wrap { --cast-h: clamp(118px, 19vh, 172px); }
  /* The phone header is two rows tall, so the hero has less to work with. */
  .ds-stage { padding: 20px 16px 46px; }
  .ds-billing { margin-top: 10px; }
  .ds-venue { margin-top: 8px; }
  .ds-cast-names { margin-top: 16px; }
  .ds-blurb { font-size: 13px; }
}

/* Anyone who has asked for less movement gets none of it. */
@media (prefers-reduced-motion: reduce) {
  .ds-cast-fig { animation: none; }
  .ds-reveal { opacity: 1; transform: none; transition: none; }
}
