/* ==========================================================================
   The Race to ASI — styles
   Dark, premium, zero-dependency. System font stack (looks great on macOS).
   ========================================================================== */

:root {
  --bg:        #05060a;
  --bg-2:      #0a0c14;
  --panel:     rgba(255, 255, 255, 0.025);
  --panel-2:   rgba(255, 255, 255, 0.04);
  --stroke:    rgba(255, 255, 255, 0.08);
  --stroke-2:  rgba(255, 255, 255, 0.14);
  --ink:       #eef1f7;
  --ink-soft:  #aab2c5;
  --ink-mute:  #8a94aa;
  --accent:    #7c5cff;
  --accent-2:  #19d3a2;
  --radius:    16px;
  --maxw:      1180px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* anchor jumps must clear the sticky nav + view-switch stack */
main section[id] { scroll-margin-top: 132px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

h1, h2, h3 { line-height: 1.1; letter-spacing: 0; margin: 0; font-weight: 700; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

::selection { background: rgba(124, 92, 255, 0.35); }

/* ----------------------------------------------------- ambient background */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 18% 0%,  rgba(124, 92, 255, 0.20), transparent 70%),
    radial-gradient(55% 45% at 92% 8%,  rgba(25, 211, 162, 0.14), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(242, 95, 176, 0.10), transparent 70%),
    var(--bg);
}
.bg-aurora::after {                 /* subtle dotted grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent);
}

/* --------------------------------------------------------------------- nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(5, 6, 10, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.brand-mark { font-size: 18px; filter: drop-shadow(0 0 10px rgba(124,92,255,.5)); }
.brand-text b { color: #fff; }
.nav-toggle {
  display: none;
  appearance: none;
  align-items: center; justify-content: center;
  width: 38px; height: 34px;
  border: 1px solid var(--stroke-2); border-radius: 10px;
  background: transparent; color: var(--ink-soft);
  cursor: pointer;
}
.nav-toggle:hover { color: #fff; }
.nav-toggle .nt-x { display: none; }
.nav.menu-open .nav-toggle .nt-bars { display: none; }
.nav.menu-open .nav-toggle .nt-x { display: block; }
.nav-links { display: flex; gap: clamp(12px, 3vw, 30px); font-size: 14px; color: var(--ink-soft); }
.nav-links a { position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a:hover { color: #fff; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1.5px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }

/* -------------------------------------------------------------------- hero */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

.hero {
  text-align: center;
  padding: clamp(56px, 11vw, 120px) 0 clamp(40px, 7vw, 72px);
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--ink-soft);
  padding: 7px 14px;
  border: 1px solid var(--stroke-2);
  border-radius: 100px;
  background: var(--panel);
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(40px, 8.5vw, 88px);
  font-weight: 800;
  letter-spacing: 0;
}
.grad {
  background: linear-gradient(100deg, #a78bff 0%, #19d3a2 55%, #f25fb0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--ink-soft);
}
.hero-updated {
  margin: 16px auto 0;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 12px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(20px, 5vw, 56px);
  margin: 42px auto 0;
}
.stat { text-align: center; }
.stat-num {
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: 0;
  background: linear-gradient(180deg, #fff, #b9c0d4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12.5px; color: var(--ink-mute); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 4px; }
.hero-cta {
  display: inline-block;
  margin-top: 46px;
  padding: 13px 26px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(100deg, var(--accent), #5b8bff);
  box-shadow: 0 10px 40px -10px rgba(124, 92, 255, 0.7);
  transition: transform .2s ease, box-shadow .2s ease;
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -10px rgba(124, 92, 255, 0.9); }

/* ----------------------------------------------------------------- section */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.compact-section { padding-top: clamp(18px, 4vw, 36px); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 4.6vw, 46px); font-weight: 800; }
.section-sub { color: var(--ink-soft); font-size: clamp(15px, 2vw, 17px); margin-top: 12px; }

/* the "Capability Index?" explainer — bubble from the data-tip attribute,
   shown on hover/focus and pinned open by tap (JS toggles .tip-open) */
.tip { position: relative; border-bottom: 1px dotted var(--ink-mute); cursor: help; }
.tip sup { color: var(--accent); font-weight: 700; }
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 40;
  width: min(320px, 78vw);
  padding: 11px 13px; border-radius: 10px;
  background: rgba(12, 14, 22, 0.97);
  border: 1px solid var(--stroke-2);
  color: var(--ink-soft); font-size: 12.5px; font-weight: 400; line-height: 1.5; text-align: left;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.9);
  opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.tip:hover::after, .tip:focus-visible::after, .tip.tip-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.noscript {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}
.noscript h2 { font-size: 20px; }
.noscript p { margin: 8px 0 0; color: var(--ink-soft); }

/* ------------------------------------------------------------------ latest */
.latest .section-head { margin-bottom: 24px; }
.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.latest-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-top: 2px solid currentColor;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.latest-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 12px;
}
.latest-card h3 { font-size: 18px; color: var(--ink); }
.latest-card h3 a:hover { color: #fff; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.latest-card p { color: var(--ink-soft); font-size: 13.5px; margin: 10px 0 0; }

/* --------------------------------------------------------------- view mode */
.view-panel {
  position: sticky;
  top: 64px;
  z-index: 35;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(5,6,10,0.86), rgba(5,6,10,0.62));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}
.view-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.view-btn:hover { color: #fff; }
.view-btn.is-active {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), #5b8bff);
  box-shadow: 0 8px 24px -12px rgba(124, 92, 255, 0.85);
}
body[data-view="chart"] #timeline,
body[data-view="chart"] #methodology,
body[data-view="chart"] #changelog,
body[data-view="timeline"] #race,
body[data-view="timeline"] #methodology {
  display: none;
}

/* ------------------------------------------------------------------ legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}
.legend-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--stroke-2);
  border-radius: 100px;
  background: var(--panel);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition: background .18s, color .18s, border-color .18s, opacity .18s, transform .18s;
}
.legend-chip:hover { transform: translateY(-1px); color: #fff; border-color: var(--stroke-2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.legend-chip.is-off { opacity: 0.4; }
.legend-chip.is-off .legend-dot { box-shadow: none; filter: grayscale(1); }

/* ------------------------------------------------------------------- chart */
.chart-wrap {
  background: linear-gradient(180deg, var(--panel-2), transparent 60%), var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: clamp(12px, 2.4vw, 22px);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255,255,255,0.04);
}
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  padding: 0 4px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--stroke-2);
  background: var(--panel-2);
  color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .18s, border-color .18s;
}
.btn:hover { background: rgba(255,255,255,0.09); transform: translateY(-1px); border-color: var(--stroke-2); }
.btn:active { transform: translateY(0); }
.btn-ico { font-size: 10px; color: var(--accent-2); }
.btn svg { flex: none; opacity: 0.85; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }

.chart-stage { position: relative; }
#chart { width: 100%; height: auto; display: block; overflow: visible; }

/* on narrow screens the chart keeps a readable width and scrolls sideways */
.swipe-hint {
  display: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-mute); text-align: center; padding: 2px 0 6px;
}
.chart-asof { padding: 8px 6px 0; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }

/* svg primitives */
.grid-line { stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.axis-label { fill: var(--ink-mute); font-size: 12px; font-family: var(--mono); }
.axis-title { fill: var(--ink-soft); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.frontier-line { stroke: rgba(242, 95, 176, 0.5); stroke-width: 1.4; stroke-dasharray: 2 6; stroke-linecap: round; }
.frontier-label { fill: rgba(242, 95, 176, 0.85); font-size: 11px; font-family: var(--mono); letter-spacing: 0.1em; }
.anno-line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; stroke-dasharray: 3 5; }
.anno-label { fill: var(--ink-soft); font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; font-weight: 600; }
.anno-sub { fill: var(--ink-mute); font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; }

.lab-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px currentColor); }
/* only the nodes are interactive — decorative elements must never steal hover */
.grid-line, .axis-label, .axis-title, .frontier-line, .frontier-label,
.anno-line, .anno-label, .anno-sub,
.lab-line, .lab-leader, .lab-endlabel { pointer-events: none; }
.lab-node { stroke: var(--bg-2); stroke-width: 2; cursor: pointer; transition: r .15s ease; pointer-events: auto; }
.lab-node:hover, .lab-node:focus { r: 8; }
.lab-node:focus-visible, .lab-node.deep-linked {
  stroke: #fff;
  stroke-width: 4;
  filter: drop-shadow(0 0 11px currentColor);
}
.lab-endlabel { font-size: 12.5px; font-weight: 700; font-family: var(--font); }

/* enlarged invisible tap/hover targets, layered under the visible nodes */
.lab-hit { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.lab-hits.is-muted { display: none; }

.lab-group { transition: opacity .3s ease; }
.lab-group.is-muted { opacity: 0.08; pointer-events: none; }
.lab-group.is-dim   { opacity: 0.16; }

/* right-gutter end labels live outside the reveal clip and fade in at the end */
.ends-layer { transition: opacity .25s ease; pointer-events: none; }
.lab-end { transition: opacity .3s ease; }
.lab-end.is-muted { opacity: 0.08; }
.lab-end.is-dim   { opacity: 0.16; }
.ends-layer.is-filtering .lab-end { opacity: 0.12; }

/* ----------------------------------------------------------------- tooltip */
.tooltip {
  position: absolute;
  z-index: 30;
  min-width: 200px;
  max-width: 270px;
  padding: 13px 15px;
  background: rgba(12, 14, 22, 0.96);
  border: 1px solid var(--stroke-2);
  border-radius: 12px;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 16px));
  transition: opacity .12s ease;
}
.tt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.tt-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; flex: none; }
.tt-lab { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tt-name { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.tt-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); margin-bottom: 8px; }
.tt-blurb { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.tt-stats { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--stroke); }
.tt-stat-num { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tt-stat-lbl { font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.tt-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tt-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 100px;
  background: rgba(255,255,255,0.07); color: var(--ink-soft);
}
.tt-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.tt-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--stroke);
  border-radius: 100px;
  background: rgba(255,255,255,0.05);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}
.tt-source:hover { color: #fff; background: rgba(255,255,255,0.1); }
.tt-source svg { width: 12px; height: 12px; opacity: 0.75; }
.tt-source.is-missing { color: var(--ink-mute); cursor: default; }

/* ------------------------------------------------------------- filter chips */
.filters {
  display: flex; align-items: center; justify-content: center; gap: 10px 12px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.filters-label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); font-family: var(--mono); }
.filters-sep { width: 1px; height: 18px; background: var(--stroke-2); margin: 0 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.axis-chip { padding: 6px 12px; font-size: 12.5px; }
.filter-chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid var(--stroke-2); background: var(--panel);
  font: inherit;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; user-select: none;
  transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.filter-chip:hover { color: #fff; transform: translateY(-1px); }
.filter-chip .fc-count { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.filter-chip.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), #5b8bff);
  box-shadow: 0 8px 24px -10px rgba(124, 92, 255, 0.8);
}
.filter-chip.is-active .fc-count { color: rgba(255,255,255,0.75); }

/* --------------------------------------------------------- who's-leading card */
.leader {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 8px 14px; border-radius: 100px;
  border: 1px solid var(--stroke-2);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  min-height: 38px;
}
.leader.is-empty { color: var(--ink-mute); }
.leader-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-mute); text-transform: uppercase; }
.leader-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 9px currentColor; }
.leader-lab { font-size: 14px; font-weight: 800; letter-spacing: 0; }
.leader-model { font-size: 13px; color: var(--ink-soft); }
.leader-cap {
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,0.08); padding: 2px 8px; border-radius: 100px;
  font-variant-numeric: tabular-nums;
}
.leader-gap { font-size: 11.5px; color: var(--ink-mute); font-family: var(--mono); }
.leader-empty { font-size: 13px; font-style: italic; }
.leader[hidden], .compare-bar[hidden] { display: none; }

/* ------------------------------------------------------------ compare mode */
.cmp-side { display: inline-flex; align-items: center; gap: 7px; }
.cmp-lab { font-weight: 800; font-size: 14px; }
.cmp-model { font-size: 13px; color: var(--ink-soft); }
.cmp-vs { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); text-transform: uppercase; }
.cmp-verdict { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); }
.compare-hint { font-size: 13px; color: var(--ink-mute); font-style: italic; }
.compare-chip { margin-left: 6px; color: var(--ink-soft); }
.compare-chip svg { opacity: 0.8; }
.compare-chip.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), #5b8bff);
  box-shadow: 0 8px 24px -10px rgba(124, 92, 255, 0.8);
}
.legend-chip.is-sel { border-color: currentColor; box-shadow: 0 0 0 1px currentColor, 0 0 18px -6px currentColor; }
.legend.is-comparing .legend-chip:not(.compare-chip):not(.is-sel) { border-style: dashed; }

/* -------------------------------------------------------------- story cards */
.story-card {
  position: absolute; z-index: 32;
  width: min(300px, 72vw);
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(12, 14, 22, 0.97);
  border: 1px solid var(--stroke-2);
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  cursor: pointer;
  animation: story-in .28s ease;
}
.story-card[hidden] { display: none; }
@keyframes story-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.story-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--accent-2); text-transform: uppercase; margin-bottom: 6px; }
.story-title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.story-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.story-hint { margin-top: 9px; font-family: var(--mono); font-size: 10px; color: var(--ink-mute); letter-spacing: 0.06em; text-transform: uppercase; }

/* --------------------------------------------------------------- standings */
.standings-wrap {
  margin-top: 18px;
  padding: 16px clamp(12px, 2.4vw, 22px) 8px;
  background: linear-gradient(180deg, var(--panel-2), transparent 70%), var(--bg-2);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow-x: auto;
}
.standings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.standings-head h3 { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); }
.standings-asof { font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; }
.standings { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
.standings th {
  text-align: left; padding: 6px 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute); border-bottom: 1px solid var(--stroke-2);
}
.standings td { padding: 9px 10px; border-bottom: 1px solid var(--stroke); color: var(--ink-soft); vertical-align: middle; }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings th.s-num, .standings td.s-gap { text-align: right; }
.s-rank { width: 26px; color: var(--ink-mute); font-family: var(--mono); font-size: 12px; }
.s-lab { color: currentColor; font-weight: 700; white-space: nowrap; }
.s-lab .legend-dot { display: inline-block; margin-right: 8px; vertical-align: -1px; }
.s-model { color: var(--ink); }
.s-idx { min-width: 150px; white-space: nowrap; }
.s-idx .sbar { display: inline-block; height: 5px; border-radius: 100px; max-width: calc(100% - 42px); opacity: 0.55; vertical-align: 2.5px; }
.s-idx .snum { font-family: var(--mono); font-weight: 700; color: var(--ink); margin-left: 8px; font-variant-numeric: tabular-nums; }
.s-gap { font-family: var(--mono); font-size: 12.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.s-date { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.s-date .s-rel { color: var(--ink-mute); }
.s-empty td { text-align: center; color: var(--ink-mute); font-style: italic; padding: 18px 10px; }

/* ------------------------------------------------------------------ scrubber */
.scrubber { display: flex; align-items: center; gap: 12px; padding: 16px 6px 4px; }
.scrubber-cap { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.scrubber-hint { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); margin-left: 4px; white-space: nowrap; }
.scrubber input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 100px;
  background: linear-gradient(90deg, var(--accent) 0%, #5b8bff var(--pct, 100%), rgba(255,255,255,0.1) var(--pct, 100%));
  outline: none; cursor: pointer;
}
.scrubber input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 0 12px var(--accent); cursor: grab;
}
.scrubber input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.15); }
.scrubber input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; box-shadow: 0 0 12px var(--accent); cursor: grab; }
.scrubber input[type=range]::-moz-range-track { height: 6px; border-radius: 100px; background: rgba(255,255,255,0.1); }
.scrubber input[type=range]::-moz-range-progress { height: 6px; border-radius: 100px; background: var(--accent); }

/* ------------------------------------------------------------------ playhead */
.playhead-line { stroke: var(--accent); stroke-width: 1.5; opacity: 0.9; }
.playhead-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.playhead-date {
  fill: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  paint-order: stroke; stroke: var(--bg-2); stroke-width: 4px; stroke-linejoin: round;
}

/* ----------------------------------------------- foundational landmarks */
.landmark-lineage {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.4;
  stroke-dasharray: 1 6;
  stroke-linecap: round;
  pointer-events: none;
}
.landmark-glow { fill: currentColor; opacity: 0.16; pointer-events: none; }
.landmark-mark {
  fill: currentColor;
  stroke: var(--bg-2);
  stroke-width: 1.5;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0 7px currentColor);
  transition: transform .15s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.landmark-mark:hover, .landmark-mark:focus { transform: scale(1.18); }
.landmark-mark:focus-visible, .landmark-mark.deep-linked { stroke: #fff; stroke-width: 2.5; }
.landmark-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg-2);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.landmark-sub {
  fill: var(--ink-mute);
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg-2);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* --------------------------------------------------- filter emphasis on chart */
.labs-layer.is-filtering .lab-line { opacity: 0.14; }
.lab-node.node-dim { opacity: 0.12; filter: grayscale(0.85); }
.lab-node.node-match { filter: drop-shadow(0 0 7px currentColor); }
.lab-node.node-match { r: 6.5; }
.lab-node:hover { r: 8; }   /* hover still wins (declared after) */

/* ---------------------------------------------------------------- timeline */
/* controls: search + category filters */
.tl-controls { max-width: 760px; margin: 0 auto 30px; display: flex; flex-direction: column; gap: 14px; }
.tl-search {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 100px;
  border: 1px solid var(--stroke-2); background: var(--panel);
  color: var(--ink-mute); transition: border-color .18s, background .18s;
}
.tl-search:focus-within { border-color: var(--accent); background: var(--panel-2); }
.tl-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font: inherit; font-size: 15px; min-width: 0;
}
.tl-search input::placeholder { color: var(--ink-mute); }
.tl-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.tl-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-cat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 100px;
  border: 1px solid var(--stroke-2); background: var(--panel);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; user-select: none;
  transition: background .16s, color .16s, border-color .16s, transform .16s, box-shadow .16s;
}
.tl-cat:hover { color: #fff; transform: translateY(-1px); }
.tl-cat svg { width: 14px; height: 14px; opacity: 0.85; }
.tl-cat .cnt { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.tl-cat.is-active {
  color: #fff; border-color: transparent;
  background: linear-gradient(100deg, var(--accent), #5b8bff);
  box-shadow: 0 8px 22px -10px rgba(124, 92, 255, 0.8);
}
.tl-cat.is-active .cnt { color: rgba(255,255,255,0.78); }
.tl-result { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }

/* era groups */
.tl-era { max-width: 760px; margin: 0 auto; }
.tl-era + .tl-era { margin-top: 30px; }
.tl-era-head { padding: 0 0 16px 46px; }
.tl-era-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-era-name {
  font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  background: linear-gradient(100deg, #a78bff, #19d3a2); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tl-era-range { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.tl-era-blurb { font-size: 13px; color: var(--ink-soft); margin: 5px 0 0; }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 760px; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 11px;
  width: 2px; background: linear-gradient(180deg, transparent, var(--stroke-2) 8%, var(--stroke-2) 92%, transparent);
}
.tl-item {
  position: relative;
  padding: 0 0 30px 46px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.tl-item.in { opacity: 1; transform: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item.hidden, .tl-era.hidden { display: none; }
.tl-node {
  position: absolute; left: 4px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid currentColor;
  box-shadow: 0 0 0 4px rgba(5,6,10,1), 0 0 16px currentColor;
}
.tl-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-left: 2px solid currentColor;
  border-radius: 12px;
  padding: 15px 18px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.tl-card:hover { transform: translateX(4px); background: var(--panel-2); }
.tl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 7px; }
.tl-date { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.tl-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  color: currentColor; background: color-mix(in srgb, currentColor 14%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}
.tl-tag svg { width: 11px; height: 11px; }
.tl-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
  letter-spacing: 0;
}
.tl-permalink {
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 13px;
  opacity: 0;
  transition: opacity .16s, color .16s;
}
.tl-card:hover .tl-permalink,
.tl-permalink:focus-visible { opacity: 1; }
.tl-permalink:hover { color: #fff; }
.tl-blurb { font-size: 14px; color: var(--ink-soft); }
.tl-item.deep-linked .tl-card {
  border-color: currentColor;
  background: linear-gradient(180deg, var(--panel-2), rgba(255,255,255,0.055));
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 25%, transparent), 0 18px 48px -34px currentColor;
}

/* sources / citations */
.tl-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tl-source {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
  padding: 4px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--stroke);
  transition: color .16s, background .16s, border-color .16s;
}
.tl-source:hover { color: #fff; background: rgba(255,255,255,0.09); border-color: var(--stroke-2); }
.tl-source svg { width: 12px; height: 12px; opacity: 0.7; }

/* empty state */
.tl-empty {
  max-width: 760px; margin: 6px auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 44px 22px; color: var(--ink-mute);
  border: 1px dashed var(--stroke-2); border-radius: 16px;
}
.tl-empty[hidden] { display: none; }

/* ------------------------------------------------------------- methodology */
.method-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.method-card {
  padding: 20px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel);
}
.method-card h3 { font-size: 16px; margin-bottom: 9px; }
.method-card p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

/* dataset downloads + contribution CTA */
.data-cta {
  margin: 26px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px;
  border: 1px dashed var(--stroke-2);
  border-radius: var(--radius);
  background: var(--panel);
}
.data-cta-text h3 { font-size: 15px; margin-bottom: 4px; }
.data-cta-text p { margin: 0; color: var(--ink-soft); font-size: 13px; max-width: 520px; }
.data-cta-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- changelog */
.follow-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }

.changelog-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.changelog-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--stroke);
}
.changelog-item:last-child { border-bottom: 1px solid var(--stroke); }
.changelog-item time {
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: 12px;
}
.changelog-item h3 { font-size: 16px; }
.changelog-item p { margin: 7px 0 0; color: var(--ink-soft); font-size: 14px; }

/* ------------------------------------------------------------------- about */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.about-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
}
.about-card h3 { font-size: 17px; margin-bottom: 10px; }
.about-card h3::before { content: ""; display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; }
.about-card p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* ------------------------------------------------------------------ footer */
.foot {
  max-width: var(--maxw); margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 40px) 64px;
  border-top: 1px solid var(--stroke);
  text-align: center;
}
.foot-row { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.foot-note { max-width: 560px; margin: 16px auto 0; color: var(--ink-mute); font-size: 13px; }
.foot-meta { color: var(--ink-mute); font-size: 12px; font-family: var(--mono); margin-top: 14px; opacity: 1; }

/* ------------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90;
  padding: 9px 16px;
  border-radius: 100px;
  background: rgba(18, 20, 30, 0.97);
  border: 1px solid var(--stroke-2);
  color: var(--ink); font-size: 13px; font-weight: 600;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.8);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  main section[id] { scroll-margin-top: 142px; }
  .nav-links { gap: 14px; }
  .scrubber-hint { display: none; }
  .tooltip { max-width: 230px; }
  .latest-grid, .method-grid { grid-template-columns: 1fr; }
  .view-panel { top: 57px; }
  .timeline { max-width: 100%; }
  .chart-toolbar { align-items: stretch; }
  .leader { justify-content: center; }
  .changelog-item { grid-template-columns: 1fr; gap: 6px; }
  .standings { font-size: 12.5px; min-width: 540px; }
  .data-cta { justify-content: center; text-align: center; }
}
@media (max-width: 700px) {
  /* keep the chart readable: fix its drawn width and let it scroll sideways */
  .swipe-hint { display: block; }
  .chart-stage { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .chart-stage #chart { min-width: 720px; }
}
@media (max-width: 560px) {
  /* collapse the links behind a hamburger; the panel drops below the bar */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none;
    flex-direction: column; gap: 0;
    padding: 4px 18px 12px;
    background: rgba(5, 6, 10, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--stroke);
  }
  .nav.menu-open .nav-links { display: flex; }
  .nav-links a { padding: 12px 4px; font-size: 15px; border-bottom: 1px solid var(--stroke); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }
  .hero-stats { gap: 22px 30px; }
  .hero-eyebrow { letter-spacing: 0.18em; font-size: 11px; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
