:root {
  color-scheme: light;
  --paper: #f8fafc;
  --paper-2: #eef2f6;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --ink: #17242f;
  --muted: #475569;
  --faint: #526171;
  --line: #d4dde5;
  --line-strong: #81909d;
  --accent: #087568;
  --accent-2: #065e54;
  --accent-wash: rgba(8,117,104, .08);
  --blue: #315b8a;
  --green: #39745a;
  --amber: #9b6a1d;
  --rose: #a43c51;

  --bg-dark: var(--paper);
  --bg-card: var(--panel);
  --bg-card-hover: #f6f3eb;
  --bg-surface: var(--paper-2);
  --bg-inset: #eef2f6;
  --nav-bg: rgba(243, 241, 235, .92);
  --panel-grad-a: var(--panel);
  --panel-grad-b: var(--panel);
  --border: var(--line);
  --border-accent: var(--line-strong);
  --text-main: var(--ink);
  --text-muted: var(--muted);
  --text-dim: var(--faint);
  --text-on-accent: #fff;
  --code-text: #22211e;
  --primary: var(--accent);
  --primary-strong: var(--accent-2);
  --primary-glow: rgba(8,117,104, .16);
  --secondary: var(--blue);
  --emerald: var(--green);
  --pink: #8e5578;
  --primary-ink: var(--accent-2);
  --primary-ink-soft: var(--accent);
  --secondary-ink: var(--blue);
  --emerald-ink: var(--green);
  --rose-ink: var(--rose);
  --amber-ink: var(--amber);
  --tint-primary: rgba(8,117,104, .07);
  --tint-primary-strong: rgba(8,117,104, .17);
  --tint-emerald: rgba(57, 116, 90, .08);
  --tint-emerald-strong: rgba(57, 116, 90, .18);
  --tint-rose: rgba(164, 60, 81, .08);
  --tint-rose-strong: rgba(164, 60, 81, .18);
  --tint-amber: rgba(155, 106, 29, .08);
  --tint-amber-strong: rgba(155, 106, 29, .18);
  --tint-neutral: rgba(21,21,21,.05);
  --link: #315b8a;
  --link-hover: #244668;
  --shadow-soft: rgba(30, 27, 20, .07);
  --shadow-strong: rgba(30, 27, 20, .13);
  --canvas-bg: #ffffff;
  --canvas-edge: #aaa59a;
  --canvas-label: #151515;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111210;
  --paper-2: #171815;
  --panel: #1a1b18;
  --panel-2: #20211e;
  --ink: #f0eee7;
  --muted: #aaa79f;
  --faint: #a6b0ba;
  --line: #30312d;
  --line-strong: #474842;
  --accent: #70d2bb;
  --accent-2: #98e6d5;
  --accent-wash: rgba(112,210,187,.08);
  --blue: #8bb1db;
  --green: #7fc09d;
  --amber: #d4a357;
  --rose: #e58da0;
  --bg-dark: var(--paper);
  --bg-card: var(--panel);
  --bg-card-hover: #23241f;
  --bg-surface: var(--paper-2);
  --bg-inset: #0d0e0c;
  --nav-bg: rgba(17,18,16,.9);
  --panel-grad-a: var(--panel);
  --panel-grad-b: var(--panel);
  --border: var(--line);
  --border-accent: var(--line-strong);
  --text-main: var(--ink);
  --text-muted: var(--muted);
  --text-dim: var(--faint);
  --text-on-accent: #111;
  --code-text: #ece9df;
  --primary: var(--accent);
  --primary-strong: var(--accent-2);
  --primary-glow: rgba(112,210,187,.18);
  --secondary: var(--blue);
  --emerald: var(--green);
  --pink: #d292bc;
  --primary-ink: var(--accent-2);
  --primary-ink-soft: var(--accent);
  --secondary-ink: var(--blue);
  --emerald-ink: var(--green);
  --rose-ink: var(--rose);
  --amber-ink: var(--amber);
  --tint-primary: rgba(112,210,187,.08);
  --tint-primary-strong: rgba(112,210,187,.18);
  --tint-emerald: rgba(127,192,157,.08);
  --tint-emerald-strong: rgba(127,192,157,.18);
  --tint-rose: rgba(229,141,160,.08);
  --tint-rose-strong: rgba(229,141,160,.18);
  --tint-amber: rgba(212,163,87,.08);
  --tint-amber-strong: rgba(212,163,87,.18);
  --tint-neutral: rgba(255,255,255,.05);
  --link: #9ec0e6;
  --link-hover: #c7daf0;
  --shadow-soft: rgba(0,0,0,.18);
  --shadow-strong: rgba(0,0,0,.34);
  --canvas-bg: #161714;
  --canvas-edge: #5c5d56;
  --canvas-label: #f0eee7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; scroll-padding-top: 86px; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: .2em; }
code, pre, .mono { font-family: var(--font-mono); }
code { font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.skip-link {
  position: fixed; top: -80px; left: 16px; z-index: 9999;
  background: var(--ink); color: var(--paper); padding: 9px 12px; border-radius: 6px;
}
.skip-link:focus { top: 12px; color: var(--paper); text-decoration: none; }

/* header */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  min-height: 68px; display: flex; align-items: center; gap: 24px;
  padding: 0 max(20px, calc((100vw - 1180px)/2));
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750;  }
.nav-brand:hover { color: var(--ink); text-decoration: none; }
.brand-glyph {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%;
  font-family: var(--font-mono); font-size: 11px;
}
.nav-links { margin-left: auto; display: flex; gap: 4px; list-style: none; }
.nav-links a { display: block; padding: 7px 9px; border-radius: 5px; color: var(--muted); font-size: 13px; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { background: var(--tint-neutral); color: var(--ink); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 7px; }
.nav-repo, .theme-toggle {
  height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
  color: var(--ink); font-size: 12px; font-weight: 650;
}
.nav-repo { padding: 0 10px; }
.nav-repo:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.theme-toggle { width: 34px; cursor: pointer; }

/* hero */
.hero { padding: clamp(64px, 8vw, 116px) 0 36px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px,.95fr); gap: clamp(42px,7vw,92px); align-items: start; }
.kicker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 650;  }
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  margin-top: 20px; max-width: 720px;
  font-size: clamp(48px, 6vw, 82px); line-height: .98; font-weight: 680;
   text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-lede { max-width: 690px; margin-top: 26px; color: var(--muted); font-size: clamp(17px,1.6vw,21px); line-height: 1.62;  }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  font-family: var(--font-sans); font-size: 13px; font-weight: 700; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--line-strong); color: var(--ink); background: var(--panel-2); }
.btn-quiet { background: transparent; color: var(--muted); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 24px; color: var(--faint); font-family: var(--font-mono); font-size: 11px; }

/* concept map */
.concept {
  border-top: 4px solid var(--ink);
  background: var(--panel);
  box-shadow: 0 12px 38px var(--shadow-soft);
}
.concept-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.concept-body { padding: 18px; }
.query-card { padding: 14px; background: var(--ink); color: var(--paper); border-radius: 5px; }
.query-card span { display: block; margin-bottom: 5px; color: #cfcac0; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;  }
.query-card code { color: inherit; font-size: 12px; }
.flow-arrow { height: 34px; display: grid; place-items: center; color: var(--faint); font-family: var(--font-mono); }
.store-box { border: 1px solid var(--line-strong); background: var(--panel-2); padding: 14px; }
.store-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.store-title strong { font-size: 14px; }
.store-title code { color: var(--accent); font-size: 12px; }
.store-parts { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-top: 12px; }
.store-parts span { min-width: 0; padding: 8px 4px; border-top: 2px solid var(--line-strong); color: var(--muted); text-align: center; font-family: var(--font-mono); font-size: 9px; }
.output-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; }
.output-grid div { min-height: 64px; padding: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.output-grid span { display: block; color: var(--faint); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;  }
.output-grid strong { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; }
.hero-facts { grid-column: 1/-1; display: grid; grid-template-columns: 1.5fr repeat(3,1fr); margin-top: 46px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-facts > * { padding: 14px 16px; border-right: 1px solid var(--line); }
.hero-facts > *:last-child { border-right: 0; }
.hero-facts span { display: block; color: var(--faint); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;  }
.hero-facts strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink); }

/* sections */
main { padding: 84px 0 120px; }
section { scroll-margin-top: 90px; margin-bottom: clamp(86px,10vw,132px); }
.section-header { max-width: 790px; margin-bottom: 34px; }
.section-subtitle { margin-bottom: 11px; color: var(--accent); font-family: var(--font-mono); font-size: 10px; font-weight: 700;  text-transform: uppercase; }
.section-title { font-size: clamp(32px,4vw,52px); line-height: 1.05;  font-weight: 650; text-wrap: balance; }
.section-desc { max-width: 720px; margin-top: 14px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.rule-title { display: grid; grid-template-columns: 60px 1fr; gap: 20px; align-items: start; margin-bottom: 28px; }
.rule-title .n { color: var(--accent); font-family: var(--font-mono); font-size: 11px; padding-top: 7px; }
.rule-title h2 { font-size: clamp(30px,4vw,50px); line-height: 1.06;  font-weight: 650; }

/* idea */
.dual-context { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.context-side { padding: 30px 28px 34px 0; }
.context-side + .context-side { padding-left: 28px; padding-right: 0; border-left: 1px solid var(--line); }
.context-side .label { color: var(--faint); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;  }
.context-side h3 { margin-top: 9px; font-size: 24px; line-height: 1.15;  }
.context-side p { margin-top: 12px; color: var(--muted); font-size: 14px; }
.context-side .question { margin-top: 18px; padding: 12px 0 0; border-top: 1px solid var(--line); color: var(--ink); font-family: var(--font-mono); font-size: 12px; }
.position-note { margin-top: 26px; max-width: 840px; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.position-note strong { color: var(--ink); }

/* concrete flow */
.change-example { display: grid; grid-template-columns: 280px 1fr; gap: 38px; border-top: 1px solid var(--line-strong); padding-top: 26px; }
.change-input { align-self: start; padding: 16px; background: var(--ink); color: var(--paper); border-radius: 5px; }
.change-input small { display: block; color: #c9c5bb; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;  }
.change-input code { display: block; margin-top: 8px; color: inherit; font-size: 12px; white-space: pre-wrap; }
.process-list { list-style: none; counter-reset: process; }
.process-list li { position: relative; display: grid; grid-template-columns: 40px 180px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.process-list li::before { counter-increment: process; content: "0" counter(process); color: var(--accent); font-family: var(--font-mono); font-size: 10px; padding-top: 3px; }
.process-list strong { font-size: 14px; }
.process-list p { color: var(--muted); font-size: 13px; }

/* theory */
.math-card { padding: 24px 0; margin: 0; border-top: 1px solid var(--line); background: transparent; }
.math-card:last-child { border-bottom: 1px solid var(--line); }
.math-title { color: var(--ink); font-size: 15px; font-weight: 700; }
.formula-box { margin-top: 14px; padding: 14px 16px; overflow-x: auto; border-left: 3px solid var(--accent); background: var(--panel); }
.math-card ul { padding-left: 20px; }

/* lab intro */
.lab-intro {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end;
  padding: 26px 0; border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line);
}
.lab-intro h2 { font-size: clamp(34px,5vw,58px); line-height: 1;  font-weight: 650; }
.lab-intro p { color: var(--muted); }
.lab-intro strong { color: var(--ink); }

/* labs */
.lab-section { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 42px; align-items: start; }
.lab-section > .section-header { position: sticky; top: 94px; margin: 0; }
.lab-section .section-title { font-size: 28px; line-height: 1.08; }
.lab-section .section-desc { font-size: 13px; line-height: 1.7; }
.sim-panel {
  min-width: 0; padding: 20px; overflow: hidden;
  border: 1px solid var(--line); border-top: 3px solid var(--ink);
  border-radius: 0; background: var(--panel);
  box-shadow: 0 10px 28px var(--shadow-soft);
}
.sim-controls { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.control-group { min-width: 170px; flex: 1; }
.control-label { display: block; margin-bottom: 6px; color: var(--faint); font-family: var(--font-mono); font-size: 9px; font-weight: 700;  text-transform: uppercase; }
select, input[type="text"], input[type="number"] {
  width: 100%; min-height: 38px; padding: 7px 10px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 12px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
.comparison-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border: 1px solid var(--line); }
.comparison-column { min-width: 0; padding: 16px; border: 0 !important; border-right: 1px solid var(--line) !important; background: transparent !important; }
.comparison-column:last-child { border-right: 0 !important; }
.metric-badge { display: inline-flex; margin: 6px 0 10px; padding: 3px 6px; background: var(--bg-inset); border: 1px solid var(--line); border-radius: 3px; font-family: var(--font-mono); font-size: 10px; }
.text-rose { color: var(--rose); } .text-amber { color: var(--amber); } .text-emerald { color: var(--green); }
.canvas-container { position: relative; width: 100%; min-height: 430px; border: 1px solid var(--line); background: var(--canvas-bg); overflow: hidden; }
.canvas-container canvas { width: 100%; height: 430px; display: block; }
.canvas-overlay { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 8px 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 10px; pointer-events: none; }

/* generic cards / callouts */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 10px; }
.card { padding: 18px; border: 1px solid var(--line); background: var(--panel); }
.card-title { display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 700; }
.card p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.pill { display: inline-flex; align-items: center; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-mono); font-size: 9px; background: var(--panel); }
.analogy-box, .honesty-box { padding: 16px 18px; border: 1px solid var(--line); background: var(--panel); }
.analogy-box { border-left: 3px solid var(--blue); }
.honesty-box { border-left: 3px solid var(--amber); }
.analogy-box h4, .honesty-box h4 { margin-bottom: 6px; font-size: 13px; }
.analogy-box p, .honesty-box p { color: var(--muted); font-size: 13px; }

/* integration */
.integration-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 18px; }
.integration-card { border-top: 3px solid var(--ink); background: var(--panel); padding: 20px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.integration-card h3 { font-size: 16px; margin-bottom: 10px; }
pre { overflow-x: auto; padding: 14px; background: #171713; color: #ece9df; border-radius: 4px; font-size: 11px; line-height: 1.65; }
pre code { color: inherit; }
.tool-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 12px; }
.tool-table th, .tool-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tool-table th { color: var(--faint); font-family: var(--font-mono); font-size: 9px;  text-transform: uppercase; }
.tool-table td:first-child { font-family: var(--font-mono); color: var(--ink); white-space: nowrap; }
.integration-note { margin-top: 16px; color: var(--muted); font-size: 12px; }

/* evidence */
.evidence-stats { display: grid; grid-template-columns: repeat(4,1fr); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.evidence-stat { padding: 18px 16px; border-right: 1px solid var(--line); }
.evidence-stat:last-child { border-right: 0; }
.evidence-stat strong { display: block; font-size: 28px; line-height: 1;  }
.evidence-stat span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.finding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.finding { padding: 20px; border: 1px solid var(--line); background: var(--panel); }
.finding h3 { font-size: 15px; }
.finding p { margin-top: 9px; color: var(--muted); font-size: 13px; }
.finding.positive { border-top: 3px solid var(--green); }
.finding.caution { border-top: 3px solid var(--amber); }
.finding.null { border-top: 3px solid var(--rose); }
.finding.neutral { border-top: 3px solid var(--blue); }
.agent-result { margin-top: 28px; display: grid; grid-template-columns: 250px 1fr; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.agent-result .result-number { padding: 24px 22px 24px 0; }
.agent-result .result-number strong { display: block; font-size: 54px;  line-height: .95; }
.agent-result .result-number span { color: var(--muted); font-size: 11px; }
.agent-result .result-copy { padding: 24px 0 24px 28px; border-left: 1px solid var(--line); }
.agent-result .result-copy h3 { font-size: 19px; }
.agent-result .result-copy p { margin-top: 8px; color: var(--muted); font-size: 13px; }
details.evidence-detail { margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
details.evidence-detail summary { cursor: pointer; padding: 13px 0; font-weight: 700; font-size: 13px; }
details.evidence-detail > div { padding: 0 0 16px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th, .data-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { color: var(--faint); background: transparent; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;  }
.highlight-row { background: var(--tint-primary); }

/* api */
.api-section { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 42px; }
.api-section > .section-header { margin: 0; }
.api-section .section-title { font-size: 28px; }
.api-section .section-desc { font-size: 13px; }

/* status/citation */
.status-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; }
.status-list { border-top: 1px solid var(--line-strong); }
.status-row { display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.status-row span { color: var(--faint); font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;  }
.status-row strong, .status-row p { font-size: 13px; }
.status-row p { color: var(--muted); }
.citation-card { padding: 20px; border-top: 3px solid var(--ink); background: var(--panel); border-left:1px solid var(--line); border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.citation-card h3 { margin-bottom: 10px; font-size: 15px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 11px; }
.footer-grid strong { color: var(--ink); }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: repeat(2,1fr); }
  .hero-facts > *:nth-child(2) { border-right:0; }
  .hero-facts > *:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .lab-section, .api-section { grid-template-columns: 1fr; gap: 22px; }
  .lab-section > .section-header { position: static; }
  .comparison-grid { grid-template-columns: 1fr; }
  .comparison-column { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; }
  .comparison-column:last-child { border-bottom:0 !important; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1180px); }
  .navbar { padding: 0 14px; }
  .nav-repo { display: none; }
  .hero { padding-top: 54px; }
  .hero h1 { font-size: clamp(44px,14vw,64px); }
  .store-parts { grid-template-columns: repeat(2,1fr); }
  .store-parts span:last-child { grid-column: 1/-1; }
  .dual-context, .lab-intro, .integration-grid, .finding-grid, .status-grid, .change-example { grid-template-columns: 1fr; }
  .context-side, .context-side + .context-side { padding: 22px 0; border-left:0; border-bottom:1px solid var(--line); }
  .process-list li { grid-template-columns: 36px 1fr; }
  .process-list li p { grid-column: 2; }
  .evidence-stats { grid-template-columns: repeat(2,1fr); }
  .evidence-stat:nth-child(2) { border-right:0; }
  .evidence-stat:nth-child(-n+2) { border-bottom:1px solid var(--line); }
  .agent-result { grid-template-columns: 1fr; }
  .agent-result .result-copy { padding-left:0; border-left:0; border-top:1px solid var(--line); }
  .hero-facts { grid-template-columns:1fr; }
  .hero-facts > * { border-right:0; border-bottom:1px solid var(--line); }
  .hero-facts > *:last-child { border-bottom:0; }
}


/* Research workspace: readable controls, compact hierarchy, persistent wayfinding. */
body { min-height: 100dvh; overflow-x: clip; }
p { text-wrap: pretty; }
h1,h2,h3 { text-wrap: balance; }
.navbar { background: var(--paper); backdrop-filter: none; flex-wrap: wrap; gap: 12px; padding-block: 12px; }
.nav-brand { font-weight: 650; font-size: 14px; }
.brand-glyph { border-radius: 4px; width: 38px; height: 34px; color: var(--accent); border-color: var(--accent); }
.nav-links { gap: 2px; }
.nav-links a { min-height: 40px; display: flex; align-items: center; }
.nav-links a.is-active { color: var(--accent-2); background: var(--tint-primary); }
.nav-actions { margin-left: auto; }
.theme-toggle,.nav-repo { min-height: 40px; min-width: 40px; }
.hero { padding: 54px 0 28px; }
.hero-grid { grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 32px 48px; align-items: center; }
.hero h1 { font-size: clamp(34px,4.1vw,56px); line-height: 1.12; font-weight: 650; }
.hero-lede { font-size: 17px; max-width: 58ch; margin-top: 22px; }
.hero-meta { font-size: 12px; color: var(--muted); }
.hero-facts { margin-top: 10px; }
.hero-facts span,.output-grid span,.context-side .label,.status-row span { font-size: 11px; }
.hero-facts strong { font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.concept,.sim-panel { box-shadow: none; border-top: 2px solid var(--accent); }
.concept { border: 1px solid var(--line); border-top: 2px solid var(--accent); }
.query-card { background: var(--bg-inset); color: var(--ink); border-radius: 2px; }
.query-card span,.change-input small { color: inherit; opacity: 1; }
.store-title { flex-wrap: wrap; }
.store-parts span { font-size: 10px; }
.store-title code { color: var(--primary-ink); }
.hero-note { margin-top: 20px; color: var(--muted); font-size: 13px; padding-left: 12px; border-left: 2px solid var(--accent); }
main { padding: 56px 0 40px; }
section { margin-bottom: 64px; scroll-margin-top: 130px; }
.section-title,.rule-title h2,.lab-intro h2 { font-size: clamp(26px,3vw,36px); line-height: 1.2; }
.section-subtitle { font-size: 12px; }
.section-header { margin-bottom: 24px; }
.lab-section { grid-template-columns: 230px minmax(0,1fr); gap: 28px; }
.lab-section .section-title { font-size: 24px; }
.lab-section .section-desc { font-size: 14px; }
.control-label { font-family: var(--font-sans); font-size: 13px; text-transform: none; color: var(--muted); }
.control-group { min-width: min(230px,100%); }
select,input[type="text"],input[type="number"] { min-height: 44px; font-size: 14px; border-color: var(--line-strong); }
input[type="range"] { min-height: 32px; }
.btn { min-height: 44px; font-size: 14px; border-radius: 4px; }
.btn-primary:hover { background: var(--primary-strong); color: var(--text-on-accent); }
.fixture-note { padding: 10px 12px; margin-bottom: 18px; background: var(--bg-inset); color: var(--muted); font-size: 13px; border-left: 2px solid var(--accent); }
.data-table,.metric-badge,.evidence-stat,output { font-variant-numeric: tabular-nums; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.graph-text { margin-top: 16px; }
.graph-text ul { padding-left: 24px; font-size: 13px; }
.graph-text summary { cursor: pointer; padding: 10px 0; }
pre { max-width: 100%; }
@media(max-width: 980px) {
 .nav-links { display: flex; order: 3; width: 100%; overflow-x: auto; margin-left: 0; }
 .nav-links li { flex: 0 0 auto; }
 .hero-grid,.lab-section { grid-template-columns: minmax(0,1fr); }
 .hero { padding-top: 32px; }
 .hero-grid { gap: 28px; }
 .lab-section > .section-header { position: static; }
}
@media(max-width: 760px) {
 .nav-brand > span:last-child { max-width: 200px; font-size: 12px; }
 .navbar { gap: 6px; padding-top: 8px; padding-bottom: 6px; }
 .nav-links a { padding: 6px 12px; }
 .hero h1 { font-size: 36px; }
 .hero-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .hero-facts > * { padding: 12px 8px; }
 .hero-facts > *:nth-child(odd) { border-right: 1px solid var(--line); }
 .hero-facts > *:nth-child(3) { border-bottom: 0; }
 .sim-panel { padding: 14px; }
 .sim-controls { align-items: stretch; }
 .control-group { flex-basis: 100%; }
 .store-parts { grid-template-columns: repeat(3,minmax(0,1fr)); }
 .store-parts span:last-child { grid-column: auto; }
 .hero-actions .btn { flex: 1 1 auto; }
}

/* Permit grid items to shrink around long code and citation identifiers. */
.integration-grid > *, .status-grid > *, .status-row > *, .sim-panel div { min-width: 0; }
.integration-note, .status-row, .citation-card, .sim-panel p { overflow-wrap: anywhere; }
#simplexResultsTable > div { flex-wrap: wrap; gap: 8px; }
@media(max-width:760px) { .status-row { grid-template-columns: 100px minmax(0,1fr); } }

.metric-badge,.pill { font-size: 12px; }
@media(max-width:760px) { .sim-controls { flex-direction: column; } .sim-controls .control-group { width: 100%; } }
