/* FDE-Bench project page.
   Sections follow the page order; each breakpoint is declared once at the end. */

/* ---------- Tokens ---------- */
:root {
  --ink: #0d1b2e;
  --ink-2: #2f3c50;
  --muted: #4f5d71;
  --faint: #5f6c80;
  --line: #e2e7ef;
  --line-strong: #cbd4e1;

  --bg: #fff;
  --bg-soft: #f6f8fc;
  --bg-tint: #eef2fb;

  --navy: #0f2142;
  --navy-2: #1a3260;
  --accent: #3347c9;
  --accent-strong: #2536a8;
  --accent-soft: #eef1fe;
  --accent-line: #c9d1fa;
  --teal: #00715f;
  --teal-soft: #e7f5f1;
  --teal-line: #b9e0d6;
  --amber: #8f4706;
  --amber-soft: #fcf6ee;
  --amber-line: #ecd3b0;

  /* Chart colors, checked with the dataviz palette validator. */
  --chart-native: #00927f;
  --chart-generic: #4a5fd6;
  --chart-track: #f0f3f9;
  --chart-grid: #dce2ec;
  --condition-hidden: #9aa8ef;
  --condition-interact: #4d61dc;
  --condition-full: #1f2f8c;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(15 33 66 / 6%), 0 1px 1px rgb(15 33 66 / 4%);
  --shadow: 0 12px 32px -16px rgb(15 33 66 / 22%), 0 2px 6px rgb(15 33 66 / 5%);
  --shadow-lg: 0 32px 64px -28px rgb(15 33 66 / 35%), 0 4px 14px rgb(15 33 66 / 6%);

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 72px;
  --chart-cols: minmax(210px, 250px) 1fr 76px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #d6ddfb; }
p, h1, h2, h3, h4, figure, dl, dd, ol, ul { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); }
h2 { font: 400 clamp(34px, 3.7vw, 50px)/1.1 var(--serif); letter-spacing: -.03em; }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
h4 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
strong, b { font-weight: 700; }
p { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: .88em; }
[hidden] { display: none !important; }

button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
summary { cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #7d8cf3;
  outline-offset: 3px;
  border-radius: 6px;
}
button:focus-visible { position: relative; z-index: 2; }

input, select {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
}
select {
  max-width: 100%;
  padding: 0 40px 0 14px;
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%234f5d71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 15px center;
  cursor: pointer;
}
select:hover, .search-label:hover { border-color: #aeb9cb; }
input { min-width: 0; }
input::placeholder { color: #657185; }

/* ---------- Layout utilities ---------- */
.container { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.section { padding-block: 104px; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -80px; left: 16px; z-index: 100;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.eyebrow, .small-label, .flow-index {
  font: 500 12px/1.5 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); margin-bottom: 16px; }
.section-heading .eyebrow::before, .reliability-intro .eyebrow::before,
.contribute-copy .eyebrow::before, .paper-section .section > .eyebrow::before {
  content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; flex-shrink: 0;
}
.small-label, .flow-index { display: block; color: var(--faint); }
.muted { font-size: 14px; color: var(--muted); }

.section-heading {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 72px;
  align-items: end;
  margin-bottom: 48px;
}
.section-intro { max-width: 540px; font-size: 18px; line-height: 1.7; color: var(--muted); }

.source-note { margin-top: 20px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.source-note a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}
.source-note a:hover { text-decoration-color: currentColor; }
.empty-state { padding: 32px 0; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- Buttons & links ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgb(255 255 255 / 18%) inset, 0 8px 20px -10px rgb(51 71 201 / 70%);
}
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { background: #fff; border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }

.text-link, .text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-strong);
}
.text-link:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Shared segmented control (results view, metric group). */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
}
.segmented button {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed=true] { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }

.search-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--faint);
  transition: border-color .15s, box-shadow .15s;
}
.search-label:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(51 71 201 / 16%); }
.search-label input { flex: 1; min-height: 42px; padding: 0; border: 0; background: transparent; outline: none; }
.search-label input:focus-visible { outline: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 94%);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgb(226 231 239 / 90%);
}
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.04em; white-space: nowrap; color: var(--navy); }
.brand img { width: 30px; height: 30px; }
.site-header nav { display: flex; align-items: center; gap: 4px; }
.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color .15s, color .15s;
}
.site-header nav a:hover { background: var(--bg-soft); color: var(--ink); }
.site-header nav .nav-github { gap: 8px; margin-left: 10px; padding: 0 16px; background: var(--navy); color: #fff; }
.site-header nav .nav-github:hover { background: var(--navy-2); color: #fff; }
.menu-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.menu-toggle > span { font-size: 16px; line-height: 1; }
.menu-toggle[aria-expanded=true] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero-surface {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 88% 6%, rgb(91 112 230 / 14%), transparent 62%),
    radial-gradient(700px 420px at 4% 96%, rgb(0 146 127 / 8%), transparent 60%),
    linear-gradient(180deg, #f7f9fd 0%, #f2f5fc 100%);
  border-bottom: 1px solid var(--line);
}
.hero-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(15 33 66 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(15 33 66 / 5%) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 25%, transparent 78%);
  pointer-events: none;
}
.hero-surface > * { position: relative; }
.hero {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 64px;
  align-items: center;
  padding-block: 80px 56px;
}
.hero-kicker {
  display: inline-flex;
  margin-bottom: 24px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 75%);
  color: var(--accent-strong);
  font-size: 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chart-native); box-shadow: 0 0 0 4px rgb(0 146 127 / 16%); flex-shrink: 0; }
.hero h1 {
  margin-bottom: 18px;
  font: 700 clamp(60px, 7.2vw, 96px)/.98 var(--sans);
  letter-spacing: -.06em;
  color: var(--navy);
}
.hero h1 > span { color: var(--accent); }
.hero-subtitle { max-width: 620px; font: 400 clamp(25px, 2.6vw, 33px)/1.22 var(--serif); letter-spacing: -.02em; color: var(--ink); }
.research-question {
  max-width: 580px;
  margin-top: 32px;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: rgb(255 255 255 / 82%);
  box-shadow: var(--shadow-sm);
}
.research-question .small-label { margin-bottom: 6px; color: var(--accent-strong); }
.research-question p { font: 400 21px/1.42 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.hero-description { max-width: 560px; margin-top: 18px; font-size: 17px; line-height: 1.7; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-jump {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  padding: 12px 18px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 70%);
  color: var(--accent-strong);
  transition: border-color .15s, background-color .15s;
}
.hero-jump:hover { border-color: var(--accent-line); background: #fff; }
.hero-takeaway { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.hero-takeaway strong { font-size: 30px; letter-spacing: -.04em; color: var(--navy); }
.hero-takeaway > span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.hero-takeaway b { font-weight: 500; color: var(--ink-2); }

/* The delivery diagram card. */
.delivery-board {
  overflow: hidden;
  padding: 0 24px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -24px 22px;
  padding: 16px 24px;
  background: linear-gradient(100deg, var(--navy), var(--navy-2));
  color: #fff;
}
.board-heading .eyebrow { margin: 0; color: #fff; font-size: 12px; }
.board-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9d3ea; }
.board-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #3fd0b8; }
.request-sheet {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px var(--radius) var(--radius) 4px;
  background: var(--bg-soft);
}
.document-symbol { font-size: 24px; color: var(--accent); }
.request-sheet h3 { margin: 4px 0 2px; font-size: 17px; }
.request-sheet p { font-size: 14px; color: var(--muted); }
.board-connector { text-align: center; font-size: 18px; line-height: 34px; color: #8592a6; }
.board-loop { display: grid; grid-template-columns: 1fr .62fr 1fr; gap: 10px; align-items: stretch; }
.loop-agent, .loop-customer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 136px;
  padding: 16px 12px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  text-align: center;
}
.loop-customer { border-color: var(--teal-line); background: var(--teal-soft); }
.node-symbol { font-size: 22px; line-height: 1.2; color: var(--accent); }
.loop-customer .node-symbol { color: var(--teal); }
.board-loop strong { font-size: 16px; color: var(--ink); }
.board-loop > div > span:last-child { font-size: 13px; line-height: 1.4; color: var(--muted); }
.loop-exchange { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.loop-exchange > span:first-child { font-weight: 700; color: var(--accent-strong); }
.exchange-arrows { font-size: 22px; line-height: 1; color: var(--accent); }
.board-budget { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.board-budget span {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--ink-2);
}
.delivery-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
}
.delivery-output .small-label { color: #b3bfda; }
.delivery-output strong { display: block; margin-top: 4px; font-size: 16px; line-height: 1.35; }
.output-check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #3fd0b8;
  color: var(--navy);
  font-weight: 700;
}
.board-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.board-footer b { margin-left: 4px; font-size: 15px; color: var(--ink); }

/* Benchmark scale strip. */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--shadow);
}
.stats-strip > div { display: flex; flex-direction: column; padding: 24px 28px; }
.stats-strip > div + div { border-left: 1px solid var(--line); }
.stats-strip dd { order: -1; margin-bottom: 8px; font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -.045em; color: var(--navy); }
.stats-strip dd > span { font-size: .55em; color: var(--accent); }
.stats-strip dt { font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.stats-strip dt span { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--muted); }

/* ---------- 01 Results ---------- */
.result-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 28px; }
.kpi {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  --meter-fill: var(--chart-generic);
  --meter-track: #e3e7fa;
  --surface: #fff;
}
.kpi-quality {
  border-color: var(--navy);
  background: linear-gradient(150deg, var(--navy-2), var(--navy) 70%);
  color: #fff;
  box-shadow: var(--shadow);
  --meter-fill: #aab6ff;
  --meter-track: rgb(170 182 255 / 22%);
  --surface: var(--navy);
}
.kpi-cases { --meter-fill: var(--chart-native); --meter-track: #dcefe9; }
.highlight-number { font-size: clamp(48px, 4.6vw, 62px); font-weight: 700; line-height: 1; letter-spacing: -.05em; color: var(--navy); }
.highlight-number > span { margin-left: 2px; font-size: .45em; letter-spacing: -.02em; color: var(--muted); }
.kpi-quality .highlight-number { color: #fff; }
.kpi-meter { position: relative; display: block; height: 8px; margin-top: 26px; border-radius: 4px; background: var(--meter-track); }
.kpi-meter i { display: block; width: calc(var(--value) * 100%); min-width: 4px; height: 100%; border-radius: 4px; background: var(--meter-fill); }
.kpi-units {
  display: block;
  height: 14px;
  margin-top: 23px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--total) - 2px), var(--surface) calc(100% / var(--total) - 2px) calc(100% / var(--total))),
    linear-gradient(90deg, var(--meter-fill) 0 calc(var(--value) / var(--total) * 100%), var(--meter-track) 0);
}
.kpi-scale { display: flex; justify-content: space-between; margin-top: 8px; font: 12px/1.4 var(--mono); color: var(--faint); }
.kpi-quality .kpi-scale { color: #b3bfda; }
.result-highlights p { margin-top: 18px; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.result-highlights p > span { display: block; margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi-quality p { color: #fff; }
.kpi-quality p > span { color: #c4cde3; }

.leaderboard-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}
.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.leaderboard-heading h3 { font-size: 22px; }
.leaderboard-heading p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px 4px; }
.metric-select { display: flex; align-items: center; gap: 12px; }
.metric-select > span { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.metric-select select { min-width: 230px; }
.table-filters { display: flex; gap: 10px; }
.table-filters .search-label { width: 220px; }
.table-filters > label { min-width: 0; }
.search-label input { width: 100%; }
.table-filters select { min-width: 172px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 14px 28px 0; font-size: 14px; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend i { width: 14px; height: 10px; border-radius: 0 3px 3px 0; }
.legend-native { background: var(--chart-native); }
.legend-generic { background: var(--chart-generic); }
.chart-legend:has(+ .results-chart[hidden]) { display: none; }
/* The metric menu only drives the chart; the table sorts by its own headers. */
.leaderboard-shell:has(.results-chart[hidden]) .metric-select { display: none; }
.leaderboard-shell:has(.results-chart[hidden]) .results-toolbar { justify-content: flex-end; }
@media (min-width: 1001px) {
  /* Share the filter row: 20px toolbar padding + 44px controls above the panel. */
  .leaderboard-shell:has(.results-chart[hidden]) .table-mode { position: relative; display: flex; width: max-content; margin-top: -64px; }
}

.results-chart { padding: 8px 16px 6px; }
.chart-scale, .leaderboard-row { display: grid; grid-template-columns: var(--chart-cols); gap: 20px; align-items: center; padding-inline: 12px; }
.chart-scale { padding-block: 12px 10px; border-bottom: 1px solid var(--line); font: 12px/1.4 var(--mono); color: var(--faint); }
.chart-scale > span:last-child { text-align: right; }
.chart-scale-ticks { position: relative; display: block; height: 1.4em; font-variant-numeric: tabular-nums; }
.chart-scale-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.chart-scale-ticks span:nth-child(1) { left: 0; transform: none; }
.chart-scale-ticks span:nth-child(2) { left: 25%; }
.chart-scale-ticks span:nth-child(3) { left: 50%; }
.chart-scale-ticks span:nth-child(4) { left: 75%; }
.chart-scale-ticks span:nth-child(5) { left: 100%; transform: translateX(-100%); }
.leaderboard-row { min-height: 58px; padding-block: 9px; border-bottom: 1px solid #eef1f6; border-radius: var(--radius-sm); transition: background-color .15s; }
.leaderboard-row:hover { background: var(--bg-soft); }
.leaderboard-label { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chart-rank { flex-shrink: 0; width: 22px; font: 12px var(--mono); color: var(--faint); }
.chart-system { display: flex; flex-direction: column; min-width: 0; }
.chart-model { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.chart-scaffold { font-size: 13px; line-height: 1.4; color: var(--muted); }
.leaderboard-track, .ablation-track {
  position: relative;
  display: block;
  border-radius: 0 4px 4px 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--chart-grid) calc(25% - 1px) 25%),
    var(--chart-track);
}
.leaderboard-track::after, .ablation-track::after {
  content: '';
  position: absolute;
  top: -4px;
  bottom: -4px;
  right: 0;
  width: 2px;
  border-radius: 1px;
  background: #8a96aa;
}
.leaderboard-track { height: 14px; }
.leaderboard-fill, .ablation-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transition: width .4s ease; }
.leaderboard-fill { background: var(--chart-generic); }
.leaderboard-row:is([data-scaffold=codex], [data-scaffold=deepseek-harness], [data-scaffold=kimi], [data-scaffold=gemini]) .leaderboard-fill { background: var(--chart-native); }
.leaderboard-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.chart-reference-note { padding: 14px 12px 8px; font-size: 13px; text-align: right; color: var(--muted); }

#results-table-panel { padding-top: 16px; }
.table-mode { margin-left: 28px; }
.table-scroll-hint { display: none; margin: 12px 28px 0; font-size: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; margin-top: 12px; }
.results-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 15px; }
.results-table th {
  padding: 12px 16px;
  border-block: 1px solid var(--line);
  background: var(--bg-soft);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.results-table th button { display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.results-table th button:hover { color: var(--ink); }
.results-table th[aria-sort=descending], .results-table th[aria-sort=ascending] { color: var(--accent-strong); }
.sort-indicator { font-family: var(--sans); font-size: 13px; }
.results-table td { padding: 14px 16px; border-bottom: 1px solid #eef1f6; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.results-table tbody tr:hover td { background: var(--bg-soft); }
.results-table th:first-child, .results-table td:first-child { padding-left: 28px; }
.results-table th:last-child, .results-table td:last-child { padding-right: 28px; }
.rank { width: 64px; font: 13px var(--mono); color: var(--faint); }
.system-cell { white-space: normal; }
.model-name { display: block; font-weight: 700; color: var(--ink); }
.scaffold-name { display: block; font-size: 13px; color: var(--muted); }
.cell-quality { min-width: 170px; }
.quality-value { display: block; font-weight: 700; color: var(--ink); }
.quality-track { display: block; width: 120px; height: 6px; margin-top: 6px; border-radius: 0 3px 3px 0; background: var(--chart-track); }
.quality-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--chart-generic); }
.table-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.leaderboard-shell .table-bottom { padding: 14px 28px; border-top: 1px solid var(--line); background: var(--bg-soft); }

.metric-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.metric-notes p {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}
.metric-notes strong { color: var(--ink); }

/* ---------- 02 Protocol ---------- */
.protocol-section, .benchmark-section, .paper-section { background: var(--bg-soft); border-block: 1px solid var(--line); }
.protocol-diagram {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}
.lane-heading { display: flex; align-items: center; gap: 10px; padding: 22px 28px 0; }
.lane-heading h3 { font-size: 17px; }
.lane-heading > span:last-child { margin-left: auto; font-size: 14px; color: var(--muted); }
.lane-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.visible-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hidden-dot { background: #c27a2c; box-shadow: 0 0 0 4px var(--amber-soft); }
.solving-lane { display: grid; grid-template-columns: 1fr 28px 1.3fr 28px 1fr; gap: 10px; align-items: stretch; padding: 20px 28px 28px; }
.solving-lane article { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); }
.solving-lane .flow-solve { border-color: var(--accent-line); background: var(--accent-soft); }
.protocol-diagram .flow-index { margin-bottom: 10px; }
.flow-solve .flow-index { color: var(--accent-strong); }
.protocol-diagram h4 { margin-bottom: 10px; }
.protocol-diagram p { font-size: 15px; line-height: 1.65; color: var(--muted); }
.protocol-diagram code, .failure-trace code, .contribute-guide code {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
}
.flow-input code { margin: 0 4px 10px 0; }
.flow-arrow { align-self: center; text-align: center; font-size: 20px; color: #8592a6; }
.flow-loop { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--accent-line); font-size: 15px; font-weight: 700; color: var(--ink); }
.flow-loop span { font-weight: 400; color: var(--accent); }
.flow-budget { margin-top: 10px; font-size: 13px; color: var(--accent-strong); }
.artifact-lines { display: grid; gap: 7px; width: 132px; margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.artifact-lines i { height: 3px; border-radius: 2px; background: #c3cbe0; }
.artifact-lines i:nth-child(2) { width: 75%; }
.artifact-lines i:nth-child(3) { width: 88%; }
.evaluation-boundary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-block: 1px dashed var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber);
}
.evaluation-boundary > span { font: 700 12px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.evaluation-boundary > p { font-size: 14px; color: var(--amber); }
.hidden-lane { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding: 20px 28px 30px; }
.hidden-lane article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.hidden-lane code { margin-bottom: 12px; border-color: var(--amber-line); background: var(--amber-soft); color: var(--amber); }
.protocol-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  margin-top: 24px;
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 15px;
}
.protocol-note strong { color: var(--ink); }
.protocol-note span { color: var(--muted); }

/* Expandable paper figures. */
.figure-disclosure { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.figure-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 22px;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.figure-disclosure summary::-webkit-details-marker { display: none; }
.figure-disclosure summary > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 18px;
  transition: transform .2s;
}
.figure-disclosure summary:hover { color: var(--accent-strong); }
.figure-disclosure[open] summary > span { transform: rotate(45deg); }
.figure-disclosure figure { padding: 4px 22px 22px; }
.figure-disclosure img { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.figure-disclosure figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- 03 Findings ---------- */
.ablation-explorer {
  display: grid;
  grid-template-columns: .82fr 1.5fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}
.ablation-controls { display: flex; flex-direction: column; padding: 32px; border-right: 1px solid var(--line); background: var(--bg-soft); }
.ablation-controls h3 { margin-bottom: 24px; font-size: 24px; line-height: 1.25; }
.ablation-controls label { margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.ablation-controls select { width: 100%; }
.ablation-controls > p { margin-top: 18px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.ablation-controls .text-link { margin-top: auto; padding-top: 18px; }
.ablation-plot { padding: 30px 32px; }
.ablation-axis { display: flex; justify-content: space-between; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--faint); }
.ablation-row { margin-bottom: 20px; }
.ablation-row-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ablation-row-label span { font-size: 15px; font-weight: 700; color: var(--ink); }
.ablation-row-label b { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ablation-track { height: 22px; }
.condition-hidden, .ablation-fill[data-condition=hidden] { background: var(--condition-hidden); }
.condition-interact, .ablation-fill[data-condition=interact] { background: var(--condition-interact); }
.condition-full, .ablation-fill[data-condition=full] { background: var(--condition-full); }
.ablation-insight { padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.7; color: var(--muted); }
.ablation-insight strong { color: var(--ink); }
.condition-key { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; padding: 0 4px; }
.condition-key p { display: grid; grid-template-columns: 12px 1fr; column-gap: 10px; align-items: center; }
.condition-key i { width: 12px; height: 12px; border-radius: 3px; }
.condition-key strong { font-size: 14px; color: var(--ink); }
.condition-key span { grid-column: 2; font-size: 14px; color: var(--muted); }

.research-findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; }
.research-findings article {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.finding-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--accent-soft);
  font: 700 13px var(--mono);
  color: var(--accent-strong);
}
.research-findings h3 { margin-bottom: 12px; font-size: 19px; line-height: 1.35; }
.research-findings p { font-size: 15px; line-height: 1.7; color: var(--muted); }
.research-findings p strong { color: var(--ink); }

.failure-study {
  margin-top: 48px;
  padding: 36px;
  border: 1px solid var(--amber-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--amber-soft), #fffdf9);
}
.failure-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.failure-heading .eyebrow { color: var(--amber); }
.failure-heading h3 { font: 400 clamp(26px, 2.6vw, 34px)/1.18 var(--serif); letter-spacing: -.02em; }
.case-tag {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--amber-line);
  border-radius: 999px;
  background: #fff;
  font: 500 12px var(--mono);
  color: var(--amber);
}
.failure-trace { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 32px; }
.failure-trace article { position: relative; padding-top: 22px; border-top: 2px solid var(--amber-line); }
.trace-dot { position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border: 2px solid var(--amber-soft); border-radius: 50%; background: #c99a63; }
.failure-trace article:last-child .trace-dot { background: #b84a1a; }
.failure-trace .small-label { color: var(--amber); }
.failure-trace h4 { margin: 6px 0 10px; font-size: 18px; }
.failure-trace code { border-color: var(--teal-line); background: var(--teal-soft); color: var(--teal); }
.failure-trace p { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.failure-trace p strong { color: #a2400f; }
.failure-study > .source-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--amber-line); }

/* ---------- 04 Benchmark construction ---------- */
.warehouse-example {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}
.warehouse-story { padding: 36px; }
.story-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 30px; }
.story-tabs button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  font: 500 12px/1.4 var(--mono);
  color: var(--faint);
  transition: border-color .15s, background-color .15s, color .15s;
}
.story-tabs button span { font: 700 14px/1.35 var(--sans); color: var(--ink-2); }
.story-tabs button:hover { border-color: var(--accent-line); }
.story-tabs button[aria-selected=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 -3px 0 var(--accent); }
.story-tabs button[aria-selected=true] span { color: var(--ink); }
#warehouse-panel h3 { margin-bottom: 14px; font: 400 clamp(26px, 2.5vw, 32px)/1.2 var(--serif); letter-spacing: -.02em; }
#warehouse-copy { min-height: 84px; font-size: 16px; line-height: 1.75; color: var(--muted); }
.example-insight {
  margin-top: 22px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.warehouse-story > .source-note { margin-top: 24px; }
.warehouse-visual {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-left: 1px solid var(--line);
  background:
    radial-gradient(rgb(15 33 66 / 9%) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--bg-tint);
}
.warehouse-visual-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.warehouse-visual-heading .eyebrow { margin: 0; color: var(--navy); }
.tiny-label { font: 12px var(--mono); letter-spacing: .05em; color: var(--faint); }
.stacks-before, .stacks-after { display: flex; flex: 1; align-items: end; justify-content: center; gap: 36px; padding: 32px 0 24px; }
.stacks-after { display: none; }
.stack { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 118px; }
.crate {
  padding: 9px 12px;
  border: 1px solid var(--accent-line);
  border-left: 5px solid var(--condition-hidden);
  border-radius: 6px;
  background: #fff;
  font: 700 13px var(--mono);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: outline-color .2s;
}
.crate span { display: block; margin-top: 2px; font: 400 12px var(--sans); color: var(--muted); }
.batch-b { border-left-color: var(--condition-full); background: #e6eafb; }
.stack-label { margin-top: 4px; padding-top: 8px; border-top: 4px solid #9aa6bb; text-align: center; font: 12px var(--mono); color: var(--faint); }
.warehouse-state { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; text-align: center; font-size: 15px; font-weight: 500; color: var(--ink); }
.state-rule, .state-delivery { display: none; }
[data-step="1"] .state-request, [data-step="2"] .state-request { display: none; }
[data-step="1"] .state-rule, [data-step="2"] .state-delivery { display: block; }
[data-step="1"] .crate.batch-b { outline: 2px dashed var(--condition-interact); outline-offset: 2px; }
[data-step="2"] .stacks-before { display: none; }
[data-step="2"] .stacks-after { display: flex; }

.construction-summary {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
  margin-top: 28px;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}
.construction-summary h3 { margin-bottom: 12px; }
.construction-summary p { font-size: 15px; line-height: 1.75; color: var(--muted); }
.construction-summary .text-link { margin-top: 14px; }
.construction-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding-left: 40px; border-left: 1px solid var(--line); }
.construction-facts p { display: flex; flex-direction: column; gap: 8px; }
.construction-facts strong { font-size: 44px; line-height: 1; letter-spacing: -.045em; color: var(--navy); }
.construction-facts span { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- 05 Cases ---------- */
.cases-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.case-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.case-filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color .15s, background-color .15s, color .15s;
}
.case-filters button span { padding: 1px 8px; border-radius: 999px; background: var(--bg-tint); font: 12px var(--mono); color: var(--muted); }
.case-filters button:hover { border-color: var(--accent); }
.case-filters button[aria-pressed=true] { border-color: var(--navy); background: var(--navy); color: #fff; }
.case-filters button[aria-pressed=true] span { background: rgb(255 255 255 / 16%); color: #fff; }
.cases-toolbar > .search-label { width: 260px; }

.case-list-heading, .case-card { display: grid; grid-template-columns: 150px 1fr 200px; column-gap: 28px; }
.case-list-heading {
  padding: 12px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft);
  font: 500 12px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}
.case-list-heading > span:last-child { text-align: right; }
.case-grid { overflow: hidden; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.case-card { row-gap: 6px; align-items: start; padding: 22px 24px; border-bottom: 1px solid var(--line); background: #fff; transition: background-color .15s; }
.case-card:last-child { border-bottom: 0; }
.case-card:hover { background: #fafbfe; }
.case-top { grid-row: 1 / 4; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.case-number { font: 700 13px var(--mono); color: var(--ink-2); }
.family-badge {
  padding: 2px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: var(--accent-soft);
  font: 500 11px/1.6 var(--mono);
  letter-spacing: .03em;
  color: var(--accent-strong);
}
.case-card[data-family=ML] .family-badge { border-color: var(--teal-line); background: var(--teal-soft); color: var(--teal); }
.case-card h3 { font-size: 17px; line-height: 1.4; }
.case-objective { grid-column: 2; max-width: 620px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.case-objective-label { display: none; }
.case-card details { grid-column: 3; grid-row: 1 / 4; min-width: 0; font-size: 14px; }
.case-card summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 36px;
  list-style: none;
  font-weight: 700;
  color: var(--accent-strong);
}
.case-card summary::-webkit-details-marker { display: none; }
.case-card summary::after {
  content: '+';
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 16px;
  line-height: 1;
}
.case-card details[open] summary::after { content: '−'; }
.case-card summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.case-checks { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-soft); font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.case-source { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--accent-strong); }
.case-source:hover { text-decoration: underline; text-underline-offset: 4px; }
#cases .table-bottom { margin-top: 18px; }

/* ---------- 06 Resources (dark) ---------- */
.resources-section {
  background:
    radial-gradient(800px 420px at 92% 0%, rgb(91 112 230 / 26%), transparent 62%),
    linear-gradient(180deg, #0f2142, #0b1a35);
  color: #fff;
}
.resources-section h2, .resources-section h3 { color: #fff; }
.resources-section .eyebrow { color: #aab6ff; }
.resources-section h2 em { color: #aab6ff; }
.resources-section .section-intro { color: #c4cde3; }
.quickstart { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.quickstart-intro h3 { margin-bottom: 26px; font-size: 24px; }
.quickstart-intro ol { counter-reset: setup; margin-bottom: 30px; padding: 0; list-style: none; }
.quickstart-intro li { position: relative; counter-increment: setup; margin-bottom: 22px; padding-left: 52px; }
.quickstart-intro li::before {
  content: '0' counter(setup);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(170 182 255 / 35%);
  border-radius: 10px;
  background: rgb(170 182 255 / 10%);
  font: 700 13px var(--mono);
  color: #aab6ff;
}
.quickstart-intro li strong { display: block; font-size: 17px; }
.quickstart-intro li span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.65; color: #c4cde3; }
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.resources-section .button-primary { background: #fff; color: var(--navy); box-shadow: 0 10px 24px -12px rgb(0 0 0 / 60%); }
.resources-section .button-primary:hover { background: #e9edff; }
.resources-section .text-link { color: #c8d0ff; }
.code-panel { overflow: hidden; border: 1px solid rgb(255 255 255 / 12%); border-radius: var(--radius-lg); background: #081429; box-shadow: 0 30px 60px -30px rgb(0 0 0 / 70%); }
.code-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  background: rgb(255 255 255 / 4%);
  font-size: 13px;
  color: #a9b5cf;
}
.code-heading > span:first-child { display: flex; align-items: center; gap: 12px; font: 700 13px var(--mono); color: #e3e8f5; }
.code-heading > span:first-child::before { content: ''; width: 42px; height: 10px; background: radial-gradient(circle, rgb(255 255 255 / 24%) 4px, transparent 4.5px) 0 0 / 16px 10px repeat-x; }
.code-panel pre { overflow-x: auto; margin: 0; padding: 24px; font: 14px/1.85 var(--mono); color: #e3e8f5; }
.code-panel code { font-size: 1em; }
.code-comment { color: #8d9bbb; }
.code-panel > p { margin: 0 24px 22px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / 10%); font-size: 14px; line-height: 1.65; color: #b2bdd6; }

/* ---------- 07 Contribute ---------- */
.contribute-section { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.contribute-copy h2 { margin-bottom: 20px; }
.contribute-copy > p:not(.eyebrow) { max-width: 520px; font-size: 18px; line-height: 1.7; color: var(--muted); }
.contribute-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.contribute-guide {
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--accent-soft), #fff 70%);
  box-shadow: var(--shadow);
}
.contribute-guide h3 { margin-bottom: 18px; }
.contribute-guide ul { margin-bottom: 22px; padding: 0; list-style: none; }
.contribute-guide li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.contribute-guide li::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 3 2 2 4-4'/%3E%3C/svg%3E") no-repeat center;
}
.contribute-guide code { padding: 0 6px; }
.contribute-guide > p { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- Reliability & scope ---------- */
.reliability-section { display: grid; grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; border-top: 1px solid var(--line); }
.reliability-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.reliability-intro > p:last-child { max-width: 480px; margin-top: 24px; font-size: 17px; line-height: 1.7; color: var(--muted); }
.reliability-content { display: grid; gap: 14px; }
.audit-row { display: grid; grid-template-columns: 128px 1fr; gap: 24px; align-items: start; padding: 24px 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.audit-row > strong { font-size: 40px; line-height: 1; letter-spacing: -.045em; color: var(--navy); }
.audit-row h3 { margin-bottom: 6px; font-size: 18px; }
.audit-row p { font-size: 15px; line-height: 1.65; color: var(--muted); }
.scope-note { padding: 24px 26px; border: 1px solid var(--amber-line); border-radius: var(--radius-lg); background: var(--amber-soft); }
.scope-note h3 { margin-bottom: 8px; font-size: 18px; color: var(--amber); }
.scope-note p { font-size: 15px; line-height: 1.7; color: var(--ink-2); }

/* ---------- Paper & team ---------- */
.paper-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; margin-bottom: 36px; }
.paper-heading h2 { max-width: 820px; font-size: clamp(28px, 2.8vw, 38px); line-height: 1.2; }
.paper-heading .button { flex-shrink: 0; }
.team { padding: 28px 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.authors { font-size: 16px; line-height: 2.1; color: var(--ink); }
.author-name { margin-right: 14px; white-space: nowrap; }
.authors sup, .affiliations sup { margin-left: 1px; font-size: 11px; color: var(--accent-strong); }
.affiliations { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.9; color: var(--muted); }
.affiliation { display: inline-block; margin-right: 20px; }
.affiliation sup { margin-right: 3px; }
.author-notes { margin-top: 10px; font-size: 13px; color: var(--muted); }
.citation { overflow: hidden; margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.citation-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.citation-heading .eyebrow { margin: 0; }
.citation-heading > div { display: flex; align-items: center; gap: 14px; }
.copy-status { font-size: 13px; font-weight: 700; color: var(--teal); }
#copy-citation > span {
  width: 15px;
  height: 15px;
  font-size: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='5.25' y='5.25' width='8.5' height='8.5' rx='2'/%3E%3Cpath d='M10.75 5.25V3.75a1.5 1.5 0 0 0-1.5-1.5h-5.5a1.5 1.5 0 0 0-1.5 1.5v5.5a1.5 1.5 0 0 0 1.5 1.5h1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5'%3E%3Crect x='5.25' y='5.25' width='8.5' height='8.5' rx='2'/%3E%3Cpath d='M10.75 5.25V3.75a1.5 1.5 0 0 0-1.5-1.5h-5.5a1.5 1.5 0 0 0-1.5 1.5v5.5a1.5 1.5 0 0 0 1.5 1.5h1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.citation pre { overflow-x: auto; margin: 0; padding: 22px 24px; font: 13.5px/1.8 var(--mono); white-space: pre-wrap; color: var(--ink-2); }
.citation code { font-size: 1em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; font-size: 14px; color: var(--muted); }
.footer-inner .brand { font-size: 17px; }
.footer-inner .brand img { width: 26px; height: 26px; }
.footer-inner > div { display: flex; gap: 24px; }
.footer-inner > div a { font-weight: 500; color: var(--ink-2); }
.footer-inner > div a:hover { color: var(--accent-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .container { width: calc(100% - 56px); }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 64px; }
  .hero-copy { max-width: 760px; }
  .delivery-board { width: 100%; max-width: 640px; }
  .section-heading { gap: 48px; }
  .stats-strip > div { padding: 22px; }
  .stats-strip dd { font-size: 40px; }
  .kpi { padding: 24px; }
  .quickstart, .contribute-section, .reliability-section { gap: 48px; }
  .case-list-heading, .case-card { grid-template-columns: 130px 1fr 180px; column-gap: 22px; }
}

@media (max-width: 1000px) {
  :root { --header-h: 64px; --chart-cols: minmax(160px, 190px) 1fr 64px; }
  .menu-toggle { display: inline-flex; }
  .site-header nav {
    position: absolute;
    top: calc(100% + 1px);
    left: -28px;
    right: -28px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 28px 20px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 24px 40px -24px rgb(15 33 66 / 30%);
  }
  .site-header nav.is-open { display: flex; }
  .site-header nav a { min-height: 50px; padding: 0 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 16px; }
  .site-header nav a:hover { background: none; color: var(--accent-strong); }
  .site-header nav .nav-github { justify-content: space-between; min-height: 50px; margin: 14px 0 0; padding: 0 18px; border: 0; border-radius: 10px; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; margin-bottom: 36px; }
  .section-intro { font-size: 17px; max-width: 680px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stats-strip > div:nth-child(3) { border-left: 0; }
  .stats-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .result-highlights { gap: 14px; }
  .highlight-number { font-size: 46px; }
  .results-toolbar { flex-wrap: wrap; }
  .metric-select, .table-filters { flex: 1 1 100%; }
  .metric-select select { flex: 1; }
  .table-filters .search-label, .table-filters > label:last-child { flex: 1; width: auto; }
  .table-filters select { width: 100%; min-width: 0; }
  .solving-lane { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); line-height: 24px; }
  .artifact-lines { display: none; }
  .hidden-lane { grid-template-columns: 1fr; gap: 0; }
  .hidden-lane article { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 28px; padding-block: 20px; }
  .hidden-lane article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .hidden-lane article > :not(p) { grid-column: 1; }
  .hidden-lane .flow-index { margin-bottom: 6px; }
  .hidden-lane code { justify-self: start; }
  .hidden-lane p { grid-column: 2; grid-row: 1 / 4; }
  .ablation-explorer { grid-template-columns: 1fr; }
  .ablation-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .ablation-controls .text-link { margin-top: 0; }
  .research-findings { grid-template-columns: 1fr; gap: 14px; }
  .research-findings article { display: grid; grid-template-columns: 36px 1fr; column-gap: 18px; padding: 24px; }
  .finding-number { grid-row: 1 / 3; margin: 0; }
  .research-findings p { grid-column: 2; }
  .warehouse-example { grid-template-columns: 1fr; }
  .warehouse-visual { border-left: 0; border-top: 1px solid var(--line); }
  .construction-summary { grid-template-columns: 1fr; gap: 28px; }
  .construction-facts { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .quickstart { grid-template-columns: 1fr; }
  .contribute-section { grid-template-columns: 1fr; }
  .reliability-section { grid-template-columns: 1fr; }
  .reliability-intro { position: static; }
  .paper-heading { flex-direction: column; align-items: flex-start; gap: 20px; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 40px); }
  .site-header nav { left: -20px; right: -20px; padding-inline: 20px; }
  .section { padding-block: 72px; }
  h2 { font-size: 36px; }
  .hero { padding-block: 44px 40px; gap: 36px; }
  .hero h1 { font-size: clamp(54px, 15vw, 72px); }
  .hero-subtitle { font-size: 26px; }
  .research-question { margin-top: 26px; padding: 16px 18px; }
  .research-question p { font-size: 19px; }
  .hero-description { font-size: 16px; }
  .hero-actions .button { flex: 1 1 0; padding: 0 14px; }
  .hero-jump { display: flex; justify-content: space-between; }
  .delivery-board { padding: 0 16px 16px; }
  .board-heading { margin: 0 -16px 18px; padding: 14px 16px; }
  .board-heading .eyebrow, .board-indicator { font-size: 12px; }
  .request-sheet { padding: 14px; gap: 12px; }
  .board-loop { grid-template-columns: 1fr .7fr 1fr; gap: 8px; }
  .loop-agent, .loop-customer { min-height: 124px; padding: 14px 8px; }
  .board-loop strong { font-size: 15px; }
  .board-budget { flex-wrap: wrap; }
  .board-footer { flex-wrap: wrap; }
  .stats-strip { margin-bottom: 40px; }
  .stats-strip > div { padding: 18px; }
  .stats-strip dd { font-size: 36px; }
  .stats-strip dt { font-size: 14px; }
  .stats-strip dt span { font-size: 13px; }
  .result-highlights { grid-template-columns: 1fr; }
  .kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; padding: 22px; }
  .kpi .highlight-number { grid-row: 1; font-size: 44px; }
  .kpi p { grid-column: 2; grid-row: 1; margin: 0; font-size: 15px; }
  .kpi-meter, .kpi-units { grid-column: 1 / -1; margin-top: 18px; }
  .kpi-scale { grid-column: 1 / -1; }
  .leaderboard-heading { flex-wrap: wrap; padding: 20px; }
  .results-toolbar { padding: 16px 20px 0; }
  .chart-legend { padding-inline: 20px; }
  .results-chart { padding-inline: 8px; }
  .chart-scale, .leaderboard-row { padding-inline: 12px; }
  .table-mode { margin-left: 20px; }
  .table-scroll-hint { display: block; margin-inline: 20px; }
  .results-table th:first-child, .results-table td:first-child { padding-left: 20px; }
  .leaderboard-shell .table-bottom { padding: 12px 20px; }
  .metric-notes { grid-template-columns: 1fr; gap: 12px; }
  .lane-heading { flex-wrap: wrap; padding: 20px 20px 0; }
  .lane-heading > span:last-child { width: 100%; margin: 0 0 0 19px; font-size: 13px; }
  .solving-lane { padding: 16px 20px 22px; }
  .solving-lane article { padding: 20px; }
  .evaluation-boundary { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 20px; }
  .hidden-lane { padding: 4px 20px 16px; }
  .hidden-lane article { display: block; }
  .protocol-note { grid-template-columns: 1fr; gap: 6px; padding: 18px 20px; }
  .figure-disclosure summary { padding: 12px 18px; line-height: 1.45; }
  .figure-disclosure figure { padding: 4px 18px 18px; }
  .ablation-controls, .ablation-plot { padding: 24px 20px; }
  .ablation-controls h3 { font-size: 21px; margin-bottom: 18px; }
  .condition-key { grid-template-columns: 1fr; gap: 10px; }
  .research-findings article { grid-template-columns: 1fr; padding: 22px; }
  .finding-number { grid-row: auto; margin-bottom: 14px; }
  .research-findings p { grid-column: 1; }
  .failure-study { padding: 24px 20px; }
  .failure-heading { flex-direction: column; gap: 14px; }
  .failure-trace { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
  .failure-trace article { padding: 0 0 24px 24px; border-top: 0; border-left: 2px solid var(--amber-line); }
  .failure-trace article:last-child { padding-bottom: 0; }
  .trace-dot { top: 2px; left: -7px; }
  .warehouse-story, .warehouse-visual { padding: 24px 20px; }
  .story-tabs { gap: 6px; margin-bottom: 24px; }
  .story-tabs button { padding: 10px; }
  .story-tabs button span { font-size: 13px; }
  .warehouse-visual-heading { flex-direction: column; gap: 4px; }
  .stacks-before, .stacks-after { gap: 20px; padding-block: 24px 20px; }
  .stack { min-width: 0; flex: 0 1 132px; }
  .construction-summary { padding: 24px 20px; }
  .construction-facts strong { font-size: 38px; }
  .cases-toolbar { flex-direction: column; align-items: stretch; }
  .cases-toolbar > .search-label { width: 100%; }
  .case-list-heading { display: none; }
  .case-grid { border-top: 1px solid var(--line); border-radius: var(--radius); }
  .case-card { grid-template-columns: 1fr; row-gap: 8px; padding: 20px; }
  .case-top { grid-row: auto; flex-direction: row; align-items: center; gap: 10px; }
  .case-objective { grid-column: 1; }
  .case-card details { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .case-card summary { justify-content: space-between; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
  .quickstart-intro h3 { font-size: 22px; }
  .resource-actions .button { width: 100%; }
  .code-heading > span:last-child { display: none; }
  .code-panel pre { padding: 20px; font-size: 13px; }
  .code-panel > p { margin: 0 20px 20px; }
  .contribute-copy > p:not(.eyebrow) { font-size: 17px; }
  .contribute-actions .button { width: 100%; }
  .contribute-guide { padding: 24px 20px; }
  .audit-row { grid-template-columns: 1fr; gap: 10px; padding: 22px 20px; }
  .audit-row > strong { font-size: 36px; }
  .scope-note { padding: 22px 20px; }
  .paper-heading .button { width: 100%; }
  .team { padding: 22px 20px; }
  .authors { font-size: 15px; line-height: 2; }
  .citation-heading { padding: 10px 16px; }
  .citation pre { padding: 18px 16px; font-size: 12.5px; }
  .footer-inner { flex-wrap: wrap; gap: 12px 24px; padding-block: 22px; }
  .footer-inner > span { order: 3; flex-basis: 100%; }
}

@media (max-width: 560px) {
  .chart-scale { grid-template-columns: 1fr; padding-left: 48px; padding-right: 12px; }
  .chart-scale > .chart-scale-label { display: none; }
  .leaderboard-row { grid-template-columns: 1fr auto; gap: 8px 12px; min-height: 0; padding-block: 12px; }
  .leaderboard-value { grid-column: 2; grid-row: 1; }
  .leaderboard-track { grid-column: 1 / -1; grid-row: 2; height: 10px; margin-left: 36px; }
  .chart-reference-note { text-align: left; }
  .table-bottom { flex-wrap: wrap; }
  .table-filters { flex-direction: column; }
  .case-filters button { flex: 1 1 auto; justify-content: center; padding-inline: 12px; }
  .code-panel pre { padding: 18px; font-size: 12px; }
  .hidden-lane article { display: block; }
}

@media (max-width: 400px) {
  .container { width: calc(100% - 32px); }
  .site-header nav { left: -16px; right: -16px; padding-inline: 16px; }
  .brand { font-size: 18px; }
  .hero h1 { font-size: 52px; }
  .hero-subtitle { font-size: 24px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .hero-takeaway strong { font-size: 26px; }
  .board-loop { grid-template-columns: 1fr 1fr; }
  .loop-exchange { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 10px; }
  .exchange-arrows { transform: rotate(90deg); }
  .stats-strip dd { font-size: 32px; }
  .kpi .highlight-number { font-size: 38px; }
  .story-tabs { grid-template-columns: 1fr; }
  .story-tabs button { flex-direction: row; align-items: baseline; gap: 10px; }
  .construction-facts { grid-template-columns: 1fr; gap: 18px; }
}

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

@media print {
  .site-header, .menu-toggle, .hero-actions, .results-toolbar, .chart-legend, .cases-toolbar, #results-more, #cases-more { display: none !important; }
  .hero-surface, .resources-section { background: #fff; color: var(--ink); }
  .resources-section h2, .resources-section h3 { color: var(--ink); }
}
