/* ==========================================================================
   Stockyard marketing site
   Colours come from the app's dark theme (apps/mobile/src/lib/theme.ts):
   accent #12A3FC, positive #22C55E, negative #EF4444, gold #E8B23A, app ground
   #191919. Each accent has one job:
     blue  = interface (controls, links, focus, the app's own chrome, Classic)
     green = the market line and gains
     red   = losses, nothing else
     gold  = fantasy and the trophy, nothing else
   Type is one family, Mona Sans, used through its width axis: slightly wide
   for headlines, normal for reading, condensed for scoreboard numerals.
   Anything that recreates the app stays in Inter, the app's own font.
   Structure comes from space, scale and ground tone. Lines are kept only
   where they carry data (charts) or belong to the recreated app UI.
   ========================================================================== */

:root {
  /* grounds, one per chapter */
  --ink-0: #0e0f11;          /* hero, close */
  --ink-warm: #13120f;       /* fantasy chapter */
  --ink-cool: #0d1014;       /* classic + solo */
  --ink-stage: #17181b;      /* the app showcase */
  --app: #191919;
  --card: #1f1f22;
  --card-2: #27272b;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f2f3f5;
  --soft: #b9bdc5;
  --muted: #80868f;
  --blue: #12a3fc;
  --up: #22c55e;
  --down: #ef4444;
  --gold: #e8b23a;

  --sans: 'Mona Sans', system-ui, -apple-system, sans-serif;
  --ui: 'Inter', -apple-system, system-ui, sans-serif;
  --gutter: clamp(20px, 4.6vw, 64px);
  --max: 1240px;
  --nav-h: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0; background: var(--ink-0); color: var(--text);
  font: 400 17px/1.6 var(--sans); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--blue); color: #04121c; padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up { color: var(--up); }
.dn { color: var(--down); }
.gold { color: var(--gold); }
.blue { color: var(--blue); }
section { position: relative; }

/* ---------- type: four tiers, used sparingly ---------- */
.display, .statement, .h-m, .h-intro, .fx-step h3 { font-family: var(--sans); text-wrap: balance; }
/* XL: the hero, once */
.display {
  font-size: clamp(50px, 7.2vw, 108px); line-height: .94; font-weight: 600; font-stretch: 112%;
  letter-spacing: -.045em; max-width: 7.2em;
}
/* L: the three moments that earn it (fantasy, the app, the close) */
.statement { font-size: clamp(36px, 4.8vw, 70px); line-height: .98; font-weight: 600; font-stretch: 108%; letter-spacing: -.04em; }
/* M: chapter headings that let the visual do the talking */
.h-m { font-size: clamp(28px, 2.9vw, 42px); line-height: 1.06; font-weight: 560; font-stretch: 104%; letter-spacing: -.03em; }
/* the modes intro reads as a sentence, second half quieter */
.h-intro { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.15; font-weight: 520; font-stretch: 104%; letter-spacing: -.025em; }
.h-intro span { color: var(--muted); }
.lede { margin-top: 20px; max-width: 30em; color: var(--soft); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; text-wrap: pretty; }
.label { font-size: 15px; font-weight: 600; font-stretch: 100%; letter-spacing: -.005em; color: var(--soft); margin-bottom: 14px; }
.label.gold { color: var(--gold); }
.label.blue { color: var(--blue); }
.num { font-family: var(--sans); font-stretch: 78%; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.illus { font-size: 12px; color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  transition: background-color .3s;
}
.nav.is-scrolled {
  background: rgba(14, 15, 17, .72);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
}
.nav-row { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 650 19px/1 var(--sans); font-stretch: 112%; letter-spacing: -.03em; }
.brand img { width: 24px; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  display: block; padding: 8px 12px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="true"] { color: var(--text); background: rgba(255, 255, 255, .07); }

/* ---------- the market line (shared) ---------- */
.market-line { display: block; width: 100%; height: 100%; overflow: visible; }
.market-line .ml-stroke { fill: none; stroke: var(--up); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.market-line .ml-area { opacity: 0; transition: opacity 1s ease; }
.market-line.is-drawn .ml-area { opacity: 1; }
.market-line .ml-end { fill: var(--up); opacity: 0; transition: opacity .4s; }
.market-line.is-drawn .ml-end { opacity: 1; }

/* ---------- store status + text link ---------- */
/* Not a button: there is no listing yet, so it reads as a status. */
.store {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 13px;
  border-radius: 12px; background: rgba(255, 255, 255, .055); color: var(--soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
  font: 600 16px/1.05 var(--sans); letter-spacing: -.01em; white-space: nowrap; cursor: default;
}
.store i { font-size: 22px; color: var(--text); }
.store small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-bottom: 2px; }
.text-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 560; font-size: 16px; color: var(--text); padding: 10px 2px;
}
.text-link i { transition: transform .25s var(--ease); color: var(--blue); }
.text-link:hover i { transform: translateX(4px); }

/* ==========================================================================
   THE DEVICE: a generic modern phone, drawn in CSS. The frame should all but
   disappear; the screen is the subject. Sized by --w (outer width).
   ========================================================================== */
.device {
  --w: 320px;
  position: relative; width: var(--w); flex: none;
  padding: calc(var(--w) * .03);
  border-radius: calc(var(--w) * .17);
  background: #050506;
  box-shadow:
    0 0 0 1px #3a3b40,                       /* the rim, catching light */
    0 0 0 2.5px #141417,                     /* the rim's dark edge */
    0 calc(var(--w) * .12) calc(var(--w) * .22) calc(var(--w) * -.1) rgba(0, 0, 0, .55);
}
/* a faint top-left highlight on the rim, nothing glossy */
.device::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, .22), transparent 22%, transparent 78%, rgba(255, 255, 255, .08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
/* side button */
.device::after {
  content: ''; position: absolute; right: -3.5px; top: 27%; width: 2.5px; height: 11%;
  border-radius: 0 2px 2px 0; background: #2a2b30;
}
.screen {
  position: relative; overflow: hidden; container-type: inline-size;
  aspect-ratio: 393 / 852; border-radius: calc(var(--w) * .14);
  background: var(--app); display: flex; flex-direction: column;
}
.screen > img { width: 100%; flex: none; }
.sbar {
  position: relative; flex: none; height: 13.6cqi; display: flex; align-items: center; justify-content: space-between;
  padding: 1.2cqi 7.5cqi 0 9cqi; font: 600 4.2cqi/1 var(--ui); color: #fff; letter-spacing: -.01em;
}
.sbar .island {
  position: absolute; left: 50%; top: 2.9cqi; width: 31.5cqi; height: 9.3cqi; transform: translateX(-50%);
  border-radius: 99px; background: #000;
}
.sb-icons { display: flex; gap: 1.3cqi; font-size: 4.3cqi; }
.sb-icons i:last-child { font-size: 6cqi; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  min-height: min(100svh, 960px); display: grid; grid-template-rows: auto 1fr;
  padding-top: calc(var(--nav-h) + clamp(40px, 8vh, 96px)); overflow: hidden;
  background: radial-gradient(60% 60% at 82% 38%, rgba(232, 178, 58, .055), transparent 70%), var(--ink-0);
}
.hero-copy { position: relative; z-index: 2; width: 100%; }
.hero-sub { margin-top: 28px; max-width: 24em; font-size: clamp(17px, 1.4vw, 20px); color: var(--soft); text-wrap: pretty; }
.hero-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }

.hero-chart { position: relative; min-height: 300px; margin-top: -12vh; }
.hero-chart .market-line { position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - 52px); }
.axis { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; }
.axis li {
  position: absolute; top: 18px; transform: translateX(-50%);
  font: 500 13px/1 var(--sans); font-stretch: 112%; letter-spacing: .02em; color: rgba(255, 255, 255, .32);
}
.axis li:first-child { transform: none; }
.axis li:last-child { color: var(--soft); }

/* the trophy stands on Friday's close and lights the ground around it */
.hero-glow {
  position: absolute; left: var(--tx, 84%); top: var(--ty, 30%); width: clamp(360px, 46vw, 720px); aspect-ratio: 1.3;
  transform: translate(-50%, -62%); pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background: radial-gradient(closest-side, rgba(232, 178, 58, .2), rgba(232, 178, 58, .06) 45%, transparent 75%);
}
.is-landed .hero-glow { opacity: 1; }
.hero-trophy {
  position: absolute; width: clamp(170px, 19vw, 280px); height: auto;
  transform: translate(-50%, calc(-100% + 18px)) scale(.96); left: var(--tx, 84%); top: var(--ty, 10%);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .5));
  opacity: 0; transition: opacity .7s ease, transform 1.1s var(--ease);
}
.hero.is-landed .hero-trophy { opacity: 1; transform: translate(-50%, calc(-100% + 4px)); }
html:not(.js) .hero-trophy { opacity: 1; }

/* the week's result, set in type beside the close, no box */
.hero-note {
  position: absolute; left: var(--nx, 60%); top: var(--ny, 40%); transform: translateX(-100%);
  display: grid; grid-template-columns: auto auto auto; align-items: baseline; column-gap: 8px; text-align: right;
  opacity: 0; transition: opacity .6s ease .35s; white-space: nowrap;
}
.hero-note span { grid-column: 1 / -1; font-size: 13px; color: rgba(255, 255, 255, .5); font-weight: 500; margin-bottom: 2px; }
.hero-note b { font-size: 28px; line-height: 1.1; }
.hero-note i { font-style: normal; font-size: 13px; color: var(--muted); }
.hero.is-landed .hero-note { opacity: 1; }

/* ==========================================================================
   MODES: fantasy leads, the other two stand quietly behind it
   ========================================================================== */
.modes {
  padding-block: clamp(96px, 11vw, 160px) clamp(64px, 8vw, 112px);
  background: linear-gradient(var(--ink-0), var(--ink-0) 50%, var(--ink-warm));
}
.lead-mode {
  margin-top: clamp(56px, 7vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(40px, 6vw, 112px); align-items: center;
}
.lead-copy .lede { margin-bottom: 18px; }

/* an open scoreboard: the matchup at a scale the page can see */
.scoreboard { font-family: var(--ui); }
.sb-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 0 clamp(16px, 2vw, 32px); }
.sb-team { display: grid; gap: 10px; justify-items: start; }
.sb-r { justify-items: end; }
.sb-who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--soft); }
.sb-who img { width: 30px; }
.sb-n { font-size: clamp(64px, 7vw, 104px); line-height: .86; font-weight: 640; letter-spacing: -.035em; }
.sb-top > i { font-style: normal; font-size: 14px; color: var(--muted); padding-bottom: 12px; }
.sb-r .sb-n { color: var(--soft); }
.sb-rows { margin-top: clamp(28px, 3vw, 40px); display: grid; gap: 4px; }
.sb-rows li {
  display: grid; grid-template-columns: 1fr 76px 66px 76px 1fr; align-items: center;
  padding: 11px 16px; border-radius: 12px; font-size: 15px;
}
.sb-rows li:nth-child(odd) { background: rgba(255, 255, 255, .028); }
.sb-rows b { font-weight: 700; }
.sb-rows b:last-child { text-align: right; }
.sb-rows span { font-size: 17px; text-align: right; padding-right: 12px; }
.sb-rows span:nth-of-type(2) { text-align: left; padding: 0 0 0 12px; }
.scoreboard .illus { margin-top: 14px; text-align: right; }

/* sector tags: the app's own chips */
.sb-rows em, .mr em, .av-row em, .roster em {
  justify-self: center; font: 700 10.5px/1 var(--ui); letter-spacing: .06em; font-style: normal;
  color: color-mix(in srgb, var(--h, #8a9099) 62%, #fff); background: color-mix(in srgb, var(--h, #8a9099) 18%, transparent);
  padding: 5px 7px; border-radius: 6px; min-width: 44px; text-align: center;
}
.sb-rows em.flex, .mr em.flex { --h: #8a9099; }

.minor-modes {
  margin-top: clamp(56px, 6vw, 88px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px;
  max-width: 880px;
}
.minor { text-decoration: none; display: block; }
.minor .label { margin-bottom: 8px; }
.minor b {
  display: block; font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; font-weight: 520; font-stretch: 104%;
  letter-spacing: -.02em; color: var(--soft); transition: color .2s;
}
.minor:hover b { color: var(--text); }

/* ==========================================================================
   FANTASY: one phone, one week
   ========================================================================== */
.fantasy {
  padding-block: clamp(24px, 4vw, 64px) clamp(80px, 9vw, 140px);
  background: radial-gradient(50% 50% at 30% 45%, rgba(232, 178, 58, .05), transparent 70%), var(--ink-warm);
}
.fx { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); }

.fx-pin {
  position: sticky; top: calc(var(--nav-h) + 24px); align-self: start;
  display: grid; justify-items: end; gap: 14px;
}
.fx-pin .device { --w: min(380px, calc((100svh - var(--nav-h) - 80px) * .47)); }
.fx-pin .illus { width: var(--w); text-align: center; }
.fx-pin { --w: min(380px, calc((100svh - var(--nav-h) - 80px) * .47)); }

.fx-story { padding-top: clamp(40px, 8vh, 96px); }
.fx-story > .h-m { max-width: 11em; }
.fx-steps { padding-block: 0 14vh; }
.fx-step { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; transition: opacity .5s ease; }
.js .fx-step { opacity: .28; }
.fx-step.is-active { opacity: 1; }
.fx-step h3 { font-size: clamp(24px, 2.1vw, 30px); line-height: 1.1; font-weight: 580; font-stretch: 104%; letter-spacing: -.025em; }
.fx-step p { margin-top: 14px; color: var(--soft); max-width: 23em; }

/* the app surface (the app's own type: Inter) */
.stage {
  --step: 0;
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);
  font-family: var(--ui); font-variant-numeric: tabular-nums; font-size: 14px; line-height: 1.35;
}
.stage[data-step="1"] { --step: 1; }
.stage[data-step="2"] { --step: 2; }
.stage[data-step="3"] { --step: 3; }
.app-bar { display: flex; align-items: center; gap: 10px; padding: 6px 16px 4px; font-size: 16px; }
.app-bar i { font-size: 20px; color: var(--soft); }
.app-bar span { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.app-tabs {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center;
  font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line);
}
.app-tabs span { padding: 11px 0; transition: color .3s; }
.stage[data-step="0"] .app-tabs span:nth-child(1),
.stage[data-step="1"] .app-tabs span:nth-child(2),
.stage[data-step="2"] .app-tabs span:nth-child(3),
.stage[data-step="3"] .app-tabs span:nth-child(4) { color: var(--text); font-weight: 600; }
.tab-line {
  position: absolute; left: 0; bottom: -1px; width: 25%; height: 2px; background: var(--blue);
  transform: translateX(calc(var(--step) * 100%)); transition: transform .5s var(--ease);
}

.layer {
  grid-row: 3; grid-column: 1; min-height: 0; padding: 14px 12px;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .45s ease, transform .6s var(--ease), visibility 0s .45s;
}
.stage[data-step="0"] .l-draft,
.stage[data-step="1"] .l-match,
.stage[data-step="2"] .l-match,
.stage[data-step="3"] .l-stand { opacity: 1; visibility: visible; transform: none; transition-delay: .12s, .12s, 0s; }

/* draft */
.clock {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-radius: 14px; background: rgba(18, 163, 252, .1); box-shadow: inset 0 0 0 1px rgba(18, 163, 252, .35);
}
.clock small { display: block; color: var(--soft); font-size: 11.5px; }
.clock b { font-size: 15px; }
.clock-t { font: 650 30px/1 var(--sans); font-stretch: 78%; color: var(--blue); font-variant-numeric: tabular-nums; }
.board { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.board span {
  display: grid; place-items: center; height: 34px; border-radius: 8px;
  background: var(--card); font-weight: 700; font-size: 12.5px;
}
.board .bh { background: none; height: 20px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.board .bh.you { color: var(--blue); }
.board span.you { background: rgba(18, 163, 252, .14); color: #bfe6ff; }
.board span.open { box-shadow: inset 0 0 0 1px var(--line-2); background: none; }
.board span[data-p] { transition: opacity .3s ease, transform .4s var(--ease); }
.stage.is-drafting .board span[data-p]:not(.in) { opacity: 0; transform: scale(.85); }
.board span.pick { box-shadow: 0 0 0 2px var(--blue) inset; }
.avail { margin-top: 14px; }
.av-row {
  display: grid; grid-template-columns: 50px auto 1fr auto; align-items: center; gap: 8px;
  padding: 9px 2px; border-top: 1px solid var(--line); font-size: 13.5px;
}
.av-row em { justify-self: start; min-width: 0; }
.av-row small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av-row .btn { padding: 5px 12px; border-radius: 999px; background: var(--blue); color: #04121c; font-weight: 700; font-size: 11.5px; }
.av-row .tk { font-size: 11.5px; color: var(--muted); }
.av-row.taken { opacity: .45; }
.av-row[data-take] { max-height: 64px; overflow: hidden; transition: opacity .3s ease, transform .3s ease, max-height .4s var(--ease) .2s, padding .4s var(--ease) .2s, border-color .2s .2s; }
.stage.took .av-row[data-take] { opacity: 0; transform: translateX(-12px); max-height: 0; padding-block: 0; border-color: transparent; }

/* lineup + matchup share one surface */
.score {
  display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 6px;
  padding: 2px 2px 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line); position: relative; min-height: 58px;
}
.sc-side { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; transition: opacity .4s ease, transform .5s var(--ease); }
.sc-side img { width: 24px; height: auto; }
.sc-side strong { display: block; font-size: 11.5px; font-weight: 600; }
.sc-side small { display: none; }
.sc-r { align-items: flex-end; text-align: right; }
.sc-n { font: 650 36px/1 var(--sans); font-stretch: 76%; letter-spacing: -.01em; font-variant-numeric: tabular-nums; transition: opacity .4s ease; }
.sc-nr { color: var(--soft); }
.sc-vs { font-size: 11px; color: var(--muted); font-weight: 600; transition: opacity .4s ease; }
.sc-lineup {
  position: absolute; inset: 2px 2px 12px; display: flex; flex-direction: column; justify-content: center;
  transition: opacity .35s ease;
}
.sc-lineup b { font-size: 17px; }
.sc-lineup small { color: var(--muted); font-size: 12px; }
.stage[data-step="1"] .sc-side, .stage[data-step="1"] .sc-vs, .stage[data-step="1"] .sc-n { opacity: 0; }
.stage[data-step="1"] .sc-r { transform: translateX(24px); }
.stage[data-step="2"] .sc-lineup, .stage[data-step="3"] .sc-lineup, .stage[data-step="0"] .sc-lineup { opacity: 0; }

.mr {
  display: grid; grid-template-columns: 1fr 44px auto 44px 1fr; align-items: center; gap: 5px;
  padding: 7px 2px; border-bottom: 1px solid var(--line);
}
.mr:last-child { border-bottom: 0; }
.mr b { font-size: 13.5px; font-weight: 700; }
.mr small { display: block; font-size: 10.5px; }
.me, .them { position: relative; min-width: 0; }
.them { text-align: right; }
.mr .nm { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr .ch { display: none; }
.stage[data-step="2"] .mr .ch { display: block; }
.stage[data-step="2"] .mr .nm { display: none; }
.mr em { min-width: 40px; padding: 4px 5px; font-size: 9.5px; }
.pt { text-align: right; font-weight: 700; font-size: 13px; transition: opacity .4s ease; }
.pt.op { text-align: left; }
.stage[data-step="1"] .pt { opacity: 0; }
.them b, .them small { transition: opacity .4s ease calc(var(--i) * 55ms), transform .55s var(--ease) calc(var(--i) * 55ms); }
.stage[data-step="2"] .pt { transition-delay: calc(.25s + var(--i) * 55ms); }
.them::after {
  content: ''; position: absolute; right: 0; top: 50%; width: 46%; height: 9px; margin-top: -4.5px;
  border-radius: 4px; background: var(--card-2); transition: opacity .3s ease;
}
.stage[data-step="2"] .them::after { opacity: 0; }
.stage[data-step="1"] .them b, .stage[data-step="1"] .them small { opacity: 0; transform: translateX(18px); }

/* standings */
.st-h, .st li { display: grid; grid-template-columns: 18px 26px 1fr 34px 50px; align-items: center; gap: 7px; }
.st-h { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 8px; }
.st-h span:first-child { grid-column: 1 / 4; }
.st-h span:not(:first-child), .st li span { text-align: right; }
.st li { padding: 9px 8px; border-top: 1px solid var(--line); font-size: 13px; transition: transform .7s var(--ease); }
.st li i { font-style: normal; color: var(--muted); font-weight: 600; }
.st li img { width: 24px; }
.st li.me { background: rgba(232, 178, 58, .09); border-radius: 10px; border-top-color: transparent; }
.st li.me b { color: var(--gold); }
.st li.out { opacity: .55; }
.st li.cut {
  display: block; padding: 8px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  border-top: 1px dashed rgba(232, 178, 58, .45);
}
.st-cup { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(232, 178, 58, .08); }
.st-cup img { width: 38px; }
.st-cup b { display: block; font-size: 13.5px; }
.st-cup small { color: var(--soft); font-size: 12px; }

/* phones: each step carries its own copy of the device (built in main.js) */
.step-stage { display: none; }

/* ==========================================================================
   RULES: one roster, two switches
   ========================================================================== */
.rules {
  padding-block: clamp(48px, 6vw, 96px) clamp(96px, 10vw, 150px);
  background: linear-gradient(var(--ink-warm), var(--ink-warm) 60%, var(--ink-cool));
}
.rules-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.console { margin-top: clamp(36px, 4vw, 52px); display: grid; gap: 32px; }
.ctl-name { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.ctl-copy { margin-top: 12px; color: var(--soft); font-size: 15px; min-height: 2.6em; max-width: 26em; }
.seg {
  position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06);
}
.seg button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--muted);
  transition: color .25s; min-width: 112px;
}
.seg button[aria-checked="true"] { color: #04121c; }
.seg button:active { transform: scale(.98); }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--blue); transition: transform .4s var(--ease);
}
.seg[data-index="1"] .seg-thumb { transform: translateX(100%); }

.roster { padding-top: 8px; }
.ro-h { display: flex; justify-content: space-between; padding: 0 0 14px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ro-h b { color: var(--text); margin-left: 6px; }
.roster li {
  display: grid; grid-template-columns: 58px 62px minmax(0, 120px) 1fr 76px 18px; align-items: center; gap: 14px;
  padding: 10px 0; font-variant-numeric: tabular-nums;
}
.roster em { justify-self: start; transition: color .35s, background-color .35s; }
.roster[data-draft="open"] em { --h: #8a9099 !important; }
.roster b { font-weight: 650; transition: opacity .16s; }
.roster small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .16s; }
.roster .swap { opacity: 0; }
.bar {
  height: 6px; border-radius: 3px; background: var(--blue); transform-origin: left;
  transform: scaleX(calc(var(--w) / 24)); --w: var(--m);
  transition: transform .6s var(--ease), background-color .4s;
}
.roster[data-money="locked"] .bar { --w: 12.5; background: #5f7c92; }
.amt { text-align: right; font-weight: 600; }
.lock { color: var(--muted); font-size: 15px; opacity: 0; transition: opacity .3s; }
.roster[data-money="locked"] .lock { opacity: 1; }

/* ==========================================================================
   CLASSIC: the field
   ========================================================================== */
.classic {
  padding-block: 0 clamp(48px, 5vw, 80px);
  background: radial-gradient(60% 50% at 70% 55%, rgba(18, 163, 252, .05), transparent 70%), var(--ink-cool);
}
.field { position: relative; height: clamp(320px, 40vw, 560px); margin-top: clamp(24px, 3vw, 40px); }
.field-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.field-svg .base { stroke: rgba(255, 255, 255, .12); stroke-dasharray: 2 6; }
.field-svg .runner { fill: none; stroke: #4d535c; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.field-svg .runner.lead { stroke: var(--up); stroke-width: 2.6; }
.field-svg .runner.second { stroke: #7fd9a0; stroke-width: 1.8; }
.field-svg .runner.loss { stroke: var(--down); stroke-width: 1.8; }
.field-svg .origin { fill: var(--text); }
.field-svg .origin-label { fill: var(--soft); font: 600 13px var(--sans); }
.field-svg .tag { font: 600 14px var(--sans); fill: var(--soft); opacity: 0; transition: opacity .5s ease; }
.field-svg .tag tspan.v { font-weight: 700; }
.field-svg .tag.lead { fill: var(--text); }
.field.is-done .tag { opacity: 1; }
/* the real podium finishes the field: it rises out of the chart's last stretch */
.classic-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 48px; align-items: start;
  margin-top: clamp(24px, 3vw, 40px);
}
.podium {
  width: 100%; border-radius: 20px; margin-top: calc(-1 * clamp(40px, 6vw, 96px)); position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 40px 70px -30px rgba(0, 0, 0, .85);
  opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .9s var(--ease);
}
.classic.is-up .podium, html:not(.js) .podium { opacity: 1; transform: none; }
.terms { margin-top: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 760px; }
.terms dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.terms dd { margin-top: 6px; font-weight: 560; }

/* ==========================================================================
   SOLO
   ========================================================================== */
.solo { padding-block: clamp(72px, 8vw, 120px) clamp(24px, 3vw, 48px); background: var(--ink-cool); }
.solo-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.bal-pick { margin-top: clamp(36px, 4vw, 56px); }
.cap { font-size: 13px; color: var(--muted); font-weight: 600; }
.bal { margin-top: 6px; font-size: clamp(48px, 5.6vw, 80px); line-height: 1; font-weight: 620; }
.chips { margin-top: 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  border: 0; background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 9px 16px; cursor: pointer;
  font-weight: 600; font-size: 14px; color: var(--soft); transition: background-color .2s, color .2s;
}
.chips button:hover { color: var(--text); background: rgba(255, 255, 255, .1); }
.chips button[aria-checked="true"] { background: var(--blue); color: #04121c; }
/* two real fragments, layered rather than lined up */
.solo-visual { position: relative; min-height: clamp(400px, 36vw, 500px); }
.frag { position: absolute; }
.frag img { border-radius: 18px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 40px 70px -34px rgba(0, 0, 0, .85); }
.frag figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.frag-chart { right: 0; top: 0; width: 70%; display: flex; flex-direction: column-reverse; }
.frag-chart figcaption { margin: 0 0 12px; text-align: right; }
.frag-mix { left: 0; bottom: 4%; width: 52%; z-index: 1; }

/* ==========================================================================
   THE APP: one composition
   ========================================================================== */
.app {
  padding-block: clamp(96px, 10vw, 150px) clamp(32px, 4vw, 56px); overflow: hidden;
  background:
    radial-gradient(46% 40% at 50% 46%, rgba(255, 255, 255, .045), transparent 72%),
    linear-gradient(var(--ink-cool), var(--ink-stage) 260px);
}
.app-head { text-align: center; }
.app-head .statement { max-width: 9em; margin-inline: auto; }
.app-head .lede { margin-inline: auto; }
.showcase {
  --p: 1; position: relative; margin: clamp(56px, 6vw, 88px) auto 0;
  height: clamp(520px, 50vw, 680px); max-width: 1100px;
  /* the section edge crops the phones, as if they rise out of the page */
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
}
.showcase .device { position: absolute; left: 50%; top: 0; }
.dv-c { --w: clamp(280px, 27vw, 370px); z-index: 3; transform: translate(-50%, calc((1 - var(--p)) * 60px)); }
.dv-l, .dv-r { --w: clamp(240px, 23vw, 316px); z-index: 1; }
.dv-l { transform: translate(calc(-50% - var(--w) * .82 * var(--p) - 20px), calc(70px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * -4deg)); }
.dv-r { transform: translate(calc(-50% + var(--w) * .82 * var(--p) + 20px), calc(70px + (1 - var(--p)) * 30px)) rotate(calc(var(--p) * 4deg)); }
.dv-l .screen > img, .dv-r .screen > img { filter: brightness(.72) saturate(.9); }
.facts {
  margin-top: clamp(24px, 3vw, 40px); max-width: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 40px;
  color: var(--soft); font-size: 14.5px;
}
.facts b { color: var(--text); font-weight: 600; }

/* ==========================================================================
   CLOSING
   ========================================================================== */
.closing {
  padding-block: 0 clamp(96px, 11vw, 150px); text-align: center; overflow: hidden;
  background: linear-gradient(var(--ink-stage), var(--ink-0) 200px);
}
.closing-chart { position: relative; height: clamp(280px, 30vw, 420px); }
.closing-chart .market-line { position: absolute; left: 0; bottom: 0; width: 100%; height: calc(100% - clamp(130px, 13vw, 180px)); }
.closing-trophy {
  position: absolute; left: var(--tx, 50%); top: var(--ty, 10%); width: clamp(110px, 11vw, 160px);
  transform: translate(-50%, calc(-100% + 4px)); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5));
  opacity: 0; transition: opacity .6s ease;
}
.closing.is-landed .closing-trophy, html:not(.js) .closing-trophy { opacity: 1; }
.closing .hero-glow { width: clamp(320px, 36vw, 560px); }
.closing-copy { margin-top: 40px; display: grid; justify-items: center; gap: 28px; }

/* ---------- footer ---------- */
.footer { background: #0b0c0d; padding: 44px 0 32px; color: var(--muted); font-size: 14px; }
.footer-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; max-width: 380px; }
.footer-brand img { width: 22px; }
.footer-brand b { color: var(--text); font: 650 16px var(--sans); font-stretch: 112%; letter-spacing: -.02em; }
.footer-brand p { grid-column: 1 / -1; margin-top: 8px; }
.footer-links { display: flex; gap: 24px; align-items: flex-start; }
.footer-links a { text-decoration: none; padding: 4px 0; }
.footer-links a:hover { color: var(--text); }
.footer-base { margin-top: 28px; font-size: 13px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .lead-mode { grid-template-columns: 1fr; }
  .scoreboard { max-width: 620px; }
  .rules-grid { grid-template-columns: 1fr; }
  .solo-grid { grid-template-columns: 1fr; }
  .solo-visual { max-width: 640px; }
}
@media (max-width: 960px) {
  /* fantasy: one device per step, the device cropped by its own fade */
  .js .fx { display: block; }
  .js .fx-pin { display: none; }
  .fx-story { padding-top: 0; }
  .js .fx-steps { padding: 0; display: grid; gap: 72px; margin-top: 40px; }
  .js .fx-step { min-height: 0; opacity: 1; }
  .js .step-stage {
    display: block; margin-top: 28px; height: clamp(500px, 136vw, 600px); overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent);
  }
  .js .step-stage .device { --w: min(86vw, 360px); margin-inline: auto; }
  html:not(.js) .fx { display: block; }
  html:not(.js) .fx-pin { position: static; justify-items: center; margin-bottom: 40px; }
  .classic-foot { grid-template-columns: 1fr; gap: 32px; }
  .podium { margin-top: 0; max-width: 380px; }
}
@media (max-width: 720px) {
  :root { --nav-h: 56px; }
  body { font-size: 16px; }
  .nav-links a { padding: 8px 10px; }
  .display { font-size: clamp(46px, 13vw, 60px); max-width: none; }
  .statement { font-size: clamp(34px, 9.4vw, 44px); }
  .h-m { font-size: clamp(27px, 7.4vw, 32px); }
  .hero { min-height: min(100svh, 800px); padding-top: calc(var(--nav-h) + 36px); }
  .hero-chart { margin-top: 8px; min-height: 340px; }
  .hero-chart .market-line { top: 140px; height: calc(100% - 52px - 140px); }
  .hero-trophy { width: 132px; }
  .hero-note { display: none; }
  .h-intro span { display: block; }
  .axis li { font-size: 11px; }
  .sb-n { font-size: clamp(50px, 15vw, 64px); }
  .sb-who { font-size: 14px; }
  .sb-who img { width: 24px; }
  .sb-rows li { grid-template-columns: 1fr 58px 56px 58px 1fr; padding: 10px 10px; font-size: 14px; }
  .sb-rows span { font-size: 15px; padding-right: 8px; }
  .sb-rows span:nth-of-type(2) { padding-left: 8px; }
  .minor-modes { grid-template-columns: 1fr; gap: 28px; }
  .seg button { min-width: 0; padding: 10px 18px; }
  .roster li { grid-template-columns: 52px 1fr 72px 18px; gap: 10px; }
  .roster small { display: none; }
  .roster .bar { grid-column: 1 / -1; grid-row: 2; height: 5px; margin-top: -2px; }
  .terms { grid-template-columns: 1fr; gap: 16px; }
  .classic { padding-bottom: 56px; }
  .solo { padding-top: 56px; }
  .frag-chart { flex-direction: column; }
  .frag-chart figcaption { margin: 12px 0 0; text-align: left; }
  .solo-visual { min-height: 0; display: grid; gap: 28px; }
  .frag { position: static; width: auto; }
  .frag-mix { width: 86%; }
  .showcase { height: clamp(500px, 140vw, 600px); }
  .dv-c { --w: min(74vw, 300px); }
  .dv-l, .dv-r { --w: min(62vw, 250px); }
  .dv-l { transform: translate(calc(-50% - var(--w) * .66), 64px) rotate(-4deg); }
  .dv-r { transform: translate(calc(-50% + var(--w) * .66), 64px) rotate(4deg); }
  .facts { flex-direction: column; gap: 10px; align-items: center; text-align: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation-duration: .01ms !important; }
  .hero-trophy, .hero-note, .closing-trophy, .hero-glow, .podium { opacity: 1; }
  .showcase { --p: 1 !important; }
}

/* ---------- without the script: everything reads in full ---------- */
html:not(.js) .fx-step { min-height: 0; opacity: 1; padding-block: 24px; }
html:not(.js) .fx-steps { padding: 0; }
html:not(.js) .closing-trophy { position: static; transform: none; margin: 0 auto; }
html:not(.js) .closing-chart { height: auto; }
html:not(.js) .closing-chart .market-line { display: none; }
html:not(.js) .hero-note { display: none; }

/* narrow screens inside the device: the scoreboard keeps the numbers */
@container (max-width: 300px) {
  .sc-n { font-size: 31px; }
}
