/* ==========================================================================
   MMBU intelligence dashboard - styles
   Identity: a glass slide under brightfield (light) and a fluorescence
   darkroom / radiograph film (dark). Hematoxylin violet is the structural
   ink, eosin pink is the accent. Every colour is a token; see CONTRACT.md.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  color-scheme: light;

  /* surfaces and ink */
  --bg: #f2f1f7;
  --surface: #fbfbfe;
  --surface-2: #e9e7f2;
  --ink: #1a1530;
  --ink-2: #474260;
  --ink-3: #645f7d;
  --rule: #d9d6e6;
  --rule-strong: #b7b3cb;

  /* brand */
  --accent: #b3225b;          /* eosin */
  --accent-2: #4a3aa7;        /* hematoxylin */
  --accent-wash: rgba(179, 34, 91, 0.09);
  --accent-2-wash: rgba(74, 58, 167, 0.09);
  --on-accent: #ffffff;
  --focus: #4a3aa7;

  /* chart series: fixed order, validated for both themes (never reorder) */
  --series-1: #5a45c2;        /* violet */
  --series-2: #d6457f;        /* pink */
  --series-3: #c27c00;        /* amber */
  --series-4: #0f958f;        /* teal */
  --series-5: #2a78d6;        /* blue */
  --series-6: #c2512a;        /* rust */
  --mark-muted: #b4b0c9;      /* de-emphasised marks */
  --seq-lo: #dcd6f6;          /* sequential ramp, low end */
  --seq-hi: #2e1f80;          /* sequential ramp, high end */
  --grid: #e3e0ee;
  --axis: #b7b3cb;

  /* status */
  --ok: #1a7f37;
  --warn: #8a5a00;
  --bad: #b3372c;

  /* callout kinds */
  --k-aha: #8a5a00;
  --k-pitfall: #b3372c;
  --k-fun: #b3225b;
  --k-analogy: #0b6f6b;
  --k-rec: #4a3aa7;

  /* hero specimen */
  --stain-bg: #f5d5e2;
  --stain-cyto: #e58fb3;
  --stain-nuclei: #47298f;
  --stain-lumen: #fdf4f8;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-edge: rgba(74, 58, 167, 0.28);

  /* type */
  --font-display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-ui: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.125rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  --fs-hero: clamp(2.5rem, 1.1rem + 6.4vw, 5.4rem);

  /* space and shape */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --gutter: 16px;
  --radius: 10px;
  --radius-sm: 6px;
  --measure: 42rem;
  --measure-wide: 66rem;
  --topbar-h: 56px;
  --sidebar-w: 272px;
  --shadow: 0 1px 2px rgba(26, 21, 48, 0.06), 0 8px 24px rgba(26, 21, 48, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070c16;
    --surface: #0f1726;
    --surface-2: #182236;
    --ink: #e8edf9;
    --ink-2: #b4bdd2;
    --ink-3: #8d97b0;
    --rule: #212d45;
    --rule-strong: #384863;
    --accent: #ff7aad;
    --accent-2: #7fd6ea;
    --accent-wash: rgba(255, 122, 173, 0.12);
    --accent-2-wash: rgba(127, 214, 234, 0.10);
    --on-accent: #070c16;
    --focus: #7fd6ea;
    --series-1: #8f7df0;
    --series-2: #e0558e;
    --series-3: #c98500;
    --series-4: #1fa39c;
    --series-5: #3987e5;
    --series-6: #d9673a;
    --mark-muted: #3d4a66;
    --seq-lo: #262058;
    --seq-hi: #beb3ff;
    --grid: #1a2438;
    --axis: #384863;
    --ok: #4cc26a;
    --warn: #f0b547;
    --bad: #ff8a7a;
    --k-aha: #f0b547;
    --k-pitfall: #ff8a7a;
    --k-fun: #ff7aad;
    --k-analogy: #5fd4cc;
    --k-rec: #a99bff;
    --stain-bg: #04070e;
    --stain-cyto: #7a1f52;
    --stain-nuclei: #58d6f0;
    --stain-lumen: #010308;
    --glass: rgba(127, 214, 234, 0.05);
    --glass-edge: rgba(127, 214, 234, 0.30);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070c16;
  --surface: #0f1726;
  --surface-2: #182236;
  --ink: #e8edf9;
  --ink-2: #b4bdd2;
  --ink-3: #8d97b0;
  --rule: #212d45;
  --rule-strong: #384863;
  --accent: #ff7aad;
  --accent-2: #7fd6ea;
  --accent-wash: rgba(255, 122, 173, 0.12);
  --accent-2-wash: rgba(127, 214, 234, 0.10);
  --on-accent: #070c16;
  --focus: #7fd6ea;
  --series-1: #8f7df0;
  --series-2: #e0558e;
  --series-3: #c98500;
  --series-4: #1fa39c;
  --series-5: #3987e5;
  --series-6: #d9673a;
  --mark-muted: #3d4a66;
  --seq-lo: #262058;
  --seq-hi: #beb3ff;
  --grid: #1a2438;
  --axis: #384863;
  --ok: #4cc26a;
  --warn: #f0b547;
  --bad: #ff8a7a;
  --k-aha: #f0b547;
  --k-pitfall: #ff8a7a;
  --k-fun: #ff7aad;
  --k-analogy: #5fd4cc;
  --k-rec: #a99bff;
  --stain-bg: #04070e;
  --stain-cyto: #7a1f52;
  --stain-nuclei: #58d6f0;
  --stain-lumen: #010308;
  --glass: rgba(127, 214, 234, 0.05);
  --glass-edge: rgba(127, 214, 234, 0.30);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* ---------- 2. Base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.62;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; text-wrap: balance; font-variation-settings: "wdth" 88; letter-spacing: -0.015em; }
p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-size: 0.9em; letter-spacing: -0.01em; }
.skip-link { position: absolute; left: var(--gutter); top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-sm); font-family: var(--font-ui); font-size: var(--fs-sm); }
.skip-link:focus { top: 8px; }
.noscript { margin: var(--sp-5) var(--gutter); padding: var(--sp-4); border: 1.5px solid var(--bad); border-radius: var(--radius); font-family: var(--font-ui); }

/* ---------- 3. Top bar --------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: var(--sp-2); text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark { align-self: center; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--accent) 0 38%, var(--accent-2) 40% 100%); flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; font-variation-settings: "wdth" 82; }
.brand-sub { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-controls { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.topbar-link { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--radius-sm); min-height: 40px; display: inline-flex; align-items: center; white-space: nowrap; }
.topbar-link:hover { background: var(--surface-2); color: var(--ink); }
.topbar-link[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
@media (max-width: 480px) { .topbar-link { padding: 8px 6px; } .topbar-link-more, .brand-sub { display: none; } .topbar { gap: var(--sp-2); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg-btn { border: 0; background: transparent; font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 500; padding: 5px 12px; border-radius: 999px; color: var(--ink-2); min-height: 32px; }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress-bar { height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- 4. Layout and sidebar ---------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); }
main { min-width: 0; padding: 0 var(--gutter) var(--sp-8); }
main:focus-visible { outline: none; }
.sidebar {
  position: fixed; z-index: 60; top: 0; bottom: 0; left: 0;
  width: min(86vw, 320px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--rule);
  transform: translateX(-102%);
  visibility: hidden;
  transition: transform 0.28s var(--ease), visibility 0s linear 0.28s;
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar.is-open { transform: none; visibility: visible; transition: transform 0.28s var(--ease), visibility 0s; box-shadow: var(--shadow); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-3) var(--sp-2) var(--sp-5); }
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(7, 12, 22, 0.5); }
.backdrop[hidden] { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0 var(--sp-3) var(--sp-4); }
.nav-link {
  display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); align-items: baseline; gap: var(--sp-1);
  padding: 9px var(--sp-3); border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none;
  font-family: var(--font-ui); font-size: 0.95rem; line-height: 1.25;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-num { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.nav-link.is-active { color: var(--ink); font-weight: 650; background: var(--accent-wash); }
.nav-link.is-active .nav-num { color: var(--accent); }
.nav-link.is-error .nav-title { color: var(--bad); }
.sidebar-foot { margin-top: auto; padding: var(--sp-4) var(--sp-5) var(--sp-5); border-top: 1px solid var(--rule); display: grid; gap: var(--sp-2); font-family: var(--font-ui); font-size: var(--fs-sm); }
.sidebar-foot a { color: var(--ink-2); }
.sidebar-foot a:hover { color: var(--accent); }

@media (min-width: 1000px) {
  :root { --gutter: 40px; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: var(--topbar-h); z-index: 1;
    width: auto; height: calc(100vh - var(--topbar-h));
    transform: none; visibility: visible; transition: none;
    background: transparent;
  }
  .sidebar.is-open { box-shadow: none; }
  .sidebar-head { padding-top: var(--sp-5); }
  .sidebar-close, .nav-toggle { display: none; }
  .backdrop { display: none; }
}

/* ---------- 5. Hero ------------------------------------------------------ */
.hero { padding: var(--sp-7) 0 var(--sp-7); max-width: var(--measure-wide); }
.kicker { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--sp-3); }
.kicker .sep { color: var(--accent); padding: 0 0.2em; }
.hero h1 { font-size: var(--fs-hero); font-weight: 800; line-height: 0.98; letter-spacing: -0.028em; font-variation-settings: "wdth" 80; max-width: 15ch; margin-bottom: var(--sp-5); }
.hero h1 em { font-family: var(--font-body); font-style: italic; font-weight: 500; letter-spacing: -0.02em; color: var(--accent); }
.lede { font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); max-width: var(--measure); margin-bottom: var(--sp-6); }

/* the specimen slide: frosted label on the left, cover glass on the right */
.slide {
  margin: 0 0 var(--sp-6);
  display: grid; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--glass-edge); border-radius: 14px;
  background: var(--glass);
  overflow: hidden;
}
.slide-label { padding: var(--sp-5); background: var(--surface); border-bottom: 1px dashed var(--glass-edge); font-family: var(--font-mono); font-size: var(--fs-sm); }
.slide-label-head { font-size: var(--fs-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--sp-3); }
.slide-fields { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px var(--sp-4); }
.slide-fields li { padding: 5px 0; border-bottom: 1px solid var(--rule); color: var(--ink); }
.slide-label-foot { margin: 0; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.slide-glass { padding: var(--sp-5); display: grid; place-items: center; }
.field { position: relative; width: min(100%, 340px); aspect-ratio: 1; }
.field canvas { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 1px var(--glass-edge), 0 0 0 10px var(--bg), 0 0 0 11px var(--rule); }
.field-reticle { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.field-reticle path { stroke: var(--ink); stroke-width: 0.5; opacity: 0.55; fill: none; }
.field-box { fill: none; stroke: var(--surface); stroke-width: 1.1; paint-order: stroke; filter: drop-shadow(0 0 0.6px var(--ink)); }
.field-tag { position: absolute; left: 26%; top: 29%; transform: translateY(-100%); background: var(--ink); color: var(--bg); font-family: var(--font-mono); font-size: 0.68rem; padding: 2px 6px; border-radius: 3px 3px 3px 0; white-space: nowrap; }
.slide figcaption { grid-column: 1 / -1; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--glass-edge); background: var(--surface); font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45; }
@media (min-width: 720px) {
  .slide { grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr); }
  .slide-label { border-bottom: 0; border-right: 1px dashed var(--glass-edge); display: flex; flex-direction: column; }
  .slide-fields { grid-template-columns: minmax(0, 1fr); }
  .slide-label-foot { margin-top: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .field.is-focusing canvas { animation: field-focus 1.4s var(--ease) both; }
  @keyframes field-focus { from { filter: blur(9px) saturate(0.6); } to { filter: none; } }
}

/* live scoring strip */
.scorer { border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); padding: var(--sp-5); margin-bottom: var(--sp-6); }
.scorer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2) var(--sp-5); margin-bottom: var(--sp-4); }
.scorer-head .kicker { margin: 0; }
.scorer-formula { margin: 0; color: var(--ink); font-size: var(--fs-sm); }
.scorer-body { display: grid; gap: var(--sp-3); }
.scorer-row { display: grid; grid-template-columns: minmax(0, 1fr) 3ch; grid-template-areas: "name out" "range range"; align-items: center; gap: var(--sp-1) var(--sp-3); font-family: var(--font-ui); font-size: var(--fs-sm); }
.scorer-name { grid-area: name; color: var(--ink-2); }
.scorer-row output { grid-area: out; text-align: right; }
.scorer-row input[type="range"] { grid-area: range; width: 100%; accent-color: var(--accent-2); min-height: 28px; margin: 0; }
#scorer-c { accent-color: var(--accent); }
.scorer-result { margin-top: var(--sp-2); }
.scorer-result p { margin: var(--sp-2) 0 0; font-family: var(--font-ui); }
.scorer-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.scorer-bar span { display: block; height: 100%; width: 0; }
.scorer-bar-t { background: var(--accent-2); }
.scorer-bar-c { background: var(--accent); }
.scorer-value { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.scorer-note { color: var(--ink-3); font-size: var(--fs-sm); }
.scorer-foot { margin: var(--sp-3) 0 0; font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--ink-3); }
@media (min-width: 720px) {
  .scorer-row { grid-template-columns: 9.5rem minmax(0, 1fr) 3ch; grid-template-areas: "name range out"; }
}

.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
.track { padding: var(--sp-4) var(--sp-5); border: 1px solid var(--rule); border-radius: var(--radius); font-family: var(--font-ui); font-size: 0.98rem; line-height: 1.45; color: var(--ink-2); }
.track p { margin: 0; }
.track-name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--ink); margin-bottom: var(--sp-2) !important; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); line-height: 1.15; }
.track-no { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); flex-basis: 100%; }
.track--ours { border-color: var(--accent); background: var(--accent-wash); }
@media (min-width: 860px) { .tracks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- 6. Chapters -------------------------------------------------- */
.sections { max-width: var(--measure-wide); }
.chapter { padding: var(--sp-7) 0 var(--sp-6); }
.chapter-head { margin-bottom: var(--sp-6); padding-top: var(--sp-5); position: relative; }
/* stage-micrometer rule: one long tick per ten short ones */
.chapter-head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px;
  background:
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 80px) 0 0 / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 8px) 0 0 / 100% 4px no-repeat;
  border-top: 1px solid var(--rule-strong);
}
.chapter-label { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.chapter-label .kicker { margin: 0; }
.chapter-num { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; color: var(--on-accent); background: var(--accent); padding: 2px 7px; border-radius: 3px; letter-spacing: 0.04em; }
.chapter-head h2 { font-size: var(--fs-xl); font-weight: 750; max-width: 24ch; }
.chapter-summary { margin: var(--sp-3) 0 0; max-width: var(--measure); font-size: var(--fs-md); line-height: 1.45; color: var(--ink-2); }
.chapter-body > * { margin-top: 0; margin-bottom: var(--sp-5); }
.chapter-body > :last-child { margin-bottom: 0; }
.chapter-body > .prose, .chapter-body > p, .chapter-body > .callout, .chapter-body > .sources, .chapter-body > h3, .chapter-body > h4 { max-width: var(--measure); }
.chapter-body > h3 { font-size: var(--fs-lg); font-weight: 700; margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.chapter-body > h4 { font-size: var(--fs-md); font-weight: 650; margin-top: var(--sp-5); margin-bottom: var(--sp-2); }

/* depth toggle */
body[data-depth="story"] .expert-only { display: none !important; }
body[data-depth="expert"] .story-only { display: none !important; }
body[data-depth="expert"] .expert-only.expert-mark { border-left: 2px solid var(--accent-2); padding-left: var(--sp-4); }

/* ---------- 7. Prose ----------------------------------------------------- */
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h3 { font-size: var(--fs-lg); font-weight: 700; margin: var(--sp-6) 0 var(--sp-3); }
.prose h4 { font-size: var(--fs-md); font-weight: 650; margin: var(--sp-5) 0 var(--sp-2); }
.prose ul, .prose ol { margin: 0 0 var(--sp-4); padding-left: 1.3em; }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--accent); font-family: var(--font-mono); font-size: 0.85em; }
.prose strong { font-weight: 650; }
.prose blockquote { margin: var(--sp-5) 0; padding: 0 0 0 var(--sp-5); border-left: 2px solid var(--accent); font-size: var(--fs-md); font-style: italic; color: var(--ink-2); }
.prose code, code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre, pre { font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.5; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: var(--sp-4); overflow-x: auto; margin: 0 0 var(--sp-4); }
.prose pre code, pre code { background: none; padding: 0; font-size: inherit; }
.prose hr, .divider { border: 0; border-top: 1px solid var(--rule); margin: var(--sp-6) 0; }
.lead { font-size: var(--fs-md); line-height: 1.5; color: var(--ink-2); }
.small { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--ink-3); }
.eyebrow { font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 650; color: var(--accent); margin: 0 0 var(--sp-1); }

/* glossary terms */
[data-term] { text-decoration: underline dotted var(--accent-2); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; cursor: help; border-radius: 2px; }
[data-term]:hover, [data-term][aria-expanded="true"] { background: var(--accent-2-wash); }
.glossary-pop {
  position: absolute; z-index: 80; width: min(320px, calc(100vw - 24px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.45;
}
.glossary-pop[hidden] { display: none; }
.glossary-pop-term { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 var(--sp-1); }
.glossary-pop-def { margin: 0; }
.glossary-pop-more { margin: var(--sp-2) 0 0; color: var(--ink-3); }

/* ---------- 8. Grids, cards, figures ------------------------------------- */
.grid-2, .grid-3, .grid-auto { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-5); min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); font-family: var(--font-ui); font-size: 0.98rem; line-height: 1.5; }
.card .kicker { margin: 0; }
.card-title { font-size: var(--fs-md); font-weight: 700; }
.card-body { color: var(--ink-2); }
.card-body > :last-child { margin-bottom: 0; }
.card-foot { margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--rule); font-size: var(--fs-sm); color: var(--ink-3); }
.card--accent { border-color: var(--accent); background: var(--accent-wash); }
.card--quiet { background: transparent; }

.figure { margin: 0 0 var(--sp-5); min-width: 0; }
.figure-body { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-4); min-width: 0; overflow: hidden; }
.figure--bare .figure-body { background: transparent; border: 0; padding: 0; border-radius: 0; }
.figure figcaption, .figure > .figcaption { margin-top: var(--sp-2); font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }
.figure figcaption .figure-source { color: var(--ink-3); }
.figure figcaption strong { color: var(--ink); font-weight: 650; }

/* ---------- 9. Callouts: drawn like a detection box with a class label ---- */
.callout { --k: var(--k-rec); position: relative; margin: var(--sp-6) 0 var(--sp-5); padding: var(--sp-5) var(--sp-5) var(--sp-4); border: 1.5px solid var(--k); border-radius: 2px var(--radius-sm) var(--radius-sm) var(--radius-sm); background: color-mix(in srgb, var(--k) 6%, transparent); font-family: var(--font-ui); font-size: 1rem; line-height: 1.5; }
.callout-label { position: absolute; left: -1.5px; top: 0; transform: translateY(-100%); background: var(--k); color: var(--bg); font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px 3px 0 0; }
.callout-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-2); }
.callout-body > :last-child { margin-bottom: 0; }
.callout--aha { --k: var(--k-aha); }
.callout--pitfall { --k: var(--k-pitfall); }
.callout--fun { --k: var(--k-fun); }
.callout--analogy { --k: var(--k-analogy); }
.callout--rec { --k: var(--k-rec); }

/* ---------- 10. Pills, badges, stats ------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.03em; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-2); background: var(--surface); white-space: nowrap; vertical-align: middle; }
.pill--accent { border-color: var(--accent); color: var(--accent); background: transparent; }
.pill--violet { border-color: var(--accent-2); color: var(--accent-2); background: transparent; }
.pill--ok { border-color: var(--ok); color: var(--ok); background: transparent; }
.pill--warn { border-color: var(--warn); color: var(--warn); background: transparent; }
.pill--bad { border-color: var(--bad); color: var(--bad); background: transparent; }
.pill-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; padding: 3px 7px 3px 5px; border-radius: 3px; vertical-align: middle; white-space: nowrap; }
.badge::before { content: ""; width: 9px; height: 9px; flex: none; }
.badge--verified { color: var(--ok); border: 1px solid var(--ok); }
.badge--verified::before { border-radius: 50%; background: var(--ok); }
.badge--unverified { color: var(--warn); border: 1px dashed var(--warn); }
.badge--unverified::before { border: 1.5px solid var(--warn); transform: rotate(45deg) scale(0.8); }

.stat-row { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--sp-4); min-width: 0; font-family: var(--font-ui); display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.3; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variation-settings: "wdth" 86; color: var(--ink); }
.stat-unit { font-size: 0.5em; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 0.15em; }
.stat-note { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.35; }
.stat-meta { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); }
.stat-meta a { color: var(--ink-3); }

/* ---------- 11. Tables --------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
.table-wrap table, table.data { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.4; }
.table-wrap caption { caption-side: top; text-align: left; padding: var(--sp-3) var(--sp-4); font-weight: 650; color: var(--ink); border-bottom: 1px solid var(--rule); }
.table-wrap th, .table-wrap td { padding: 10px var(--sp-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table-wrap thead th { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; background: var(--surface); }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }
.table-wrap tbody th { font-weight: 650; }
.table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* key-value list */
.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; font-family: var(--font-ui); font-size: 0.98rem; }
.kv dt { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); padding-top: var(--sp-3); }
.kv dd { margin: 0; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--rule); }
@media (min-width: 560px) {
  .kv { grid-template-columns: 11rem minmax(0, 1fr); }
  .kv dt, .kv dd { padding: var(--sp-3) 0; border-bottom: 1px solid var(--rule); }
}

/* ---------- 12. Tabs ----------------------------------------------------- */
.tabs { min-width: 0; }
.tablist { display: flex; gap: var(--sp-1); overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--rule-strong); scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: transparent; padding: 10px var(--sp-4); min-height: 44px; font-family: var(--font-ui); font-size: 0.98rem; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.tab:focus-visible { outline-offset: -3px; }
.tabpanel { padding-top: var(--sp-5); }
.tabpanel[hidden] { display: none; }
.tabpanel > :last-child { margin-bottom: 0; }

/* ---------- 13. Stepper -------------------------------------------------- */
.stepper { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); min-width: 0; overflow: hidden; }
.stepper-stage { padding: var(--sp-4); border-bottom: 1px solid var(--rule); min-width: 0; }
.stepper-stage:empty { display: none; }
.stepper-panel { padding: var(--sp-5); font-family: var(--font-ui); font-size: 1rem; line-height: 1.5; min-height: 8rem; }
.stepper-count { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--sp-2); }
.stepper-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-2); }
.stepper-body > :last-child { margin-bottom: 0; }
.stepper-controls { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--rule); }
.stepper-dots { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 auto; padding: 0; list-style: none; }
.stepper-dot { width: 24px; height: 24px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.stepper-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rule-strong); }
.stepper-dot[aria-current="step"]::before { background: var(--accent); width: 10px; height: 10px; }
/* scrolly variant: stage sticks while the steps scroll past */
.stepper--scrolly { display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; border: 0; background: transparent; border-radius: 0; }
.stepper--scrolly .stepper-stage { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 2; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.stepper--scrolly .stepper-steps { display: grid; gap: var(--sp-4); padding: var(--sp-4) 0; }
.stepper-step { padding: var(--sp-5); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); font-family: var(--font-ui); font-size: 1rem; line-height: 1.5; opacity: 0.55; transition: opacity 0.3s, border-color 0.3s; }
.stepper-step.is-active { opacity: 1; border-color: var(--accent); }
.stepper--scrolly .stepper-controls { position: sticky; bottom: 8px; z-index: 2; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; width: fit-content; margin: 0 auto; padding: 4px; }
@media (min-width: 900px) {
  .stepper--scrolly { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
  .stepper--scrolly .stepper-stage { grid-column: 1; grid-row: 1; }
  .stepper--scrolly .stepper-steps { grid-column: 2; grid-row: 1 / span 2; padding: 0 0 20vh; gap: 24vh; }
  .stepper--scrolly .stepper-steps > :first-child { margin-top: 4vh; }
  .stepper--scrolly .stepper-controls { grid-column: 1; grid-row: 2; position: sticky; top: auto; bottom: 16px; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- 14. Timeline ------------------------------------------------- */
.timeline-wrap { min-width: 0; }
.timeline-strip { margin-bottom: var(--sp-4); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; font-family: var(--font-ui); }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--rule-strong); }
.timeline-item { --dot: var(--series-1); position: relative; padding: 0 0 var(--sp-5) 28px; scroll-margin-top: calc(var(--topbar-h) + 24px); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 0; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--bg); }
.timeline-date { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.05em; color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.timeline-label { font-size: 1.05rem; font-weight: 650; line-height: 1.3; margin: 2px 0; color: var(--ink); }
.timeline-detail { font-size: 0.97rem; line-height: 1.5; color: var(--ink-2); margin: 0; max-width: var(--measure); }
.timeline-item.is-flash .timeline-label { background: var(--accent-wash); box-shadow: 0 0 0 4px var(--accent-wash); border-radius: 2px; }
@media (min-width: 720px) {
  .timeline::before { left: calc(6.5rem + 5px); }
  .timeline-item { padding-left: calc(6.5rem + 30px); }
  .timeline-item::before { left: 6.5rem; }
  .timeline-date { position: absolute; left: 0; top: 3px; width: 5.75rem; justify-content: flex-end; text-align: right; }
}

/* ---------- 15. Charts --------------------------------------------------- */
.chart { min-width: 0; font-family: var(--font-ui); }
.chart-head { margin-bottom: var(--sp-3); }
.chart-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; line-height: 1.25; margin: 0; color: var(--ink); }
.chart-subtitle { font-size: var(--fs-sm); color: var(--ink-2); margin: 2px 0 0; line-height: 1.4; }
.chart-plot { position: relative; min-width: 0; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-plot svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.chart text { font-family: var(--font-ui); font-size: 12px; fill: var(--ink-3); }
.chart .tick-label { font-variant-numeric: tabular-nums; }
.chart .axis-label { fill: var(--ink-2); font-size: 12px; }
.chart .cat-label { fill: var(--ink); font-size: 13px; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .direct-label { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .point-label { fill: var(--ink-2); font-size: 11.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ref-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ref-label { fill: var(--ink-3); font-size: 11px; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.chart .series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { opacity: 0.1; stroke: none; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .bar-hit, .chart .hit { fill: transparent; }
.chart .bar-row:focus-visible { outline: none; }
.chart .bar-row:focus-visible .bar-hit, .chart .bar-row.is-hover .bar-hit { fill: var(--accent-2-wash); }
.chart .bar-row:focus-visible .bar-hit { stroke: var(--focus); stroke-width: 2; }
.chart .dot.is-hover { stroke: var(--ink); }
.chart-empty { padding: var(--sp-4); border: 1px dashed var(--rule-strong); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); list-style: none; margin: 0 0 var(--sp-3); padding: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 14px; height: 10px; border-radius: 2px; background: var(--key); flex: none; }
.legend-key--line { height: 2px; border-radius: 1px; }
.legend-key--dot { width: 10px; border-radius: 50%; }
.chart-data { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.chart-data > summary { cursor: pointer; color: var(--ink-3); width: fit-content; padding: 4px 0; font-family: var(--font-ui); }
.chart-data > summary:hover { color: var(--ink); }
.chart-data .table-wrap { margin-top: var(--sp-2); max-height: 320px; overflow: auto; }

.tooltip { position: fixed; z-index: 90; left: 0; top: 0; pointer-events: none; max-width: min(280px, calc(100vw - 16px)); background: var(--ink); color: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.35; box-shadow: var(--shadow); }
.tooltip[hidden] { display: none; }
.tooltip-title { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.04em; opacity: 0.75; margin: 0 0 4px; }
.tooltip-row { display: flex; align-items: center; gap: 8px; margin: 0; }
.tooltip-key { width: 12px; height: 2px; border-radius: 1px; background: var(--key, currentColor); flex: none; }
.tooltip-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip-name { opacity: 0.8; }
.tooltip-note { margin: 4px 0 0; opacity: 0.8; }

/* ---------- 16. Sources and citations ------------------------------------ */
.sources { font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.45; border-top: 1px solid var(--rule); padding-top: var(--sp-4); margin-top: var(--sp-6); }
.sources-title { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 var(--sp-3); }
.sources ol { margin: 0; padding: 0; list-style: none; counter-reset: src; display: grid; gap: var(--sp-2); }
.sources li { counter-increment: src; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); scroll-margin-top: calc(var(--topbar-h) + 24px); color: var(--ink-2); }
.sources li::before { content: "[" counter(src) "]"; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); padding-top: 2px; }
.sources li:target { background: var(--accent-wash); box-shadow: 0 0 0 4px var(--accent-wash); border-radius: 2px; }
.sources a { overflow-wrap: anywhere; }
.source-note { color: var(--ink-3); }
.cite { font-family: var(--font-mono); font-size: 0.72em; vertical-align: super; line-height: 0; text-decoration: none; padding: 0 1px; white-space: nowrap; }
.cite:hover { text-decoration: underline; }

/* ---------- 17. States --------------------------------------------------- */
.error-card { border: 1.5px solid var(--bad); border-radius: var(--radius); padding: var(--sp-5); background: color-mix(in srgb, var(--bad) 7%, transparent); font-family: var(--font-ui); font-size: 0.98rem; line-height: 1.5; max-width: var(--measure); }
.error-card-title { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-2); }
.error-card p { margin-bottom: var(--sp-2); }
.error-card pre { margin: var(--sp-3) 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.empty-state { margin: var(--sp-6) 0; padding: var(--sp-6) var(--sp-5); border: 1px dashed var(--rule-strong); border-radius: 14px; max-width: var(--measure); font-family: var(--font-ui); }
.empty-state-mark { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--glass-edge); background: radial-gradient(circle at 50% 50%, transparent 0 9px, var(--rule) 9px 10px, transparent 10px), var(--glass); margin-bottom: var(--sp-4); }
.empty-state h2 { font-size: var(--fs-lg); font-weight: 700; margin-bottom: var(--sp-2); }
.empty-state p { color: var(--ink-2); font-size: 1rem; line-height: 1.5; margin-bottom: var(--sp-3); }
.empty-state p:last-child { margin-bottom: 0; }

.loading { padding: var(--sp-6) 0; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--ink-3); }

.site-foot { max-width: var(--measure); margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--rule-strong); font-family: var(--font-ui); font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.site-foot-small { color: var(--ink-3); }

/* onVisible enhancement hook: content is visible at rest; .is-visible may add motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal.is-visible { animation: reveal-in 0.6s var(--ease) both; }
  @keyframes reveal-in { from { opacity: 0.35; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

@media print {
  .topbar, .sidebar, .backdrop, .stepper-controls, .chart-data > summary { display: none !important; }
  .layout { display: block; }
  body { background: #fff; }
  body[data-depth="story"] .expert-only { display: revert !important; }
}
