:root {
  --bg: #F5F1EA;
  --bg-2: #EFEAE0;
  --ink: #1A1A19;
  --ink-2: #3A3A37;
  --ink-3: #6E6B63;
  --ink-4: #A8A49A;
  --rule: #D9D2C4;
  --rule-2: #E8E2D4;
  --accent: oklch(0.55 0.13 35);
  --accent-soft: oklch(0.55 0.13 35 / 0.10);
  --accent-ink: oklch(0.42 0.13 35);
  --measure: 720px;
  --wide: 980px;
  --bleed: 1180px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Source Serif 4', 'Iowan Old Style', Georgia, serif;
  font-size: 19px;
  line-height: 1.62;
  letter-spacing: -0.005em;
  font-feature-settings: "pnum", "lnum", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-soft); color: var(--ink); }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: normal; }

a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid color-mix(in oklch, var(--accent-ink) 30%, transparent); transition: border-color .15s, color .15s; }
a:hover { border-bottom-color: var(--accent-ink); }

/* ───────── NAV ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner {
  max-width: var(--bleed); margin: 0 auto; padding: 18px 40px;
  display: flex; align-items: center; gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  letter-spacing: 0.02em; color: var(--ink); border: none;
}
.brand-mark {
  width: 22px; height: 22px; flex: none;
  object-fit: contain; display: block;
  background: var(--bg);
}
.nav-links {
  display: flex; gap: 26px; flex: 1;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.nav-links a {
  color: var(--ink-2); border: none;
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  border: none;
  transition: background .15s;
}
.nav-cta:hover { background: var(--accent-ink); border: none; }
.progress-bar {
  height: 1px; background: var(--accent); width: 0%;
  transition: width .1s linear;
}

/* ───────── PAGE GRID ───────── */
main { max-width: var(--measure); margin: 0 auto; padding: 0 32px; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 32px; }
.bleed { max-width: var(--bleed); margin: 0 auto; padding: 0 32px; }

/* ───────── HEADER / TITLE ───────── */
header.paper {
  padding: 96px 0 48px;
  text-align: left;
}
.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 28px;
  display: flex; gap: 12px; align-items: center;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
h1.title {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 24px;
  text-wrap: pretty;
}
h1.title em { font-style: italic; color: var(--accent-ink); font-weight: 500; }
.subtitle {
  font-size: 22px; line-height: 1.45; color: var(--ink-2);
  margin: 0 0 40px; font-weight: 400;
  text-wrap: pretty;
  max-width: 640px;
}

/* AUTHORS */
.authors { margin: 0 0 28px; line-height: 1.9; }
.author {
  display: inline; font-size: 18px; color: var(--ink);
  border-bottom: 1px dotted var(--ink-4);
  cursor: help;
  position: relative;
  padding-bottom: 1px;
  white-space: nowrap;
}
.author:hover { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.author sup { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-3); margin-left: 2px; }
.author-sep { color: var(--ink-4); margin: 0 6px; }
.affiliations {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-3); line-height: 1.9; margin-bottom: 32px;
}
.affiliations sup { color: var(--accent-ink); margin-right: 4px; }
.affiliations .school { color: var(--ink); font-weight: 500; }
.aff-parent .school { display: block; margin-top: 10px; }
.aff-legend { margin-top: 8px; }
.aff-legend span + span::before {
  content: '·';
  color: var(--ink-4);
  margin: 0 8px;
}
.aff-parent {
  margin-top: 12px;
  /* padding-top: 10px; */
  /* border-top: 1px solid var(--rule-2); */
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.meta-row {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-3);
  padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}
.meta-row .k { color: var(--ink-4); margin-right: 6px; }
.meta-row .v { color: var(--ink-2); }

/* BUTTONS */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 64px; }
.actions-break { flex-basis: 100%; height: 0; margin: 0; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { transform: translateY(-1px); background: var(--accent-ink); border-color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn svg, .btn img { width: 14px; height: 14px; flex: none; }
.btn .badge {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: color-mix(in oklch, currentColor 15%, transparent);
  color: inherit;
}

/* ───────── HERO FIGURE ───────── */
.hero-figure {
  margin: 0 auto 80px;
  max-width: var(--wide);
  padding: 0 32px;
}
.hero-canvas {
  aspect-ratio: 2 / 1;
  background:
    radial-gradient(circle at 20% 30%, oklch(0.55 0.13 35 / 0.12), transparent 50%),
    radial-gradient(circle at 80% 70%, oklch(0.55 0.13 200 / 0.08), transparent 55%),
    var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.hero-canvas .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.hero-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-caption {
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3);
  display: flex; gap: 12px; align-items: baseline;
}
.hero-caption .num { color: var(--ink); font-weight: 500; }

/* ───────── SECTIONS ───────── */
section.s { padding: 56px 0; scroll-margin-top: 80px; }
h2.h {
  font-family: 'Source Serif 4', serif;
  font-size: 32px; line-height: 1.15; letter-spacing: -0.02em;
  font-weight: 500; margin: 0 0 8px;
}
.h-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 12px;
}
h3.h3 {
  font-family: 'Source Serif 4', serif;
  font-size: 22px; line-height: 1.25; letter-spacing: -0.015em;
  font-weight: 500; margin: 40px 0 12px;
}
p { margin: 0 0 20px; text-wrap: pretty; }
p.lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
blockquote {
  margin: 32px 0; padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-style: italic; color: var(--ink-2);
  font-size: 20px; line-height: 1.5;
}

/* TLDR card */
.tldr {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  border-radius: 4px;
  padding: 28px 32px;
  margin: 0 0 48px;
  position: relative;
}
.tldr-label {
  position: absolute; top: -10px; left: 24px;
  background: var(--bg); padding: 0 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
}
.tldr ul { margin: 0; padding-left: 18px; }
.tldr li { margin-bottom: 8px; }
.tldr li::marker { color: var(--accent); }

/* Footnote */
.fn {
  color: var(--accent-ink); cursor: help;
  font-family: 'JetBrains Mono', monospace; font-size: 0.7em;
  vertical-align: super; line-height: 0;
  border: none; padding: 0 1px;
}
.fn:hover { color: var(--accent); }
.tip {
  position: fixed;
  background: var(--ink); color: var(--bg);
  padding: 12px 14px; border-radius: 6px;
  font-size: 13px; line-height: 1.45; max-width: 320px;
  font-family: 'Source Serif 4', serif;
  pointer-events: none;
  z-index: 100; opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}
.tip.show { opacity: 1; transform: translateY(0); }

/* ───────── DIAGRAM (architecture) ───────── */
.diagram {
  background: var(--bg-2); border: 1px solid var(--rule);
  border-radius: 4px; padding: 40px 32px; margin: 32px 0 16px;
}
.pipeline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  align-items: stretch;
}
.stage {
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: 4px; padding: 18px 16px;
  cursor: pointer; transition: border-color .15s, transform .15s, background .15s;
  position: relative;
}
.stage:hover { border-color: var(--accent); transform: translateY(-2px); }
.stage.active { border-color: var(--accent); background: color-mix(in oklch, var(--accent-soft) 50%, var(--bg)); }
.stage .num {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-4); letter-spacing: 0.08em;
}
.stage .name {
  font-family: 'Source Serif 4', serif; font-size: 18px;
  margin: 6px 0 8px; font-weight: 500;
  letter-spacing: -0.01em;
}
.stage .desc {
  font-size: 13px; color: var(--ink-3); line-height: 1.5;
}
.stage-detail {
  margin-top: 18px; padding: 18px 20px;
  background: var(--bg); border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
  min-height: 80px;
}
.stage-detail .k {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
}

/* ───────── TABLE ───────── */
.results-wrap {
  margin: 28px 0 16px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
table.results {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
table.results thead th {
  text-align: left;
  padding: 14px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
  cursor: pointer; user-select: none;
  white-space: nowrap;
  position: relative;
}
table.results thead th:hover { color: var(--ink); }
table.results thead th .arrow {
  display: inline-block; width: 0; height: 0;
  margin-left: 6px; opacity: 0.3;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
  transition: transform .15s, opacity .15s;
}
table.results thead th.sorted .arrow { opacity: 1; }
table.results thead th.sorted.desc .arrow { transform: rotate(180deg); }
table.results tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-2);
}
table.results tbody tr:last-child td { border-bottom: none; }
table.results tbody tr.ours { background: color-mix(in oklch, var(--accent-soft) 30%, transparent); }
table.results tbody tr.ours td { color: var(--ink); font-weight: 500; }
table.results tbody tr.ours td:first-child::before {
  content: "▸ ";
  color: var(--accent);
}
table.results tbody tr:hover { background: var(--bg-2); }
table.results tbody tr.ours:hover { background: color-mix(in oklch, var(--accent-soft) 50%, transparent); }
table.results .num { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
table.results .best { color: var(--accent-ink); font-weight: 600; }
table.results thead th:not([data-sort]) { cursor: default; }
table.results thead th:not([data-sort]):hover { color: var(--ink-3); }
.dist {
  display: flex; height: 12px; min-width: 140px; width: 100%;
  border-radius: 2px; overflow: hidden;
  background: var(--bg);
  outline: 1px solid var(--rule-2);
}
.dist .seg, .dist-key .seg {
  display: inline-block; height: 100%;
  transition: opacity .15s, box-shadow .15s, transform .15s;
}
.dist .seg { cursor: help; }
.dist:hover .seg { opacity: 0.4; }
.dist:hover .seg:hover {
  opacity: 1;
  box-shadow: inset 0 0 0 1px var(--ink);
}
.dist-key {
  display: inline-flex; gap: 1px; vertical-align: middle;
  margin: 0 6px; height: 9px;
}
.dist-key .seg { width: 7px; }
.seg.s1 { background: oklch(0.55 0.13 35 / 0.10); }
.seg.s2 { background: oklch(0.55 0.13 35 / 0.30); }
.seg.s3 { background: oklch(0.55 0.13 35 / 0.50); }
.seg.s4 { background: oklch(0.55 0.13 35 / 0.75); }
.seg.s5 { background: oklch(0.55 0.13 35); }

/* ───────── HEATMAP ───────── */
.heatmap-figure { margin: 28px 0 0; }
.heatmap {
  width: 100%; border-collapse: separate; border-spacing: 4px;
  table-layout: fixed;
}
.heatmap thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 500; color: var(--ink-3);
  padding: 8px 4px 12px; text-align: center; vertical-align: bottom;
  line-height: 1.35; border: none; cursor: default;
}
.heatmap thead th[data-def] { cursor: help; }
.heatmap thead th span { display: block; }
.heatmap tbody th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  text-align: right; vertical-align: middle;
  padding: 0 14px 0 0; line-height: 1.35;
  border: none; width: 160px;
}
.heatmap .hm-cell {
  background: oklch(0.55 0.13 35 / var(--alpha, 0));
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  padding: 14px 6px; text-align: center;
  cursor: help;
  transition: transform .12s, box-shadow .12s, outline-color .12s;
  position: relative;
  outline: 1px solid transparent;
}
.heatmap .hm-cell:hover {
  transform: scale(1.05); z-index: 2;
  outline-color: var(--ink);
  box-shadow: 0 4px 14px color-mix(in oklch, var(--ink) 18%, transparent);
}
.heatmap .hm-count {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 600; color: var(--ink);
  line-height: 1;
}
.heatmap .hm-pct {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--ink-3); margin-top: 4px;
  line-height: 1;
}
.heatmap .hm-cell.hm-dark .hm-count { color: var(--bg); }
.heatmap .hm-cell.hm-dark .hm-pct { color: color-mix(in oklch, var(--bg) 78%, transparent); }

@media (max-width: 800px) {
  .heatmap { font-size: 11px; }
  .heatmap thead th { font-size: 9px; }
  .heatmap tbody th { width: 130px; padding-right: 8px; font-size: 11px; }
  .heatmap .hm-cell { padding: 10px 3px; }
  .heatmap .hm-count { font-size: 12px; }
}

/* ───────── CLAIM SANKEY ───────── */
.sankey-figure { margin: 28px 0 0; }
.sankey-figure svg { width: 100%; height: auto; display: block; }
.sankey-flow {
  fill-opacity: 0.55;
  cursor: help;
  transition: fill-opacity .15s;
}
/* Source-coded palette: three warm-hue stops, all inside the page's terracotta family */
.sankey-flow.flow-paper    { fill: oklch(0.65 0.12 35); }   /* light terracotta */
.sankey-flow.flow-artifact { fill: oklch(0.50 0.13 35); }   /* mid */
.sankey-flow.flow-interp   { fill: oklch(0.38 0.13 35); }   /* deep */
.sankey-figure svg:hover .sankey-flow { fill-opacity: 0.18; }
.sankey-figure svg:hover .sankey-flow:hover { fill-opacity: 0.85; }

.sankey-node               { fill: oklch(0.42 0.13 35); }   /* default = page accent-ink */
.sankey-node.node-paper    { fill: oklch(0.50 0.13 35); }
.sankey-node.node-artifact { fill: oklch(0.40 0.13 35); }
.sankey-node.node-interp   { fill: oklch(0.30 0.10 35); }

.sankey-labels text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  fill: var(--ink);
}
.sankey-counts text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 600;
  fill: var(--bg);
}
.sankey-counts text.sm { font-size: 11px; }
.sankey-axis {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.08em;
  fill: var(--ink-4);
}

/* ───────── RQ2: Orchestrated vs Claude Code ───────── */
.rq2-figure { margin: 28px 0 0; }

/* Section 1: W/T/L summary */
.rq2-summary {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 18px 22px 16px;
  margin-bottom: 28px;
}
.rq2-summary-head {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.rq2-summary-head .lh { color: oklch(0.50 0.13 35); font-weight: 600; }
.rq2-summary-head .rh { color: oklch(0.38 0.13 35); font-weight: 600; }
.rq2-summary-track {
  display: flex; height: 16px; width: 100%;
  border-radius: 3px; overflow: hidden;
  background: var(--bg);
  outline: 1px solid var(--rule-2);
}
.wtl-seg {
  display: block; height: 100%;
  cursor: help; transition: opacity .15s, box-shadow .15s;
}
.rq2-summary-track:hover .wtl-seg { opacity: 0.45; }
.rq2-summary-track:hover .wtl-seg:hover {
  opacity: 1;
  box-shadow: inset 0 0 0 1px var(--ink);
}
.wtl-seg.seg-win  { background: oklch(0.55 0.13 35); }
.wtl-seg.seg-tie  { background: var(--ink-4); }
.wtl-seg.seg-loss { background: oklch(0.38 0.13 35); }

.rq2-summary-labels {
  display: flex; justify-content: space-between;
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-2);
}
.rq2-summary-labels .lbl { display: inline-flex; align-items: center; gap: 8px; }
.rq2-summary-labels strong { font-weight: 600; color: var(--ink); }
.rq2-summary-labels .swatch {
  display: inline-block; width: 11px; height: 11px;
}
.swatch.sw-win  { background: oklch(0.55 0.13 35); border-radius: 2px; }              /* square — Orchestrated */
.swatch.sw-tie  {
  background: var(--ink-4); width: 12px; height: 3px;
  align-self: center; border-radius: 1px;
}                                                                                       /* horizontal bar — tie */
.swatch.sw-loss { background: oklch(0.38 0.13 35); border-radius: 50%; }                /* circle — Claude Code */

/* Section 2: per-dimension comparison */
.rq2-dims {
  width: 100%; border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
}
.rq2-dims thead th {
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 500; color: var(--ink-3);
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--rule);
  cursor: default;
}
.rq2-dims thead th.orch-col { color: oklch(0.50 0.13 35); text-align: right; }
.rq2-dims thead th.cc-col   { color: oklch(0.38 0.13 35); text-align: left; }
.rq2-dims thead th.orch-col::after,
.rq2-dims thead th.cc-col::before {
  content: ""; display: inline-block;
  width: 8px; height: 8px;
  margin: 0 4px; vertical-align: middle;
}
.rq2-dims thead th.orch-col::after {
  background: oklch(0.55 0.13 35); border-radius: 2px;
}
.rq2-dims thead th.cc-col::before {
  background: oklch(0.38 0.13 35); border-radius: 50%;
}
.rq2-dims thead th.track-col {
  position: relative;
  padding: 10px 16px;
}
.rq2-dims thead th.track-col span {
  display: inline-block;
}
.rq2-dims thead th.track-col .t-min { width: 0; }
.rq2-dims thead th.track-col .t-mid {
  position: absolute; left: 50%; transform: translateX(-50%);
}
.rq2-dims thead th.track-col .t-max {
  position: absolute; right: 16px;
}
.rq2-dims thead th.pval-col { text-align: right; }

.rq2-dims tbody th {
  font-size: 13px; font-weight: 500; color: var(--ink);
  text-align: left; padding: 16px 12px 16px 0;
  border-bottom: 1px solid var(--rule-2);
  width: 200px;
}
[data-def] {
  cursor: help;
  text-decoration: underline dotted var(--ink-4);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .15s, color .15s;
}
[data-def]:hover {
  text-decoration-color: var(--accent-ink);
  color: var(--accent-ink);
}
.rq2-dims tbody td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: middle;
}
.rq2-dims tbody td.num {
  font-size: 14px; font-weight: 600;
  width: 50px; white-space: nowrap;
}
.rq2-dims tbody td.num.orch { color: oklch(0.50 0.13 35); text-align: right; }
.rq2-dims tbody td.num.cc   { color: oklch(0.38 0.13 35); text-align: left; }
.rq2-dims tbody td.track-cell { padding: 16px; }
.rq2-dims tbody td.pval {
  font-size: 12px; color: var(--ink-3);
  text-align: right; width: 80px; white-space: nowrap;
}
.rq2-dims tbody td.pval.sig {
  color: var(--accent-ink); font-weight: 600;
}
.rq2-dims tbody tr.significant th { color: var(--accent-ink); }
.rq2-dims tbody tr:last-child th,
.rq2-dims tbody tr:last-child td { border-bottom: none; }

.dim-track {
  position: relative; height: 18px; width: 100%;
  min-width: 240px;
}
.dim-track::before {
  content: ""; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: var(--rule); transform: translateY(-50%);
}
.dim-track .tick {
  position: absolute; top: 50%;
  width: 1px; height: 8px;
  background: var(--ink-4);
  transform: translate(-50%, -50%);
}
.dim-track .dot {
  position: absolute; top: 50%;
  width: 13px; height: 13px;
  border: 2px solid var(--bg);
  transform: translate(-50%, -50%);
  cursor: help;
  transition: transform .12s, box-shadow .12s;
}
.dim-track .dot:hover {
  transform: translate(-50%, -50%) scale(1.4);
  z-index: 2;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ink) 18%, transparent);
}
.dim-track .dot.orch { background: oklch(0.55 0.13 35); border-radius: 2px; }   /* square */
.dim-track .dot.cc   { background: oklch(0.38 0.13 35); border-radius: 50%; }   /* circle */

@media (max-width: 800px) {
  .rq2-summary-labels { flex-direction: column; gap: 4px; align-items: flex-start; }
  .rq2-dims tbody th { width: 130px; font-size: 11px; }
  .rq2-dims tbody td.num { font-size: 12px; }
  .dim-track { min-width: 140px; }
}

.caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3); line-height: 1.5;
  margin-top: 12px;
  padding-left: 0;
}
.caption .lab { color: var(--ink); font-weight: 500; }

/* ───────── GALLERY ───────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin: 28px 0 16px;
}
.tile {
  aspect-ratio: 1 / 1;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: zoom-in;
  position: relative; overflow: hidden;
  transition: transform .2s, border-color .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile svg { width: 100%; height: 100%; display: block; }
.tile .label {
  position: absolute; left: 10px; bottom: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-3);
  background: var(--bg); padding: 3px 7px; border-radius: 3px;
  border: 1px solid var(--rule);
}

/* ───────── BLOG EXPANSION ───────── */
.story-start {
  padding-top: 40px;
}

.contrast-grid,
.bottleneck-grid,
.case-grid,
.failure-taxonomy {
  display: grid;
  gap: 14px;
}

.contrast-grid {
  grid-template-columns: repeat(2, 1fr);
  margin: 34px 0 4px;
}

.contrast-card,
.bottleneck,
.case-card,
.failure-taxonomy article {
  border: 1px solid var(--rule);
  background: var(--bg-2);
  border-radius: 4px;
}

.contrast-card {
  padding: 26px 26px 28px;
  position: relative;
  overflow: hidden;
}

.contrast-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -50px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(in oklch, var(--ink-4) 18%, transparent);
}

.contrast-card.scientific::after {
  background: color-mix(in oklch, var(--accent) 24%, transparent);
}

.contrast-card h3,
.bottleneck h3,
.case-card h3 {
  font-family: 'Source Serif 4', serif;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 8px 0 12px;
}

.contrast-card p,
.bottleneck p,
.case-card p,
.failure-taxonomy p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

.mini-k,
.case-id,
.pkg-card span,
.pill,
.failure-taxonomy span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-k,
.pkg-card span,
.case-id,
.failure-taxonomy span {
  color: var(--ink-3);
}

.package-panel {
  margin: 28px 0 14px;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    radial-gradient(circle at 10% 20%, color-mix(in oklch, var(--accent) 14%, transparent), transparent 34%),
    radial-gradient(circle at 90% 80%, color-mix(in oklch, var(--ink-4) 18%, transparent), transparent 34%),
    var(--bg-2);
}

.package-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.pkg-card {
  min-height: 180px;
  padding: 22px 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: color-mix(in oklch, var(--bg) 88%, white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pkg-card strong {
  display: block;
  font-family: 'Source Serif 4', serif;
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin: 14px 0 16px;
}

.pkg-card p {
  margin: 0;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.5;
}

.pkg-card.hidden {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--rule));
  background: color-mix(in oklch, var(--accent-soft) 48%, var(--bg));
}

.pkg-arrow {
  align-self: center;
  color: var(--accent-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
}

.paper-figure {
  margin: 28px 0 36px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg-2);
  padding: 22px;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: white;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
}

.paper-figure .caption {
  margin-top: 14px;
}

.bottleneck-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0 0;
}

.bottleneck {
  padding: 24px 22px;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--bg) 75%, transparent), var(--bg-2));
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.failure-taxonomy {
  grid-template-columns: repeat(2, 1fr);
  margin-top: -10px;
}

.failure-taxonomy article {
  padding: 20px 22px;
  background: var(--bg);
}

.failure-taxonomy span {
  display: block;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

.case-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 28px 0 16px;
}

.case-card {
  padding: 24px 22px;
  background: var(--bg);
}

.case-card p + p {
  margin-top: 14px;
}

.case-card .case-takeaway {
  padding-top: 14px;
  border-top: 1px solid var(--rule-2);
  color: var(--ink);
  font-style: italic;
}

.conclusion {
  border-top: 1px solid var(--rule);
  margin-top: 28px;
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--ink) 70%, transparent);
  backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 40px;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox-inner {
  max-width: 1000px; width: 100%; aspect-ratio: 4 / 3;
  background: var(--bg); border-radius: 6px;
  border: 1px solid var(--rule);
  overflow: hidden; position: relative;
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
}

/* ───────── BIBTEX ───────── */
.bib {
  margin: 28px 0;
  background: #0F0F0E; color: #E8E2D4;
  border-radius: 6px; overflow: hidden;
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.65;
}
.bib pre {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  font-family: inherit; font-size: inherit;
  color: inherit; white-space: pre;
}
.bib .t-key { color: oklch(0.78 0.13 80); }
.bib .t-name { color: oklch(0.72 0.13 200); }
.bib .t-str { color: oklch(0.78 0.10 130); }
.copy-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.06);
  color: #E8E2D4; border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  cursor: pointer; letter-spacing: 0.05em;
  transition: background .15s, color .15s;
}
.copy-btn:hover { background: rgba(255,255,255,0.12); }
.copy-btn.copied { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ───────── ABSTRACT (expandable) ───────── */
details.abstract {
  margin: 0 0 32px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
details.abstract summary {
  list-style: none;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: space-between;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::after {
  content: "+ Expand";
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-ink);
}
details.abstract[open] summary::after { content: "− Collapse"; }
details.abstract .body { padding-top: 18px; font-size: 18px; line-height: 1.62; color: var(--ink); }

/* ───────── FOOTER ───────── */
footer.page {
  margin-top: 120px;
  border-top: 1px solid var(--rule);
  padding: 56px 0 80px;
}
.foot-grid {
  max-width: var(--bleed); margin: 0 auto; padding: 0 32px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.foot-brand { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-3); line-height: 1.7; max-width: 360px; }
.foot-col h4 {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); margin: 0 0 14px; font-weight: 500;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 8px; font-size: 14px; }
.foot-col a { color: var(--ink-2); border: none; }
.foot-col a:hover { color: var(--accent-ink); }
.foot-bottom {
  max-width: var(--bleed); margin: 60px auto 0; padding: 24px 32px 0;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-4);
}

/* responsive */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .contrast-grid,
  .bottleneck-grid,
  .case-grid,
  .failure-taxonomy { grid-template-columns: 1fr; }
  .package-flow { grid-template-columns: 1fr; }
  .pkg-arrow { transform: rotate(90deg); justify-self: center; }
  .paper-figure { padding: 14px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  h1.title { font-size: 36px; }
}

@media (max-width: 560px) {
  main,
  .wide,
  .bleed,
  .hero-figure { padding-left: 20px; padding-right: 20px; }
  body { font-size: 17px; }
  .subtitle,
  p.lead { font-size: 19px; }
  .pipeline,
  .gallery,
  .foot-grid { grid-template-columns: 1fr; }
  .package-panel,
  .diagram,
  .tldr,
  .contrast-card,
  .bottleneck,
  .case-card { padding: 20px; }
  .hero-canvas { aspect-ratio: 4 / 3; }
  .actions { margin-bottom: 36px; }
  .btn { width: 100%; justify-content: center; }
  .lightbox { padding: 18px; }
}
