:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101a18;
  --ink: #edf5f0;
  --muted: #b6c9c0;
  --accent: #96dec3;
  --green: #274139;
  --border: #415a50;
  --surface: #192923;
  --surface-active: #2a463a;
  --control-border: #78988a;
  --on-accent: #102d24;
}

:root[data-theme="dark"] .header {
  background: var(--paper);
}

:root[data-theme="dark"] .brand-symbol img { filter: brightness(0) invert(1); }

:root[data-theme="dark"] .brand-name { color: #fff; }

:root[data-theme="dark"] :is(.language-picker, .case-files > h3,
  .case-grid summary, .notebook-intro h2, .editor-head h1, .lab-check summary,
  .lab-model h3, .reading-list strong, .lab-upcoming) {
  color: var(--ink);
}

:root[data-theme="dark"] :is(.language-options, .case-grid details,
  .lab-check, .lab-model, .reading-list > a) {
  background: var(--surface);
  border-color: var(--border);
}

:root[data-theme="dark"] .language-options {
  border-color: var(--control-border);
  box-shadow: 0 .4rem 1.25rem #0006;
}

:root[data-theme="dark"] :is(.language-picker[open] summary,
  .language-picker summary:hover, .language-options a:hover,
  .language-options a[aria-current], .lab-upcoming h3 span) {
  background: var(--surface-active);
  color: var(--ink);
}

:root[data-theme="dark"] .lab-upcoming { border-color: var(--border); }
:root[data-theme="dark"] .nav-contact { border-color: var(--control-border); }
:root[data-theme="dark"] .line { background: var(--accent); }

:root[data-theme="dark"] :is(.button, .skip-link) {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

:root[data-theme="dark"] .button:hover {
  background: #baf3da;
  border-color: #baf3da;
  color: var(--on-accent);
}

:root[data-theme="dark"] .contact {
  color: var(--ink);
}

:root[data-theme="dark"] .contact .text-link { color: var(--accent); }

/* The model has its own green stage; retain its discipline and selection colors. */
:root[data-theme="dark"] .story-step:not(.is-active) { opacity: .9; }

@media (prefers-reduced-motion: reduce), (max-width: 800px) {
  :root[data-theme="dark"] .story-step:not(.is-active) { opacity: 1; }
}

:root[data-theme="dark"] .project-tap-zone:focus-visible {
  opacity: 1;
  background: rgb(8 31 22 / .12);
  outline: 3px solid white;
  outline-offset: -5px;
}
