/* ============================================================================
   helios docs · SOLAR ATLAS design system  (shared by every page)
   Warm ivory page · solar-amber accent (the kernel) · pine = evergreen/trust.
   Serif display (Iowan @600), sans body, mono labels.
   Dark = SCOPED SURFACE TREATMENT: the page stays ivory in both modes; only
   cards/figures/tables in the :is() union flip to slate.  Linked relatively by
   all pages; no CDN, no web fonts, no build step.
   NOTE(b): long-term migration — widgets should bind to var(--paper)/--margin/
   --ink so the union list stops growing; new widget classes must be added to
   the :is() union below until then.
   ============================================================================ */
:root {
  --display: 'Iowan Old Style', Palatino, 'Palatino Linotype', ui-serif, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Monaco, Consolas, monospace;
  --bg: #f8f5ee;
  --paper: #fffdf8;
  --margin: #f0e9da;
  --ink: #1d1812;
  --ink-2: #453d31;
  --ink-faint: #8c8172;
  --rule: #e5dcc9;
  --rule-strong: #cfc4ab;
  --accent: #b26205;          /* solar amber — the kernel */
  --accent-2: #8a4b04;
  --accent-tint: #f7e8cf;
  --code-bg: #221c13;
  --code-ink: #ede4d0;
  --code-comment: #8f8571;
  --ok: #3f6e54;              /* pine — evergreen / trusted */
  --ok-tint: #dde9e1;
  --warn: #a8741a;
  --warn-tint: #f2e7cc;
  --stop: #a8443a;            /* iron red — violations / stop */
  --stop-tint: #f1ddd9;
  --info: #3a5a78;            /* slate blue — info / viewer plane */
  --info-tint: #dde6ee;
  --seed: #7a8c3f;            /* seedling olive */
  --seed-tint: #e8ecd6;
  --shadow-1: 0 1px 2px rgba(29, 24, 18, 0.05);
  --shadow-2: 0 16px 36px -20px rgba(29, 24, 18, 0.22), 0 2px 6px rgba(29, 24, 18, 0.06);
}
/* Dark is a SCOPED SURFACE TREATMENT, not a page theme. */
html[data-theme='dark']
  :is(
    figure.fig,
    .callout,
    table.data,
    .map,
    .sim,
    .machine,
    .flow,
    .endpoint,
    .doc-card,
    .panel,
    .term,
    .promptbox,
    .statgrid .stat,
    .journey,
    .pipeline,
    .swatch
  ) {
  --paper: #221c13;
  --margin: #2d261b;
  --ink: #efe7d5;
  --ink-2: #cfc4ab;
  --ink-faint: #9b8f7b;
  --rule: #383021;
  --rule-strong: #4c4230;
  --accent-2: #e8a24a;
  --accent-tint: #3a2c14;
  --ok-tint: #1e2c24;
  --warn-tint: #322a16;
  --stop-tint: #321f1c;
  --info-tint: #1c2733;
  --seed-tint: #262b16;
  --code-bg: #110d07;
  color: var(--ink);
}
html[data-theme='dark'] .readout-box .ro {
  background: #0e0b06;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 88% -5%, rgba(178, 98, 5, 0.07), transparent 60%),
    radial-gradient(900px 500px at 5% 8%, rgba(63, 110, 84, 0.05), transparent 55%);
}
::selection { background: var(--accent-tint); color: var(--accent-2); }
.mono { font-family: var(--mono); }
.brand, .jump, .eyebrow, .marginalia, .label,
table.data thead th, .path, code, pre, .fig-num, .tag, .chip, .btn,
.switcher a, .pill, .kbd, .slider-row .top, .readout-box, .step-n, .crumb {
  font-family: var(--mono);
}

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 32px; gap: 20px;
}
.brand {
  display: flex; align-items: baseline; gap: 9px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
}
.brand a { color: inherit; text-decoration: none; display: flex; align-items: baseline; gap: 9px; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3b344, var(--accent));
  box-shadow: 0 0 0 3px var(--accent-tint);
  align-self: center;
}
.brand .title { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.switcher { display: flex; gap: 4px; }
.switcher a {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); text-decoration: none;
  padding: 5px 9px; border: 1px solid var(--rule); border-radius: 4px; transition: 0.15s;
}
.switcher a:hover { border-color: var(--accent); color: var(--accent); }
.switcher a[aria-current='page'] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.jump { display: flex; gap: 1px; flex-wrap: wrap; font-size: 11px; letter-spacing: 0.08em; }
.jump a {
  color: var(--ink-faint); text-decoration: none; padding: 6px 9px;
  border-radius: 3px; transition: 0.15s;
}
.jump a:hover, .jump a.active { color: var(--accent); background: var(--accent-tint); }
.icon-btn {
  background: transparent; border: 1px solid var(--rule); color: var(--ink);
  width: 32px; height: 32px; border-radius: 4px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: 0.15s; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.page {
  position: relative; z-index: 1;
  max-width: 1280px; margin: 0 auto; padding: 64px 32px 120px;
}

.crumb { font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 18px; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb span { opacity: 0.6; }

/* ── hero ── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px;
  align-items: end; padding-bottom: 40px;
  border-bottom: 1px solid var(--rule); margin-bottom: 28px;
}
.hero .eyebrow, .landing-hero .eyebrow, .post-head .eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px; font-family: var(--mono);
}
.hero .eyebrow::before, .landing-hero .eyebrow::before, .post-head .eyebrow::before {
  content: ''; width: 28px; height: 1px; background: var(--accent);
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 56px); line-height: 1.04;
  letter-spacing: -0.015em; font-weight: 600; margin: 0 0 22px;
}
.hero h1 em, .landing-hero h1 em, .post-head h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 560px; }
.hero-meta {
  padding-left: 22px; border-left: 1px solid var(--rule);
  font-size: 12px; line-height: 1.7; color: var(--ink-faint); font-family: var(--mono);
}
.hero-meta .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 0; border-bottom: 1px dotted var(--rule);
}
.hero-meta .row span:last-child { color: var(--ink); }

/* ── numbered chapter + asymmetric reading column ── */
.chapter {
  display: grid; grid-template-columns: minmax(0, 720px) 1fr; gap: 56px;
  margin: 0 auto 72px; scroll-margin-top: 80px;
}
.chapter-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.chapter-num {
  font-family: var(--mono); font-size: 13px; line-height: 1; font-weight: 600;
  letter-spacing: 0.02em; color: var(--accent-2);
  background: var(--margin); border: 1px solid var(--rule);
  padding: 5px 9px; border-radius: 4px;
}
.chapter-title {
  font-family: var(--display); font-size: 28px; line-height: 1.15;
  letter-spacing: -0.01em; font-weight: 600; margin: 0;
}
.chapter-summary {
  font-size: 16.5px; line-height: 1.55; color: var(--ink-2);
  margin: 0 0 30px; max-width: 620px; font-style: italic;
}
.marginalia {
  font-size: 11px; line-height: 1.7; color: var(--ink-faint);
  letter-spacing: 0.02em; padding-top: 60px; font-family: var(--mono);
}
.marginalia .label {
  color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 10px; margin: 22px 0 7px; display: block;
}
.marginalia .label:first-child { margin-top: 0; }
.marginalia ul { list-style: none; padding: 0; margin: 0; }
.marginalia li { padding: 4px 0; border-bottom: 1px dotted var(--rule); }
.marginalia p { margin: 0; }

.prose { max-width: 720px; }
.prose p { margin: 15px 0; }
.prose h3 {
  font-family: var(--display); font-size: 20px; letter-spacing: -0.006em;
  margin: 40px 0 10px; font-weight: 600;
}
.prose h4 {
  font-size: 12px; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-faint); margin: 28px 0 8px;
}
.prose a {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose strong { font-weight: 600; }

code {
  font-size: 0.88em; background: var(--margin);
  padding: 1px 6px; border-radius: 3px; border: 1px solid var(--rule);
}
.path {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--accent-2); background: var(--accent-tint);
  padding: 2px 7px; border-radius: 3px; border: 0; white-space: nowrap;
}
.path::before { content: '⌗'; font-size: 10px; opacity: 0.7; }
pre {
  background: var(--code-bg); color: var(--code-ink);
  padding: 18px 20px; border-radius: 7px; overflow-x: auto;
  font-size: 12.5px; line-height: 1.7; margin: 18px 0;
  border: 1px solid rgba(0, 0, 0, 0.25); position: relative;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
pre .c { color: var(--code-comment); }
pre .k { color: #e8a24a; }
pre .s { color: #a7bd84; }
pre .lbl {
  position: absolute; top: 0; right: 12px;
  background: var(--code-bg); color: var(--code-comment);
  padding: 2px 8px; border-radius: 0 0 3px 3px;
  font-size: 10px; letter-spacing: 0.1em; font-family: var(--mono);
}

.gl { border-bottom: 1px dotted var(--accent); cursor: help; position: relative; }
.gl:hover::after {
  content: attr(data-def);
  position: absolute; bottom: calc(100% + 8px); left: 0;
  background: var(--ink); color: var(--paper);
  padding: 10px 13px; border-radius: 5px;
  font-size: 11px; line-height: 1.5; width: 250px; z-index: 20;
  box-shadow: var(--shadow-2); font-family: var(--sans);
}
.gl:hover::before {
  content: ''; position: absolute; bottom: calc(100% + 3px); left: 8px;
  border: 5px solid transparent; border-top-color: var(--ink);
}

.callout {
  border-left: 3px solid var(--accent); background: var(--margin);
  padding: 14px 20px; margin: 22px 0; border-radius: 0 5px 5px 0;
}
.callout.note { border-color: var(--info); }
.callout.warn { border-color: var(--warn); }
.callout.ok { border-color: var(--ok); }
.callout.stop { border-color: var(--stop); }
.callout .label {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 5px; font-family: var(--mono);
}
.callout.note .label { color: var(--info); }
.callout.warn .label { color: var(--warn); }
.callout.ok .label { color: var(--ok); }
.callout.stop .label { color: var(--stop); }
.callout p { margin: 5px 0; font-size: 14.5px; }

table.data {
  width: 100%; border-collapse: collapse; font-size: 13px; margin: 22px 0;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; overflow: hidden;
}
table.data thead th {
  text-align: left; font-weight: 500; background: var(--margin);
  border-bottom: 1px solid var(--rule-strong);
  padding: 9px 13px; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}
table.data td { border-bottom: 1px solid var(--rule); padding: 9px 13px; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.mono, table.data td .path { font-family: var(--mono); }
table.data .yes { color: var(--ok); font-weight: 700; }
table.data .no { color: var(--stop); font-weight: 700; }
table.data tr.dim td { opacity: 0.32; }
table.data tr.lit td { background: var(--accent-tint); }

.tag, .chip, .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 20px; font-family: var(--mono);
}
.chip { border-radius: 4px; }
.tag.get { background: var(--ok-tint); color: var(--ok); }
.tag.post { background: var(--accent-tint); color: var(--accent-2); }
.tag.put { background: var(--warn-tint); color: var(--warn); }
.tag.delete { background: var(--stop-tint); color: var(--stop); }
.tag.int { background: var(--info-tint); color: var(--info); }
.pill.seed { background: var(--seed-tint); color: var(--seed); }
.pill.grow { background: var(--warn-tint); color: var(--warn); }
.pill.ever { background: var(--ok-tint); color: var(--ok); }

figure.fig {
  margin: 30px 0; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 8px;
  padding: 28px 28px 18px; box-shadow: var(--shadow-1); position: relative;
}
figure.fig svg { width: 100%; height: auto; display: block; }
figure.fig figcaption {
  display: flex; gap: 12px; margin-top: 16px; padding-top: 12px;
  border-top: 1px dotted var(--rule);
  font-size: 11px; line-height: 1.55; color: var(--ink-faint);
}
figure.fig .fig-num {
  color: var(--accent); letter-spacing: 0.1em; font-weight: 600;
  text-transform: uppercase; flex-shrink: 0; font-family: var(--mono);
}

footer.bottom {
  margin-top: 96px; padding: 40px 0 0;
  border-top: 1px solid var(--rule-strong);
  display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between;
  font-size: 12px; color: var(--ink-faint); font-family: var(--mono);
}
footer.bottom a { color: var(--accent); text-decoration: none; }
footer.bottom a:hover { text-decoration: underline; }
footer .set-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============================ WIDGET SHELLS ============================ */
.map, .sim, .machine, .flow, .journey, .pipeline {
  margin: 0 0 30px;
  background: linear-gradient(180deg, var(--paper), var(--margin));
  border: 1px solid var(--rule-strong); border-radius: 10px;
  padding: 30px; box-shadow: var(--shadow-2);
  position: relative; overflow: hidden;
}
.map::before, .sim::before, .machine::before, .flow::before, .journey::before, .pipeline::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #e8a24a, var(--ok));
}
.map .eyebrow, .sim .eyebrow, .machine .eyebrow, .flow .eyebrow, .journey .eyebrow, .pipeline .eyebrow {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 5px; font-family: var(--mono);
}
.map h2, .sim h2, .machine h2, .flow h2, .journey h2, .pipeline h2 {
  font-family: var(--display); font-size: 24px; margin: 0 0 3px; font-weight: 600;
}
.map .sub, .sim .sub, .machine .sub, .flow .sub, .journey .sub, .pipeline .sub {
  font-style: italic; color: var(--ink-faint); margin: 0 0 22px; font-size: 14px;
}
.hint {
  font-size: 11px; color: var(--ink-faint); margin-top: 12px;
  font-family: var(--mono); letter-spacing: 0.04em;
}
.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 4px;
  border: 1px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

/* clickable architecture map */
.map-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; align-items: start; }
.map-svg { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; }
.map-svg svg { width: 100%; height: auto; display: block; }
.node { cursor: pointer; }
.node rect { transition: 0.18s; }
.node:hover rect { stroke: var(--accent); stroke-width: 2; }
.node.active rect { stroke: var(--accent); stroke-width: 2.5; fill: var(--accent-tint); }
.node text { pointer-events: none; }
.node .nlabel { font-family: var(--mono); font-size: 12px; fill: var(--ink); font-weight: 600; }
.node .nsub { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-faint); }
.panel {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 8px; padding: 20px; min-height: 280px;
}
.panel .ptag {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-family: var(--mono);
}
.panel h3 { font-family: var(--display); font-size: 21px; margin: 6px 0 4px; font-weight: 600; }
.panel .pmeta { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); margin-bottom: 14px; }
.panel p { font-size: 14px; line-height: 1.6; margin: 0 0 14px; color: var(--ink-2); }
.panel .prow { display: flex; gap: 8px; font-size: 11.5px; padding: 6px 0; border-top: 1px dotted var(--rule); }
.panel .prow .pk {
  font-family: var(--mono); color: var(--ink-faint); min-width: 64px;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 10px; padding-top: 1px;
}
.panel .prow .pv { color: var(--ink-2); }

/* tabbed reference cards */
.endpoint { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; margin: 12px 0; overflow: hidden; }
.endpoint summary { list-style: none; cursor: pointer; padding: 13px 18px; display: flex; align-items: center; gap: 12px; transition: 0.15s; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint summary:hover { background: var(--margin); }
.endpoint summary .ep-path { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 600; }
.endpoint summary .ep-desc { font-size: 12.5px; color: var(--ink-faint); margin-left: auto; text-align: right; }
.endpoint[open] summary { border-bottom: 1px solid var(--rule); background: var(--margin); }
.endpoint .ep-body { padding: 4px 18px 18px; }
.tabs { display: flex; gap: 2px; margin: 14px 0 12px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 7px 12px; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); cursor: pointer;
  transition: 0.15s; margin-bottom: -1px; font-family: var(--mono);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpane { display: none; }
.tabpane.active { display: block; }
.tabpane table.data { margin: 0; }
.kbd {
  display: inline-block; font-size: 10px; padding: 1px 6px;
  border: 1px solid var(--rule-strong); border-bottom-width: 2px;
  border-radius: 4px; background: var(--margin);
}

/* sliders / readouts */
.sim-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; align-items: start; }
.sim-grid.left-rail { grid-template-columns: 280px 1fr; gap: 26px; }
.slider-row { margin: 14px 0; }
.slider-row .top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.slider-row .top .val { color: var(--accent-2); font-weight: 600; }
.slider-row input[type='range'] {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 3px; background: var(--rule-strong); border-radius: 2px; outline: none;
}
.slider-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  background: var(--accent); border: 2px solid var(--paper); border-radius: 50%; cursor: pointer;
}
.slider-row input[type='range']::-moz-range-thumb {
  width: 16px; height: 16px; background: var(--accent);
  border: 2px solid var(--paper); border-radius: 50%; cursor: pointer;
}
.presets { display: flex; gap: 6px; margin: 4px 0 10px; flex-wrap: wrap; }
.presets button {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 5px 9px; border: 1px solid var(--rule); border-radius: 4px;
  background: var(--paper); color: var(--ink-faint); cursor: pointer;
}
.presets button:hover { border-color: var(--accent); color: var(--accent); }
.readout-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.readout-box .ro { background: var(--ink); color: #f0e9da; border-radius: 6px; padding: 10px 12px; }
.readout-box .ro .k { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: #a59a86; }
.readout-box .ro .v { font-size: 18px; margin-top: 2px; }
.readout-box .ro.primary .v { color: #eda751; font-size: 22px; }
.verdict {
  margin-top: 12px; font-family: var(--mono); font-size: 12px;
  padding: 9px 12px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--paper);
}

/* stat grid (chapter openers) */
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.statgrid .stat {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  padding: 14px 16px; box-shadow: var(--shadow-1);
}
.statgrid .stat .v { font-family: var(--display); font-size: 30px; font-weight: 600; color: var(--accent-2); line-height: 1.1; }
.statgrid .stat .k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 4px;
}

/* copy-as-prompt block */
.promptbox {
  background: var(--paper); border: 1px solid var(--rule-strong);
  border-radius: 10px; overflow: hidden; margin: 24px 0; box-shadow: var(--shadow-2);
}
.promptbox .pb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: var(--margin); border-bottom: 1px solid var(--rule);
}
.promptbox .pb-head .t {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
.promptbox .pb-head .btn { margin-left: auto; }
.promptbox pre { margin: 0; border: 0; border-radius: 0; max-height: 520px; overflow: auto; }

/* terminal (typing demo) */
.term {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; border: 1px solid rgba(0,0,0,0.3);
  overflow: hidden; box-shadow: var(--shadow-2); font-family: var(--mono);
}
.term .term-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.term .term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #5c5344; display: block; }
.term .term-bar i:nth-child(1) { background: #a8443a; }
.term .term-bar i:nth-child(2) { background: #a8741a; }
.term .term-bar i:nth-child(3) { background: #3f6e54; }
.term .term-bar .tt { font-size: 10px; letter-spacing: 0.12em; color: var(--code-comment); margin-left: 8px; }
.term .term-body { padding: 18px 20px; font-size: 12.5px; line-height: 1.75; min-height: 220px; white-space: pre-wrap; }
.term .p1 { color: #e8a24a; }
.term .p2 { color: #a7bd84; }
.term .dim { color: var(--code-comment); }
.caret { display: inline-block; width: 7px; height: 14px; background: #eda751; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* shared keyframes for animated SVG figures */
@keyframes dashflow { to { stroke-dashoffset: -24; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulseGlow { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
.flowline { stroke-dasharray: 6 6; animation: dashflow 1.2s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .flowline, .caret { animation: none; }
  * { animation-duration: 0.001s !important; }
}

/* ── landing index ── */
.landing-hero { padding: 28px 0 42px; border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.landing-hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 68px); line-height: 1.02;
  letter-spacing: -0.02em; font-weight: 600; margin: 0 0 24px; max-width: 14ch;
}
.landing-hero .lede { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 620px; }
.toc-group { margin-bottom: 56px; }
.toc-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; }
.toc-head h2 { font-family: var(--display); font-size: 24px; font-weight: 600; margin: 0; }
.toc-head .pkg {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--accent-2); background: var(--accent-tint);
  padding: 3px 9px; border-radius: 4px;
}
.toc-head .desc { font-size: 13px; color: var(--ink-faint); margin-left: auto; font-style: italic; }
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 18px; }
.doc-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 10px;
  padding: 22px 22px 20px; box-shadow: var(--shadow-1);
  transition: 0.18s; position: relative; overflow: hidden;
}
.doc-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: var(--accent); opacity: 0; transition: 0.18s;
}
.doc-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.doc-card:hover::before { opacity: 1; }
.doc-card .cn { font-family: var(--mono); font-size: 12px; color: var(--accent-2); font-weight: 600; letter-spacing: 0.04em; }
.doc-card h3 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 6px 0 8px; }
.doc-card p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 14px; }
.doc-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-card .tags .chip { background: var(--margin); color: var(--ink-faint); font-size: 9.5px; }
.doc-card .widget {
  position: absolute; top: 20px; right: 20px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent-tint); border-radius: 20px; padding: 3px 9px;
}

/* blog post chrome */
.post-head { max-width: 760px; margin: 0 auto 34px; }
.post-head h1 {
  font-family: var(--display);
  font-size: clamp(36px, 5.4vw, 60px); line-height: 1.05;
  letter-spacing: -0.018em; font-weight: 600; margin: 0 0 18px;
}
.post-head .lede { font-size: 18.5px; line-height: 1.6; color: var(--ink-2); font-style: italic; }
.post-head .byline {
  display: flex; gap: 14px; margin-top: 18px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.post-body { max-width: 760px; margin: 0 auto; }
.post-body > .prose { max-width: none; }
.post-section-num {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: 0.2em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; margin: 56px 0 8px;
}
.post-section-num::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

@media (max-width: 980px) {
  .jump { display: none; }
  .hero, .chapter, .map-grid, .sim-grid, .sim-grid.left-rail, .cards-grid, .statgrid {
    grid-template-columns: 1fr; gap: 24px;
  }
  .statgrid { grid-template-columns: repeat(2, 1fr); }
  .hero-meta, .marginalia { border-left: 0; border-top: 1px solid var(--rule); padding: 16px 0 0; }
  .marginalia { padding-top: 16px; }
  .readout-box { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { padding: 40px 18px 80px; }
  .switcher a { padding: 5px 7px; }
  .statgrid { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .hint, .icon-btn, .actions, .presets { display: none; }
  body { background: #fff; font-size: 11pt; }
  .chapter, .map, .sim, .machine, .flow, .journey, .pipeline, .endpoint, .doc-card, figure.fig {
    page-break-inside: avoid;
  }
  .endpoint .ep-body { display: block !important; }
}
