/* ============================================================
   RJA/SFL — "The Record"
   Carbon black · warm white · signal red · steel gray.
   Dark, stark, numbers-forward. Serious motorsport editorial.
   Authored centrally so every page shares one language.
   ============================================================ */

:root {
  /* Surfaces — carbon */
  --void: #0b0b0d;
  --surface: #141417;
  --surface-2: #1a1b1f;
  --surface-sink: #101013;

  /* Ink — warm white + steel */
  --ink: #f3f1ec;
  --ink-soft: #c7c4bb;
  --muted: #8a8b92;
  --faint: #5a5b63;

  /* Lines — steel hairlines */
  --line: #26262c;
  --line-strong: #34353d;

  /* Signal red */
  --accent: #e5202e;
  --accent-strong: #f33b46;
  --accent-tint: rgba(229, 32, 46, 0.12);
  --accent-ink: #ffffff;

  /* Verdict language — keeper glows, rejects ghost */
  --keep: #e5202e;
  --reject: #6b6c73;
  --warn: #c9a23f;
  --gain: #f3f1ec;      /* positive deltas read as bright warm white */
  --loss: #e5202e;
  --alien: #e5202e;

  /* Type */
  --font-display: 'Space Grotesk','Inter',ui-sans-serif,system-ui,'Segoe UI',Arial,sans-serif;
  --font-sans: 'Inter',ui-sans-serif,system-ui,'Segoe UI',Arial,sans-serif;
  --font-mono: 'JetBrains Mono','IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  /* Layout */
  --sidebar-w: 232px;
  --content-max: 62rem;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-strong); }
table { border-collapse: collapse; }
img { max-width: 100%; }
details summary::-webkit-details-marker { display: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); }

::selection { background: var(--accent); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff;
  padding: 0.6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ============================================================
   App shell
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.nav-toggle-input { display: none; }
.nav-scrim { display: none; }

.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.5rem 0.85rem 1.1rem;
  background: var(--void);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem;
  padding: 0.1rem 0.5rem 1.2rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}
.sidebar-brand-logo { width: 168px; max-width: 100%; height: auto; display: block; }
.sidebar-brand:hover { color: var(--ink); }
.sidebar-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; width: 46px; flex: 0 0 auto; overflow: hidden;
}
.sidebar-brand-mark img { height: 100%; width: 100%; object-fit: contain; }
.sidebar-brand-name {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: 0.01em; line-height: 1;
}
.sidebar-brand-slash { color: var(--accent); }
.sidebar-brand-sub {
  display: block; font-family: var(--font-mono);
  font-size: 0.6rem; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin-top: 0.32rem;
}

.sidebar-nav {
  display: flex; flex-direction: column; gap: 1.05rem;
  overflow-y: auto; padding: 0.5rem 0; flex: 1 1 auto;
}
.nav-group { display: flex; flex-direction: column; gap: 0.05rem; }
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint);
  padding: 0 0.6rem 0.4rem;
}
.nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.46rem 0.6rem; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 0.9rem; font-weight: 500; line-height: 1.2;
}
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link.is-active { color: var(--ink); font-weight: 600; }
.nav-link.is-active .nav-link-icon { color: var(--accent); opacity: 1; }
.nav-link-icon { height: 16px; width: 16px; flex: 0 0 auto; opacity: 0.7; }

.sidebar-foot {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; justify-content: space-between;
  padding: 0.9rem 0.6rem 0; border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.sidebar-foot a { color: var(--accent); }

.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  display: none; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1rem; background: var(--void);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.nav-burger {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; width: 38px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); color: var(--ink); cursor: pointer;
}
.nav-burger i { height: 20px; width: 20px; }
.topbar-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); display: inline-flex; align-items: center; }
.topbar-brand-logo { height: 26px; width: auto; display: block; }

.doc {
  flex: 1 1 auto; width: 100%;
  max-width: calc(var(--content-max) + 6rem);
  margin: 0 auto; padding: 3rem 3.2rem 4.5rem; min-width: 0;
}

/* ============================================================
   Shared atoms
   ============================================================ */

.kicker {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.kicker::before { content: ""; height: 2px; width: 1.7rem; background: var(--accent); }

.section-label {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}

.eyebrow {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent);
}

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.22rem 0.5rem; border-radius: 4px;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.badge-keep { color: #fff; border-color: var(--accent); background: var(--accent); }
.badge-reject { color: var(--reject); border-color: var(--line-strong); background: transparent; }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

.alien-link {
  color: inherit; text-decoration: underline; text-decoration-style: dotted;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px;
}
.alien-link:hover { text-decoration-color: var(--accent); color: var(--ink); }

/* ============================================================
   Home — the record / the hunt
   ============================================================ */

.home { display: flex; flex-direction: column; gap: 3.4rem; }

.home-hero { position: relative; overflow: hidden; border-radius: 14px; padding: 2.6rem 2rem; border: 1px solid var(--line); margin-bottom: 1.8rem; isolation: isolate; }
.home-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center right; z-index: -2; }
.home-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, var(--void) 8%, rgba(11,11,13,0.88) 40%, rgba(11,11,13,0.40) 100%); }
.home-hero-inner { display: flex; flex-direction: column; gap: 1.1rem; max-width: 40rem; }
@media (max-width: 640px) { .home-hero { padding: 1.8rem 1.3rem; } .home-hero::after { background: linear-gradient(180deg, rgba(11,11,13,0.6) 0%, var(--void) 75%); } }
.home-title {
  font-size: clamp(2.7rem, 6.4vw, 5rem); font-weight: 700;
  letter-spacing: -0.025em; line-height: 0.98; margin: 0.4rem 0 0; max-width: 16ch;
}
.home-title em { font-style: normal; color: var(--accent); }
.home-lede { font-size: 1.12rem; line-height: 1.6; color: var(--ink-soft); max-width: 58ch; margin: 0; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.4rem; }

.home-credit {
  margin: 1.6rem 0 0; padding: 1.1rem 1.25rem;
  background: var(--accent-tint); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
}
.home-credit .kicker { color: var(--accent-strong); }
.home-credit-body {
  margin: 0.45rem 0 0.95rem; color: var(--ink-soft);
  font-size: 0.96rem; line-height: 1.55; max-width: 62ch;
}
.home-credit-links { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; height: 2.7rem;
  padding: 0 1.15rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.9rem; border: 1px solid var(--line-strong); color: var(--ink); background: transparent;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn i { height: 16px; width: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

/* Stark stat strip */
.statline {
  display: flex; flex-wrap: wrap; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.statline .stat {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 0.95rem 1.3rem; border-right: 1px solid var(--line); flex: 1 1 auto; min-width: 7rem;
}
.statline .stat:last-child { border-right: 0; }
.stat-value {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.18rem;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.01em;
}
.stat-value.is-accent { color: var(--accent); }
.stat-key {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase;
}

/* Section heads */
.home-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.home-section-head h2 { font-size: 0.95rem; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); margin: 0; }
.home-section-head a { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.home-section-head a:hover { color: var(--accent-strong); }

/* The chase — current target spotlight */
.chase {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.chase-main { padding: 1.7rem 1.8rem; border-right: 1px solid var(--line); }
.chase-side { padding: 1.7rem 1.8rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.9rem; }
.chase-track { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; margin: 0.5rem 0 0; }
.chase-note { color: var(--ink-soft); font-size: 0.98rem; line-height: 1.55; margin: 0.7rem 0 0; max-width: 42ch; }
.chase-big { font-family: var(--font-mono); font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 600; color: var(--accent); letter-spacing: -0.02em; line-height: 1; margin-top: 0.6rem; }
.chase-cap { display: block; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 0.55rem; }
.chase-dl { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.chase-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
.chase-row:last-child { border-bottom: 0; padding-bottom: 0; }
.chase-row dt { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.chase-row dd { margin: 0; font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Per-track knowledge chapter (rendered from docs/tracks/reference.md) */
.knowledge-chapter { max-width: 72ch; line-height: 1.65; }
.knowledge-chapter > :first-child { margin-top: 0; }
.knowledge-chapter h2 { font-size: 1.05rem; margin: 2rem 0 0.6rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
.knowledge-chapter h3 { font-size: 0.92rem; margin: 1.3rem 0 0.4rem; }
.knowledge-chapter p { margin: 0.6rem 0; }
.knowledge-chapter ul { margin: 0.6rem 0; padding-left: 1.2rem; }
.knowledge-chapter li { margin: 0.35rem 0; }
.knowledge-chapter strong { font-weight: 650; }
.knowledge-chapter code { font-family: var(--font-mono); font-size: 0.85em; background: var(--accent-tint); padding: 0.05em 0.35em; border-radius: 4px; }
.knowledge-chapter blockquote { border-left: 2px solid var(--accent); padding: 0.1rem 0 0.1rem 0.9rem; margin: 0.8rem 0; color: var(--muted); font-size: 0.9rem; }
.knowledge-chapter table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.85rem; }
.knowledge-chapter th, .knowledge-chapter td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.7rem; text-align: left; vertical-align: top; }
.knowledge-chapter th { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.corner-note { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* Setup verdicts */
.verdicts { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.verdict {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: 0.5rem 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line);
}
.verdict-stage { font-family: var(--font-mono); font-weight: 600; font-size: 1rem; color: var(--ink); }
.verdict.is-rejected .verdict-stage { color: var(--reject); }
.verdict-name { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.verdict-change { grid-column: 3 / 4; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }
.verdict.is-rejected .verdict-change { color: var(--muted); }
@media (max-width: 620px) {
  .verdict { grid-template-columns: auto 1fr auto; }
  .verdict-change { grid-column: 1 / -1; }
}

/* Circuits index */
.circuit-index { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.circuit-index a {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
}
.circuit-index a:hover { color: var(--accent-strong); }
.circuit-index a .circuit-meta { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; }
.circuit-index a:hover .circuit-meta { color: var(--ink-soft); }

/* Lower band */
.home-band { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2.8rem; }

/* Log feed */
.log-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.log-item { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.log-item h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.log-item h3 a { color: var(--ink); }
.log-item h3 a:hover { color: var(--accent-strong); }
.log-item p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.55; max-width: 64ch; }

.meta-line {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.meta-line span + span::before { content: "/"; color: var(--line-strong); margin-right: 0.5rem; }

.home-empty { color: var(--muted); font-size: 0.94rem; padding: 1rem 0; }

/* ============================================================
   Prose (markdown posts + reference docs) — replaces .post-*
   ============================================================ */

.doc-article { max-width: var(--content-max); margin: 0 auto; }
.doc-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); margin-bottom: 2.2rem;
}
.doc-back:hover { color: var(--accent); }

.doc-header { border-bottom: 1px solid var(--line); padding-bottom: 1.7rem; margin-bottom: 2.2rem; }
.doc-header h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.03; margin: 0.8rem 0 0; }

.prose, .post-body, .wall-post-body { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.74; }
.prose p, .post-body p { margin: 0 0 1.15rem; }
.prose p:last-child, .post-body p:last-child { margin-bottom: 0; }
.prose h2, .post-body h2 { font-size: 1.4rem; font-weight: 600; color: var(--ink); margin: 2.3rem 0 0.8rem; letter-spacing: -0.01em; }
.prose h3, .post-body h3 { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin: 1.8rem 0 0.6rem; }
.prose ul, .post-body ul { margin: 0 0 1.15rem; padding-left: 1.3rem; }
.prose li, .post-body li { margin: 0.4rem 0; }
.prose li::marker, .post-body li::marker { color: var(--accent); }
.prose strong, .post-body strong { color: var(--ink); font-weight: 600; }
.prose a, .post-body a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.prose code, .post-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 4px; color: var(--ink); }

/* Spec table — setup values */
.spec-table { width: 100%; font-size: 0.92rem; }
.spec-table th, .spec-table td { text-align: left; padding: 0.7rem 0.85rem 0.7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.spec-table td { color: var(--ink-soft); }
.spec-table td.spec-value { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.source-cite { font-size: 0.82rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 0.85rem; }
.source-cite a { color: var(--accent-strong); font-weight: 600; }

.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 1rem 1.15rem; font-size: 0.95rem; color: var(--ink-soft); }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: calc(var(--content-max) + 6rem); margin: 0 auto; width: 100%;
  padding: 1.8rem 3.2rem 2.6rem; border-top: 1px solid var(--line);
}
.site-footer-brand { display: inline-flex; max-width: min(20rem, 52vw); }
.site-footer-brand img { display: block; height: auto; max-height: 3.2rem; object-fit: contain; }
.site-footer-wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; color: var(--ink); display: inline-flex; align-items: center; }
.site-footer-logo { height: 30px; width: auto; display: block; }
.site-footer-wordmark:hover { color: var(--accent-strong); }
.site-footer-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; justify-content: flex-end;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-strong); }

/* ============================================================
   Rating chart — dark, signal red
   ============================================================ */

.rating-chart { width: 100%; height: clamp(260px, 38vw, 390px); }
.chart-bg { fill: var(--surface); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-grid-soft { stroke-opacity: 0.6; }
.chart-axis { fill: var(--muted); font: 12px var(--font-mono); }
.chart-axis-x { text-anchor: middle; }
.chart-target { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 9 7; }
.chart-rating { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.chart-point-manual { fill: var(--accent); stroke: var(--surface); stroke-width: 1.75; }
.chart-point-wrap { cursor: pointer; outline: none; }
.chart-point-hit { fill: transparent; stroke: transparent; pointer-events: all; }
.chart-hover-badge { opacity: 0; transform-box: fill-box; transition: opacity 140ms ease, transform 140ms ease; pointer-events: none; }
.chart-point-wrap:hover .chart-hover-badge, .chart-point-wrap:focus-visible .chart-hover-badge { opacity: 1; transform: scale(1.05); }
.chart-point-wrap:hover .chart-point, .chart-point-wrap:focus-visible .chart-point,
.chart-point-wrap:hover .chart-point-manual, .chart-point-wrap:focus-visible .chart-point-manual { stroke-width: 2.5; }
.chart-hover-badge-bg { fill: var(--void); stroke: var(--line-strong); stroke-width: 1.5; }
.chart-hover-badge-text { fill: var(--ink); font: 600 10px var(--font-mono); text-anchor: middle; dominant-baseline: central; }
.chart-current-ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.chart-current-label, .chart-target-label { fill: var(--ink); font: 600 14px var(--font-mono); }

/* ============================================================
   Calendar — dark, signal red
   ============================================================ */

.calendar-legend { display: inline-block; width: 0.85rem; height: 0.85rem; margin-right: 0.35rem; border-radius: 0.2rem; vertical-align: -0.12rem; }
.calendar-legend-target { background: var(--accent); }
.calendar-legend-showed { background: var(--accent-tint); border: 1px solid var(--accent); }
.calendar-legend-partial { background: color-mix(in srgb, var(--warn) 20%, transparent); border: 1px solid var(--warn); }
.calendar-legend-missed {
  background: linear-gradient(135deg, transparent 42%, var(--line-strong) 45%, var(--line-strong) 55%, transparent 58%), var(--surface-sink);
  border: 1px solid var(--line-strong);
}
.calendar-day {
  position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 0.25rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface); transition: border-color 120ms ease;
}
.calendar-day:hover { border-color: var(--accent); }
.calendar-day-selected { outline: 2px solid var(--ink); outline-offset: 1px; }
.calendar-day-target { background: var(--accent); border-color: var(--accent); color: #fff; }
.calendar-day-showed { background: var(--accent-tint); border-color: var(--accent); color: var(--ink); }
.calendar-day-partial { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: var(--warn); color: var(--warn); }
.calendar-day-missed {
  background: linear-gradient(135deg, transparent 44%, var(--line-strong) 46%, var(--line-strong) 54%, transparent 56%), var(--surface-2);
  border-color: var(--line-strong); color: var(--muted);
}
.calendar-day-target::after, .calendar-day-showed::after, .calendar-day-partial::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 4px; height: 4px; border-radius: 999px; }
.calendar-day-target::after { background: #fff; }
.calendar-day-showed::after { background: var(--accent); }
.calendar-day-partial::after { background: var(--warn); }

/* ============================================================
   Legacy run-status (other pages) kept on-brand
   ============================================================ */

.run-status { border: 1px solid var(--line-strong); border-radius: 4px; display: inline-flex; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; min-height: 1.55rem; padding: 0.2rem 0.45rem; text-transform: uppercase; color: var(--muted); }
.run-status-keeper { border-color: var(--accent); color: #fff; background: var(--accent); }
.run-status-rejected { border-color: var(--line-strong); color: var(--reject); }

/* ============================================================
   Wall (community) — dark, kept for compatibility
   ============================================================ */

.wall-home { max-width: var(--content-max); margin: 0 auto; }
.wall-composer, .wall-post, .wall-empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.wall-composer { display: flex; gap: 0.85rem; margin-bottom: 1rem; padding: 1rem; }
.wall-feed { display: grid; gap: 1rem; }
.wall-post { padding: 1rem 1rem 0.75rem; }
.wall-post-title { font-size: 1.28rem; font-weight: 600; color: var(--ink); margin: 0 0 0.7rem; }
.wall-post-title a { color: inherit; }
.wall-empty { color: var(--muted); padding: 1rem; }
.wall-actions button, .wall-actions a { color: var(--muted); }
.wall-actions button.is-liked { color: var(--accent); }
.post-meta, .wall-post-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font: 500 0.7rem var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.post-meta span + span::before, .wall-post-meta span + span::before { content: "/"; color: var(--line-strong); margin-right: 0.5rem; }

/* ============================================================
   Track pages — header, lab, keeper, tables
   ============================================================ */

.track-page { display: flex; flex-direction: column; gap: 3rem; }

.track-head { display: flex; flex-direction: column; gap: 1.2rem; padding-bottom: 2.2rem; border-bottom: 1px solid var(--line); }
.track-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1; margin: 0.3rem 0 0; }

.section { display: flex; flex-direction: column; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.section-head h2 { font-size: 0.95rem; font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); margin: 0; }
.section-head a, .section-head .section-note { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.section-head a:hover { color: var(--accent-strong); }
.section-lede { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; max-width: 64ch; margin: -0.4rem 0 1.4rem; }

/* Record table — sessions, sectors, circuit index */
.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; font-size: 0.88rem; }
.data-table th {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.data-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .is-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.data-table .is-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent-strong); }
.data-table .is-dim { color: var(--muted); }
.data-table a { color: var(--ink); font-weight: 600; }
.data-table a:hover { color: var(--accent-strong); }

/* Setup lab — the measured climb */
.lab { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lab-stage {
  display: grid; grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.2rem 1.4rem; padding: 1.35rem 0; border-bottom: 1px solid var(--line);
  position: relative;
}
.lab-code {
  font-family: var(--font-mono); font-weight: 600; font-size: 1.02rem;
  color: var(--ink); line-height: 1.45;
}
.lab-stage.is-keeper .lab-code { color: var(--accent-strong); }
.lab-stage.is-rejected .lab-code { color: var(--reject); }
.lab-body { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.lab-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.lab-title h3 { font-size: 1.02rem; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.lab-stage.is-rejected .lab-title h3 { color: var(--muted); }
.lab-change { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; margin: 0; }
.lab-garage { margin: 0.1rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.18rem; }
.lab-garage li {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted);
  line-height: 1.5; padding-left: 0.95rem; position: relative;
}
.lab-garage li::before { content: ""; position: absolute; left: 0; top: 0.62em; height: 1px; width: 0.5rem; background: var(--line-strong); }
.lab-result {
  font-size: 0.92rem; color: var(--ink); line-height: 1.55; margin: 0.15rem 0 0;
  font-variant-numeric: tabular-nums;
}
.lab-stage.is-rejected .lab-result { color: var(--ink-soft); }
@media (max-width: 620px) {
  .lab-stage { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* Keeper card — the current measured setup */
.keeper-note { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; max-width: 64ch; margin: -0.4rem 0 1.4rem; padding-left: 0.9rem; border-left: 3px solid var(--accent); }
.keeper { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.keeper-main { padding: 1.7rem 1.8rem; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.2rem; }
.keeper-big { font-family: var(--font-mono); font-size: clamp(2rem, 4.5vw, 2.7rem); font-weight: 600; color: var(--accent); letter-spacing: -0.02em; line-height: 1; margin-top: 0.6rem; }
.keeper-cap { font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 0.5rem; }
.keeper-stats { margin: 1.4rem 0 0; display: flex; flex-direction: column; gap: 0.55rem; }
.keeper-stats .chase-row dd { color: var(--ink); }
.keeper-spec { padding: 1.5rem 1.8rem; background: var(--surface); }
.keeper-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.05rem 2rem; }
.keeper-spec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem; padding: 0.42rem 0; border-bottom: 1px solid var(--line); }
.keeper-spec-row dt { font-size: 0.78rem; color: var(--muted); }
.keeper-spec-row dd { margin: 0; font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) {
  .keeper { grid-template-columns: 1fr; }
  .keeper-main { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Plain numbered/bulleted record lists — lessons, open questions */
.record-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; border-top: 1px solid var(--line); counter-reset: record; }
.record-list li {
  counter-increment: record;
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1rem;
  padding: 0.95rem 0; border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.94rem; line-height: 1.6;
}
.record-list li::before {
  content: counter(record, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  color: var(--accent); padding-top: 0.15rem;
}

/* Curated source cards */
.curated-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.curated-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.curated-card h3 { font-size: 0.98rem; font-weight: 600; margin: 0; }
.curated-card p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55; }
.curated-card .meta-line { margin-top: auto; padding-top: 0.5rem; }
.curated-card .meta-line a { color: var(--accent-strong); }

/* Track map */
.track-map { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.2rem; }
.track-map img { display: block; width: 100%; border-radius: var(--radius-sm); background: #f3f1ec; padding: 0.8rem; }
.track-map-credit { font-size: 0.74rem; color: var(--muted); margin-top: 0.7rem; }
.track-map-credit a { color: var(--accent-strong); }

/* Two-column band for facts/corners */
.track-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.4rem; }
@media (max-width: 760px) { .track-band { grid-template-columns: 1fr; } }

/* Corner groups */
.corner-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.corner-list > div { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.corner-list .corner-name { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.corner-list .corner-turns { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; color: var(--accent); margin-left: 0.6rem; }
.corner-list p { margin: 0.25rem 0 0; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

/* ============================================================
   About — driver, rig, method
   ============================================================ */

.about { display: flex; flex-direction: column; gap: 3rem; max-width: var(--content-max); }
.about-head { display: flex; flex-direction: column; gap: 1.1rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.about-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.02; margin: 0; max-width: 18ch; }
.about-head h1 em { font-style: normal; color: var(--accent); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(82vw, var(--sidebar-w));
    z-index: 50; transform: translateX(-100%); transition: transform 200ms ease; box-shadow: var(--shadow-pop);
  }
  .nav-toggle-input:checked ~ .sidebar { transform: translateX(0); }
  .nav-toggle-input:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.6); }
  .doc { padding: 2rem 1.25rem 3rem; }
  .site-footer { padding: 1.5rem 1.25rem 2.4rem; }
  .chase { grid-template-columns: 1fr; }
  .chase-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .home-band { grid-template-columns: 1fr; gap: 2.2rem; }
  .home { gap: 2.6rem; }
  .statline .stat { min-width: 50%; }
}

@media (min-width: 921px) { .sidebar { transform: none !important; } }
