/* =====================================================================
   3Blue1Brown blackboard theme: blue, gold, coral and violet only.
   ===================================================================== */
:root {
  --bg: #0B0E14;
  --bg2: #111622;
  --panel: #131927;
  --panel-2: #182032;
  --line: rgba(148, 160, 184, 0.16);
  --line-strong: rgba(148, 160, 184, 0.3);
  --grid: rgba(88, 196, 221, 0.06);
  --blue: #58C4DD;
  --blue-l: #9CDCEB;
  --blue-d: #29ABCA;
  --steel: #5F7391;
  --gold: #F2C14E;
  --coral: #FC6255;
  --lavender: #9A72AC;
  --violet: #C792EA;
  --chalk: #ECE6D8;
  --chalk-2: #94A0B8;
  --math: "STIX Two Text", "STIX Two Math", "Latin Modern Roman", "CMU Serif", "Cambria Math", Georgia, "Times New Roman", serif;
  --sans: Inter, "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --rail-w: 188px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--chalk);
  font: 400 16px/1.65 var(--sans);
  overflow-x: hidden;
}
::selection { background: rgba(242, 193, 78, 0.35); color: var(--chalk); }
a { color: var(--blue); text-decoration-color: rgba(88, 196, 221, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--blue-l); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
sub, sup { line-height: 0; font-size: 0.72em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

.math { font-family: var(--math); font-size: 1.08em; letter-spacing: 0.01em; }
.math i, i.math { font-style: italic; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--chalk-2); }
.tiny { font-size: 12.5px; line-height: 1.5; }
.gold { color: var(--gold); }
.coral { color: var(--coral); }
.blue { color: var(--blue); }
.steel { color: #8EA0BC; }
.violet { color: var(--violet); }

/* ---------------- Rail ---------------- */
.rail {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  width: var(--rail-w); padding: 10px 0 10px 18px; z-index: 40;
  display: flex; flex-direction: column; gap: 2px;
}
.rail-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px;
  color: var(--chalk-2); text-decoration: none; font-size: 13px; line-height: 1.2;
  transition: color .25s, background-color .25s;
}
.rail-num {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line-strong); font-family: var(--math); font-size: 14px;
  transition: border-color .25s, color .25s, box-shadow .25s;
}
.rail-label { opacity: 0; transform: translateX(-4px); transition: opacity .25s, transform .25s; }
.rail:hover .rail-label, .rail-item.active .rail-label { opacity: 1; transform: none; }
.rail-item:hover { color: var(--chalk); }
.rail-item.active { color: var(--chalk); }
.rail-item.active .rail-num { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, 0.35); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  padding: 96px clamp(16px, 5vw, 64px) 72px calc(var(--rail-w) + 12px);
  overflow: hidden; isolation: isolate;
  background: radial-gradient(1200px 700px at 70% 40%, rgba(41, 171, 202, 0.10), transparent 60%), var(--bg);
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(11,14,20,0.92) 0%, rgba(11,14,20,0.55) 55%, rgba(11,14,20,0.15) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 22%); }
.hero-inner { max-width: 860px; }
.eyebrow { font: 500 12.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin: 0 0 18px; }
.hero-title { font-family: var(--math); font-weight: 400; font-size: clamp(36px, 5.6vw, 72px); line-height: 1.08; margin: 0 0 22px; letter-spacing: -0.01em; }
.hero-title .gold { text-shadow: 0 0 28px rgba(242, 193, 78, 0.35); }
.hero-title .coral { font-style: italic; text-shadow: 0 0 28px rgba(252, 98, 85, 0.35); }
.hero-sub { font-size: clamp(16px, 1.5vw, 18.5px); color: #D5D0C4; max-width: 720px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 38px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; max-width: 760px; }
.hero-stats > div { border-top: 1px solid var(--line-strong); padding-top: 10px; }
.hero-stats dt { font-size: 12.5px; color: var(--chalk-2); }
.hero-stats dd { margin: 2px 0 0; font: 600 clamp(18px, 2vw, 24px)/1.3 var(--mono); color: var(--chalk); }
.hero-stats div:first-child dd { color: var(--gold); }

.tour-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 999px;
  background: rgba(21, 27, 41, 0.92); border: 1px solid var(--line-strong); backdrop-filter: blur(8px);
  font-size: 14px; max-width: calc(100vw - 24px);
}
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 1.4s ease-in-out infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------------- Buttons & controls ---------------- */
button { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(24, 32, 50, 0.7); color: var(--chalk);
  font: 500 15px/1 var(--sans); text-decoration: none; transition: border-color .2s, background-color .2s, transform .15s;
}
.btn:hover { border-color: var(--blue); color: var(--chalk); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: #17130A; border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: #F6D076; color: #17130A; border-color: #F6D076; }
.btn-ghost { background: transparent; }
.btn-violet { border-color: rgba(199, 146, 234, 0.5); }
.btn-violet:hover { border-color: var(--violet); }
.btn-small { padding: 8px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.ico { font-size: .8em; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(11, 14, 20, 0.7); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
  color: var(--chalk-2); transition: color .2s, background-color .2s, box-shadow .2s; white-space: nowrap;
}
.seg button:hover { color: var(--chalk); }
.seg button[aria-selected="true"] { background: var(--panel-2); color: var(--chalk); box-shadow: inset 0 0 0 1px rgba(88, 196, 221, 0.55); }
#ch3Mode button[data-mode="kmeans"][aria-selected="true"], #ch1Mode button[data-mode="kmeans"][aria-selected="true"] { box-shadow: inset 0 0 0 1px rgba(199, 146, 234, 0.7); color: var(--violet); }

.transport { display: inline-flex; gap: 4px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(24, 32, 50, 0.7);
  cursor: pointer; display: grid; place-items: center; font-size: 13px; transition: border-color .2s, color .2s;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue-l); }
.icon-btn.play { border-color: var(--gold); color: var(--gold); }
.seed-pips { display: inline-flex; gap: 6px; align-items: center; }
.seed-pips button {
  border: 1px solid var(--line-strong); background: transparent; color: var(--chalk-2); cursor: pointer;
  font: 500 12.5px/1 var(--mono); padding: 7px 8px; border-radius: 8px; transition: all .2s;
}
.seed-pips button[aria-current="true"] { border-color: var(--gold); color: var(--gold); background: rgba(242, 193, 78, 0.08); }

/* ---------------- Chapters ---------------- */
main { padding-left: var(--rail-w); }
.chapter { max-width: 1240px; margin: 0 auto; padding: 96px clamp(16px, 3.5vw, 48px) 24px; scroll-margin-top: 8px; }
.chapter-head { max-width: 820px; margin-bottom: 26px; }
.chapter-num { font: 500 12.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.chapter h2 { font-family: var(--math); font-weight: 400; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; margin: 12px 0 16px; }
.lede { color: #D5D0C4; font-size: 17px; margin: 0; }
.lede b { color: var(--chalk); }

.panel {
  position: relative; background: linear-gradient(180deg, rgba(21, 27, 41, 0.92), rgba(17, 22, 34, 0.92));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 14px; }
.hint { color: var(--chalk-2); font-size: 13.5px; }
.canvas-wrap { position: relative; min-width: 0; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
canvas.stage { display: block; width: 100%; }
.stage-bars { height: 100%; min-height: 470px; }
.stage-plane { height: 100%; min-height: 520px; touch-action: none; cursor: crosshair; }
.stage-cloud { height: 100%; min-height: 500px; }
.stage-gauge { height: 64px; }
.stage-pairs { height: 108px; }
.stage-strip { height: 72px; margin: 6px 0 4px; }
.caption { color: var(--chalk-2); font-size: 14px; margin: 14px 2px 0; min-height: 1.6em; }
.caption b { color: var(--chalk); }

.loading {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--radius);
  background: rgba(11, 14, 20, 0.82); color: var(--chalk-2); font: 500 14px var(--mono); z-index: 5; text-align: center; padding: 24px;
}
.loading.error { color: var(--coral); }
.ready .loading { display: none; }

/* Chapter I */
.ch1-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.gauges { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gauge, .readout, .mode-card { background: rgba(11, 14, 20, 0.6); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.gauge-title, .r-label { font-size: 12.5px; letter-spacing: .02em; color: var(--chalk-2); text-transform: none; }
.gauge-formula { color: var(--chalk); font-size: 17px; margin: 2px 0 4px; }
.gauge-read { font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.gauge-read .mono:first-child { font-size: 20px; font-weight: 600; }
.verdict { margin-top: 6px; }
.chip { display: inline-block; font: 600 11.5px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; }
.chip-blue { background: rgba(88, 196, 221, 0.12); color: var(--blue-l); border: 1px solid rgba(88, 196, 221, 0.35); }
.chip-coral { background: rgba(252, 98, 85, 0.12); color: var(--coral); border: 1px solid rgba(252, 98, 85, 0.45); }
.chip-violet { background: rgba(199, 146, 234, 0.12); color: var(--violet); border: 1px solid rgba(199, 146, 234, 0.4); }
.top3-compare { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; font-size: 12.5px; margin: 6px 0 8px; }
.top3-compare .tlabel { font-family: var(--mono); color: var(--chalk-2); }
.top3-row { display: flex; flex-wrap: wrap; gap: 4px; }
.fchip { font: 500 11.5px/1.2 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--chalk); transition: all .3s; }
.fchip.new { border-color: var(--coral); color: var(--coral); background: rgba(252, 98, 85, 0.1); }
.fchip.kept { border-color: rgba(242, 193, 78, 0.5); color: var(--gold); }

/* Chapter II */
.ch2-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.readouts { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.r-val { font-size: 26px; font-weight: 600; line-height: 1.25; }
.r-sub { font-size: 13px; color: var(--chalk-2); margin-top: 4px; }
.meter { position: relative; height: 8px; border-radius: 99px; background: rgba(148, 160, 184, 0.14); margin-top: 8px; overflow: visible; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--blue); transition: width .12s linear, left .12s linear, background-color .25s; }
.meter-violet { background: var(--violet); }
.meter-tau { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.meter-zero { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--chalk-2); }
.rank-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 6px; border-radius: 6px; transition: background-color .3s; }
.rank-list .rk { font: 600 12px var(--mono); color: var(--bg); background: var(--gold); border-radius: 5px; padding: 2px 5px; }
.rank-list li.flipped { background: rgba(252, 98, 85, 0.12); }
.readout-insight { border-color: rgba(252, 98, 85, 0.3); }

/* Chapter III */
.ch3-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.ch3-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mode-name { font-family: var(--math); font-size: 26px; line-height: 1.2; }
.mode-desc { font-size: 14px; color: #D5D0C4; margin: 6px 0 12px; }
.range-val { font-size: 24px; font-weight: 600; }

/* Chapter IV */
.legend { display: inline-flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; color: var(--chalk-2); font-size: 12.5px; margin-left: auto; }
.sw { display: inline-block; width: 14px; height: 8px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.sw-steel { background: var(--steel); }
.sw-blue { background: var(--blue); }
.sw-coral { background: transparent; border: 1.5px solid var(--coral); }
.ch4-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.matrix { display: grid; grid-template-columns: 92px repeat(4, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.m-head { font: 500 12.5px/1.25 var(--mono); color: var(--chalk-2); padding: 4px 6px; display: flex; align-items: flex-end; }
.m-row { font-size: 13px; color: var(--chalk); padding: 6px; display: flex; flex-direction: column; justify-content: center; }
.m-row .fam { font: 500 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--chalk-2); }
.m-row .fam.neural { color: var(--violet); }
.m-cell {
  position: relative; text-align: left; cursor: pointer; padding: 9px 10px 10px; border-radius: 10px; min-width: 0;
  background: rgba(11, 14, 20, 0.66); border: 1px solid var(--line); transition: border-color .2s, background-color .4s, transform .15s;
}
.m-cell:hover { border-color: rgba(88, 196, 221, 0.6); }
.m-cell[aria-selected="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 20px -4px rgba(242, 193, 78, 0.45); }
.m-cell.dev { border-color: rgba(252, 98, 85, 0.55); }
.m-cell.dev[aria-selected="true"] { border-color: var(--gold); }
.m-val { font: 600 18px/1.2 var(--mono); color: var(--chalk); }
.m-delta { font: 500 11.5px var(--mono); color: var(--chalk-2); }
.m-delta.bad { color: var(--coral); }
.bars { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.bar { position: relative; height: 6px; border-radius: 99px; background: rgba(148, 160, 184, 0.1); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .7s cubic-bezier(.22, .9, .3, 1); }
.bar.paper > span { background: var(--steel); }
.bar.ours > span { background: var(--blue); box-shadow: 0 0 8px rgba(88, 196, 221, 0.6); }
.m-cell.dev .bar.ours > span { background: var(--coral); box-shadow: 0 0 8px rgba(252, 98, 85, 0.5); }
.m-cell .heat { position: absolute; inset: 0; border-radius: 10px; pointer-events: none; transition: background-color .6s; }
.m-cell > *:not(.heat) { position: relative; }

.detail { background: rgba(11, 14, 20, 0.6); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.detail h4 { font-family: var(--math); font-weight: 400; font-size: 22px; margin: 0 0 4px; line-height: 1.2; }
.detail .sub { color: var(--chalk-2); font-size: 13px; margin-bottom: 12px; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.detail dt { color: var(--chalk-2); }
.detail dd { margin: 0; text-align: right; font-family: var(--mono); }
.detail .verdict-box { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.verdict-box.ok { background: rgba(88, 196, 221, 0.08); border: 1px solid rgba(88, 196, 221, 0.3); }
.verdict-box.dev { background: rgba(252, 98, 85, 0.08); border: 1px solid rgba(252, 98, 85, 0.4); }

.insight {
  margin-top: 20px; display: grid; grid-template-columns: minmax(270px, auto) 1fr; gap: 24px; align-items: center;
  border: 1px solid rgba(242, 193, 78, 0.35); border-radius: var(--radius); padding: 22px 24px;
  background: radial-gradient(600px 200px at 0% 50%, rgba(242, 193, 78, 0.08), transparent 70%), rgba(17, 22, 34, 0.9);
}
.insight .big { font-size: clamp(24px, 2.6vw, 34px); font-weight: 600; color: var(--gold); line-height: 1.1; white-space: nowrap; }
.insight .big .slash { color: var(--chalk-2); }
.insight h3 { font-family: var(--math); font-weight: 400; font-size: 24px; margin: 0 0 6px; }
.insight p { margin: 0; color: #D5D0C4; font-size: 15px; }

/* Chapter V */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: rgba(17, 22, 34, 0.9); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { font-family: var(--math); font-weight: 400; font-size: 22px; margin: 12px 0 8px; line-height: 1.2; }
.card p { margin: 0; color: #D5D0C4; font-size: 15px; }
.card-glyph { font-family: var(--math); font-size: 24px; height: 40px; display: flex; align-items: center; }
.provenance { margin-top: 26px; border-top: 1px solid var(--line-strong); padding-top: 20px; }
.provenance h3 { font-family: var(--math); font-weight: 400; font-size: 24px; margin: 0 0 12px; }
.prov-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.prov-list a {
  display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(11, 14, 20, 0.6);
  text-decoration: none; color: var(--chalk); transition: border-color .2s, transform .2s; height: 100%;
}
.prov-list a:hover { border-color: var(--blue); transform: translateY(-2px); }
.prov-list .pk { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.prov-list .pt { display: block; font-size: 15px; margin: 4px 0 2px; }
.prov-list .pr { font: 400 12px var(--mono); color: var(--chalk-2); overflow-wrap: anywhere; }

.foot { padding: 40px clamp(16px, 3.5vw, 48px) 48px calc(var(--rail-w) + 24px); display: flex; gap: 12px 24px; flex-wrap: wrap; justify-content: space-between; font-size: 13px; color: var(--chalk); border-top: 1px solid var(--line); margin-top: 72px; }

.toast { position: fixed; right: 16px; bottom: 16px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: #2A1517; border: 1px solid var(--coral); color: var(--chalk); font-size: 14px; z-index: 80; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1280px) {
  :root { --rail-w: 64px; }
  .rail-label { display: none; }
  .rail { padding-left: 12px; }
}
@media (max-width: 1100px) {
  .ch1-grid, .ch2-grid, .ch3-grid, .ch4-grid { grid-template-columns: minmax(0, 1fr); }
  .gauges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch3-side { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
  .insight { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  .rail {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; flex-direction: row; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(11, 14, 20, 0.92); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  }
  .rail-item { padding: 2px; }
  .rail-num { flex-basis: 34px; height: 34px; }
  body { padding-bottom: 56px; }
  .hero { padding: 72px 16px 56px; min-height: auto; }
  .hero-canvas { opacity: 0.32; }
  .hero::after { background: linear-gradient(180deg, rgba(11,14,20,0.6), rgba(11,14,20,0.92)); }
  .hero-stats { grid-template-columns: 1fr; gap: 8px; }
  .chapter { padding: 64px 16px 12px; }
  .panel { padding: 12px; }
  .lede { font-size: 16px; }
  .gauges, .readouts, .ch3-side { grid-template-columns: minmax(0, 1fr); }
  .stage-bars { min-height: 420px; }
  .stage-plane { min-height: 380px; }
  .stage-cloud { min-height: 360px; }
  .cards { grid-template-columns: 1fr; }
  .matrix { grid-template-columns: 54px repeat(4, minmax(0, 1fr)); gap: 4px; }
  .m-cell { padding: 6px 5px 7px; border-radius: 8px; }
  .m-val { font-size: 12.5px; }
  .m-delta { font-size: 10px; }
  .m-head { font-size: 10.5px; padding: 2px; word-break: break-word; }
  .m-row { font-size: 11px; padding: 2px; }
  .legend { margin-left: 0; }
  .foot { padding: 28px 16px 80px; }
  .tour-bar { bottom: 70px; }
  .toast { left: 12px; right: 12px; bottom: 70px; }
}
