:root {
  color-scheme: dark;
  --bg: #05081d;
  --panel: rgba(10, 15, 43, 0.86);
  --panel-strong: #0c1234;
  --ink: #eef5ff;
  --muted: #9ba8c9;
  --dim: #65708f;
  --line: rgba(140, 166, 225, 0.18);
  --cyan: #4ff5df;
  --cyan-soft: rgba(79, 245, 223, 0.1);
  --coral: #ff657f;
  --coral-soft: rgba(255, 101, 127, 0.1);
  --violet: #9385ff;
  --gold: #ffd77a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(55, 83, 186, 0.23), transparent 30rem),
    radial-gradient(circle at 88% 26%, rgba(93, 57, 174, 0.18), transparent 34rem),
    var(--bg);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  line-height: 1.62;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(112, 139, 202, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 139, 202, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

a { color: inherit; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
code, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
code { color: #c9c3ff; }

.ambient {
  position: absolute;
  inset: 0 0 auto;
  height: 820px;
  overflow: hidden;
  pointer-events: none;
}
.ambient::before, .ambient::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(79, 245, 223, 0.09);
  transform: rotate(45deg);
}
.ambient::before { left: -260px; top: 80px; }
.ambient::after { right: -300px; top: 190px; border-color: rgba(147, 133, 255, 0.1); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 29, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
.brand > span:last-child { display: grid; gap: 2px; }
.brand b { font-size: 13px; letter-spacing: 0.22em; }
.brand small, .eyebrow {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.2em;
}
.brand-mark { position: relative; width: 34px; height: 34px; display: block; }
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  transform: rotate(45deg);
  border: 1px solid var(--cyan);
}
.brand-mark::before { inset: 3px; opacity: 0.26; }
.brand-mark::after { inset: 10px; box-shadow: 0 0 18px rgba(79, 245, 223, 0.5); }
.brand-mark i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cyan);
}
.brand-mark i:nth-child(1) { left: 0; top: 16px; }
.brand-mark i:nth-child(2) { right: 0; top: 16px; }
.brand-mark i:nth-child(3) { left: 16px; top: 0; }

.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav a, .topbar nav button {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.topbar nav button:hover { color: var(--cyan); border-color: rgba(79, 245, 223, 0.42); }

main {
  position: relative;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  min-height: 650px;
  padding: 112px 0 70px;
  display: grid;
  align-content: center;
}
.hero h1 {
  max-width: 920px;
  margin: 16px 0 24px;
  font-size: clamp(48px, 8.5vw, 102px);
  line-height: 0.94;
  letter-spacing: -0.055em;
  font-weight: 310;
}
.hero h1::after {
  content: "";
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin: 0 0 0.1em 0.16em;
  background: var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 28px var(--cyan);
}
.lead {
  max-width: 790px;
  margin: 0;
  color: #bdc8e2;
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 1.55;
}
.hero-actions {
  margin-top: 35px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.hero-actions a {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.hero-actions .primary-action {
  padding: 12px 17px;
  color: #041612;
  background: var(--cyan);
  font-weight: 700;
}
.hero-facts {
  margin: 74px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-facts div { padding: 18px 20px; border-right: 1px solid var(--line); }
.hero-facts div:last-child { border-right: 0; }
.hero-facts dt { color: var(--dim); font-size: 8px; letter-spacing: 0.14em; }
.hero-facts dd { margin: 6px 0 0; color: var(--cyan); font-size: 16px; letter-spacing: 0.05em; }

.primer {
  padding: 42px 0 62px;
  border-top: 1px solid var(--line);
}
.primer h2 {
  max-width: 740px;
  margin: 8px 0 28px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 380;
}
.primer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}
.primer-grid article { min-height: 126px; padding: 20px; background: var(--panel-strong); }
.primer-grid b { color: var(--cyan); font-size: 12px; }
.primer-grid p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }

.chapter {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}
.chapter-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.chapter-heading > span {
  min-width: 42px;
  padding-top: 8px;
  color: var(--cyan);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}
.chapter-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 380;
}
.chapter-intro {
  max-width: 810px;
  margin: 28px 0 42px 62px;
  color: #b3bfdc;
  font-size: 18px;
}

.pipeline {
  margin: 42px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
  border: 1px solid var(--line);
}
.pipeline li {
  position: relative;
  min-height: 170px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(79, 245, 223, 0.035), transparent 60%);
}
.pipeline li:last-child { border-right: 0; }
.pipeline li:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 2;
  right: -9px;
  top: 50%;
  width: 18px;
  color: var(--cyan);
  background: var(--bg);
  text-align: center;
}
.pipeline span { color: var(--dim); font-family: monospace; font-size: 11px; }
.pipeline b { font-size: 12px; letter-spacing: 0.12em; }
.pipeline small { color: var(--muted); font-size: 11px; line-height: 1.5; }

.plain-note {
  max-width: 850px;
  margin: 38px 0 0 62px;
  padding: 18px 22px;
  border-left: 2px solid var(--cyan);
  background: linear-gradient(90deg, var(--cyan-soft), transparent);
}
.plain-note b { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.plain-note p { margin: 8px 0 0; color: #b9c4df; }

.neuron-anatomy {
  display: grid;
  grid-template-columns: 1fr 35px 1fr 45px 1.4fr 45px 0.8fr;
  align-items: stretch;
  border: 1px solid var(--line);
  background: rgba(7, 11, 33, 0.7);
}
.neuron-anatomy > i {
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 22px;
  font-style: normal;
}
.anatomy-inputs, .anatomy-weights, .anatomy-sum, .anatomy-output {
  min-width: 0;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 9px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.anatomy-inputs { border-left: 0; }
.anatomy-output { border-right: 0; text-align: center; }
.neuron-anatomy span { color: var(--dim); font-size: 8px; letter-spacing: 0.13em; }
.anatomy-inputs div, .anatomy-weights div {
  padding: 7px 0;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.anatomy-inputs b, .anatomy-weights b { color: var(--cyan); font-family: monospace; }
.anatomy-inputs small, .anatomy-weights small { color: var(--muted); font-size: 9px; }
.neuron-anatomy code { color: var(--ink); font-size: 10px; }
.anatomy-sum b { color: #b8c4de; font-size: 10px; font-weight: 450; }
.anatomy-sum strong, .anatomy-output strong { color: var(--cyan); font-family: monospace; font-size: 19px; }
.anatomy-output small { color: var(--muted); font-size: 9px; }
.concept-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.concept-grid article { min-height: 190px; padding: 20px; border-right: 1px solid var(--line); }
.concept-grid article:last-child { border-right: 0; }
.concept-grid b { font-size: 12px; }
.concept-grid p { margin: 13px 0 0; color: var(--muted); font-size: 11px; }

.normalization-story {
  display: grid;
  grid-template-columns: 1fr 48px 1.3fr 48px 1fr;
  align-items: stretch;
}
.normalization-story > div {
  min-height: 150px;
  padding: 22px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  background: var(--panel);
}
.normalization-story > i { display: grid; place-items: center; color: var(--cyan); font-style: normal; }
.normalization-story span { color: var(--dim); font-size: 8px; letter-spacing: 0.14em; }
.normalization-story b { margin: 8px 0; color: var(--cyan); font-family: monospace; font-size: 16px; }
.normalization-story p { margin: 0; color: var(--muted); font-size: 10px; }
.normalization-table { margin-top: 22px; border: 1px solid var(--line); }
.normalization-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr 1.2fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.normalization-row:last-child { border-bottom: 0; }
.normalization-row > * { min-width: 0; padding: 11px 14px; }
.normalization-row > * + * { border-left: 1px solid var(--line); }
.normalization-row.head { min-height: 38px; color: var(--dim); background: rgba(139, 161, 218, 0.04); font-size: 8px; letter-spacing: 0.12em; }
.normalization-row b { font-size: 10px; }
.normalization-row code { font-size: 10px; }
.normalization-row span, .normalization-row small { color: var(--muted); font-size: 10px; }
.normalization-details {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.normalization-details article { padding: 19px 20px; border-left: 2px solid var(--violet); background: rgba(147, 133, 255, 0.055); }
.normalization-details b { font-size: 11px; }
.normalization-details p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.lab {
  display: grid;
  grid-template-columns: minmax(250px, 0.36fr) minmax(0, 0.64fr);
  border: 1px solid var(--line);
  background: rgba(7, 11, 33, 0.68);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.28);
}
.lab-controls {
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 24px;
  border-right: 1px solid var(--line);
}
.lab-controls label { display: grid; gap: 9px; }
.lab-controls label > span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #bbc6df;
  font-size: 11px;
}
.lab-controls output { color: var(--cyan); font-family: monospace; }
input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: rgba(139, 161, 218, 0.17);
}
input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: 2px solid #071122;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(79, 245, 223, 0.7);
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid #071122;
  border-radius: 50%;
  background: var(--cyan);
}

.flight-panel { position: relative; min-width: 0; display: flex; flex-direction: column; background: #071027; }
.flight-panel canvas { display: block; width: 100%; height: 300px; }
.decision {
  position: static;
  margin: 0 22px 18px;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px 16px;
  background: rgba(5, 8, 29, 0.84);
  border: 1px solid rgba(154, 175, 229, 0.22);
}
.decision > span { color: var(--dim); font-size: 8px; letter-spacing: 0.14em; }
.decision > strong { color: var(--cyan); font-size: 12px; letter-spacing: 0.13em; }
.decision.flap > strong, .decision.flap > b { color: var(--coral); }
.decision > b { color: var(--cyan); font-family: monospace; font-size: 20px; }
.decision-track {
  position: relative;
  grid-column: 1 / -1;
  height: 5px;
  background: rgba(139, 161, 218, 0.15);
}
.decision-track i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #7aa5ff, var(--coral));
  transition: width 0.12s ease;
}
.decision-track em {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  border-left: 1px solid #fff;
}
.decision small {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 8px;
}

.sensor-panel, .network-panel, .neuron-inspector { grid-column: 1 / -1; }
.sensor-panel { padding: 20px 24px 24px; border-top: 1px solid var(--line); }
.sensor-panel header, .network-panel header, .neuron-inspector header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.sensor-panel header b, .network-panel header b, .neuron-inspector header b {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.sensor-panel header span, .network-panel header span, .neuron-inspector header span {
  color: var(--dim);
  font-size: 9px;
}
.sensor-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px 28px; }
.sensor-row {
  display: grid;
  grid-template-columns: 150px 1fr 58px;
  align-items: center;
  gap: 10px;
}
.sensor-row span { color: #abb7d3; font-size: 10px; }
.sensor-row code { color: var(--ink); font-size: 10px; text-align: right; }
.sensor-track { position: relative; height: 4px; background: rgba(139, 161, 218, 0.14); }
.sensor-track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}
.sensor-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(79, 245, 223, 0.5);
}

.network-panel {
  padding: 22px 24px 14px;
  border-top: 1px solid var(--line);
  background: radial-gradient(circle at 52% 55%, rgba(112, 91, 255, 0.1), transparent 50%);
}
.network-panel header > div { display: grid; gap: 3px; }
.legend { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; border-top: 2px solid var(--cyan); }
.legend i:nth-of-type(2) { margin-left: 8px; border-color: var(--coral); }
.network-panel canvas { display: block; width: 100%; height: 410px; }
.network-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.12em;
}
.network-labels span:nth-child(2) { text-align: center; }
.network-labels span:last-child { text-align: right; }

.neuron-inspector { padding: 24px; border-top: 1px solid var(--line); }
.neuron-inspector header > div:first-child { display: grid; gap: 3px; }
.neuron-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.neuron-buttons button {
  width: 32px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.neuron-buttons button[aria-pressed="true"] {
  color: #07111c;
  border-color: var(--cyan);
  background: var(--cyan);
}
.neuron-inspector > p {
  margin: 0 0 20px;
  padding: 14px 16px;
  overflow-wrap: anywhere;
  color: #d8e2f8;
  background: rgba(79, 245, 223, 0.055);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
}
.contribution-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contribution {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  border: 1px solid var(--line);
}
.contribution span { color: var(--muted); font-size: 9px; }
.contribution code { color: var(--ink); font-size: 10px; }
.contribution i {
  grid-column: 1 / -1;
  height: 3px;
  transform-origin: left;
  background: var(--cyan);
}
.contribution.negative i { background: var(--coral); }

.formula-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.formula-flow > div {
  min-height: 220px;
  padding: 22px;
  border-right: 1px solid var(--line);
}
.formula-flow > div:last-child { border-right: 0; }
.formula-flow span { color: var(--cyan); font-size: 8px; letter-spacing: 0.14em; }
.formula-flow code { display: block; margin: 38px 0 24px; color: var(--ink); font-size: 14px; }
.formula-flow p { margin: 0; color: var(--muted); font-size: 12px; }
.parameter-count {
  margin-top: 26px;
  padding: 24px;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px 28px;
  border: 1px solid rgba(147, 133, 255, 0.28);
  background: rgba(147, 133, 255, 0.06);
}
.parameter-count span { color: var(--muted); font-size: 11px; }
.parameter-count b { color: #d3ceff; font-family: monospace; font-size: 19px; text-align: right; }
.parameter-count p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.layer-explanation {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.layer-explanation article { padding: 20px; border: 1px solid var(--line); }
.layer-explanation span { color: var(--cyan); font-size: 8px; letter-spacing: 0.12em; }
.layer-explanation p { margin: 12px 0 0; color: var(--muted); font-size: 11px; }

.sensor-explanations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.sensor-explanations article { min-height: 155px; padding: 24px; background: var(--panel-strong); }
.sensor-explanations b { font-size: 13px; }
.sensor-explanations p { margin: 13px 0 0; color: var(--muted); font-size: 12px; }
.truth-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.truth-grid > div {
  padding: 19px 22px;
  border-left: 2px solid var(--coral);
  background: var(--coral-soft);
}
.truth-grid b { font-size: 12px; }
.truth-grid p { margin: 7px 0 0; color: #b7c1db; font-size: 12px; }

.training-timeline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.learning-language {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--line);
}
.learning-language article { min-height: 240px; padding: 23px; background: var(--panel-strong); }
.learning-language span, .method-comparison span, .training-vs-inference span {
  color: var(--cyan);
  font-size: 8px;
  letter-spacing: 0.13em;
}
.learning-language b { display: block; margin-top: 13px; font-size: 13px; }
.learning-language p { margin: 15px 0 0; color: var(--muted); font-size: 11px; }
.learning-language article:last-child span { color: var(--violet); }
.answer-note {
  margin: 0 0 24px;
  padding: 21px 24px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 215, 122, 0.055);
}
.answer-note b { color: var(--gold); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.answer-note p { margin: 8px 0 0; color: #c3c9d9; font-size: 12px; }
.training-timeline article { padding: 28px; border: 1px solid var(--line); background: var(--panel); }
.training-timeline article:first-child { border-top: 2px solid var(--cyan); }
.training-timeline article:last-child { border-top: 2px solid var(--violet); }
.training-timeline header { display: grid; gap: 6px; }
.training-timeline header span { color: var(--dim); font-size: 8px; letter-spacing: 0.16em; }
.training-timeline header b { font-size: 22px; font-weight: 440; }
.training-timeline article > p { min-height: 112px; color: #b4bfd9; font-size: 13px; }
.training-timeline dl { margin: 24px 0 0; border-top: 1px solid var(--line); }
.training-timeline dl div {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.training-timeline dt { color: var(--dim); font-size: 10px; }
.training-timeline dd { margin: 0; color: var(--cyan); font-family: monospace; font-size: 11px; }
.teacher {
  margin-top: 18px;
  padding: 26px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(79, 245, 223, 0.07), rgba(147, 133, 255, 0.06));
}
.teacher > div { display: grid; gap: 9px; }
.teacher span { color: var(--cyan); font-size: 9px; letter-spacing: 0.13em; }
.teacher code { color: var(--ink); }
.teacher p { margin: 0; color: #b8c3dd; font-size: 13px; }
.supervised-steps {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.supervised-steps article { min-height: 170px; padding: 19px; border-right: 1px solid var(--line); }
.supervised-steps article:last-child { border-right: 0; }
.supervised-steps span { color: var(--cyan); font-family: monospace; font-size: 10px; }
.supervised-steps b { display: block; margin-top: 20px; font-size: 11px; }
.supervised-steps p { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.explanation-paragraph {
  max-width: 900px;
  margin: 25px 0;
  color: #bbc5dc;
  font-size: 13px;
}
.evolution-loop {
  display: grid;
  grid-template-columns: 1fr 34px 1fr 34px 1fr 34px 1fr;
  align-items: stretch;
  border: 1px solid var(--line);
}
.evolution-loop > div { min-height: 160px; padding: 18px; display: grid; align-content: space-between; }
.evolution-loop > i { display: grid; place-items: center; color: var(--violet); font-style: normal; }
.evolution-loop span { color: var(--violet); font-family: monospace; font-size: 9px; }
.evolution-loop b { font-size: 11px; }
.evolution-loop small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.method-comparison {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.method-comparison article { min-height: 230px; padding: 22px; border: 1px solid var(--line); }
.method-comparison article.chosen { border-color: rgba(79, 245, 223, 0.38); background: var(--cyan-soft); }
.method-comparison b { display: block; margin-top: 14px; font-size: 13px; }
.method-comparison p { margin: 15px 0 0; color: var(--muted); font-size: 11px; }

.runtime-diagram {
  margin-top: 42px;
  display: grid;
  grid-template-columns: 1fr 80px 1.4fr;
  align-items: stretch;
}
.runtime-diagram > div {
  min-height: 220px;
  padding: 30px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
}
.runtime-diagram > div.active {
  border-color: rgba(79, 245, 223, 0.36);
  background: var(--cyan-soft);
  box-shadow: inset 0 0 45px rgba(79, 245, 223, 0.035);
}
.runtime-diagram > i { display: grid; place-items: center; color: var(--cyan); font-size: 28px; font-style: normal; }
.runtime-diagram span { color: var(--dim); font-size: 9px; letter-spacing: 0.15em; }
.runtime-diagram b { margin: 8px 0 16px; font-size: 28px; font-weight: 400; }
.runtime-diagram small { color: var(--muted); font-size: 12px; }
.runtime-details { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.runtime-details article { padding: 20px; border-right: 1px solid var(--line); }
.runtime-details article:last-child { border-right: 0; }
.runtime-details b { font-size: 11px; }
.runtime-details p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.training-vs-inference {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.training-vs-inference article { padding: 22px; border: 1px solid var(--line); }
.training-vs-inference article:last-child { border-color: rgba(79, 245, 223, 0.34); background: var(--cyan-soft); }
.training-vs-inference b { display: block; margin-top: 10px; font-size: 15px; }
.training-vs-inference p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.limits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.limits > div {
  min-height: 135px;
  padding: 22px;
  border: 1px solid var(--line);
}
.limits span { color: var(--cyan); font-size: 9px; letter-spacing: 0.16em; }
.limits > div:nth-child(n + 3) span { color: var(--coral); }
.limits p { margin: 16px 0 0; color: #bbc5dc; font-size: 13px; }

.source-chapter > p { max-width: 760px; margin-left: 62px; color: #b9c3da; }
pre {
  margin: 26px 0 0 62px;
  padding: 22px 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #040717;
  color: #d8e2fa;
  font-size: 12px;
  line-height: 1.75;
}
.source-note { color: var(--muted) !important; font-size: 12px; }

.page-footer {
  width: min(1120px, calc(100% - 48px));
  min-height: 110px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
}
.page-footer div { display: grid; gap: 3px; }
.page-footer b { color: var(--cyan); font-size: 10px; letter-spacing: 0.18em; }
.page-footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 900px) {
  .topbar { padding: 0 20px; }
  .topbar nav a { display: none; }
  main { width: min(100% - 30px, 720px); }
  .hero { min-height: auto; padding-top: 90px; }
  .hero-facts { grid-template-columns: repeat(2, 1fr); }
  .hero-facts div:nth-child(2) { border-right: 0; }
  .hero-facts div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .primer-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li { min-height: 100px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pipeline li:last-child { border-bottom: 0; }
  .pipeline li:not(:last-child)::after { right: 50%; top: auto; bottom: -13px; transform: rotate(90deg); }
  .neuron-anatomy { grid-template-columns: 1fr; }
  .neuron-anatomy > i { min-height: 38px; transform: rotate(90deg); }
  .anatomy-inputs, .anatomy-weights, .anatomy-sum, .anatomy-output {
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  .anatomy-output { border-bottom: 0; }
  .concept-grid { grid-template-columns: repeat(2, 1fr); }
  .concept-grid article:nth-child(2) { border-right: 0; }
  .concept-grid article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .normalization-story { grid-template-columns: 1fr; }
  .normalization-story > i { min-height: 38px; transform: rotate(90deg); }
  .normalization-details { grid-template-columns: 1fr; }
  .lab { grid-template-columns: 1fr; }
  .lab-controls { grid-template-columns: repeat(2, 1fr); border-right: 0; border-bottom: 1px solid var(--line); }
  .sensor-list { grid-template-columns: 1fr; }
  .formula-flow { grid-template-columns: repeat(2, 1fr); }
  .formula-flow > div:nth-child(2) { border-right: 0; }
  .formula-flow > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .layer-explanation { grid-template-columns: 1fr; }
  .sensor-explanations { grid-template-columns: repeat(2, 1fr); }
  .learning-language { grid-template-columns: 1fr; }
  .learning-language article { min-height: auto; }
  .supervised-steps { grid-template-columns: repeat(2, 1fr); }
  .supervised-steps article:nth-child(2) { border-right: 0; }
  .supervised-steps article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .evolution-loop { grid-template-columns: 1fr; }
  .evolution-loop > div { min-height: 120px; }
  .evolution-loop > i { min-height: 34px; transform: rotate(90deg); }
  .method-comparison { grid-template-columns: 1fr; }
  .method-comparison article { min-height: auto; }
  .runtime-details { grid-template-columns: repeat(2, 1fr); }
  .runtime-details article:nth-child(2) { border-right: 0; }
  .runtime-details article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .contribution-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 74px; }
  .topbar { min-height: 66px; }
  .brand b { font-size: 11px; }
  .brand small { font-size: 7px; }
  .topbar nav button { padding: 7px 9px; font-size: 8px; }
  main { width: calc(100% - 22px); }
  .hero { padding: 72px 4px 48px; }
  .hero h1 { font-size: clamp(43px, 15vw, 64px); }
  .lead { font-size: 16px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .hero-facts { margin-top: 48px; }
  .hero-facts div { padding: 13px; }
  .hero-facts dd { font-size: 13px; }
  .primer { padding: 34px 0 48px; }
  .primer-grid { grid-template-columns: 1fr; }
  .primer-grid article { min-height: auto; }
  .chapter { padding: 62px 0; }
  .chapter-heading { gap: 9px; }
  .chapter-heading > span { min-width: 30px; }
  .chapter-heading h2 { font-size: 34px; }
  .chapter-intro, .plain-note, .source-chapter > p, pre { margin-left: 0; }
  .chapter-intro { font-size: 15px; }
  .lab-controls { grid-template-columns: 1fr; padding: 18px; }
  .flight-panel canvas { height: 270px; }
  .decision { margin: 0 10px 10px; }
  .sensor-panel, .network-panel, .neuron-inspector { padding: 18px; }
  .sensor-panel header, .network-panel header, .neuron-inspector header { align-items: flex-start; flex-direction: column; }
  .sensor-row { grid-template-columns: 118px 1fr 48px; }
  .network-panel canvas { height: 330px; }
  .network-panel .legend { display: none; }
  .contribution-list, .formula-flow, .sensor-explanations, .truth-grid,
  .training-timeline, .limits { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .concept-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .concept-grid article:last-child { border-bottom: 0; }
  .normalization-row.head { display: none; }
  .normalization-row { grid-template-columns: 1fr; padding: 10px 0; }
  .normalization-row > * { padding: 5px 14px; border-left: 0 !important; }
  .normalization-row b { color: var(--cyan); }
  .formula-flow > div { min-height: 170px; border-right: 0; border-bottom: 1px solid var(--line); }
  .formula-flow > div:last-child { border-bottom: 0; }
  .formula-flow code { margin: 22px 0 17px; }
  .parameter-count { grid-template-columns: 1fr; }
  .parameter-count b { text-align: left; font-size: 16px; }
  .training-timeline article > p { min-height: auto; }
  .supervised-steps { grid-template-columns: 1fr; }
  .supervised-steps article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .supervised-steps article:last-child { border-bottom: 0; }
  .teacher { grid-template-columns: 1fr; }
  .runtime-diagram { grid-template-columns: 1fr; }
  .runtime-diagram > i { min-height: 48px; transform: rotate(90deg); }
  .runtime-details { grid-template-columns: 1fr; }
  .runtime-details article { border-right: 0; border-bottom: 1px solid var(--line); }
  .runtime-details article:last-child { border-bottom: 0; }
  .training-vs-inference { grid-template-columns: 1fr; }
  .page-footer { width: calc(100% - 22px); padding: 25px 0; align-items: flex-start; flex-direction: column; gap: 16px; }
}

@media print {
  :root { color-scheme: light; --ink: #0b1020; --muted: #44506b; --dim: #667089; --line: #cdd4df; --cyan: #007a73; --coral: #a51f3a; --violet: #51459d; }
  body { color: #0b1020; background: #fff; font-size: 10pt; }
  body::before, .ambient, .topbar nav, .hero-actions, .lab-controls, .neuron-buttons { display: none !important; }
  .topbar { position: static; padding: 0; color: #0b1020; background: #fff; border-color: #ccd2dc; }
  main, .page-footer { width: 100%; }
  .hero { min-height: auto; padding: 42px 0 32px; }
  .hero h1 { font-size: 48pt; }
  .lead { color: #33405a; font-size: 14pt; }
  .chapter { padding: 36px 0; break-inside: avoid; }
  .chapter-intro, .plain-note, .source-chapter > p, pre { margin-left: 0; }
  .lab { display: block; background: #fff; box-shadow: none; }
  .flight-panel, .network-panel, .sensor-explanations article, .training-timeline article, pre { background: #fff; }
  .flight-panel canvas, .network-panel canvas { max-height: 270px; }
  .decision { position: static; color: #0b1020; background: #fff; border-left: 0; border-right: 0; }
  .sensor-panel, .network-panel, .neuron-inspector { break-inside: avoid; }
  .plain-note, .truth-grid > div, .teacher, .parameter-count { background: #f3f6f8; }
  .training-timeline, .runtime-diagram, .sensor-explanations, .formula-flow { break-inside: avoid; }
  .page-footer { min-height: 60px; }
  a { text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
