/* ============================================================
   bayesRatings — design system
   Styling reference: datahub.com — warm eggshell ground, deep
   navy serif display, floating white card nav, chip components
   with thin dark borders, sky-blue platform panel, royal-blue
   CTAs, muted beige decorative squares.
   This file is the design guide for the full site build.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300..900;1,8..60,300..900&family=Figtree:ital,wght@0,300..900;1,300..900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- tokens ---------- */
:root {
  /* ground + surfaces */
  --bg:            #f1efe8;
  --surface:       #ffffff;
  --surface-dim:   #f7f5ef;
  --panel:         #d5eaf6;   /* sky-blue platform panel */
  --panel-deep:    #bcdcee;
  --decor:         #e4e0d2;   /* beige background squares */

  /* ink */
  --ink:           #0e2537;   /* deep navy */
  --ink-soft:      #46596a;
  --ink-faint:     #8494a1;

  /* borders */
  --border:        #ddd9cb;   /* soft card border */
  --border-strong: #24405a;   /* thin dark chip border */

  /* brand */
  --blue:          #1465e0;   /* royal blue CTA */
  --blue-soft:     #e5effc;
  --blue-deep:     #0d4cb0;

  /* the Bayes triad */
  --prior:  #d97a1a;          /* market prior — orange  */
  --model:  #1465e0;          /* model evidence — blue  */
  --post:   #0e2537;          /* posterior — navy ink   */
  --prior-soft: #d97a1a22;
  --model-soft: #1465e022;

  --up:   #12805c;
  --down: #c2452d;
  --live: #d97a1a;

  /* type */
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body:    'Figtree', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --font-mono:    'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --text-xs:  0.72rem;
  --text-sm:  0.84rem;
  --text-md:  0.96rem;
  --text-lg:  1.15rem;
  --text-xl:  clamp(1.5rem, 3vw, 2rem);
  --text-hero: clamp(2.4rem, 5.6vw, 4rem);

  /* rhythm */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-6: 1.5rem;   --sp-8: 2rem;    --sp-12: 3rem;    --sp-16: 4rem;

  --max-w: 74rem;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --shadow-card: 0 1px 2px #0e253714, 0 8px 24px -12px #0e253726;
  --shadow-nav:  0 2px 6px #0e25371a, 0 12px 32px -16px #0e253733;

  accent-color: var(--blue);
}

:root[data-theme="dark"] {
  --bg:            #0e141b;
  --surface:       #171f29;
  --surface-dim:   #131a23;
  --panel:         #12283c;
  --panel-deep:    #0f2233;
  --decor:         #171f29;

  --ink:           #e7edf3;
  --ink-soft:      #a2b2c0;
  --ink-faint:     #6d7e8d;

  --border:        #263341;
  --border-strong: #5b7996;

  --blue:          #4f92f7;
  --blue-soft:     #14283f;
  --blue-deep:     #82b2fa;

  --prior:  #e69138;
  --model:  #4f92f7;
  --post:   #e7edf3;
  --prior-soft: #e6913826;
  --model-soft: #4f92f726;

  --up:   #34a37f;
  --down: #d3735d;
  --live: #e69138;

  --shadow-card: 0 1px 2px #00000040, 0 10px 28px -14px #00000080;
  --shadow-nav:  0 2px 8px #00000055, 0 14px 36px -16px #00000090;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6); }
a { color: inherit; }
::selection { background: var(--blue); color: #fff; }

.num, td.num, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* micro label — small caps utility used everywhere */
.micro {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   buttons + chips
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border-radius: var(--r-sm);
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue);
  border: 1px solid var(--blue-deep);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-deep); box-shadow: var(--shadow-card); }
:root[data-theme="dark"] .btn-primary:hover,
.btn-primary:hover { color: #fff; }

.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--blue);
  color: var(--blue);
}
.btn-outline:hover { background: var(--blue-soft); }

/* chip — the signature DataHub-style component */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.85rem;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: box-shadow .12s ease, transform .12s ease;
}
.chip:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.chip .ico { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.chip .ico.round { border-radius: 50%; }
.chip.ghost { border-style: dashed; color: var(--ink-soft); font-weight: 500; }
.chip.mini { padding: 0.2rem 0.6rem; font-size: var(--text-xs); border-radius: 5px; }

/* tag — tiny pill used for NEW / SOON */
.tag {
  display: inline-block;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: var(--surface);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
}
.tag.warm { border-color: var(--prior); color: var(--prior); }

/* ============================================================
   floating nav card
   ============================================================ */
.nav-shell { padding-top: var(--sp-4); position: sticky; top: 0.75rem; z-index: 50; }

.navbar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-nav);
  padding: 0.6rem var(--sp-4) 0.6rem var(--sp-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  margin-right: var(--sp-2);
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark .curve  { stroke: var(--blue); }
.brand-mark .curve2 { stroke: var(--prior); }
.brand-mark .base   { stroke: var(--ink-faint); }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-name em { font-style: normal; color: var(--blue); }

.nav-links {
  display: flex;
  gap: var(--sp-6);
  font-size: var(--text-sm);
  font-weight: 600;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color .12s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--blue); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: all .12s ease;
}
.theme-toggle:hover { color: var(--ink); box-shadow: var(--shadow-card); }

/* ============================================================
   hero
   ============================================================ */
.hero {
  position: relative;
  text-align: center;
  padding: var(--sp-16) 0 var(--sp-8);
  overflow: visible;
}

/* decorative beige squares, DataHub-style */
.decor { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.decor span {
  position: absolute;
  background: var(--decor);
  border-radius: 22px;
  animation: drift 9s ease-in-out infinite alternate;
}
.decor .d1 { width: 120px; height: 120px; left: 2%;  top: 12%; }
.decor .d2 { width: 84px;  height: 84px;  left: 9%;  top: 46%; animation-delay: -3s; }
.decor .d3 { width: 140px; height: 140px; left: 4%;  top: 66%; animation-delay: -6s; }
.decor .d4 { width: 130px; height: 130px; right: 3%; top: 10%; animation-delay: -2s; }
.decor .d5 { width: 90px;  height: 90px;  right: 10%; top: 44%; animation-delay: -5s; }
.decor .d6 { width: 70px;  height: 70px;  right: 5%; top: 68%; animation-delay: -7s; }
@keyframes drift { from { transform: translateY(-6px); } to { transform: translateY(8px); } }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--sp-6);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 18ch;
  margin: 0 auto;
}
.hero h1 em { font-style: italic; font-weight: 560; color: var(--blue); }

.hero .lede {
  margin: var(--sp-6) auto 0;
  max-width: 44rem;
  font-size: var(--text-lg);
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}

.hero .fineprint {
  margin-top: var(--sp-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   platform diagram — the DataHub-style centerpiece
   ============================================================ */
.platform { margin: var(--sp-8) 0 var(--sp-4); }

/* top consumers bar */
.consumers {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  background: var(--surface-dim);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: var(--sp-3) var(--sp-4);
}
.consumers .spacer { flex: 1; }

/* dashed connectors */
.connectors {
  display: flex;
  justify-content: space-around;
  height: 34px;
  padding: 0 12%;
}
.connectors span {
  width: 0;
  border-left: 1.5px dashed var(--ink-faint);
  position: relative;
}
.connectors span::before, .connectors span::after {
  content: "";
  position: absolute;
  left: -4.25px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}
.connectors span::before { top: -1px; border-bottom: 5px solid var(--ink-faint); }
.connectors span::after  { bottom: -1px; border-top: 5px solid var(--ink-faint); }

/* the blue panel */
.panel {
  background: var(--panel);
  border: 2px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-6) var(--sp-3);
  box-shadow: var(--shadow-card);
}
.panel-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3) 0;
}
.panel-row + .panel-row { border-top: 1px dashed color-mix(in srgb, var(--border-strong) 35%, transparent); }
.panel-row .label { line-height: 1.5; }
.panel-row .chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-3);
  margin-top: var(--sp-1);
  border-top: 1px solid color-mix(in srgb, var(--border-strong) 30%, transparent);
}
.panel-foot .brand-name { font-size: 1rem; }

/* bottom sources bar */
.sources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.source-group {
  background: var(--surface-dim);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: var(--sp-3) var(--sp-4);
}
.source-group .chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.source-group .micro { color: var(--ink-faint); }

/* ============================================================
   section headers
   ============================================================ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin: var(--sp-12) 0 var(--sp-4);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 640;
  letter-spacing: -0.01em;
}
.section-head .count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* live pulse dot */
.pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 0.4em;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================================
   slate card + game rows
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.legend .key { display: flex; align-items: center; gap: 0.45em; }
.legend .swatch { width: 9px; height: 9px; border-radius: 50%; }
.legend .swatch.prior { background: var(--prior); }
.legend .swatch.model { background: var(--model); }
.legend .swatch.post  { background: var(--post); outline: 2px solid color-mix(in srgb, var(--post) 25%, transparent); outline-offset: 1px; }

.ledger-cols, .game-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(13rem, 1.35fr) minmax(9rem, 1fr) 5.2rem 4.4rem 6rem;
  gap: var(--sp-4);
  align-items: center;
  padding: 0 var(--sp-6);
}
.ledger-cols {
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
}
.ledger-cols .r, .game-row .r { text-align: right; }

.game-row {
  padding-top: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  animation: row-in 0.5s ease both;
  transition: background .12s ease;
}
.game-row:last-child { border-bottom: none; }
.game-row:hover { background: var(--surface-dim); }
@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.game-row:nth-child(n)  { animation-delay: calc(0.04s * var(--i, 0)); }

.kick {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-soft);
  line-height: 1.6;
}
.kick .net { color: var(--ink-faint); }

.teams { display: grid; gap: 0.4rem; }
.team { display: flex; align-items: center; gap: var(--sp-2); }
.team .abbr {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  min-width: 2.9em;
  text-align: center;
}
.team .name { font-weight: 600; }
.team .prob {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.team.fav .abbr { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.team.fav .prob { color: var(--blue); font-weight: 600; }

/* mini bayes strip */
.strip { position: relative; height: 26px; }
.strip .track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--border-strong) 28%, transparent);
}
.strip .mid {
  position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1px;
  background: repeating-linear-gradient(color-mix(in srgb, var(--border-strong) 45%, transparent) 0 2px, transparent 2px 4px);
}
.strip .m { position: absolute; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.strip .m.prior { width: 8px; height: 8px; background: var(--prior); }
.strip .m.model { width: 8px; height: 8px; background: var(--model); }
.strip .m.post {
  width: 12px; height: 12px;
  background: var(--post);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1.5px var(--post);
  z-index: 2;
}
.strip .span {
  position: absolute; top: 50%; height: 4px; border-radius: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--prior-soft), var(--model-soft));
}

.spread-cell, .total-cell, .ml-cell {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
}
.ml-cell { color: var(--ink-soft); font-weight: 500; line-height: 1.7; }
.cell-sub { display: block; font-size: var(--text-xs); font-weight: 400; color: var(--ink-faint); }

/* ============================================================
   data tables (ratings)
   ============================================================ */
.table-wrap { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data thead th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th.r, table.data td.r { text-align: right; }
table.data tbody td { padding: 0.6rem var(--sp-4); border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: var(--surface-dim); }
table.data .rk { font-family: var(--font-mono); color: var(--ink-faint); width: 2.5rem; }
table.data .team-name { font-weight: 600; white-space: nowrap; }
table.data .team-name .abbr {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-right: 0.6em;
  min-width: 2.9em;
  text-align: center;
}
table.data td.num { font-weight: 600; }
table.data .delta.up   { color: var(--up); }
table.data .delta.down { color: var(--down); }
table.data .rec { color: var(--ink-soft); }

/* diverging rating bar */
.rbar { position: relative; width: 130px; height: 8px; display: inline-block; vertical-align: middle; }
.rbar::before {
  content: "";
  position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px;
  background: color-mix(in srgb, var(--border-strong) 45%, transparent);
}
.rbar .fill { position: absolute; top: 1px; height: 6px; background: var(--blue); border-radius: 3px; }
.rbar .fill.neg { background: var(--prior); }

/* ============================================================
   methodology
   ============================================================ */
.prose { max-width: 46rem; margin: 0 auto; padding: var(--sp-8) 0; }
.prose > p.lede {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: var(--sp-8);
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 640;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  margin: var(--sp-12) 0 var(--sp-3);
}
.prose h2 .no {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--blue);
  vertical-align: super;
  margin-right: 0.5em;
}
.prose p { margin-bottom: var(--sp-4); }
.prose .aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--prior);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  margin: var(--sp-6) 0;
}

.formula {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-6) 0;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  text-align: center;
  overflow-x: auto;
}
.formula .prior-t { color: var(--prior); }
.formula .model-t { color: var(--model); }
.formula .post-t  { font-weight: 600; }
.formula i { font-family: var(--font-display); }

/* ============================================================
   footer
   ============================================================ */
.foot {
  margin-top: var(--sp-16);
  border-top: 1px solid var(--border);
  padding: var(--sp-8) 0 var(--sp-12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4) var(--sp-8);
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--ink-faint);
  line-height: 1.8;
}
.foot a { color: var(--ink-soft); }
.foot .disclaim { max-width: 34rem; }

/* mock banner */
.mock-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  text-align: center;
  padding: 0.4rem var(--sp-4);
}
:root[data-theme="dark"] .mock-note { background: #000; color: var(--ink-soft); }
.mock-note b { color: var(--prior); font-weight: 600; }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .decor .d2, .decor .d5 { display: none; }
}

@media (max-width: 720px) {
  .ledger-cols { display: none; }
  .game-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "kick  kick"
      "teams teams"
      "strip strip"
      "spread total"
      "ml    ml";
    gap: var(--sp-2) var(--sp-4);
  }
  .game-row .kick   { grid-area: kick; }
  .game-row .teams  { grid-area: teams; }
  .game-row .strip  { grid-area: strip; }
  .game-row .spread-cell { grid-area: spread; text-align: left; }
  .game-row .total-cell  { grid-area: total;  text-align: right; }
  .game-row .ml-cell     { grid-area: ml; text-align: left; }
  .game-row .r { text-align: left; }
  .panel-row { grid-template-columns: 1fr; gap: var(--sp-2); }
  .sources { grid-template-columns: 1fr; }
  .connectors { padding: 0 20%; }
  .hero { padding-top: var(--sp-8); }
  .decor span { display: none; }
}

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

/* ============================================================
   matchup page
   ============================================================ */
a.game-row { text-decoration: none; color: inherit; }

.match-crumb {
  display: flex; align-items: center; gap: 0.5em;
  margin: var(--sp-6) 0 0;
  font-size: var(--text-sm); color: var(--ink-soft);
}
.match-crumb a { text-decoration: none; color: var(--blue); font-weight: 600; }

.match-hero { position: relative; text-align: center; padding: var(--sp-8) 0 var(--sp-4); }

.match-teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-6); align-items: center;
  max-width: 58rem; margin: 0 auto;
}
.mteam { display: flex; flex-direction: column; gap: 0.35rem; }
.mteam.away { align-items: flex-start; text-align: left; }
.mteam.home { align-items: flex-end; text-align: right; }
.mteam .tname {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  font-weight: 640; line-height: 1.05; letter-spacing: -0.015em;
}
.mteam .trec { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink-soft); }
.at-divider {
  font-family: var(--font-display); font-style: italic;
  font-size: var(--text-lg); color: var(--ink-faint);
}
.match-meta {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: var(--sp-2); margin-top: var(--sp-6);
}

/* generic card header + grid */
.card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-4); padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface-dim);
}
.card-head h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 640; }
.card-head .sub { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); }
.card-pad { padding: var(--sp-4) var(--sp-6); }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); margin-top: var(--sp-6); }
.match-grid .span2 { grid-column: 1 / -1; }
.match-grid > .card { align-self: start; }

/* odds board */
.best {
  display: inline-block;
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px var(--blue);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  color: var(--blue-deep);
  font-weight: 600;
}
table.data .book { font-weight: 700; white-space: nowrap; }
table.data tr.consensus td {
  background: var(--surface-dim);
  border-top: 2px solid var(--border-strong);
  font-weight: 700;
}

/* team comparison rows */
.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(8rem, 0.9fr) minmax(0, 1.1fr);
  align-items: center; gap: var(--sp-3);
  padding: 0.45rem var(--sp-6);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.compare-row:last-child { border-bottom: none; }
.compare-row .stat { text-align: center; }
.compare-row .side {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-mono); font-weight: 600;
  min-width: 0;
}
.compare-row .side.home { justify-content: flex-end; }
.compare-row .bar {
  height: 6px; border-radius: 3px; flex: 1; max-width: 8.5rem;
  background: color-mix(in srgb, var(--border-strong) 12%, transparent);
  position: relative;
}
.compare-row .bar .f { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.compare-row .side.away .bar .f { right: 0; background: var(--prior); }
.compare-row .side.home .bar .f { left: 0;  background: var(--model); }
.compare-row .side .v.lead { color: var(--ink); }
.compare-row .side .v { color: var(--ink-soft); }
.compare-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface-dim);
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.compare-head .away { color: var(--prior); }
.compare-head .home { color: var(--model); text-align: right; }
.compare-head .mid  { color: var(--ink-faint); }

/* player cards */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); }
.pcard {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
}
.pcard .prow { display: flex; align-items: baseline; gap: var(--sp-2); }
.pcard .pname { font-weight: 700; }
.pcard .ppos {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 0.05rem 0.35rem; color: var(--ink-soft);
}
.pcard .pteam { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); }
.pcard .pstat {
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--ink-soft); margin-top: 0.35rem; line-height: 1.8;
}

/* injuries */
.inj-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: var(--sp-3); align-items: center;
  padding: 0.45rem var(--sp-6);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.inj-row:last-child { border-bottom: none; }
.inj-row .detail { color: var(--ink-soft); }
.status {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-radius: 4px; padding: 0.1rem 0.45rem;
}
.status.q   { background: var(--prior-soft); color: var(--prior); border: 1px solid var(--prior); }
.status.o   { background: color-mix(in srgb, var(--down) 12%, transparent); color: var(--down); border: 1px solid var(--down); }
.status.ir  { background: color-mix(in srgb, var(--ink-faint) 14%, transparent); color: var(--ink-soft); border: 1px solid var(--ink-faint); }

/* head-to-head */
.h2h-row {
  display: grid; grid-template-columns: 6.5rem 1fr auto auto;
  gap: var(--sp-3); align-items: center;
  padding: 0.5rem var(--sp-6);
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.h2h-row:last-child { border-bottom: none; }
.h2h-row .when { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-faint); }
.h2h-row .score { font-family: var(--font-mono); font-weight: 600; }

@media (max-width: 900px) {
  .match-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .match-teams { grid-template-columns: 1fr; gap: var(--sp-2); }
  .mteam.away, .mteam.home { align-items: center; text-align: center; }
  .pgrid { grid-template-columns: 1fr; }
}

/* ============================================================
   belief-update axis + headline stat row (matchup page)
   ============================================================ */
.bayes-axis { position: relative; height: 172px; margin: var(--sp-6) 0 var(--sp-2); }
.bayes-axis .track {
  position: absolute; left: 0; right: 0; top: 104px;
  height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--border-strong) 28%, transparent);
}
.bayes-axis .tick {
  position: absolute; top: 100px;
  width: 1px; height: 9px;
  background: var(--border-strong); opacity: 0.5;
}
.bayes-axis .tick-label {
  position: absolute; top: 112px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: var(--text-xs);
  color: var(--ink-faint);
}
.bayes-axis .halfway {
  position: absolute; top: 74px; bottom: 46px; width: 1px;
  background: repeating-linear-gradient(var(--border-strong) 0 3px, transparent 3px 6px);
  opacity: 0.5;
}

.axis-mark {
  position: absolute; top: 104px;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.axis-mark .dot {
  display: block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--surface);
}
.axis-mark.prior .dot { background: var(--prior); }
.axis-mark.post .dot {
  width: 17px; height: 17px;
  background: var(--post);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--post) 18%, transparent);
}

.axis-callout {
  position: absolute; transform: translateX(-50%);
  text-align: center; white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5;
}
.axis-callout .lab { letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.axis-callout .val { font-size: var(--text-md); font-weight: 600; }
.axis-callout.prior { top: 0; color: var(--prior); }
.axis-callout.post  { top: 124px; color: var(--post); }
.axis-callout .stem {
  display: block; width: 1px; margin: 2px auto 0;
  background: currentColor; opacity: 0.5;
}
.axis-callout.prior .stem { height: 60px; }
.axis-callout.post .stem  { height: 16px; margin: 0 auto 2px; }

/* bayesRatings marker slides in from the market's position on load */
@keyframes slide-post {
  from { left: var(--from); opacity: 0.4; }
  to   { left: var(--to);   opacity: 1; }
}
.axis-mark.post, .axis-callout.post {
  animation: slide-post 1.4s cubic-bezier(.22,1,.36,1) 0.45s both;
}

.featured-row {
  display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: var(--sp-4);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-4); padding-top: var(--sp-4);
}
.featured-stat .k {
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-faint);
}
.featured-stat .v {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: var(--text-lg); font-weight: 600;
}
.featured-stat .v small { font-size: var(--text-xs); color: var(--ink-soft); font-weight: 400; }

/* keep hero decor squares clear of the team names on the matchup hero */
.match-hero .decor span { opacity: 0.55; }
.match-hero .d1 { width: 84px; height: 84px; left: 0; top: 62%; }
.match-hero .d4 { width: 96px; height: 96px; right: 0; top: 4%; }

/* ============================================================
   blog posts (prose additions: code, tables, images, lists)
   ============================================================ */
.blog-post h3 { font-family: var(--font-display); margin: var(--sp-6) 0 var(--sp-2); }
.blog-post ul, .blog-post ol { margin: 0 0 var(--sp-4) 1.4rem; }
.blog-post li { margin-bottom: 0.3rem; }
.blog-post a { color: var(--blue); }
.blog-post img { max-width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); margin: var(--sp-3) 0; }
.blog-post code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-dim); border: 1px solid var(--border); border-radius: 4px; padding: 0.05rem 0.3rem; }
.blog-post pre { background: var(--surface-dim); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); overflow-x: auto; margin-bottom: var(--sp-4); }
.blog-post pre code { background: none; border: none; padding: 0; }
.blog-post blockquote { border-left: 3px solid var(--prior); padding-left: var(--sp-4); color: var(--ink-soft); margin-bottom: var(--sp-4); }
.blog-post .table-wrap { margin-bottom: var(--sp-4); }
