/* === TFT ELO landing page (/welcome) =======================================
   Standalone: this page links tokens.css and NOTHING else from the app, so it
   can't drift when style.css moves. Every colour, size, radius and duration
   below is a token. The hex-board rendering is the one technique copied out of
   style.css (clip-path polygon + cost-coloured backing hex) because the hex is
   the product's native shape and the landing page has to show a real board.

   Three hues, fixed jobs: gold is the rating, mint (--you) is board A, ember
   (--foe) is board B. The one page-load motion is the two ratings counting up
   with the probability marker travelling under them — nothing else moves on
   its own. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: local('Bricolage Grotesque'),
       url('/fonts/bricolage-grotesque-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local('Instrument Sans'),
       url('/fonts/instrument-sans-var.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: local('JetBrains Mono'),
       url('/fonts/jetbrains-mono-var.woff2') format('woff2');
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  /* One soft vignette toward --bg-deep so the ground reads as depth rather than
     a flat fill. Not a gradient wash behind content — it never touches type. */
  background-image: radial-gradient(120% 80% at 18% -10%, var(--surface-2) 0%, var(--bg) 46%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-3);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: var(--space-4); top: var(--space-4);
  transform: translateY(-160%);
  background: var(--gold); color: var(--gold-ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-pill);
  font-weight: 600; text-decoration: none;
  z-index: 20;
}
.skip-link:focus-visible { transform: none; }

/* Shared page gutter. Set once, here, so no section can invent its own. */
.site-head, main > section, .site-foot {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* ---- Head ---------------------------------------------------------------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5);
  padding-block: var(--space-5);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-4);
  letter-spacing: -0.01em;
}
.site-nav { display: flex; gap: clamp(14px, 3vw, 28px); }
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: var(--fs-2);
  padding-block: var(--space-1);
  border-bottom: 1px solid transparent;
  transition: color var(--dur-quick) var(--ease-out);
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--gold); }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding-block: clamp(40px, 8vw, 96px) clamp(44px, 7vw, 88px);
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(var(--fs-6), 5.2vw, var(--fs-8));
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.lede {
  max-width: 44ch;
  margin-top: var(--space-5);
  font-size: var(--fs-4);
  color: var(--text-muted);
}
.actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Two shapes, one meaning each: gold pill continues the loop, outlined pill
   offers the alternative. Nothing lifts on hover — only colour answers. */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-size: var(--fs-3);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur-quick) var(--ease-out),
              border-color var(--dur-quick) var(--ease-out);
}
.btn-primary { background: var(--gold); color: var(--gold-ink); }
.btn-primary:hover { background: var(--gold-bright); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--gold); }

/* ---- The two-board evidence panel ---------------------------------------- */
.duel {
  --hex-w: clamp(32px, 3.4vw, 42px);
  --hex-h: calc(var(--hex-w) * 1.1333);
  display: flex; flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.duel[hidden] { display: none; }
.duel-cap {
  order: -1;
  font-size: var(--fs-1);
  color: var(--text-muted);
  max-width: 46ch;
}
.side {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
}
/* The A/B marks carry the hue job: mint is board A, ember is board B. They are
   the legend for the probability rail and the sigmoid, so there is no legend. */
.side-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  font-weight: 700;
}
.side[data-side="a"] .side-mark { background: var(--you); color: var(--bg-deep); }
.side[data-side="b"] .side-mark { background: var(--foe); color: var(--bg-deep); }
.side-rating {
  font-family: var(--font-mono);
  font-size: var(--fs-6);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  line-height: 1;
  text-align: right;
  min-width: 4.2ch;
}

/* Probability rail: an axis from "B wins" (ember, left) to "A wins" (mint,
   right) with the model's number marked on it, plus a hairline at even odds so
   the marker is readable without ticks. */
.prob { display: grid; gap: var(--space-2); }
.prob[hidden] { display: none; }
.prob-rail { position: relative; height: 10px; }
.prob-track {
  position: absolute; inset: 3px 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--foe-deep), var(--line-strong) 50%, var(--you-deep));
}
.prob-even {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 1px; background: var(--text-dim);
}
.prob-marker {
  position: absolute; top: 50%; left: 50%;
  width: 3px; height: 18px;
  margin-left: -1.5px;
  transform: translate(0, -50%);
  border-radius: 2px;
  background: var(--gold-bright);
  box-shadow: 0 0 0 2px var(--surface);
}
.prob-read {
  display: flex; align-items: baseline; gap: var(--space-2);
  flex-wrap: wrap;
}
.prob-read .num {
  font-family: var(--font-mono);
  font-size: var(--fs-5);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  line-height: 1;
}
.prob-said { font-size: var(--fs-2); color: var(--text-muted); }
.prob-gap {
  font-size: var(--fs-1);
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.prob-gap:empty { display: none; }

/* ---- Mini hex board (technique lifted from style.css .board / .hex) ------- */
.mini-board { display: flex; flex-direction: column; gap: calc(var(--hex-w) * 0.2); }
.mini-row { display: flex; gap: calc(var(--hex-w) * 0.067); }
/* Pointy-top hexes tile with alternate rows staggered by HALF a width. The
   app's own board indents by a full hex because it is a fixed 7-wide grid with
   real coordinates; this panel is a roster (search boards carry no positions),
   so the honest stagger is the half. */
.mini-row.offset { margin-left: calc(var(--hex-w) * 0.5 + var(--hex-w) * 0.033); }
.mini-cell { position: relative; width: var(--hex-w); height: var(--hex-h); }
.mini-hex {
  width: 100%; height: 100%;
  position: relative;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: var(--line-strong);
}
.mini-hex.cost-1 { background: var(--cost-1); }
.mini-hex.cost-2 { background: var(--cost-2); }
.mini-hex.cost-3 { background: var(--cost-3); }
.mini-hex.cost-4 { background: var(--cost-4); }
.mini-hex.cost-5 { background: var(--cost-5); }
.mini-hex img {
  position: absolute; inset: 2px;
  width: calc(100% - 4px); height: calc(100% - 4px);
  object-fit: cover;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.mini-stars {
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%);
  font-size: calc(var(--hex-w) * 0.2);
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  white-space: nowrap; z-index: 3;
}
.mini-items {
  position: absolute; bottom: calc(var(--hex-w) * -0.09); left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 1px; z-index: 4;
}
.mini-item {
  width: calc(var(--hex-w) * 0.29); height: calc(var(--hex-w) * 0.29);
  border-radius: 3px; overflow: hidden;
  border: 1px solid var(--bg-deep);
  background: var(--surface-3);
}
.mini-item img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Three doors --------------------------------------------------------- */
.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding-block: clamp(32px, 5vw, 56px);
}
.door {
  display: flex; flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.door h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-4);
  letter-spacing: -0.01em;
}
.door p { color: var(--text-muted); font-size: var(--fs-2); }
.door-link, .door-note {
  margin-top: auto;
  font-size: var(--fs-2);
  font-weight: 600;
}
.door-link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  align-self: flex-start;
  padding-bottom: 2px;
  transition: border-color var(--dur-quick) var(--ease-out);
}
.door-link:hover { border-bottom-color: var(--gold); }
.door-note { color: var(--text-muted); font-weight: 400; }

/* ---- How it works -------------------------------------------------------- */
.explain {
  display: grid;
  grid-template-columns: minmax(0, 64ch) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(32px, 5vw, 56px) clamp(48px, 7vw, 80px);
}
.explain-prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-5);
  line-height: var(--lh-snug);
  letter-spacing: -0.015em;
  margin-bottom: var(--space-4);
}
.explain-prose p { color: var(--text-muted); }
.explain-prose p + p { margin-top: var(--space-4); }
.explain-fig { align-self: start; max-width: 340px; }
.sigmoid svg { width: 100%; height: auto; }
/* The sigmoid's own palette — gold is the curve (it is the rating's mapping),
   mint drops from the marked point because that point is board A's margin. */
.sg-grid  { stroke: var(--line); stroke-width: 1; }
.sg-even  { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.sg-curve { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.sg-drop  { stroke: var(--you); stroke-width: 1; stroke-dasharray: 2 3; }
.sg-dot   { fill: var(--gold-bright); stroke: var(--surface); stroke-width: 2; }
.sg-tick  { fill: var(--text-muted); font-family: var(--font-mono); font-size: 10px; }
.sg-axis  { fill: var(--text-muted); font-family: var(--font-body); font-size: 10px; }
.explain-fig figcaption {
  margin-top: var(--space-3);
  font-size: var(--fs-1);
  color: var(--text-muted);
}

/* ---- Foot ---------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line);
  padding-block: var(--space-6) var(--space-7);
  font-size: var(--fs-1);
  color: var(--text-muted);
}
.site-foot p { max-width: 64ch; }
.foot-links { margin-top: var(--space-3); }
.foot-links a { color: var(--text); }

/* ---- Narrow -------------------------------------------------------------
   The hero stacks at 1000, not 720: between those widths the right-hand column
   is narrower than a 5-wide hex row plus its rating, and the board clips. Every
   step below was checked against the widest board this panel renders (a 10-unit
   board, five hexes to a row, a 5-character rating). */
@media (max-width: 1000px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-block: clamp(32px, 6vw, 56px) clamp(36px, 6vw, 64px);
  }
  .duel { max-width: 460px; }
}
@media (max-width: 900px) {
  .explain { grid-template-columns: minmax(0, 1fr); }
  .explain-fig { max-width: 320px; }
}
@media (max-width: 720px) {
  .doors { grid-template-columns: minmax(0, 1fr); }
  .duel { --hex-w: clamp(30px, 8.2vw, 42px); }
  .side-rating { font-size: var(--fs-5); }
  .lede { font-size: var(--fs-3); }
}
@media (max-width: 480px) {
  /* Below this the rating no longer fits beside the board, so it drops under
     it — still right next to its own board, still left-aligned with it. */
  .side { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--space-2); }
  .side .side-mark { grid-area: 1 / 1; align-self: start; }
  .side .mini-board { grid-area: 1 / 2; }
  .side .side-rating { grid-area: 2 / 2; text-align: left; min-width: 0; }
}
@media (max-width: 400px) {
  .site-nav { gap: var(--space-3); }
  .duel { padding: var(--space-4); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
