/* Sand to GPU · an engineering atlas. Shared tokens also serve all interactive models. */
:root {
  --ground: #f5f3ed;
  --panel: #fdfcf8;
  --panel2: #ece9e0;
  --ink: #242d2a;
  --muted: #626c65;
  --line: #dcded3;
  --line2: #bcc4b8;
  --accent: #a54c30;
  --accent-soft: #f1e2d7;
  --on-accent: #fffaf4;
  --accent2: #786491;
  --si: #43777b;
  --cu: #ae6745;
  --ok: #397453;
  --warn: #9b711f;
  --bad: #b6453d;
  --shadow: 0 2px 5px #23322705,0 16px 42px #23322708;
  --hero-bg: #1d2825;
  --hero-ink: #f5f3ed;
  --hero-muted: #b7c1ba;
  --hero-line: #42504a;
  --sans: "Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
  --serif: "Source Serif 4",Georgia,serif;
  --mono: "JetBrains Mono",Consolas,monospace;
  --radius: 6px;
  --reading-progress: 0%;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ground: #171d1b;
  --panel: #1e2723;
  --panel2: #29332d;
  --ink: #e8ece2;
  --muted: #a8b5a9;
  --line: #364239;
  --line2: #59685b;
  --accent: #e9a07d;
  --accent-soft: #3c3028;
  --on-accent: #23251e;
  --accent2: #b0a0cf;
  --si: #8bbdc1;
  --cu: #dfa57e;
  --ok: #87bb93;
  --warn: #dbc276;
  --bad: #e89587;
  --shadow: 0 12px 30px #0002;
  --hero-bg: #0e1513;
  --hero-ink: #eef2e9;
  --hero-muted: #aeb9b0;
  --hero-line: #34423c;
  color-scheme: dark;
}

@media(prefers-color-scheme:dark) {
  :root:not([data-theme="light"]) {
    --ground: #171d1b;
    --panel: #1e2723;
    --panel2: #29332d;
    --ink: #e8ece2;
    --muted: #a8b5a9;
    --line: #364239;
    --line2: #59685b;
    --accent: #e9a07d;
    --accent-soft: #3c3028;
    --on-accent: #23251e;
    --accent2: #b0a0cf;
    --si: #8bbdc1;
    --cu: #dfa57e;
    --ok: #87bb93;
    --warn: #dbc276;
    --bad: #e89587;
    --shadow: 0 12px 30px #0002;
    --hero-bg: #0e1513;
    --hero-ink: #eef2e9;
    --hero-muted: #aeb9b0;
    --hero-line: #34423c;
    color-scheme: dark;
  }

}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.72 var(--serif);
  -webkit-font-smoothing: antialiased
}

a {
  color: var(--si);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

button,input,select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none!important;
}

svg {
  max-width: 100%;
}

button:disabled {
  cursor: default;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: -80px;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--ground);
  z-index: 100;
  font: 14px var(--sans);
}

.skip-link:focus {
  top: 10px;
}

/* Persistent chrome. Keep controls quiet and the current reading location clear. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}

.topbar:after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: var(--reading-progress);
  height: 2px;
  background: var(--accent);
  content: "";
}

.is-home .topbar:after {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand .mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.brand small {
  display: none;
}

.search {
  position: relative;
  width: clamp(160px,24vw,320px);
}

.search input {
  height: 36px;
  width: 100%;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font: 13px var(--sans);
}

.search input::placeholder {
  color: var(--muted);
}

.search>svg {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.search-shortcut {
  font: 11px var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: -16px;
}

.spacer {
  flex: 1;
}



.icon-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--panel2);
}

.menu-btn {
  display: none;
}

.progress-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.progress-pill .bar {
  width: 42px;
  height: 4px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.progress-pill .bar i {
  height: 100%;
  display: block;
  background: var(--accent);
  transition: width .3s;
}

.search-results {
  position: absolute;
  top: 44px;
  left: 0;
  width: max(100%,360px);
  max-height: 65vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font: 13px/1.45 var(--sans);
}

.search-results a {
  display: block;
  padding: 12px 15px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.search-results a:hover,.search-results a.sel {
  background: var(--panel2);
}

.search-results .kind {
  font: 10px var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  margin-right: 7px;
}

.search-results .ctx {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.search-results mark {
  background: var(--accent-soft);
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr) 200px;
  min-height: calc(100vh - 68px);
}

main {
  min-width: 0;
  padding-bottom: 80px;
}

.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
  padding: 24px 12px 40px;
  border-right: 1px solid var(--line);
  font-family: var(--sans);
  scrollbar-width: thin;
  scrollbar-color: var(--line2) transparent;
}

.curriculum-label {
  font: 10px var(--mono);
  letter-spacing: .12em;
  color: var(--muted);
  padding: 0 10px 12px;
}



.track-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--panel2);
  border-radius: 6px;
  margin: 15px 0 25px;
}

.track-btn {
  display: grid;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: 12px var(--sans);
}

.track-btn small {
  color: var(--muted);
  font-size: 10px;
}

.track-btn.active {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 1px 3px #0001;
}

.track-btn.active b {
  color: var(--accent);
}

.sidebar .part {
  margin: 0 0 20px;
}

.part-h {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  font: 10px/1.5 var(--sans);
  color: var(--muted);
  padding: 0 10px 8px;
  letter-spacing: .02em;
}

.part-h b {
  font: 9px/1.6 var(--mono);
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar a.mod {
  display: grid;
  grid-template-columns: 23px 1fr 12px;
  gap: 6px;
  align-items: baseline;
  padding: 8px 9px;
  margin: 1px 0;
  border-radius: 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar a.mod:hover {
  background: var(--panel2);
  color: var(--ink);
}

.sidebar a.mod.active {
  box-shadow: inset 2px 0 var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.sidebar .num {
  font: 10px var(--mono);
  color: var(--muted);
}

.sidebar a.mod.active .num {
  color: var(--accent);
}

.tick {
  width: 11px;
  height: 11px;
  border: 1px solid var(--line2);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.tick svg {
  display: none;
  width: 7px;
  height: 7px;
}

.read .tick {
  border-color: var(--si);
}

.read .tick svg {
  display: block;
  color: var(--si);
}

.passed .tick {
  border-color: var(--ok);
  background: var(--ok);
}

.passed .tick svg {
  display: block;
  color: var(--ground);
}

.legend {
  margin: 24px 10px;
  font: 10px/1.6 var(--sans);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--si);
  border-radius: 50%;
}

.legend i.p {
  background: var(--ok);
  border-color: var(--ok);
}

.scrim {
  display: none;
}

/* Reading canvas: prose has a measure; diagrams use the full canvas. */
.article {
  max-width: 1020px;
  margin: auto;
  padding: 42px 36px 0;
}

.mod-head {
  margin-bottom: 28px;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--accent);
  font: 10px/1.6 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.eyebrow .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.eyebrow .meta {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.title {
  font: 600 clamp(36px,3.7vw,56px)/1.08 var(--sans);
  letter-spacing: -.045em;
  margin: 17px 0 20px;
  text-wrap: balance;
}

.chapter-intro {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 0;
  align-items: start;
}

.chapter-object {
  color: var(--si);
}

.chapter-object .atlas-object {
  width: 100%;
  height: auto;
}

.chapter-deck {
  max-width: 64ch;
  font: 17px/1.6 var(--serif);
  color: var(--muted);
  margin: 0 0 24px;
}

.stage-ribbon {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stage-ribbon a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 12px 8px;
  color: var(--muted);
  text-decoration: none;
  font: 12px var(--sans);
  border-radius: 3px;
}

.stage-ribbon a:hover, .stage-ribbon a:focus-visible {
  background: var(--panel2);
  color: var(--ink);
}

.stage-ribbon a.current {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
}

.stage-ribbon a.current:after {
  content: "";
  position: absolute;
  left: 0;
  right: 16px;
  height: 2px;
  bottom: -1px;
  background: var(--accent);
}

.stage-node {
  font: 9px var(--mono);
  opacity: .65;
}

.chapter-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  margin-bottom: 32px;
  font: 11px var(--sans);
  color: var(--muted);
}








.reading-status {
  display: flex;
  gap: 8px;
  font: 10px var(--mono);
}

.reading-status b {
  font-weight: 400;
  color: var(--ink);
}

.prose>:not(.widget):not(.section-figure):not(.table-scroll):not(pre) {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.prose {
  overflow-wrap: break-word;
}

.prose h2 {
  font: 600 29px/1.2 var(--sans);
  letter-spacing: -.035em;
  margin-top: 64px;
  margin-bottom: 22px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
  text-wrap: balance;
}

.prose h3 {
  font: 600 21px/1.35 var(--sans);
  letter-spacing: -.02em;
  margin-top: 35px;
  margin-bottom: 12px;
}

.prose h4 {
  font: 600 17px/1.4 var(--sans);
  margin-top: 26px;
  margin-bottom: 10px;
}

.prose p {
  margin-top: 0;
  margin-bottom: 21px;
}

.prose li {
  margin: 7px 0;
}

.prose ul,.prose ol {
  padding-left: 25px;
  margin-top: 0;
  margin-bottom: 22px;
}

.prose strong {
  font-weight: 600;
}

.prose code {
  font: .82em var(--mono);
  padding: 2px 4px;
  background: var(--panel2);
  border-radius: 3px;
}

.prose pre {
  overflow-x: auto;
  background: var(--panel2);
  padding: 20px;
  font: 12px/1.6 var(--mono);
  border-radius: 6px;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px auto;
}

.prose img {
  max-width: 100%;
}

.prose sub,.prose sup {
  line-height: 0;
}

.prose .math {
  white-space: nowrap;
}

.prose .math sub,.prose .math sup {
  font-size: .75em;
}

.callout {
  padding: 20px 24px;
  border-left: 3px solid var(--si);
  background: var(--panel);
  font-size: 16px;
  margin-top: 25px;
  margin-bottom: 25px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout.worked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.callout.worked>p:first-child strong:first-child {
  font: 11px var(--sans);
  color: var(--accent);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reference-content:not(h2) {
  font-size: 14px;
  color: var(--muted);
}

.summary-content:not(h2) {
  background: var(--panel);
  padding: 20px 28px;
  border-left: 2px solid var(--si);
}

.table-scroll {
  width: 100%;
  overflow: auto;
  margin: 25px 0 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font: 13px/1.5 var(--sans);
}

.prose th,.prose td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--panel2);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.prose tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--panel2) 35%, transparent);
}

.prose tbody tr:hover {
  background: color-mix(in srgb, var(--si) 7%, var(--panel));
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td {
  font-variant-numeric: tabular-nums;
}

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font: 16px/1.4 var(--sans);
}

.prevnext>* {
  flex: 1;
  min-width: 0;
}

.prevnext a {
  text-decoration: none;
  color: var(--ink);
}

.prevnext a:hover {
  color: var(--accent);
}

.prevnext small {
  display: block;
  font: 10px var(--mono);
  color: var(--muted);
  margin-bottom: 10px;
}

.prevnext .next {
  text-align: right;
}

.rail {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 45px 18px 35px 4px;
  font-family: var(--sans);
  scrollbar-width: thin;
}

.rail-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.rail h5 {
  font: 10px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0;
  color: var(--muted);
}

.rail-top>span {
  font: 10px var(--mono);
  color: var(--muted);
}

.toc a {
  display: flex;
  gap: 8px;
  padding: 7px 4px;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.toc-number {
  font: 10px/1.8 var(--mono);
  opacity: .65;
  flex: none;
}

.toc a.active {
  color: var(--accent);
}

.toc .d3 {
  display: none;
  padding: 6px 0 6px 26px;
  font-size: 11px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
}

.toc-group.in-view .d3 {
  display: block;
}



/* Chapter opening plate: one illustrated artifact in its process context. */
.chapter-plate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(220px,38%);
  align-items: center;
  min-height: 205px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px 30px 0;
  margin: 4px 0 22px;
  background: radial-gradient(ellipse at 80% 40%, color-mix(in srgb, var(--si) 11%, transparent), transparent 65%), var(--panel);
}
.chapter-plate:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .17;
  mask-image: linear-gradient(90deg, transparent, #000);
}
.plate-copy { position: relative; z-index: 1; }
.plate-index { display: block; color: var(--accent); font: 10px var(--mono); letter-spacing: .12em; }
.plate-copy strong { display: block; max-width: 18ch; font: 500 clamp(25px,2.35vw,34px)/1.13 var(--sans); letter-spacing: -.035em; margin: 15px 0 12px; }
.plate-path { display: block; color: var(--muted); font: 11px/1.7 var(--mono); }
.plate-drawing { position: relative; justify-self: center; width: 220px; height: 160px; }
.plate-drawing:before { content: ""; position: absolute; width: 155px; height: 155px; border: 1px solid var(--line); border-radius: 50%; top: -1px; left: 32px; }
.plate-drawing .atlas-object { position: relative; height: 160px; filter: drop-shadow(0 7px 6px #23322710); }
.plate-cross { position: absolute; color: var(--line2); font: 16px var(--mono); }
.cross-a { left: 4px; top: 0; }
.cross-b { right: 4px; bottom: 4px; }
.plate-label { position: relative; grid-column: 1 / -1; margin: 20px -30px 0; background: color-mix(in srgb, var(--panel) 82%, transparent); display: flex; justify-content: space-between; gap: 12px; padding: 10px 15px; border-top: 1px solid var(--line); color: var(--si); font: 10px var(--mono); }

.prose > p:first-child { font-size: 1.08em; }
.prose > p:first-child:first-letter { float: left; color: var(--accent); font: 400 3.6em/.84 var(--serif); padding: .08em .13em 0 0; }
.toc-group.in-view { border-left: 2px solid var(--accent); padding-left: 7px; margin-left: -9px; }
.prose a { text-decoration-color: color-mix(in srgb, var(--si) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
button:disabled { opacity: .62; }
.w-lab-kicker { margin-bottom: 8px; color: var(--accent); font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.w-lab-section { margin: 16px 0 9px; }
.w-lab-section > h3, .w-lab-section > h4 { color: var(--muted); font: 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.w-lab-progress button > span { display: block; margin-bottom: 3px; font: 11px var(--mono); opacity: .75; }
.w-lab-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px,1fr)); gap: 4px; margin: 12px 0; }
.w-lab-progress button { min-height: 38px; padding: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 11px/1.3 var(--sans); }
.w-lab-progress button:hover { border-color: var(--line2); color: var(--ink); }
.w-lab-progress button.active, .w-lab-progress button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- widgets ---------- */
.widget {
  margin: 32px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--sans);
}

.widget-head h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.widget-head .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--si);
  white-space: nowrap;
}

.widget-cap {
  padding: 14px 20px 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.widget-body {
  padding: 18px 20px 22px;
  font-family: var(--sans);
  font-size: 13.5px;
}

.widget-body.error {
  color: var(--bad);
}

.w-svg {
  display: block;
  width: 100%;
  height: auto;
}

.w-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 10px 0 12px;
}

.w-ctl {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(48px,1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: min(100%,240px);
  flex: 1 1 240px;
  font-size: 13px;
  max-width: 100%;
}

.w-ctl > span {
  color: var(--muted);
  white-space: nowrap;
}

.w-ctl output {
  font-family: var(--mono);
  font-size: 12.5px;
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.w-ctl select {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  padding: 4px 6px;
  font-size: 13px;
}

input[type=range] {
  accent-color: var(--accent);
  width: 100%;
}

input[type=checkbox] {
  accent-color: var(--accent);
}

.w-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 8px 0 6px;
}

.w-stat {
  display: grid;
  gap: 2px;
}

.w-stat b {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

.w-stat span {
  color: var(--muted);
  font-size: 12px;
}

.w-formula {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--ground);
  border-radius: 4px;
  margin: 8px 0;
  display: inline-block;
}

.w-steps {
  display: grid;
  gap: 10px;
}

.w-step-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.w-step-nav .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.w-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line2);
  background: var(--panel);
  padding: 0;
  cursor: pointer;
}

.w-step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.w-step-dot.done {
  background: var(--line2);
}

.w-step-title {
  font-weight: 600;
  font-size: 14px;
}

.w-step-desc {
  color: var(--muted);
}

.w-btn {
  border: 1px solid var(--line2);
  background: var(--panel);
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
}

.w-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.w-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.w-btn.primary:hover {
  color: var(--on-accent);
  filter: brightness(1.08);
}

.w-btn:disabled {
  opacity: .5;
  cursor: default;
}

.w-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}

.w-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.w-legend-item i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.w-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}

.w-grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .w-grid2 {
    grid-template-columns: 1fr;
  }

}

.widget-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

.widget-body th, .widget-body td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.widget-body th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.widget-body td {
  font-variant-numeric: tabular-nums;
}

/* ---------- quiz ---------- */
.quiz {
  margin-top: 65px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-family: var(--sans);
  border-top: 3px solid var(--si);
  box-shadow: none;
}

.quiz-head {
  padding: 25px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quiz-head h3 {
  margin: 0;
  font-size: 23px;
}

.quiz-head .score {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.q {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.q:last-of-type {
  border-bottom: 0;
}

.q .qt {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 16px;
}

.q .qt small {
  font-family: var(--mono);
  color: var(--muted);
  font-weight: 400;
  margin-right: 8px;
}

.q label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid transparent;
}

.q label:hover {
  background: var(--panel2);
}

.q label input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.q.answered label {
  cursor: default;
}

.q.answered label.correct {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}

.q.answered label.wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
}

.q .expl {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--si);
  background: var(--ground);
  font-size: 13.5px;
  color: var(--muted);
}

.quiz-foot {
  padding: 20px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.quiz-foot .verdict {
  font-weight: 600;
}

.quiz-foot .verdict.pass {
  color: var(--ok);
}

/* Lab studios place the mechanism before the console and notes. */

.w-studio {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 18px;
}

.w-studio>* {
  min-width: 0;
}

.w-console {
  padding: 16px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.w-console .w-controls {
  margin: 0;
}

.w-console .w-note:last-child {
  margin-bottom: 0;
}

.w-console .w-readout {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.widget-body details {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 12px;
}

.widget-body summary {
  cursor: pointer;
  color: var(--si);
  font-size: 12px;
  font-weight: 600;
}

.widget-body details[open] summary {
  margin-bottom: 14px;
}

.w-btn.active,.w-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.w-grid2>* {
  min-width: 0;
}

.w-ctl>span {
  white-space: normal;
}

.w-ctl input,.w-ctl select {
  min-width: 0;
  max-width: 100%;
}

.w-ctl:has(input[type=checkbox]),.w-ctl:has(input[type=radio]) {
  grid-template-columns: minmax(0,1fr) auto auto;
}

.w-ctl output:empty {
  display: none;
}

.diagram-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  /* A vertical stable gutter hides the final 15px of a horizontal-only viewport. */
}

.diagram-scroll>svg {
  display: block;
}

.diagram-scroll-hint {
  margin: 4px 0 12px;
  font: 11px/1.5 var(--sans);
  color: var(--muted);
}

.quiz-head .eyebrow {
  font-size: 9px;
  margin-bottom: 6px;
}

/* Detailed lab cards retain readable category colors in their selected state. */
.widget-body {
  container-type: inline-size;
}

.w-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.w-workbench > * {
  min-width: 0;
}

.w-insight {
  padding: 12px 16px;
  border-left: 2px solid var(--si);
  background: var(--ground);
  font-size: 13px;
  line-height: 1.65;
}

.w-stage-strip .w-btn.primary {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--accent);
}

@container (min-width: 720px) {
  .w-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .68fr);
  }
}

/* The atlas cover: a meaningful object sequence, not a decorative banner. */
.is-home .layout {
  grid-template-columns: minmax(0,1fr);
}

.is-home .sidebar,.is-home .rail {
  display: none;
}

@keyframes home-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-scan {
  from { transform: translateX(-85%); }
  to { transform: translateX(85%); }
}

.home-page {
  --home-gutter: 64px;
  max-width: 1440px;
  padding: 0 var(--home-gutter);
  margin: auto;
}

.home-hero {
  position: relative;
  margin: 0 calc(-1 * var(--home-gutter));
  padding: 58px var(--home-gutter) 22px;
  overflow: hidden;
  color: var(--hero-ink);
  background-color: var(--hero-bg);
  background-image:
    radial-gradient(circle at 82% 15%, #6fa6a61a 0, transparent 27%),
    radial-gradient(circle at 8% 78%, #d8825c12 0, transparent 24%),
    linear-gradient(#ffffff07 1px, transparent 1px),
    linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  border-bottom: 1px solid var(--hero-line);
  --panel: #25322e;
  --panel2: #303f39;
  --ground: var(--hero-bg);
  --ink: var(--hero-ink);
  --muted: var(--hero-muted);
  --line: var(--hero-line);
  --line2: #69776f;
  --accent: #e79872;
  --accent-soft: #45362f;
  --si: #88babe;
  --cu: #dea17d;
}

.home-hero:before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 0 42%, #ffffff08 49%, transparent 56%);
  content: "";
  transform: translateX(-85%);
  animation: hero-scan 1.1s .35s cubic-bezier(.2,.75,.25,1) both;
}

.home-hero > * {
  position: relative;
  z-index: 1;
  max-width: 1312px;
  margin-inline: auto;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(260px,.75fr);
  gap: 16px 60px;
  align-items: end;
}

.hero-copy>.eyebrow {
  grid-column: 1/-1;
  color: var(--hero-muted);
  animation: home-rise .55s .05s cubic-bezier(.2,.75,.25,1) both;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 13%, transparent);
}

.home-hero h1 {
  font: 600 clamp(44px,5.5vw,80px)/1.03 var(--sans);
  letter-spacing: -.055em;
  margin: 14px 0 0;
  white-space: nowrap;
  color: var(--hero-ink);
  text-wrap: balance;
  animation: home-rise .7s .1s cubic-bezier(.2,.75,.25,1) both;
}

.home-hero h1 em {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -.055em;
}

.hero-intro .lede {
  font: 17px/1.7 var(--serif);
  color: var(--hero-muted);
  margin: 0 0 18px;
  max-width: 40ch;
}

.hero-intro {
  animation: home-rise .7s .18s cubic-bezier(.2,.75,.25,1) both;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  text-decoration: none;
  font: 12px var(--sans);
  color: var(--hero-ink);
  border-bottom: 1px solid var(--hero-line);
  padding-bottom: 6px;
  transition: gap .2s, border-color .2s, color .2s;
}

.text-link:hover {
  gap: 31px;
  color: var(--hero-ink);
  border-color: var(--accent);
}

.hero-visual {
  margin-top: 40px;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 45%, #8bbdc112, transparent 70%), #202d29cc;
  box-shadow: 0 24px 70px #0002;
  animation: home-rise .8s .25s cubic-bezier(.2,.75,.25,1) both;
}

.atlas-journey {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.journey-stage {
  position: relative;
  padding: 16px 18px 20px;
  text-decoration: none;
  color: var(--ink);
  border-left: 1px solid var(--line);
  font-family: var(--sans);
  transition: background .2s, color .2s;
}

.journey-stage:first-child {
  border-left: 0;
}

.journey-stage:hover {
  background: color-mix(in srgb, var(--si) 9%, var(--panel));
  color: var(--hero-ink);
}

.journey-number {
  display: flex;
  justify-content: space-between;
  font: 10px var(--mono);
  color: var(--muted);
}

.journey-number span {
  color: var(--accent);
  font-size: 15px;
}

.atlas-object {
  display: block;
  width: 100%;
  color: var(--si);
  height: auto;
}

.journey-stage .atlas-object {
  height: 170px;
  margin: 5px 0 9px;
  filter: drop-shadow(0 11px 7px #23322712);
  transition: transform .35s cubic-bezier(.2,.75,.25,1), filter .35s;
}

.journey-stage:not(:last-child):after {
  content: "→";
  position: absolute;
  right: -10px;
  top: 47%;
  z-index: 1;
  width: 20px;
  background: var(--panel);
  color: var(--accent);
  text-align: center;
  font: 15px var(--mono);
}
.journey-stage:hover .atlas-object { transform: translateY(-7px) scale(1.015); filter: drop-shadow(0 16px 9px #0004); }
.journey-stage:focus-visible { outline-offset: -4px; background: var(--panel2); }
.path-option:focus-visible, .mod-card:focus-visible { outline-offset: 4px; border-color: var(--accent); }
.atlas-journey .atlas-object { stroke-width: 1.7; }
.journey-stage strong {
  display: block;
  font-size: 15px;
  letter-spacing: -.025em;
  font-weight: 600;
}

.journey-detail {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.hero-caption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  font: 9px/1.5 var(--mono);
  color: var(--hero-muted);
  letter-spacing: .035em;
  animation: home-rise .65s .5s cubic-bezier(.2,.75,.25,1) both;
}

.hero-caption-meta {
  text-align: right;
}

.reading-paths,.home-proof,.home-curriculum {
  padding-top: 72px;
  scroll-margin-top: 80px;
}

.section-kicker>span {
  font: 10px var(--mono);
  color: var(--accent);
  letter-spacing: .07em;
}

.section-kicker h2 {
  font: 600 35px/1.2 var(--sans);
  letter-spacing: -.04em;
  margin: 12px 0 30px;
}

.path-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.path-option {
  display: flex;
  flex-direction: column;
  padding: 30px 32px 24px;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform .25s cubic-bezier(.2,.75,.25,1), border-color .2s, box-shadow .25s;
}

.path-option:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-4px);
  box-shadow: 0 20px 45px #2332270c;
}

.survey-path {
  background: var(--accent-soft);
}

.deep-path {
  background: var(--panel2);
}

.path-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.path-arrow {
  font-size: 25px;
  color: var(--accent);
}

.path-option h3 {
  font: 600 28px/1.25 var(--sans);
  letter-spacing: -.035em;
  margin: 22px 0 12px;
}

.path-option p {
  color: var(--muted);
  font: 15px/1.6 var(--serif);
  margin: 0 0 25px;
  max-width: 47ch;
}

.path-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line2);
  font: 11px var(--sans);
}

.path-bottom>span {
  color: var(--muted);
}

.path-bottom b {
  font-weight: 600;
}

.home-proof {
  display: grid;
  grid-template-columns: minmax(260px,.72fr) minmax(0,1.28fr);
  gap: clamp(40px,7vw,100px);
  align-items: end;
}

.proof-intro .section-kicker h2 {
  margin-bottom: 16px;
  max-width: 15ch;
}

.proof-intro > p {
  max-width: 43ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.proof-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
}

.proof-item {
  min-width: 0;
  padding: 22px 22px 24px;
  border-left: 1px solid var(--line);
  font-family: var(--sans);
}

.proof-item:first-child {
  border-left: 0;
}

.proof-item b {
  display: block;
  font: 600 clamp(32px,3.3vw,48px)/1 var(--sans);
  letter-spacing: -.055em;
  color: var(--accent);
}

.proof-item span {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.proof-item small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font: 10px/1.55 var(--mono);
}

.curriculum-part {
  border-top: 1px solid var(--line);
}

.curriculum-part:last-child {
  border-bottom: 1px solid var(--line);
}

.curriculum-part summary {
  display: grid;
  grid-template-columns: 55px 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 24px 6px;
  cursor: pointer;
  list-style: none;
}

.curriculum-part summary::-webkit-details-marker {
  display: none;
}

.part-index {
  font: 12px var(--mono);
  color: var(--accent);
}

.curriculum-part summary b {
  display: block;
  font: 600 20px var(--sans);
  letter-spacing: -.02em;
}

.curriculum-part summary small {
  display: block;
  font: 11px var(--sans);
  color: var(--muted);
  margin-top: 7px;
}

.expand-sign {
  font: 25px var(--sans);
  color: var(--muted);
}

.curriculum-part[open] .expand-sign {
  transform: rotate(45deg);
}

.mod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 35px;
  padding: 0 0 24px 75px;
}

.mod-card {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--sans);
}

.mod-card:hover {
  color: var(--accent);
}

.mod-card .n {
  font: 10px var(--mono);
  color: var(--muted);
}

.mod-card .t {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.mod-card .m {
  display: block;
  font: 10px var(--mono);
  color: var(--muted);
  margin-top: 6px;
}

.card-arrow {
  color: var(--muted);
  font-size: 14px;
}

.mod-card.passed .n {
  color: var(--ok);
}

.atlas-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: center;
  padding: 36px 0 0;
  margin-top: 50px;
  border-top: 1px solid var(--line);
  font: 11px var(--sans);
  color: var(--muted);
}

.atlas-footer b {
  font-size: 16px;
  color: var(--ink);
}


.atlas-footer a {
  text-decoration: none;
}

/* Responsive recomposition; no page-wide horizontal scrolling. */
@media(min-width:1550px) {
  .layout {
    grid-template-columns: 250px minmax(0,1fr) 250px;
  }

  .article {
    padding-left: 55px;
    padding-right: 55px;
  }

  .rail {
    padding-right: 30px;
  }

  .sidebar {
    padding-left: 20px;
    padding-right: 20px;
  }



}

@media(max-width:1180px) {
  .layout {
    grid-template-columns: 210px minmax(0,1fr);
  }

  .rail {
    display: none;
  }

  .article {
    max-width: 900px;
  }


  .home-page {
    --home-gutter: 40px;
  }

  .hero-copy {
    gap: 15px 35px;
  }

  .home-hero h1 {
    font-size: clamp(44px,5.7vw,68px);
  }

  .hero-intro .lede {
    font-size: 16px;
  }

}

@media(max-width:860px) {
  .topbar {
    height: 60px;
    padding: 0 18px;
    gap: 14px;
  }

  .layout {
    grid-template-columns: minmax(0,1fr);
  }

  .menu-btn {
    display: grid;
  }

  .sidebar,.is-home .sidebar {
    display: block;
    position: fixed;
    left: 0;
    top: 60px;
    width: 285px;
    height: calc(100vh - 60px);
    z-index: 40;
    background: var(--ground);
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: none;
  }

  .scrim {
    display: block;
    position: fixed;
    inset: 60px 0 0;
    background: #0006;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }

  .scrim.show {
    opacity: 1;
    pointer-events: auto;
  }

  .article {
    padding: 32px 30px 0;
    max-width: 850px;
  }

  .search-shortcut {
    display: none;
  }

  .search {
    width: auto;
    flex: 1;
  }

  .progress-pill {
    display: none;
  }

  .home-page {
    --home-gutter: 30px;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .hero-copy>.eyebrow {
    font-size: 9px;
  }

  .home-hero h1 {
    font-size: 58px;
  }

  .hero-intro {
    display: flex;
    gap: 25px;
    align-items: end;
  }

  .hero-intro .lede {
    max-width: 50ch;
    margin-bottom: 0;
  }

  .text-link {
    flex: none;
    font-size: 11px;
  }

  .journey-stage {
    padding: 12px 10px 16px;
  }

  .journey-stage .atlas-object {
    height: 115px;
  }

  .journey-stage strong {
    font-size: 12px;
  }

  .journey-detail {
    font-size: 10px;
  }

  .hero-visual {
    margin-top: 30px;
  }

  .path-option {
    padding: 22px;
  }

  .home-proof {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .proof-intro .section-kicker h2 {
    max-width: 19ch;
  }

  .path-option h3 {
    font-size: 25px;
  }

  .atlas-footer {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }


}

@media(max-width:560px) {
  body {
    font-size: 16px;
  }

  .topbar {
    padding: 0 12px;
    gap: 6px;
  }

  .brand {
    font-size: 15px;
  }

  .brand .mark {
    width: 23px;
    height: 23px;
  }

  .search {
    width: 44px;
    min-width: 44px;
    flex: 0 0 44px;
    margin-left: auto;
  }

  .search input {
    height: 44px;
    padding-left: 30px;
    padding-right: 0;
    color: transparent;
    cursor: pointer;
  }

  .search input::placeholder {
    color: transparent;
  }

  .search>svg {
    left: 15px;
    top: 15px;
  }

  .search:focus-within {
    position: absolute;
    left: 14px;
    right: 14px;
    width: auto;
    z-index: 45;
  }

  .search:focus-within input {
    color: var(--ink);
    padding-left: 34px;
    padding-right: 12px;
    background: var(--panel);
  }

  .search:focus-within input::placeholder {
    color: var(--muted);
  }

  .search-results {
    width: 100%;
    font-size: 12px;
  }

  .topbar .spacer {
    display: none;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .menu-btn {
    border: 0;
    width: 44px;
  }

  .article {
    padding: 26px 20px 0;
  }

  .title {
    font-size: 37px;
    line-height: 1.08;
  }

  .eyebrow {
    font-size: 9px;
    gap: 5px;
  }

  .eyebrow .dot {
    display: none;
  }

  .eyebrow .meta {
    flex-basis: 100%;
  }

  .chapter-intro {
    grid-template-columns: 1fr;
  }

  .chapter-intro {
    grid-template-columns: minmax(0,1fr) 100px;
    gap: 8px;
  }

  .chapter-intro>div:first-child {
    display: contents;
  }

  .chapter-intro .title {
    grid-column: 1/-1;
  }

  .chapter-object {
    display: block;
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }

  .chapter-object .atlas-object {
    height: 110px;
  }

  .chapter-intro .chapter-deck {
    grid-column: 1;
    font-size: 15px;
  }

  .chapter-deck {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .stage-ribbon a {
    font-size: 10px;
    gap: 4px;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 4px;
  }

  .stage-node {
    font-size: 9px;
  }

  .stage-ribbon a.current:after {
    right: 8px;
  }

  .chapter-tools {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding-bottom: 16px;
    font-size: 10px;
  }


  .reading-status {
    display: none;
  }


  .prose h2 {
    font-size: 26px;
    margin-top: 48px;
    padding-top: 21px;
  }

  .prose h3 {
    font-size: 20px;
  }

  .prose p {
    margin-bottom: 19px;
  }

  .callout {
    padding: 16px;
    font-size: 15px;
  }

  .prose th,.prose td {
    padding: 10px;
  }

  /* Keep explanatory columns readable instead of wrapping one word per line. */
  .prose > .table-scroll > table:has(th:nth-child(4)) {
    min-width: 560px;
  }

  .prose > .table-scroll:has(th:nth-child(4))::before {
    content: "Scroll horizontally to read all columns →";
    display: block;
    position: sticky;
    left: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel2);
    color: var(--muted);
    font: 11px/1.5 var(--sans);
  }

  .widget-head {
    padding: 13px 14px;
    align-items: flex-start;
  }

  .widget-head h4 {
    font-size: 14px!important;
  }

  .widget-head .tag {
    font-size: 11px;
    padding-top: 2px;
  }

  .widget-cap {
    padding: 12px 14px 0;
    font-size: 12px;
  }

  .widget-body {
    padding: 14px!important;
  }

  .w-console {
    padding: 12px;
  }

  .w-ctl {
    font-size: 12px;
  }

  .w-ctl output {
    font-size: 11px;
    min-width: 42px;
  }

  .w-stat b {
    font-size: 17px;
  }

  .w-formula {
    font-size: 11px;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .w-grid2 {
    grid-template-columns: 1fr;
  }

  .quiz-head {
    display: block;
    padding: 20px;
  }

  .quiz-head .score {
    display: block;
    margin-top: 10px;
  }

  .q {
    padding: 20px 16px;
  }

  .quiz-foot {
    padding: 18px 16px;
    font-size: 12px;
  }

  .prevnext {
    gap: 22px;
    font-size: 14px;
  }

  .prevnext small {
    font-size: 9px;
  }

  .home-page {
    --home-gutter: 20px;
  }

  .home-hero {
    padding-top: 32px;
  }

  .home-hero h1 {
    font-size: 42px;
    white-space: normal;
    letter-spacing: -.055em;
    margin-top: 5px;
  }

  .hero-copy {
    gap: 15px;
  }

  .hero-intro {
    display: block;
  }

  .hero-intro .lede {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
  }

  .hero-visual {
    margin-top: 24px;
  }

  .atlas-journey {
    grid-template-columns: repeat(6,minmax(0,1fr));
  }

  .journey-stage {
    grid-column: span 2;
    padding: 10px 8px 14px;
  }

  .journey-stage:nth-child(4),.journey-stage:nth-child(5) {
    grid-column: span 3;
    border-top: 1px solid var(--line);
  }

  .journey-stage:nth-child(4) {
    border-left: 0;
  }

  .journey-stage .atlas-object {
    height: 87px;
    margin: 0;
  }

  .journey-stage:nth-child(4) .atlas-object,.journey-stage:nth-child(5) .atlas-object {
    height: 96px;
  }

  .journey-stage strong {
    font-size: 11px;
    line-height: 1.4;
  }

  .journey-detail {
    display: none;
  }

  .journey-number {
    font-size: 8px;
  }

  .journey-number span {
    font-size: 12px;
  }

  .hero-caption {
    font-size: 8px;
    gap: 14px;
  }


  .reading-paths,.home-proof,.home-curriculum {
    padding-top: 40px;
  }

  .section-kicker>span {
    font-size: 9px;
  }

  .section-kicker h2 {
    font-size: 28px;
    margin: 12px 0 22px;
  }

  .path-options {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .path-option {
    padding: 21px;
  }

  .path-option h3 {
    margin: 14px 0 10px;
    font-size: 26px;
  }

  .path-option p {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .path-bottom {
    font-size: 10px;
  }

  .home-proof {
    gap: 22px;
  }

  .proof-list {
    grid-template-columns: 1fr;
  }

  .proof-item {
    display: grid;
    grid-template-columns: 76px minmax(0,1fr);
    gap: 2px 14px;
    align-items: baseline;
    padding: 17px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .proof-item:first-child {
    border-top: 0;
  }

  .proof-item b {
    grid-row: 1 / span 2;
    font-size: 32px;
  }

  .proof-item span {
    margin-top: 0;
  }

  .proof-item small {
    margin-top: 3px;
  }

  .curriculum-part summary {
    grid-template-columns: 30px 1fr auto;
    gap: 12px;
    padding: 22px 0;
  }

  .curriculum-part summary b {
    font-size: 18px;
  }

  .curriculum-part summary small {
    font-size: 10px;
  }

  .part-index {
    font-size: 10px;
  }

  .mod-grid {
    grid-template-columns: 1fr;
    padding-left: 0;
    padding-bottom: 18px;
  }

  .mod-card {
    grid-template-columns: 30px 1fr auto;
  }

  .atlas-footer {
    font-size: 10px;
    margin-top: 32px;
    padding-top: 25px;
  }

  .atlas-footer b {
    font-size: 15px;
  }

}

@media (max-width: 560px) {
  .chapter-intro { display: block; }
  .chapter-plate { grid-template-columns: minmax(0,1fr) 132px; min-height: 184px; padding: 18px 15px 0; margin-top: 4px; }
  .plate-copy strong { font-size: 21px; margin: 12px 0 9px; max-width: 12ch; }
  .plate-index { font-size: 10px; }
  .plate-path { font-size: 10px; }
  .plate-drawing { width: 132px; height: 120px; }
  .plate-drawing .atlas-object { height: 120px; }
  .plate-drawing:before { width: 110px; height: 110px; left: 11px; top: 5px; }
  .plate-cross { display: none; }
  .plate-label { display: grid; gap: 3px; margin: 18px -15px 0; font-size: 10px; padding: 9px 12px; }

  .journey-stage:nth-child(3):after { display: none; }
  .journey-stage:nth-child(4):after { top: 42%; }
  .prose > p:first-child:first-letter { font-size: 3.2em; }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none!important;
    transition: none!important;
  }

}

/* Preserve complete diagrams when two readable SVG viewports cannot fit side by side. */
.w-grid2.diagram-grid-stack { grid-template-columns: minmax(0, 1fr) !important; }
.diagram-grid-stack > svg.w-svg { max-width: 520px; margin-inline: auto; }
.diagram-grid-stack .diagram-scroll { max-width: 560px; width: 100%; margin-inline: auto; }
