/* Layout: one 880px column on white for text and figures alike, with small sans captions.
   One accent, the Eiffel Tower's bronze-brown paint, used only for steered words, active neurons and the main line in charts. */
:root {
  --paper: #ffffff;
  --ink: #1d2226;
  --muted: #5d6770;
  --rule: #e2e5e8;
  --wash: #f4f5f6;
  --accent: #8a5a2e;
  --accent-wash: #f4ece3;
  --cool: #8a9aa5;
  --link: #2a5d77;
  --serif: "Newsreader", "Source Serif Pro", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.62 var(--serif);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code { font: 0.85em var(--mono); }
/* body text and figures share one width; margin-inline only, so figures keep their vertical spacing */
.col { max-width: 880px; margin-inline: auto; }
.wide { max-width: 880px; margin-inline: auto; }

.top { max-width: 880px; margin: 0 auto; font: 13px/1.4 var(--sans); color: var(--muted); padding-block: 14px; border-bottom: 1px solid var(--rule); }
header.col { padding-block: 48px 4px; }
h1 { font: 600 clamp(38px, 8vw, 52px)/1.05 var(--serif); letter-spacing: -0.01em; margin: 0 0 16px; text-wrap: balance; }
.dek { font: italic 400 clamp(19px, 3.6vw, 22px)/1.45 var(--serif); color: var(--muted); margin: 0 0 18px; text-wrap: pretty; }
.by { font: 14px/1.5 var(--sans); margin: 0; }
.by span { color: var(--muted); }
h2 { font: 600 28px/1.2 var(--serif); margin: 52px 0 12px; text-wrap: balance; }
p { margin: 0 0 18px; }
.pts { padding-left: 1.3em; margin: 0 0 18px; }
.pts li { margin-bottom: 10px; padding-left: 4px; }
.note { font: 15px/1.55 var(--sans); color: var(--muted); }

figure { margin: 36px auto 44px; padding-top: 14px; border-top: 1px solid var(--rule); }
.fh { font: 600 13px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
figcaption { font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 14px; }
figcaption b { color: var(--ink); }

.ctl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.chip { font: 13px var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 99px; padding: 6px 11px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.toggle { font: 14px var(--sans); color: var(--ink); display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.neurons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.neuron { font: 12.5px/1.3 var(--sans); border: 1px solid var(--rule); border-radius: 4px; padding: 7px 9px; min-width: 0; max-width: 100%; transition: background 0.25s, border-color 0.25s; }
.neuron code { font: 500 11px var(--mono); color: var(--muted); display: block; }

.ask { font: 15px/1.45 var(--sans); color: var(--muted); margin: 0 0 8px; }
.ask strong { color: var(--ink); font-weight: 600; }
.reply { font: 14.5px/1.65 var(--mono); background: var(--wash); border-radius: 4px; padding: 14px 16px; margin: 0; min-height: 11em; white-space: pre-wrap; overflow-wrap: anywhere; }
.reply.short { min-height: 4.5em; }
.reply mark { background: var(--accent-wash); color: var(--accent); border-radius: 2px; padding: 0 1px; }
.reply .cap { color: var(--cool); }

.dial { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 14px; }
.dial label { font: 600 12px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.val { font: 500 15px var(--mono); font-variant-numeric: tabular-nums; color: var(--accent); min-width: 5ch; text-align: right; }
.state { font: 14px/1.5 var(--sans); margin: 10px 0 0; }

.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 720px) { .two { grid-template-columns: minmax(0, 1fr); } }
svg { display: block; max-width: 100%; height: auto; }
svg text { font-family: var(--sans); fill: var(--muted); }

select { font: 15px var(--sans); padding: 7px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink); max-width: 100%; }
.facts { font: 13.5px/1.5 var(--sans); color: var(--muted); margin: 0 0 12px; }
.facts b { color: var(--ink); font-weight: 600; }
.writes { font: 13px/1.45 var(--sans); color: var(--muted); margin: 12px 0 0; padding-left: 18px; }
.writes li { margin-bottom: 4px; }
.writes code { color: var(--ink); }

table.data { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--sans); }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data th { font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; }

ol.time { list-style: none; padding: 0; margin: 0 0 18px; border-left: 2px solid var(--rule); }
ol.time li { position: relative; padding: 0 0 14px 18px; font: 15px/1.5 var(--sans); }
ol.time li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--accent); }
ol.time time { font: 500 12.5px var(--mono); color: var(--muted); display: block; }

footer { font: 13px/1.55 var(--sans); color: var(--muted); border-top: 1px solid var(--rule); margin-top: 56px; padding-block: 18px 48px; }
.loading { font: 14px var(--sans); color: var(--muted); }

/* skip link, figure leads, auto dials */
.skip { margin: 22px 0 0; }
.skipbtn { display: inline-block; font: 600 15px var(--sans); color: var(--paper); background: var(--accent); border-radius: 99px; padding: 10px 18px; text-decoration: none; }
.skipbtn:hover { filter: brightness(1.1); }
.maplink { font: 15px/1.5 var(--sans); margin: 12px 0 0; }
.lead { font: 16px/1.5 var(--sans); color: var(--ink); margin: 0 0 14px; }
.askrow { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.askrow .ask { margin: 0; flex: 1 1 260px; min-width: 0; }
.dial { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.play { font: 12px var(--sans); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; padding: 0; }
.play:hover { border-color: var(--accent); }

h1 .brk { color: var(--cool); font-weight: 400; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; max-width: 100%; }
.qnav select { max-width: min(100%, 340px); font-size: 13px; }
#layers .hot { cursor: pointer; }
#layers .hot circle { transition: r 0.5s ease, fill-opacity 0.5s ease; }
#layers .hot:focus { outline: none; }
#layers .hot:focus .core { stroke: var(--ink); stroke-width: 2; }

/* figure 2 rows: every recall question at once */
ol.qrows { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
ol.qrows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
ol.qrows .q { grid-column: 1 / -1; font: 13.5px/1.4 var(--sans); color: var(--muted); }
ol.qrows .a { font: 14.5px/1.5 var(--mono); min-width: 0; overflow-wrap: anywhere; }
ol.qrows .a.wrong { color: var(--ink); background: var(--wash); border-radius: 2px; padding: 0 4px; justify-self: start; }
ol.qrows .p { font: 500 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; }

/* hover / tap definitions */
.term { border-bottom: 1px dotted var(--muted); cursor: help; position: relative; }
.term:hover::after, .term:focus::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; width: min(300px, 80vw);
  font: 400 13.5px/1.45 var(--sans); font-style: normal; font-weight: 400; color: var(--paper); background: var(--ink);
  padding: 8px 10px; border-radius: 4px; text-transform: none; letter-spacing: 0; white-space: normal;
}
.term:focus { outline: none; }

/* methodology */
details.method { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 12px 0; margin: 24px 0; }
details.method summary { font: 600 16px var(--sans); cursor: pointer; }
details.method h3 { font: 600 15px var(--sans); margin: 20px 0 6px; }
details.method p { font-size: 16.5px; }

/* editing copy only (claude.ai); never shown on the public site */
.editbar { position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-radius: 99px; padding: 6px 8px 6px 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); z-index: 10; max-width: calc(100vw - 24px); }
.editmsg { font: 13px var(--sans); color: var(--muted); }
.editing [data-copy] { outline: 1px dashed var(--cool); outline-offset: 3px; cursor: text; }
.editing [data-copy]:focus { outline: 2px solid var(--accent); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.closing { font: 400 24px/1.4 var(--serif); text-align: left; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); }

/* review aid in the editing copy only */
.changed { outline: 2px solid #9fd5a6; outline-offset: 4px; border-radius: 2px; }
.changed ins, .chgpanel ins { background: #dcf3df; color: #1f5f2a; text-decoration: none; border-radius: 2px; padding: 0 1px; }
.changed del, .chgpanel del { background: #f8dcdc; color: #8a2a2a; border-radius: 2px; padding: 0 1px; }
.chgpanel { position: fixed; left: calc(12px + env(safe-area-inset-left, 0px)); bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 10; width: min(360px, calc(100vw - 24px)); max-height: 45vh; overflow: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); padding: 12px 14px; font: 13px/1.45 var(--sans); }
.chgpanel p { margin: 6px 0; }
.chgpanel ul { margin: 0; padding-left: 18px; }
.chgpanel .k { margin-left: 6px; }

/* figure 3 mode switch */
.modes { gap: 0; }
.modes .chip { border-radius: 0; }
.modes .chip:first-child { border-radius: 99px 0 0 99px; }
.modes .chip:last-child { border-radius: 0 99px 99px 0; border-left: 0; }
.qhead { display: flex; justify-content: space-between; gap: 12px; font: 600 11.5px var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
ol.qrows mark { background: var(--accent-wash); color: var(--accent); border-radius: 2px; padding: 0 1px; }
