/* System appearance is the only theme source. No toggle, script or stored preference. */
:root {
  color-scheme: light dark;
  --mute: #666;
  --research-ink: #111;
  --research-text: #333;
  --research-muted: #666;
  --research-accent: #555;
  --research-rule: #d5d5d5;
  --research-dot: #ccc;
}
::selection { background: var(--ink); color: var(--paper); }
/* The hero and its drawing sheet retain their original layout. */
section, section.dark {
  --serif: Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ink: var(--research-ink);
  --ink-2: var(--research-text);
  --mute: var(--research-muted);
  --gold: var(--research-accent);
  --red: var(--research-ink);
  --rule: var(--research-rule);
  --dot: var(--research-dot);
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 Arial, Helvetica, sans-serif;
  padding-top: 64px;
  padding-bottom: 64px;
}
section .grid { grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 48px; }
section .mono { font-size: 11px; letter-spacing: 0; text-transform: none; }
section .label b,
section.dark .label b,
section .lede,
section .ledger h3,
section .quad h3,
section .neuropil h3 {
  font: 600 18px/1.4 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  color: var(--ink);
}
section p.lede { font-weight: 400; }
section .epi,
section blockquote { font: 400 14px/1.55 Arial, Helvetica, sans-serif; }
section .epi { max-width: 30ch; }
section .epi cite { letter-spacing: 0; text-transform: none; line-height: 1.5; }
section .lede em { color: inherit; font-style: normal; }
section .lede, section .body, section .quad p {
  text-align: left;
  hyphens: none;
}
section .body { max-width: 72ch; margin-top: 24px; }
section blockquote { margin-top: 32px; border-color: var(--rule); }
section .ledger { border-color: var(--rule); }
section .ledger li { gap: 24px; border-bottom-style: solid; }
section .quad p { font-size: 15px; }
section .quad, section .neuropil, section .stages { border-color: var(--rule); }
section .quad div, section .stages li { border-bottom-style: solid; }
section .stages li { font: 400 15px/1.5 Arial, Helvetica, sans-serif; }
/* Content is visible immediately; motion belongs to the scientific figures. */
section [data-r] { opacity: 1; transform: none; transition: none; }
section .iso-legend { color: var(--ink-2); }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
@media (max-width: 820px) {
  section { padding-top: 40px; padding-bottom: 40px; }
  section .grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  section .ledger li { gap: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* The same scientific geometry uses a system-selected material palette. */
section .iso {
  --anatomy-page: #fff; --anatomy-card: #fff; --anatomy-paper: #fff;
  --anatomy-text: #333; --anatomy-strong: #181818; --anatomy-muted: #666;
  --anatomy-face: #fff; --anatomy-top: #fff;
  --anatomy-shade-0: #dcdcdc; --anatomy-shade-1: #e5e5e5;
  --anatomy-shade-2: #ededed; --anatomy-shade-3: #f4f4f4;
  --anatomy-lit-top: #fff; --anatomy-lit-shade: #eee;
  --anatomy-hi: #262626; --anatomy-mid: #707070;
  --anatomy-lo: #999; --anatomy-faint: #ccc; --anatomy-lit: #0a0a0a;
  --anatomy-halo: #888; --anatomy-halo-opacity: .25; --anatomy-dot: #333;
  --anatomy-red: #b4232b; --anatomy-green: #187146; --anatomy-blue: #245bcc;
  --anatomy-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --spark: #765d30;
}
/* Figure keys sit on the page, not on the shaded instrument plate. */
section .iso .iso-plate { box-shadow: 0 0 0 1px var(--research-rule); }
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111; --ink: #f5f5f5; --ink-2: #ccc; --mute: #aaa;
    --gold: #c4ad83; --red: #e28e91; --rule: #363636; --dot: #666;
    --research-ink: #eee; --research-text: #ccc; --research-muted: #aaa;
    --research-accent: #bbb; --research-rule: #3d3d3d; --research-dot: #444;
  }
  section .iso {
    --anatomy-page: #111; --anatomy-card: #161616; --anatomy-paper: #161616;
    --anatomy-text: #ccc; --anatomy-strong: #eee; --anatomy-muted: #aaa;
    --anatomy-face: #252525; --anatomy-top: #242424;
    --anatomy-shade-0: #171717; --anatomy-shade-1: #1b1b1b;
    --anatomy-shade-2: #202020; --anatomy-shade-3: #262626;
    --anatomy-lit-top: #363636; --anatomy-lit-shade: #2c2c2c;
    --anatomy-hi: #ddd; --anatomy-mid: #999;
    --anatomy-lo: #666; --anatomy-faint: #414141; --anatomy-lit: #fff;
    --anatomy-halo: #050505; --anatomy-halo-opacity: .9; --anatomy-dot: #eee;
    --anatomy-red: #ff8b8b; --anatomy-green: #80d9ab; --anatomy-blue: #96b7ff;
    --spark: #d7bd8d;
  }
}
