/* StableBet public site. One stylesheet, token-based, dark primary with a parallel light theme.
   Palette follows the StableBot app: forest and turf greens, rail cream, saddle brass, vermilion for scratches and losses. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/plex-sans-wght.woff2") format("woff2-variations"), url("../fonts/plex-sans-wght.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #0a130f;
  --bg-2: #0d1813;
  --surface: #122019;
  --surface-2: #17281f;
  --surface-3: #1e3228;
  --line: rgba(236, 232, 214, 0.08);
  --line-2: rgba(236, 232, 214, 0.14);
  --line-3: rgba(236, 232, 214, 0.24);
  --text: #f2efe4;
  --text-2: #bdc6b8;
  --text-3: #8f9b8e;
  --accent: #8fcf8f;
  --accent-strong: #b9e4b4;
  --accent-ink: #0a1a0f;
  --accent-soft: rgba(143, 207, 143, 0.13);
  --accent-band: rgba(143, 207, 143, 0.28);
  --brass: #d2ab6c;
  --brass-soft: rgba(210, 171, 108, 0.13);
  --rail: #efeadb;
  --market: #efeadb;
  --live: #8fcf8f;
  --live-soft: rgba(143, 207, 143, 0.12);
  --stale: #d2ab6c;
  --stale-soft: rgba(210, 171, 108, 0.13);
  --loss: #f08466;
  --loss-soft: rgba(240, 132, 102, 0.12);
  --sim: #d2ab6c;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-3: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 50px 120px -40px rgba(0, 0, 0, 0.85), 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  --stripe: rgba(143, 207, 143, 0.02);
  --grid-dot: rgba(236, 232, 214, 0.06);
  --glow: rgba(143, 207, 143, 0.06);

  --font: "IBM Plex Sans", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(84px, 11vw, 150px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-2: #efece3;
  --surface: #fffefa;
  --surface-2: #faf8f1;
  --surface-3: #eeeadf;
  --line: rgba(25, 61, 50, 0.1);
  --line-2: rgba(25, 61, 50, 0.16);
  --line-3: rgba(25, 61, 50, 0.28);
  --text: #16291f;
  --text-2: #445a4d;
  --text-3: #5b6d61;
  --accent: #23634a;
  --accent-strong: #193d32;
  --accent-ink: #fffdf7;
  --accent-soft: rgba(35, 99, 74, 0.09);
  --accent-band: rgba(35, 99, 74, 0.2);
  --brass: #8a6329;
  --brass-soft: rgba(177, 134, 76, 0.13);
  --rail: #193d32;
  --market: #2d2a22;
  --live: #1f7a45;
  --live-soft: rgba(31, 122, 69, 0.09);
  --stale: #8a6329;
  --stale-soft: rgba(177, 134, 76, 0.13);
  --loss: #b63b24;
  --loss-soft: rgba(182, 59, 36, 0.08);
  --sim: #8a6329;
  --shadow-1: 0 1px 2px rgba(25, 61, 50, 0.07);
  --shadow-2: 0 20px 50px -24px rgba(25, 61, 50, 0.24), 0 2px 6px rgba(25, 61, 50, 0.06);
  --shadow-3: 0 50px 100px -40px rgba(25, 61, 50, 0.3), 0 10px 24px -12px rgba(25, 61, 50, 0.12);
  --stripe: rgba(35, 99, 74, 0.035);
  --grid-dot: rgba(25, 61, 50, 0.08);
  --glow: rgba(35, 99, 74, 0.05);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p, li { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.num, .mono { font-family: var(--mono); font-feature-settings: "tnum", "zero"; letter-spacing: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; animation-timing-function: var(--ease); }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.section + .section::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 13px; pointer-events: none; opacity: 0.17;
  background:
    linear-gradient(var(--rail), var(--rail)) 0 0 / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, var(--rail) 0 3px, transparent 3px 168px) 0 3px / 100% 10px no-repeat;
}
.section--tight { padding-block: clamp(56px, 8vw, 104px); }

/* ---------- Type scale ---------- */
.display {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(3.1rem, 6.6vw, 6.1rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.002em;
}
.h2 { font-family: var(--display); text-transform: uppercase; font-size: clamp(2.4rem, 4.9vw, 4.1rem); font-weight: 700; letter-spacing: 0.004em; line-height: 0.93; }
.h2 em { font-style: normal; color: var(--accent); }
.h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.18; }
.h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); line-height: 1.55; color: var(--text-2); max-width: 38em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 0.875rem; line-height: 1.55; }
.xs { font-size: 0.78rem; line-height: 1.5; }
.label {
  font-family: var(--display); font-size: 0.98rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--brass);
}
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); max-width: 860px; }
.section-head .label { display: flex; align-items: center; gap: 10px; }
.split-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(24px, 5vw, 80px); align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.split-head .lede { margin: 0; }
@media (max-width: 860px) { .split-head { grid-template-columns: 1fr; } }

/* ---------- Status strip ---------- */
.status-strip {
  position: relative; z-index: 41;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-2);
}
.status-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.status-strip ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.status-strip li { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sim); box-shadow: 0 0 0 3px var(--stale-soft); }
.status-strip a { color: var(--text-2); }
@media (max-width: 720px) { .status-strip li:nth-child(n+2) { display: none; } .status-strip .strip-link { display: none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 1.45rem; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .tld { color: var(--text-3); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--text-2); font-size: 0.94rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: var(--line); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; display: block; height: 1px; background: var(--accent); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 10px; background: transparent; color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); background: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; inset: 100% 0 auto 0; margin: 0; padding: 12px var(--gutter) 24px; max-height: calc(100vh - 80px); overflow-y: auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--line-2);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all 0.25s var(--ease);
  }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--b);
  background: transparent; color: var(--text); font-weight: 560; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { border-color: var(--line-3); background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn--primary:hover { background: var(--accent-strong); color: var(--accent-ink); border-color: transparent; }
:root[data-theme="light"] .btn--primary:hover { background: var(--accent-strong); color: #fffdf7; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; border-radius: 13px; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 0.85rem; border-radius: 9px; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.text-link { color: var(--text); font-weight: 560; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-3); padding-bottom: 2px; transition: border-color 0.2s; }
.text-link:hover { border-color: var(--accent); }

/* ---------- Badges: freshness, simulation, build status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.03em; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2);
}
.badge svg { width: 12px; height: 12px; flex: none; }
.badge--live { color: var(--live); border-color: color-mix(in oklab, var(--live) 35%, transparent); background: var(--live-soft); }
.badge--live .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; }
.badge--live .pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid currentColor; animation: pulse 2s var(--ease) infinite; }
.badge--snapshot { color: var(--text-2); }
.badge--stale {
  color: var(--stale); border-color: color-mix(in oklab, var(--stale) 40%, transparent);
  background: repeating-linear-gradient(-45deg, var(--stale-soft) 0 4px, transparent 4px 8px);
}
.badge--sim { color: var(--sim); border-color: color-mix(in oklab, var(--sim) 40%, transparent); background: var(--stale-soft); }
.badge--accent { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); background: var(--accent-soft); }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  position: relative;
}
.panel--flat { box-shadow: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 0.9rem; font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: center; gap: 10px; }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.source-note { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); letter-spacing: 0.02em; }
.source-note a { color: var(--text-2); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(40px, 5.5vw, 84px); padding-bottom: clamp(72px, 9vw, 130px); isolation: isolate; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hero-copy { padding-top: clamp(0px, 3vw, 48px); }
.hero-copy { max-width: 620px; }
.hero h1 { margin-bottom: 26px; }
.hero h1 .w { display: inline-block; }
.hero .lede { margin-bottom: 36px; }
.cta-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-facts { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 28px; }
.hero-facts li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-2); }
.hero-facts svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
@media (max-width: 1060px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 720px; }
}
@media (max-width: 600px) { .hero-facts { grid-template-columns: 1fr; } }

.display em { font-style: normal; color: var(--accent); }

/* ---------- Race card (shared by hero and demos) ---------- */
.race { overflow: hidden; }
.race-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.race-head-main { display: grid; gap: 4px; }
.race-name { font-weight: 620; font-size: 1rem; letter-spacing: -0.01em; }
.race-sub { font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
.race-scale {
  display: grid; grid-template-columns: 28px minmax(0, 1.25fr) minmax(0, 1.6fr) 58px; gap: 12px; align-items: end;
  padding: 10px 18px 6px; font-family: var(--mono); font-size: 0.66rem; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase;
}
.race-scale .ticks { position: relative; height: 14px; }
.race-scale .ticks span { position: absolute; bottom: 0; transform: translateX(-50%); }
.race-scale .ticks span:first-child { transform: none; }
.race-scale .ticks span:last-child { transform: translateX(-100%); }
.runners { list-style: none; margin: 0; padding: 0 8px 8px; }
.runner {
  width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1.25fr) minmax(0, 1.6fr) 58px; gap: 12px; align-items: center;
  padding: 5px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left;
  transition: background 0.2s, border-color 0.2s, opacity 0.35s var(--ease);
}
.runner:hover { background: var(--surface-2); }
.runner[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent) 35%, transparent); }
.runner.is-scratched { opacity: 0.42; }
.runner.is-scratched .rname { text-decoration: line-through; text-decoration-color: var(--text-3); }
.saddle {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500; background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
}
.rname { font-weight: 600; font-size: 0.92rem; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpeople { display: block; font-size: 0.68rem; color: var(--text-3); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.band-track { position: relative; height: 26px; }
.band-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.band-track .grid-line { position: absolute; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.band {
  position: absolute; top: 7px; height: 12px; border-radius: 6px;
  background: var(--accent-band); border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  transition: left 0.7s var(--ease), width 0.7s var(--ease), opacity 0.4s;
}
.band .mid { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--accent-strong); left: calc(var(--m) * 100%); transform: translateX(-50%); transition: left 0.7s var(--ease); }
.mkt {
  position: absolute; top: 2px; width: 0; height: 22px; transform: translateX(-50%); transition: left 0.7s var(--ease);
}
.mkt::before { content: ""; position: absolute; left: -5px; top: 0; border: 5px solid transparent; border-top: 6px solid var(--market); }
.mkt::after { content: ""; position: absolute; left: -0.5px; top: 5px; bottom: 0; width: 1px; background: var(--market); opacity: 0.8; }
.rpct { font-family: var(--mono); font-size: 0.8rem; text-align: right; color: var(--text); font-feature-settings: "tnum"; }
.rpct small { display: block; font-size: 0.66rem; color: var(--text-3); }
.race-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 0.75rem; color: var(--text-2); }
.race-legend .key { display: inline-flex; gap: 8px; align-items: center; }
.key-band { width: 22px; height: 10px; border-radius: 5px; background: var(--accent-band); border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent); position: relative; }
.key-band::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--accent-strong); transform: translateX(-50%); }
.key-mkt { width: 10px; height: 12px; position: relative; }
.key-mkt::before { content: ""; position: absolute; left: 0; top: 0; border: 5px solid transparent; border-top: 6px solid var(--market); }
.key-mkt::after { content: ""; position: absolute; left: 4.5px; top: 5px; bottom: 0; width: 1px; background: var(--market); }

.why {
  border-top: 1px solid var(--line); padding: 16px 18px 18px; display: grid; gap: 12px;
  background: linear-gradient(to bottom, var(--surface-2), var(--surface));
}
.why-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.why h3 { font-size: 0.98rem; letter-spacing: -0.01em; }
.why ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: why; }
.why li { counter-increment: why; display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 0.86rem; line-height: 1.5; color: var(--text-2); }
.why li::before { content: counter(why); font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); padding-top: 3px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--line-2);
  text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
button.chip:hover, a.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip svg { width: 11px; height: 11px; }
.chip.ask { font-family: var(--font); font-size: 0.76rem; font-weight: 560; height: 28px; padding: 0 11px; border-radius: 999px; cursor: pointer; }
.chip.ask[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.why p b { color: var(--accent); font-weight: 620; }
.conf { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-2); }
.conf-meter { display: inline-flex; gap: 2px; }
.conf-meter i { width: 5px; height: 12px; border-radius: 1.5px; background: var(--line-2); }
.conf-meter i.on { background: var(--accent); }

.scenario { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; color: var(--text-2); font-size: 0.8rem; font-weight: 560; padding: 6px 11px; border-radius: 7px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
:root[data-theme="light"] .seg button[aria-pressed="true"], :root[data-theme="light"] .seg button[aria-checked="true"] { background: #fff; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  font-size: 0.8rem; font-weight: 560; padding: 6px 11px; border-radius: 9px; transition: all 0.2s;
}
.toggle[aria-pressed="true"] { color: var(--loss); border-color: color-mix(in oklab, var(--loss) 40%, transparent); background: var(--loss-soft); }
.toggle .box { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.toggle[aria-pressed="true"] .box::after { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }

.hero-visual { position: relative; }
.hero-visual .race { box-shadow: var(--shadow-3); }
.hero-visual .annot {
  position: absolute; font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.hero-visual .annot::before { content: ""; width: 26px; height: 1px; background: var(--line-3); }
.hero-visual .annot--a { top: -26px; right: 18px; }
@media (max-width: 1060px) { .hero-visual .annot { display: none; } }
@media (max-width: 560px) {
  .race-scale, .runner { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1.05fr) 48px; gap: 8px; }
  .race-scale { padding-inline: 14px; }
  .runners { padding-inline: 4px; }
  .rpeople { display: none; }
  .rname { font-size: 0.84rem; }
}

/* ---------- Honesty band ---------- */
.not-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.not-list > div { padding: 26px 24px 8px 0; border-right: 1px solid var(--line); margin-right: 24px; }
.not-list > div:last-child { border-right: 0; margin-right: 0; }
.not-list .h4 { margin: 12px 0 8px; }
.not-list p { color: var(--text-2); font-size: 0.93rem; margin: 0; }
.not-list svg { width: 20px; height: 20px; color: var(--text-3); }
@media (max-width: 960px) { .not-list { grid-template-columns: 1fr 1fr; } .not-list > div:nth-child(2) { border-right: 0; } }
@media (max-width: 560px) { .not-list { grid-template-columns: 1fr; } .not-list > div { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 22px; } }

.loss-figure { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; margin-top: clamp(48px, 7vw, 88px); }
.bignum { font-size: clamp(4rem, 11vw, 9rem); font-weight: 560; letter-spacing: -0.06em; line-height: 0.9; font-stretch: 88%; font-feature-settings: "tnum"; color: var(--loss); }
.bignum .unit { font-size: 0.45em; letter-spacing: -0.03em; margin-left: 0.04em; }
@media (max-width: 860px) { .loss-figure { grid-template-columns: 1fr; } }

/* ---------- Modes (beginner / expert) ---------- */
.modes { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.modes-copy ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.modes-copy li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; color: var(--text-2); }
.modes-copy li svg { width: 18px; height: 18px; color: var(--accent); margin-top: 4px; }
.modes-copy li strong { color: var(--text); font-weight: 600; }
.mode-view { min-height: 420px; }
.mode-pane[hidden] { display: none; }
.plain-card { padding: 22px; display: grid; gap: 18px; }
.plain-card .big { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 560; letter-spacing: -0.025em; line-height: 1.2; }
.plain-card .big b { color: var(--accent); font-weight: 620; }
.dots100 { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; max-width: 360px; }
.dots100 i { aspect-ratio: 1; border-radius: 50%; background: var(--line-2); transition: background 0.4s var(--ease); }
.dots100 i.hit { background: var(--accent); }
.dots100 i.maybe { background: var(--accent-band); }
.tip {
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 0.88rem; color: var(--text-2);
}
.tip svg { width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }

.dense { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dense th, .dense td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dense th { font-family: var(--mono); font-weight: 500; font-size: 0.66rem; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface); }
.dense th:nth-child(-n+2), .dense td:nth-child(-n+2) { text-align: left; }
.dense td { font-family: var(--mono); font-feature-settings: "tnum"; color: var(--text-2); }
.dense td.name { font-family: var(--font); color: var(--text); font-weight: 560; }
.dense tr:hover td { background: var(--surface-2); }
.dense .pos { color: var(--live); }
.dense .neg { color: var(--loss); }
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.col-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.col-picker label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-2); padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; user-select: none; }
.col-picker input { accent-color: var(--accent); margin: 0; }
@media (max-width: 960px) { .modes { grid-template-columns: 1fr; } }

/* ---------- Knowledge graph ---------- */
.graph-shell { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr); overflow: hidden; }
.graph-stage { position: relative; min-height: 520px; border-right: 1px solid var(--line); background:
  radial-gradient(var(--grid-dot) 1px, transparent 1.2px) 0 0 / 20px 20px, var(--bg-2); }
.graph-stage:focus-visible { outline-offset: -3px; }
.graph-stage svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.graph-toolbar { position: absolute; left: 14px; top: 14px; right: 14px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; pointer-events: none; }
.graph-toolbar > * { pointer-events: auto; }
.graph-help { position: absolute; left: 14px; bottom: 12px; z-index: 2; font-family: var(--mono); font-size: 0.68rem; color: var(--text-3); }
.graph-help kbd { font-family: var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--surface); color: var(--text-2); }
.g-edge { stroke: var(--line-3); stroke-width: 1.2; transition: stroke 0.25s, stroke-width 0.25s, opacity 0.25s; }
.g-edge.is-hot { stroke: var(--accent); stroke-width: 1.8; }
.g-edge.is-dim { opacity: 0.25; }
.g-node { cursor: pointer; transition: opacity 0.25s; }
.g-node circle { stroke-width: 1.5; transition: r 0.3s var(--ease), stroke 0.2s, fill 0.2s; }
.g-node text { font-family: var(--font); font-size: 11.5px; font-weight: 560; fill: var(--text-2); paint-order: stroke; stroke: var(--bg-2); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.g-node .glyph { font-family: var(--mono); font-size: 9.5px; font-weight: 500; stroke: none; fill: var(--text); }
.g-node.is-dim { opacity: 0.3; }
.g-node.is-sel circle.ring { stroke: var(--accent); stroke-width: 2; }
.g-node.is-sel text { fill: var(--text); }
.g-node.is-kbd circle.ring { stroke: var(--text); stroke-dasharray: 3 3; stroke-width: 1.5; }
.g-node.is-new { animation: nodeIn 0.6s var(--ease) both; }
@keyframes nodeIn { from { opacity: 0; } to { opacity: 1; } }
.graph-side { padding: 20px; display: grid; gap: 16px; align-content: start; max-height: 520px; overflow: auto; }
.graph-side .kind { display: inline-flex; align-items: center; gap: 8px; }
.kind-dot { width: 9px; height: 9px; border-radius: 3px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.84rem; }
.facts dt { color: var(--text-3); font-family: var(--mono); font-size: 0.72rem; padding-top: 2px; }
.facts dd { margin: 0; color: var(--text); }
.neighbors { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.neighbors button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 9px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 0.84rem;
}
.neighbors button:hover { background: var(--surface-2); color: var(--text); }
.neighbors .rel { margin-left: auto; font-family: var(--mono); font-size: 0.66rem; color: var(--text-3); }
.graph-list { padding: 18px; max-height: 520px; overflow: auto; }
.graph-list ul { list-style: none; margin: 0; padding-left: 16px; border-left: 1px solid var(--line-2); }
.graph-list > ul { padding-left: 0; border: 0; }
.graph-list li { padding: 4px 0; font-size: 0.88rem; }
.graph-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-2); }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) {
  .graph-shell { grid-template-columns: 1fr; }
  .graph-stage { min-height: 420px; border-right: 0; border-bottom: 1px solid var(--line); }
  .graph-side { max-height: none; }
}

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; grid-auto-flow: dense; }
.tile {
  grid-column: span 4; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  padding: 26px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; min-height: 280px;
}
.tile .h3 { font-size: 1.22rem; }
.tile p { color: var(--text-2); font-size: 0.93rem; margin: 0; }
.tile .foot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tile--7 { grid-column: span 7; }
.tile--5 { grid-column: span 5; }
.tile--6 { grid-column: span 6; }
.tile--8 { grid-column: span 8; }
.tile--12 { grid-column: span 12; }
.tile--media { padding: 0; min-height: 420px; }
.tile--media picture, .tile--media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile--media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 8, 10, 0.92) 8%, rgba(6, 8, 10, 0.35) 45%, rgba(6, 8, 10, 0) 70%); }
.tile--media .tile-over { position: relative; z-index: 1; margin-top: auto; padding: 28px; color: #eef0f3; display: grid; gap: 10px; max-width: 520px; }
.tile--media .tile-over p { color: rgba(238, 240, 243, 0.78); }
.tile--media .credit { position: absolute; z-index: 1; top: 16px; right: 16px; }
.tile--media .credit .badge { background: rgba(10, 12, 15, 0.72); color: #d6dae0; border-color: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
@media (max-width: 1060px) { .tile, .tile--5, .tile--7 { grid-column: span 6; } .tile--8, .tile--12 { grid-column: span 12; } }
@media (max-width: 700px) { .bento > * { grid-column: 1 / -1 !important; } .tile { min-height: 0; } .tile--media { min-height: 380px; } }

.fresh-demo { display: grid; gap: 10px; }
.fresh-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.84rem; }
.spark { width: 100%; height: 86px; }
.spark path.l { fill: none; stroke: var(--market); stroke-width: 1.6; }
.spark path.a { fill: var(--accent-band); opacity: 0.6; }
.spark path.m { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.spark line { stroke: var(--line-2); }
.spark text { font-family: var(--mono); font-size: 9px; fill: var(--text-3); }

.local-diagram { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-2); flex-wrap: wrap; }
.local-diagram .node { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; background: var(--surface-2); }
.local-diagram .node.me { border-color: color-mix(in oklab, var(--accent) 50%, transparent); color: var(--accent); }
.local-diagram .arrow-line { width: 26px; height: 1px; background: var(--line-3); }

/* ---------- Paper bet ---------- */
.paper-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.paper-form { padding: 22px; display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > label, .field > legend, .field-label { font-size: 0.84rem; font-weight: 600; color: var(--text); padding: 0; }
.field .hint { font-size: 0.78rem; color: var(--text-3); }
.input, .select {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"] { border-color: var(--loss); }
.stake-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stake-row button { min-width: 64px; }
.radio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; }
.radio-cards label {
  position: relative; display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2);
  cursor: pointer; transition: border-color 0.2s, background 0.2s; font-size: 0.88rem; font-weight: 600;
}
.radio-cards label span { font-weight: 400; font-size: 0.76rem; color: var(--text-3); }
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-cards label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .radio-cards { grid-template-columns: 1fr; } }

.receipt {
  position: relative; padding: 22px; font-size: 0.84rem; overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, color-mix(in oklab, var(--sim) 5%, transparent) 14px 15px),
    var(--surface);
}
.receipt-empty { display: grid; place-items: center; text-align: center; min-height: 360px; color: var(--text-3); gap: 12px; padding: 30px; }
.receipt-empty svg { width: 36px; height: 36px; margin-inline: auto; color: var(--text-3); }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0; }
.receipt dt { font-family: var(--mono); font-size: 0.7rem; color: var(--text-3); padding-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.receipt dd { margin: 0; font-family: var(--mono); font-size: 0.8rem; color: var(--text); overflow-wrap: anywhere; }
.stamp {
  position: absolute; right: 18px; top: 18px; transform: rotate(4deg);
  border: 1.5px solid var(--sim); color: var(--sim); border-radius: 6px; padding: 4px 8px;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.3; text-align: center;
}
.receipt.is-new { animation: receiptIn 0.55s var(--ease) both; }
@keyframes receiptIn { from { opacity: 0; transform: translateY(10px) scale(0.99); } to { opacity: 1; transform: none; } }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); }
.result-line.lost { border-color: color-mix(in oklab, var(--loss) 40%, transparent); background: var(--loss-soft); }
.result-line.won { border-color: color-mix(in oklab, var(--live) 40%, transparent); background: var(--live-soft); }
.ledger { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.ledger th, .ledger td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ledger th { font-family: var(--mono); font-weight: 500; font-size: 0.64rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ledger td { font-family: var(--mono); color: var(--text-2); }
.ledger td.r, .ledger th.r { text-align: right; }
@media (max-width: 860px) { .paper-grid { grid-template-columns: 1fr; } }

/* ---------- Build status ---------- */
.status-table { width: 100%; border-collapse: collapse; }
.status-table th, .status-table td { text-align: left; padding: 18px 16px 18px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.status-table th { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; padding-bottom: 12px; }
.status-table td:first-child { font-weight: 600; width: 34%; }
.status-table td:last-child { color: var(--text-2); font-size: 0.92rem; }
.st { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.74rem; white-space: nowrap; }
.st svg { width: 14px; height: 14px; }
.st--works { color: var(--live); }
.st--dev { color: var(--accent); }
.st--planned { color: var(--text-3); }
.st--no { color: var(--loss); }
@media (max-width: 760px) {
  .status-table thead { display: none; }
  .status-table tr { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
  .status-table td { border: 0; padding: 0; width: auto !important; }
}

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart:focus-visible { outline-offset: 6px; }
.ax text { font-family: var(--mono); font-size: 10.5px; fill: var(--text-3); }
.ax line, .ax path { stroke: var(--line-2); }
.ax .zero { stroke: var(--line-3); stroke-dasharray: 3 4; }
.c-win { fill: none; stroke: var(--loss); stroke-width: 2; }
.c-place { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; }
.c-band { fill: var(--accent-band); opacity: 0.55; }
.c-band.loss { fill: var(--loss); opacity: 0.16; }
.c-median { fill: none; stroke: var(--accent); stroke-width: 2; }
.c-median.loss { stroke: var(--loss); }
.c-cursor { stroke: var(--text-2); stroke-width: 1; }
.c-dot { stroke: var(--surface); stroke-width: 2; }
.readout {
  display: flex; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.78rem; color: var(--text-2); min-height: 1.6em;
}
.readout b { color: var(--text); font-weight: 500; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 20px; height: 0; border-top: 2px solid; }
.sw--dash { border-top-style: dashed; }
.sw--band { height: 10px; border: 0; border-radius: 3px; }
details.data { margin-top: 12px; }
details.data summary { cursor: pointer; font-size: 0.8rem; color: var(--text-2); font-weight: 560; list-style: none; display: inline-flex; gap: 8px; align-items: center; }
details.data summary::-webkit-details-marker { display: none; }
details.data summary::before { content: "+"; font-family: var(--mono); color: var(--text-3); width: 12px; }
details.data[open] summary::before { content: "−"; }
details.data .table-scroll { max-height: 280px; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }

/* ---------- Simulator (100 races) ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.sim-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.sim-grid i { aspect-ratio: 1; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line); transition: background 0.2s, border-color 0.2s, transform 0.3s var(--ease); }
.sim-grid i.win { background: var(--accent); border-color: transparent; }
.sim-grid i.run { transform: scale(0.86); }
.slider { width: 100%; accent-color: var(--accent); }
@media (max-width: 760px) { .sim { grid-template-columns: 1fr; } }

/* ---------- Stats row ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.stat { padding: 26px 20px 24px 0; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat .v { font-size: clamp(1.8rem, 3.4vw, 2.7rem); font-weight: 560; letter-spacing: -0.04em; line-height: 1; font-feature-settings: "tnum"; font-stretch: 92%; }
.stat .v.neg { color: var(--loss); }
.stat .k { margin-top: 10px; font-size: 0.84rem; color: var(--text-2); }
@media (max-width: 860px) { .stats { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { padding-left: 0; border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- Steps (how it works) ---------- */
.step { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 56px); padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); align-items: start; }
.step:first-of-type { border-top: 0; padding-top: 0; }
.step-n { font-family: var(--mono); font-size: 0.8rem; color: var(--text-3); padding-top: 10px; }
.step-n b { display: block; font-family: var(--font); font-size: 3.2rem; font-weight: 300; font-stretch: 75%; color: var(--text-2); letter-spacing: -0.04em; line-height: 1; margin-bottom: 6px; }
.step ul { padding-left: 1.1em; color: var(--text-2); margin: 16px 0 0; display: grid; gap: 8px; }
@media (max-width: 1000px) { .step { grid-template-columns: 1fr; } .step-n b { font-size: 2.4rem; } }

/* ---------- Prose ---------- */
.prose { max-width: 700px; font-size: 1.07rem; line-height: 1.72; color: var(--text-2); }
.prose h2 { font-size: 1.6rem; color: var(--text); margin: 2.2em 0 0.7em; letter-spacing: -0.025em; }
.prose h3 { font-size: 1.2rem; color: var(--text); margin: 1.8em 0 0.6em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration-color: var(--accent); }
.prose li { margin-bottom: 0.4em; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-size: 0.82rem; color: var(--text-3); margin-top: 10px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--text); font-size: 1.15rem; line-height: 1.55; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.article-head { padding-top: clamp(56px, 8vw, 110px); padding-bottom: clamp(32px, 4vw, 56px); }
.article-head .display { font-size: clamp(2.8rem, 6.2vw, 5.2rem); max-width: 18ch; margin: 18px 0 24px; }
.byline { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.with-toc.faq-split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.toc { position: sticky; top: 100px; display: grid; gap: 4px; font-size: 0.86rem; }
.toc a { text-decoration: none; color: var(--text-3); padding: 5px 0 5px 14px; border-left: 1px solid var(--line-2); transition: color 0.2s, border-color 0.2s; }
.toc a:hover, .toc a.is-active { color: var(--text); border-color: var(--accent); }
.with-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
@media (max-width: 960px) { .with-toc, .with-toc.faq-split { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* ---------- Insights index ---------- */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 28px; padding: 32px 0; text-decoration: none; align-items: baseline; transition: background 0.2s; }
.post-list a:hover .h3 { color: var(--accent); }
.post-list .h3 { transition: color 0.2s; }
.post-list .desc { display: block; color: var(--text-2); margin: 10px 0 0; max-width: 60ch; }
.post-list .arrow { color: var(--text-3); }
.post-list .upcoming { opacity: 0.7; }
@media (max-width: 760px) { .post-list a { grid-template-columns: 1fr; gap: 8px; } .post-list .arrow { display: none; } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line-2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; font-weight: 600; font-size: 1.06rem; position: relative; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: translateY(-70%) rotate(45deg); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .ans { padding: 0 0 24px; color: var(--text-2); max-width: 70ch; }

/* ---------- CTA / form ---------- */
.cta-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.join { padding: clamp(22px, 3vw, 32px); display: grid; gap: 20px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 0.84rem; color: var(--text-2); align-items: start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-msg { font-size: 0.9rem; border-radius: 10px; padding: 12px 14px; display: none; }
.form-msg.is-ok { display: block; color: var(--live); background: var(--live-soft); border: 1px solid color-mix(in oklab, var(--live) 35%, transparent); }
.form-msg.is-err { display: block; color: var(--loss); background: var(--loss-soft); border: 1px solid color-mix(in oklab, var(--loss) 35%, transparent); }
.field-err { font-size: 0.8rem; color: var(--loss); min-height: 0; }
.expect { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.expect li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.expect li b { color: var(--text); display: block; font-weight: 600; margin-bottom: 2px; }
.expect .n { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); padding-top: 3px; }
@media (max-width: 900px) { .cta-block { grid-template-columns: 1fr; } }

/* ---------- Page head ---------- */
.page-head { padding-top: clamp(56px, 8vw, 112px); padding-bottom: clamp(48px, 6vw, 88px); position: relative; }
.page-head .display { font-size: clamp(3rem, 7vw, 6rem); max-width: 16ch; margin: 18px 0 26px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-2); background: var(--bg-2); padding-block: 64px 36px; font-size: 0.9rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 0.7fr)); gap: 32px; }
.foot-grid h2 { font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--text-2); text-decoration: none; }
.foot-grid a:hover { color: var(--text); }
.foot-statement { color: var(--text-2); max-width: 44ch; margin-top: 16px; }
.help-line { margin-top: 48px; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 14px; display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); font-size: 0.86rem; background: var(--surface); }
.help-line svg { width: 20px; height: 20px; flex: none; color: var(--text-3); margin-top: 2px; }
.help-line a { color: var(--text); }
.foot-base { margin-top: 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.72rem; color: var(--text-3); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Utility ---------- */
.stack-sm > * + * { margin-top: 10px; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-l { margin-top: clamp(32px, 5vw, 56px); }
.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (forced-colors: active) {
  .band, .key-band { border: 1px solid CanvasText; }
  .badge { border: 1px solid CanvasText; }
}
.nav-try { display: none; }
@media (max-width: 960px) { .nav a.nav-try { display: block; color: var(--text); border-top: 1px solid var(--line); margin-top: 6px; } }
.gloss { margin: 0 0 1em; display: grid; gap: 0; border-top: 1px solid var(--line); }
.gloss dt { font-weight: 650; color: var(--text); padding-top: 16px; scroll-margin-top: 110px; }
.gloss dt:target { color: var(--accent); }
.gloss dd { margin: 4px 0 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.stake-row button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.tile > svg.spark { margin-top: auto; width: 100%; height: auto; }
.shift { margin-top: auto; display: grid; gap: 10px; }
.shift-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 92px; gap: 12px; align-items: center; font-size: 0.8rem; }
.shift-row .nm { color: var(--text); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shift-row .d { font-family: var(--mono); font-size: 0.72rem; text-align: right; color: var(--text-2); }
.shift-row .band-track .band.was { background: transparent; border-style: dashed; border-color: var(--line-3); }
.shift-row .band-track .band.was .mid { background: var(--text-3); }
.js .shift .band.now { transition: left 1.1s var(--ease) 0.3s, width 1.1s var(--ease) 0.3s; }
.js .reveal:not(.is-in) .shift .band.now { left: var(--l0) !important; width: var(--w0) !important; }
.tile p.label { font-size: 0.75rem; color: var(--text-3); }
.field > label.check { font-weight: 400; font-size: 0.84rem; color: var(--text-2); }
.hero, .page-head { overflow-x: clip; }
html { overflow-x: clip; }

/* =========================================================
   Racing identity (added 2026-09-28)
   ========================================================= */

/* North American saddle-cloth colours. Number text keeps its own contrast colour. */
.saddle { font-family: var(--display); font-weight: 700; font-size: 0.92rem; border-radius: 5px; }
.saddle[data-n="1"] { background: #c8202b; color: #fff; border-color: transparent; }
.saddle[data-n="2"] { background: #f6f3ea; color: #14140f; border-color: rgba(0, 0, 0, 0.18); }
.saddle[data-n="3"] { background: #1d4ea3; color: #fff; border-color: transparent; }
.saddle[data-n="4"] { background: #f2c318; color: #14140f; border-color: transparent; }
.saddle[data-n="5"] { background: #1d7a3e; color: #fff; border-color: transparent; }
.saddle[data-n="6"] { background: #111; color: #f2c318; border-color: rgba(255, 255, 255, 0.2); }
.saddle[data-n="7"] { background: #ef7d22; color: #14140f; border-color: transparent; }
.saddle[data-n="8"] { background: #f29bbf; color: #14140f; border-color: transparent; }

/* Program-style section tag: saddle cloth + condensed caps */
.race-tag { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass); }
.race-tag .saddle { width: 26px; height: 26px; display: inline-grid; place-items: center; border: 1px solid transparent; letter-spacing: 0; }
.race-tag .dist { color: var(--text-3); font-weight: 600; }
.race-tag .dist::before { content: "\00B7"; margin-right: 12px; color: var(--line-3); }

/* Mown-turf stripes for alternate sections */
.turf { background: repeating-linear-gradient(90deg, var(--stripe) 0 128px, transparent 128px 256px), var(--bg-2); }

/* ---------- Racing hero ---------- */
.hero--racing { padding: 0 0 clamp(64px, 8vw, 110px); overflow-x: clip; }
.hero-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: clamp(540px, 66vh, 640px); }
.hero-top .hero-copy {
  align-self: center; max-width: none;
  padding: clamp(40px, 5vw, 72px) clamp(24px, 4vw, 64px) clamp(150px, 16vw, 210px) max(var(--gutter), calc((100vw - var(--wrap)) / 2));
}
.hero-media { position: relative; margin: 0; border-bottom-left-radius: 36px; overflow: hidden; background: var(--surface-2); }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 44% 50%; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 19, 15, 0.35), rgba(10, 19, 15, 0) 28%); pointer-events: none; }
.hero-demo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); margin-top: calc(-1 * clamp(140px, 15vw, 200px)); position: relative; z-index: 2; align-items: start; }
.hero-demo .demo-steps { padding-top: clamp(170px, 17vw, 230px); }
.demo-steps ol { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 18px; }
.demo-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; color: var(--text-2); font-size: 0.95rem; }
.demo-steps li b { color: var(--text); display: block; font-weight: 600; }
.demo-steps .saddle { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; }
.media-note { font-size: 0.75rem; color: var(--text-3); margin-top: 22px; }
@media (max-width: 1060px) {
  .hero-top { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { order: -1; aspect-ratio: 16 / 9; border-radius: 0; }
  .hero-top .hero-copy { padding: 36px var(--gutter) 40px; }
  .hero-demo { grid-template-columns: 1fr; margin-top: 0; }
  .hero-demo .demo-steps { padding-top: 0; order: 2; }
}

/* ---------- Photography ---------- */
.photo { margin: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-lg); background: var(--surface-2); }
.photo figcaption { margin-top: 12px; font-size: 0.9rem; color: var(--text-2); }
.photo figcaption b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.ai-note { display: inline-block; margin-top: 6px; font-size: 0.72rem; color: var(--text-3); }
.film { display: grid; grid-template-columns: 1.15fr 0.85fr 1fr; gap: 14px; margin-top: clamp(40px, 6vw, 64px); }
.film .photo img { aspect-ratio: 4 / 3.2; }
.film .photo:nth-child(2) img { aspect-ratio: 3 / 3.3; }
@media (max-width: 860px) { .film { grid-template-columns: 1fr; } .film .photo img, .film .photo:nth-child(2) img { aspect-ratio: 16 / 10; } }

.photo-band { position: relative; height: clamp(220px, 34vw, 440px); overflow: hidden; margin: 0; }
.photo-band img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.photo-band + .section::before { display: none; }

.split-photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split-photo .photo img { aspect-ratio: 4 / 3.4; }
@media (max-width: 900px) { .split-photo { grid-template-columns: 1fr; } }

/* ---------- Morning plan card ---------- */
.plan { overflow: hidden; }
.plan-rows { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; padding: 18px; font-size: 0.9rem; }
.plan-rows dt { color: var(--text-3); font-size: 0.8rem; padding-top: 2px; }
.plan-rows dd { margin: 0; color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 4px 18px 18px; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 74px 18px 1fr; gap: 10px; font-size: 0.86rem; color: var(--text-2); position: relative; padding-bottom: 14px; }
.timeline time { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); padding-top: 2px; }
.timeline .pin { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--line-3); position: relative; }
.timeline li:not(:last-child) .pin::after { content: ""; position: absolute; left: 4px; top: 12px; width: 2px; height: calc(100% + 16px); background: var(--line-2); }
.timeline .ok .pin { background: var(--accent); }
.timeline .warn .pin { background: var(--brass); box-shadow: 0 0 0 4px var(--brass-soft); }
.timeline .done .pin { background: var(--text-2); }
.timeline b { color: var(--text); font-weight: 600; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); align-items: center; }

/* ---------- Tiles with photos: image first, words below ---------- */
.tile--photo { padding: 0; }
.tile--photo .tile-img { aspect-ratio: 16 / 8.2; overflow: hidden; }
.tile--photo .tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile--photo .tile-words { padding: 22px 26px 26px; display: grid; gap: 10px; }
.quote { margin: 0; padding: 14px 16px; border-left: 3px solid var(--brass); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 0.92rem; color: var(--text); }
.quote cite { display: block; margin-top: 8px; font-style: normal; font-family: var(--mono); font-size: 0.68rem; color: var(--text-3); }
.watch { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.watch li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.86rem; }
.watch li span:last-child { color: var(--text-3); font-size: 0.78rem; }
.rain { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.rain i { flex: 1; background: color-mix(in oklab, var(--accent) 45%, transparent); border-radius: 3px 3px 0 0; }
.rain-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.66rem; color: var(--text-3); margin-top: 6px; }

/* ---------- Family row ---------- */
.family { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(40px, 6vw, 72px); }
.family .photo img { aspect-ratio: 4 / 3; }
.fam-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 18px; }
.fam-table th, .fam-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.fam-table th { font-family: var(--display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; color: var(--text-3); }
.fam-table td { color: var(--text-2); }
.fam-table td:first-child { color: var(--text); font-weight: 600; }
@media (max-width: 900px) { .family { grid-template-columns: 1fr; } }

/* ---------- Articles and insight thumbnails ---------- */
.article-figure { margin: 8px 0 0; }
.article-figure img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-xl); }
.article-figure figcaption { font-size: 0.74rem; color: var(--text-3); margin-top: 8px; text-align: right; }
.post-list a { grid-template-columns: 200px minmax(0, 1fr) auto; align-items: center; }
.post-thumb { width: 200px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.post-list a:hover .post-thumb img { transform: scale(1.04); }
.post-list .label { display: block; margin-bottom: 6px; }
@media (max-width: 760px) { .post-thumb { width: 100%; aspect-ratio: 16 / 9; } }

/* Panel headings stay in Plex Sans */
.race-name, .panel-title, .why h3 { font-family: var(--font); }

/* Scroll-scrubbed hero clip and mist plane */
.hero-media { will-change: transform; transform-origin: 60% 100%; }
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 44% 50%; opacity: 0; transition: opacity 0.6s var(--ease); }
.is-scrubbing .hero-media video { opacity: 1; }
.hero-mist { position: absolute; inset: -10% -20% -10% -10%; pointer-events: none; z-index: 1; will-change: transform;
  background: radial-gradient(40% 30% at 20% 85%, rgba(242, 239, 228, 0.22), transparent 70%), radial-gradient(35% 25% at 70% 95%, rgba(242, 239, 228, 0.16), transparent 70%); filter: blur(8px); }
.hero-copy { will-change: transform; }
.post-list .h3 { display: block; }
.nw { white-space: nowrap; }
.hero-top .display { font-size: clamp(3rem, 5.2vw, 5.1rem); }
.hero-top .hero-copy { padding-bottom: clamp(140px, 13vw, 180px); }
.hero-top .lede { font-size: clamp(1.05rem, 1.3vw, 1.18rem); }
