/* Neuron Atlas v2: one column; the picture is the page, the words are short. */
:root {
  --bg: #eef0f3; --surface: #ffffff; --stage: #f8f9fb; --ink: #15171d; --muted: #5a6273; --line: #d5dae2;
  --accent: #2f43c9; --accent-soft: #e3e7fb;
  --na: #e0662f; --k: #7a4bd8; --cl: #198f62; --ca: #c99606; --nt: #0b9db0; --exc: #d4471a; --inh: #2468d1;
  --memb: #d6b585; --myelin: #e9dfc6; --cell: #f6e1e8; --cell-edge: #a8466c; --dim: .22;
  --tip-bg: #15171d; --tip-fg: #f4f6f9;
  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Serif 4", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #161a21; --stage: #12161c; --ink: #e7ebf1; --muted: #9aa3b4; --line: #2a313c;
    --accent: #93a1ff; --accent-soft: #232a4a;
    --na: #ff8a50; --k: #b190ff; --cl: #46c98f; --ca: #f2c33a; --nt: #39cfe0; --exc: #ff7a4a; --inh: #6aa2ff;
    --memb: #8d7350; --myelin: #4b4535; --cell: #3a2431; --cell-edge: #ec8db3; --dim: .25;
    --tip-bg: #e7ebf1; --tip-fg: #11141a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #161a21; --stage: #12161c; --ink: #e7ebf1; --muted: #9aa3b4; --line: #2a313c;
  --accent: #93a1ff; --accent-soft: #232a4a;
  --na: #ff8a50; --k: #b190ff; --cl: #46c98f; --ca: #f2c33a; --nt: #39cfe0; --exc: #ff7a4a; --inh: #6aa2ff;
  --memb: #8d7350; --myelin: #4b4535; --cell: #3a2431; --cell-edge: #ec8db3; --dim: .25;
  --tip-bg: #e7ebf1; --tip-fg: #11141a; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--f-body); font-size: 18px; line-height: 1.55; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 600px; margin: 0 auto; padding-inline: 18px; padding-block: 18px 56px; }
h1, h2, .display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.01em; line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 7vw, 2.4rem); }
.back { display: inline-block; font-family: var(--f-display); font-size: .95rem; text-decoration: none; margin-bottom: 14px; }
.oneliner { font-size: 1.15rem; margin: 8px 0 18px; color: var(--muted); }

/* the picture */
.viz { margin: 0 -18px; background: var(--surface); border-block: 1px solid var(--line); }
@media (min-width: 600px) { .viz { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; } }
.say { font-family: var(--f-display); font-size: 1.08rem; line-height: 1.35; padding: 14px 16px 12px; min-height: calc(3 * 1.35em + 26px); display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 12px; align-items: start; }
.say .n { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 1px; }
.say .t { min-width: 0; }
.stage { background: var(--stage); border-block: 1px solid var(--line); }
.stage svg { display: block; width: 100%; height: auto; max-height: 72vh; margin: 0 auto; touch-action: manipulation; }
.stage svg text { font-family: var(--f-display); }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.nav button { font: 600 1rem var(--f-display); min-width: 48px; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--stage); color: var(--ink); cursor: pointer; }
.nav button.primary { background: var(--accent); border-color: var(--accent); color: var(--surface); padding-inline: 16px; }
.nav .dots { display: flex; gap: 8px; flex: 1 1 auto; justify-content: center; }
.nav .dots button { min-width: 28px; min-height: 28px; width: 28px; height: 28px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; border: 0; }
.nav .dots button::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.nav .dots button[aria-current="step"]::after { background: var(--accent); width: 12px; height: 12px; }
.try { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
.try button { font: 600 .95rem var(--f-display); min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); cursor: pointer; }

/* words */
.plain { margin: 26px 0 8px; font-size: 1.12rem; }
.plain p { margin: 0 0 .8em; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; padding: 16px 2px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 500; font-size: 1.4rem; color: var(--accent); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 2px 16px; font-size: 1rem; }
details p { margin: 0 0 .8em; }
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: grid; grid-template-columns: 4.2em minmax(0,1fr); gap: 10px; padding: 4px 0; }
.tl b { font-family: var(--f-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.vs { display: grid; gap: 12px; }
.vs div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.vs .who { font-family: var(--f-display); font-weight: 700; font-size: .9rem; color: var(--muted); display: block; margin-bottom: 2px; }
.vs .now .who { color: var(--accent); }
.src { font-size: .85rem; color: var(--muted); padding-left: 1.1em; margin: 0; }
.pager { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 28px; }
.pager a { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 700; min-width: 0; }
.pager a small { display: block; font-weight: 500; color: var(--muted); }
.pager a.next { grid-column: 2; text-align: right; }

/* glossary */
.term { border-bottom: 1.5px dotted var(--accent); cursor: help; }
.tip { position: fixed; z-index: 50; max-width: min(300px, calc(100vw - 24px)); background: var(--tip-bg); color: var(--tip-fg); font: 400 .92rem/1.4 var(--f-display); padding: 10px 12px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.25); pointer-events: none; }

/* menu */
.menu h1 { font-size: clamp(2.3rem, 10vw, 3.4rem); }
.menu .lede { margin: 10px 0 26px; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list a { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 2px 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
.list a:hover { border-color: var(--accent); }
.list svg { width: 52px; height: 52px; grid-row: span 2; color: var(--accent); }
.list .nm { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; }
.list .ds { font-size: .95rem; color: var(--muted); line-height: 1.35; }
.group { font-family: var(--f-display); font-size: 1.15rem; margin: 28px 0 10px; }
@media (prefers-reduced-motion: reduce) { summary::after { transition: none; } }

.menu h1 .yr { font: 600 .9rem var(--f-display); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; vertical-align: middle; letter-spacing: .04em; }

/* Neuron Atlas v5 — an anatomical plate with a legend. Always printed on paper. */
:root {
  --paper: #16130f; --paper-2: #1e1a15; --ink: #ece4d4; --ink-2: #c2b7a6; --rule: #3d362d;
  --red: #f0947a; --f-plate: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --tip-bg: #ece4d4; --tip-fg: #16130f; --accent: #f0947a;
}
html { background: #16130f; }
body.pl-on { min-height: 100vh; overflow: hidden; background: var(--paper); color: var(--ink); color-scheme: dark; }
.pl { height: 100vh; height: 100dvh; display: grid; grid-template-rows: minmax(0, 58fr) minmax(0, 42fr);
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .9 0 0 0 0 .82 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (min-width: 860px) { .pl { grid-template-rows: 100%; grid-template-columns: minmax(0, 1fr) clamp(340px, 30vw, 440px); } }

.plate { position: relative; min-height: 0; overflow: hidden;
  background: radial-gradient(120% 100% at 45% 45%, rgba(255, 240, 215, .035) 0%, transparent 55%, rgba(0, 0, 0, .35) 100%); }
.plate svg.world { display: block; width: 100%; height: 100%; }
.plate .region { cursor: pointer; }
.plate .region:hover { filter: saturate(1.25) brightness(1.03); }
.plate-no { position: absolute; left: 18px; bottom: 12px; margin: 0; font: italic 500 .95rem var(--f-plate); color: var(--ink-2); letter-spacing: .02em; }
svg.leads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
svg.leads line { stroke: var(--ink); stroke-width: .9; }
svg.leads circle { fill: var(--ink); }
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl { position: absolute; left: 0; top: 0; pointer-events: auto; max-width: 240px; text-align: left; border: 0; background: none; padding: 2px 4px; cursor: pointer;
  font: italic 500 1.12rem/1.2 var(--f-plate); color: var(--ink); transition: opacity .4s;
  text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper), 0 0 10px var(--paper); }
.lbl .t { border-bottom: 1px dotted var(--ink-2); }
.lbl:hover .t { border-bottom-style: solid; }
.lbl .d { display: none; font: normal 400 .95rem/1.35 var(--f-plate); color: var(--ink); margin-top: 6px; padding: 8px 10px; background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; text-shadow: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); width: max-content; max-width: 230px; }
.lbl.open .d { display: block; }
.lbl.still { cursor: default; } .lbl.still .t { border: 0; }
.lbl.go .t { border-bottom: 1px solid var(--red); color: var(--red); }
.hovertip { position: absolute; left: 0; top: 0; pointer-events: none; font: italic 500 1rem var(--f-plate); background: var(--paper); border: 1px solid var(--rule); color: var(--ink); padding: 4px 10px; border-radius: 4px; white-space: nowrap; }

/* the legend */
.legend { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; border-top: 1px solid var(--rule); background: var(--paper-2); }
@media (min-width: 860px) { .legend { border-top: 0; border-left: 1px solid var(--rule); } }
.lg-body { overflow-y: auto; padding: 18px 20px 8px; overscroll-behavior: contain; }
@media (min-width: 860px) { .lg-body { padding: 44px 38px 12px; align-self: center; max-height: 100%; } }
.fig { margin: 0; font: italic 500 1rem var(--f-plate); color: var(--red); }
.legend h1 { font: 600 clamp(1.7rem, 2.6vw, 2.3rem)/1.1 var(--f-plate); letter-spacing: -.005em; margin: 2px 0 12px; color: var(--ink); }
.lead { font: 500 1.32rem/1.32 var(--f-plate); margin: 0 0 10px; color: var(--ink); }
.simple { font: 400 1.08rem/1.55 var(--f-plate); margin: 0 0 14px; color: var(--ink-2); }
.more { border: 0; margin: 0 0 6px; }
.more summary { display: inline-flex; list-style: none; cursor: pointer; font: italic 500 1.02rem var(--f-plate); color: var(--red); padding: 6px 0; border-bottom: 1px solid currentColor; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: none; }
.more[open] summary { margin-bottom: 8px; }
.more p, .more .tl, .more .vs, .more .src { font: 400 1rem/1.55 var(--f-plate); color: var(--ink); }
.more .term { border-bottom-color: var(--red); }
.more .tl b { color: var(--red); font-family: var(--f-plate); }
.more .vs div { background: transparent; border: 0; border-left: 2px solid var(--rule); border-radius: 0; padding: 4px 0 4px 12px; }
.more .who { font: italic 500 .9rem var(--f-plate); color: var(--ink-2); }
.more .now2 { color: var(--red); }
.cta { display: block; width: 100%; margin: 16px 0 6px; min-height: 52px; border: 0; border-radius: 6px; background: var(--ink); color: var(--paper); font: 600 1.15rem var(--f-plate); letter-spacing: .01em; cursor: pointer; }
.cta:hover { background: #fff8ea; }
.endbtns { margin-bottom: 10px; }
.meter { margin: 0 0 14px; }
.scale { position: relative; height: 10px; border: 1px solid var(--ink); border-radius: 5px; background: var(--paper); overflow: hidden; }
.scale .lvl { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, #7d9ed6 0 3px, #a9bfe6 3px 6px); transition: background .2s; }
.scale.fire .lvl { background: repeating-linear-gradient(135deg, #ff6a3d 0 3px, #ff9a76 3px 6px); }
.scale .thr { position: absolute; top: -2px; bottom: -2px; left: 21.7%; width: 1.5px; background: var(--ink); z-index: 1; }
.mlab { display: flex; justify-content: space-between; font: italic 500 .92rem var(--f-plate); color: var(--ink-2); margin-top: 4px; }
.mlab .mv { font-style: normal; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.lg-nav { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 16px 14px; border-top: 1px solid var(--rule); }
@media (min-width: 860px) { .lg-nav { padding: 16px 38px 26px; } }
.lg-nav .back { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.lg-nav .back:disabled { opacity: .25; cursor: default; }
.lg-nav .next { min-height: 48px; padding: 0 22px; border-radius: 6px; border: 0; background: var(--ink); color: var(--paper); font: 600 1.08rem var(--f-plate); cursor: pointer; }
.lg-nav .next[hidden] { display: none; }
.dots { display: flex; justify-content: center; gap: 2px; }
.dots button { width: 26px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.dots button::after { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--ink); }
.dots button[aria-current="step"]::after { background: var(--ink); width: 9px; height: 9px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.lg-nav .next.wide { grid-column: 2 / -1; }
.lg-nav:has(.next.wide) .dots { display: none; }

/* dark-paper details */
.plate-no a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink-2); }
.plate-no a:hover { color: var(--ink); }
.lg-nav .next:hover, .cta:hover { background: #fff8ea; }
.legend .term { border-bottom: 1.5px dotted var(--red); }
.tip { background: var(--tip-bg); color: var(--tip-fg); }
.nextplate { display: block; margin: 14px 0 10px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); text-decoration: none; font: 600 1.15rem var(--f-plate); }
.nextplate span { display: block; font: italic 500 .9rem var(--f-plate); color: var(--red); }
.nextplate:hover { border-color: var(--red); }
body.pl-index { overflow: auto; }
.contents { max-width: 760px; margin: 0 auto; padding: 56px 22px 80px; color: var(--ink); }
.contents h1 { font: 600 clamp(2.6rem, 8vw, 4rem)/1 var(--f-plate); margin: 6px 0 14px; color: var(--ink); }
.contents .lead { font: 400 1.25rem/1.45 var(--f-plate); color: var(--ink-2); max-width: 34em; }
.contents h2 { font: italic 500 1.15rem var(--f-plate); color: var(--red); margin: 40px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents li a { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 0 12px; padding: 14px 4px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.contents li a:hover { background: rgba(255, 240, 215, .04); }
.contents .no { grid-row: span 2; font: italic 500 1.05rem var(--f-plate); color: var(--ink-2); padding-top: 3px; }
.contents .nm { font: 600 1.3rem/1.2 var(--f-plate); }
.contents .ds { font: 400 1.02rem/1.4 var(--f-plate); color: var(--ink-2); }

/* labels stay readable over any wash: a quiet dark tag behind the italic */
.lbl { padding: 3px 8px 4px; border-radius: 4px; background: rgba(22, 19, 15, .82); box-shadow: 0 0 0 1px rgba(236, 228, 212, .12); text-shadow: none; }
.lbl .t { border-bottom-color: rgba(236, 228, 212, .45); }
.lbl.go { background: rgba(22, 19, 15, .9); }
.lbl .d { margin: 6px -8px -4px; }
.plate-no { padding: 2px 8px; border-radius: 4px; background: rgba(22, 19, 15, .7); left: 12px; }
