@font-face {
  font-family: Inter;
  src: url("assets/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  src: url("assets/inter-cyrillic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
:root {
  color-scheme: light;
  --bg: #fdfdfc;
  --ink: #1d1d1a;
  --text: #4a4a44;
  --muted: #696961;
  --faint: #707068;
  --surface: #f4f4f0;
  --surface-strong: #e9e9e3;
  --line: #deded7;
  --line-strong: #96968b;
  --accent: #2d55d6;
  --accent-ink: #1d3fae;
  --accent-soft: #e8edfb;
  --on-accent: #ffffff;
  --inverse: #fdfdfc;
  --radius: 16px;
  --radius-s: 8px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --motion-fast: 150ms;
  --motion-reveal: 400ms;
  --motion-wire: 500ms;
  --nav-width: 192px;
  --shadow-demo:
    0 4px 8px rgb(29 29 26 / 0.03), 0 18px 48px rgb(29 29 26 / 0.08);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17171a;
  --ink: #f1f1ec;
  --text: #c3c3bb;
  --muted: #aaa9a2;
  --faint: #a1a19a;
  --surface: #202024;
  --surface-strong: #2b2b30;
  --line: #38383e;
  --line-strong: #797982;
  --accent: #91aaff;
  --accent-ink: #b6c7ff;
  --accent-soft: #252d44;
  --on-accent: #17171a;
  --inverse: #17171a;
  --shadow-demo: 0 4px 8px rgb(0 0 0 / 0.12), 0 18px 48px rgb(0 0 0 / 0.24);
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 32px;
  scrollbar-color: var(--line-strong) var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    400 1rem / 1.65 Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
p,
h1,
h2,
h3,
figure,
ol,
ul,
dl {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
h1,
h2,
h3,
strong,
dt {
  color: var(--ink);
}
h1,
h2,
h3 {
  font-weight: 500;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.5rem, 1rem + 4vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 30px;
}
.headline-line {
  display: block;
}
h1 em {
  font-style: normal;
  color: var(--accent);
}
h2 {
  font-size: clamp(1.75rem, 1.05rem + 1.3vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
h3 {
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
}
strong {
  font-weight: 550;
}
p {
  max-width: 65ch;
  text-wrap: pretty;
}
p + p {
  margin-top: 14px;
}
a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}
button,
select {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button {
  border: 0;
  background: none;
  padding: 0;
}
button,
a,
select,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:is(button, a, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
::selection {
  background: var(--ink);
  color: var(--inverse);
}
.small,
figcaption {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}
figcaption {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-wrap: pretty;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  left: 20px;
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--bg);
}
.skip:focus {
  top: 12px;
}

/* The reading rail and chapters share a single leading edge. */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 56px 40px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 550;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--inverse);
  font-size: 19px;
  line-height: 1;
  padding-right: 2px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.edition {
  font-size: 0.8125rem;
  color: var(--muted);
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
}
.theme-toggle svg {
  grid-area: 1 / 1;
}
.theme-sun {
  display: none;
}
[data-theme="dark"] .theme-moon {
  display: none;
}
[data-theme="dark"] .theme-sun {
  display: block;
}
.section-nav {
  position: sticky;
  top: 32px;
  float: left;
  width: var(--nav-width);
  font-size: 0.8125rem;
}
.nav-heading {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.75rem;
}
.nav-links {
  display: grid;
  gap: 2px;
}
.section-nav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-decoration: none;
}
.section-nav a::before {
  content: "";
  width: 20px;
  height: 2px;
  flex: none;
  background: var(--line-strong);
  transform: scaleX(0.4);
  transform-origin: left;
}
.section-nav a[aria-current="location"] {
  color: var(--ink);
  font-weight: 550;
}
.section-nav a[aria-current="location"]::before {
  background: var(--accent);
  transform: scaleX(1);
}
.mobile-nav {
  display: none;
}
main {
  margin-left: var(--nav-width);
}
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 32px 48px;
  align-items: start;
  padding-bottom: 80px;
  margin-bottom: 80px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 32px;
}
.chapter > * {
  min-width: 0;
}
.chapter > .section-copy {
  grid-column: 1;
}
.chapter > :not(.section-copy) {
  grid-column: 2;
}
.chapter > :is(.below-figure, details, .advantage-list) {
  grid-column: 1 / -1;
}
.intro {
  grid-template-columns: 1fr;
  gap: 32px;
}
.intro > :not(.section-copy) {
  grid-column: 1;
}
.intro > .section-copy {
  max-width: 1000px;
}
.lead {
  max-width: 65ch;
  font-size: 1.125rem;
  line-height: 1.65;
}
.hero-context {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 18px;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--inverse);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.button svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
}
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  padding-top: 4px;
}
.facts li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.facts strong {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.facts span {
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: 27ch;
}
.section-number {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 18px;
}
.principles {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  font-size: 0.9375rem;
}
.principles li {
  padding-left: 18px;
  position: relative;
}
.principles li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  left: 0;
  top: 0.65em;
}
.below-figure {
  max-width: none;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Diagrams use live text so their reading order survives narrow screens. */
.figure {
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
}
.figure-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
}
.figure-index {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.75rem;
}
.tag {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.6;
  white-space: nowrap;
}
.tag-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  flex: none;
}

/* Diagram vocabulary shared by every figure: nodes, pins, wires, labels.
   Wires are drawn by app.js between live nodes; without JS the text still reads. */
.diagram {
  position: relative;
}
.wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.wire-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.25;
}
.wire-head {
  fill: var(--muted);
}
.wire-accent .wire-line {
  stroke: var(--accent);
}
.wire-accent .wire-head {
  fill: var(--accent);
}
.wire[data-dash] .wire-line {
  stroke-dasharray: 3 4;
}
.wire-faint .wire-line {
  stroke: var(--line-strong);
}
.node {
  position: relative;
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.node strong {
  font-size: 0.9375rem;
  line-height: 1.35;
}
.node-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.node-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--inverse);
}
.node-soft {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}
:is(.node-accent, .node-ink, .node-soft) :is(strong, .icon, .pin, .index) {
  color: inherit;
}
.pin {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pin-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pin-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--inverse);
}
.index {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.wire-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 14px;
  font-size: 0.75rem;
  color: var(--muted);
}
.wire-labels:not(:has(.wire-label:not(.is-placed))) {
  display: contents;
}
.wire-label.is-placed {
  position: absolute;
  transform: translate(-50%, calc(-100% - 5px));
  padding: 0 6px;
  background: var(--surface);
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--muted);
}
.wire-label.is-placed.label-accent {
  color: var(--accent-ink);
  font-weight: 550;
}
.wire-label .icon {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 8px;
}

/* 01 · Learning cycle: four steps, two return paths, one history underneath. */
.loop-figure {
  margin-top: 12px;
  padding: 28px 32px;
}
.cycle {
  margin-top: 24px;
  padding-top: 90px;
}
.cycle-nodes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}
.cycle-nodes .node {
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  min-height: 118px;
}
.cycle-nodes .node > strong {
  grid-column: 1 / -1;
  align-self: end;
  font-size: 1rem;
}
.cycle-nodes .node > span:not(.index) {
  grid-column: 1 / -1;
}
.cycle-base {
  margin-top: 40px;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 4px 20px;
  padding: 14px 18px;
}
.cycle-base strong {
  font-size: 0.9375rem;
}

/* 02 · Four sources that never meet; the student's question sits below them. */
.islands {
  margin-top: 24px;
}
.island-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.island-row .node {
  padding: 12px;
}
.island-row .icon {
  margin-bottom: 8px;
}
.island-row strong {
  font-size: 0.875rem;
}
.island-row span {
  font-size: 0.75rem;
}
.island-row span:last-child {
  color: var(--muted);
}
.island-question {
  max-width: none;
  margin-top: 56px;
  text-align: center;
  padding: 16px 20px;
  border-style: dashed;
}
.island-question strong {
  color: var(--ink);
}
.island-question span {
  color: var(--muted);
}

/* 03 · Lesson demo card. */
.lesson-demo {
  background: var(--bg);
  box-shadow: var(--shadow-demo);
  padding-bottom: 0;
}
.lesson-steps {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-top: 20px;
  background: var(--surface);
  border-radius: 12px;
}
.lesson-steps li {
  flex: 1;
  min-width: 0;
}
.lesson-steps button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  padding: 8px 6px;
  border-radius: var(--radius-s);
  font-size: 0.75rem;
  color: var(--muted);
}
.lesson-steps button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--ink);
}
.lesson-steps .pin {
  width: 22px;
  height: 22px;
  font-size: 0.6875rem;
}
.lesson-steps [aria-pressed="true"] .pin {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
.lesson-content {
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 36px 12px;
  min-height: 326px;
  text-align: center;
}
.lesson-label {
  font-size: 0.8125rem;
  color: var(--muted);
}
.equation {
  color: var(--ink);
  font-size: clamp(2.25rem, 3.2vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  padding: 16px 0 24px;
  font-variant-numeric: tabular-nums;
}
.lesson-explanation {
  font-size: 0.9375rem;
  max-width: 42ch;
}
.lesson-note {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 18px;
}
.lesson-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-block: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.text-button {
  color: var(--accent-ink);
  font-size: 0.8125rem;
  min-height: 44px;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 5px;
}

/* 04 · Audience: three segments on one rail. */
.audience-list {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}
.audience-list article {
  display: grid;
  gap: 6px;
  align-content: start;
}
.numbered-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 1rem;
  line-height: 1.5;
}
.numbered-heading .pin {
  display: inline-grid;
  width: 28px;
  height: 28px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.numbered-heading > span:last-child {
  min-width: 0;
}
.audience-list article > :not(.numbered-heading) {
  margin-left: 44px;
}
.audience-list p {
  font-size: 0.875rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 2px;
}
.tags li {
  color: var(--muted);
  font-size: 0.75rem;
}
.tags li + li::before {
  content: "·";
  padding-right: 12px;
}
.callout {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.callout p {
  font-size: 0.875rem;
  margin-top: 12px;
}

/* 05 · Market: revenue bars and a preliminary estimate. */
.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px;
  padding-top: 24px;
}
.bars {
  --max: 8;
  display: grid;
  gap: 8px;
}
.bars-plot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  height: 170px;
  margin: 34px 0 0 22px;
  padding: 0 8px;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.tick {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--t) / var(--max) * 100%);
  border-top: 1px dashed var(--line);
  font-size: 0.6875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tick-origin {
  border: 0;
}
.tick::before {
  content: attr(data-value);
  position: absolute;
  right: 100%;
  top: 0;
  transform: translate(-6px, -50%);
}
.bar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  height: 100%;
}
.bar-value {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.bar-fill {
  display: block;
  width: 100%;
  flex: none;
  height: calc(var(--v) / var(--max) * 100%);
  border-radius: 6px 6px 0 0;
  background: var(--surface-strong);
  transform-origin: bottom;
}
.bar-accent .bar-fill {
  background: var(--accent);
}
.bars-axis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-left: 22px;
  padding: 0 8px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bars-unit {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-left: 22px;
}
.metric {
  display: grid;
  gap: 6px;
}
.metric strong {
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.metric span {
  font-size: 0.8125rem;
}
.market-notes .small {
  margin-top: 16px;
}
.estimate {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.estimate .figure-top {
  border: 0;
  padding-bottom: 0;
}
.estimate-values {
  display: grid;
  gap: 18px;
  margin: 24px 0 20px;
}
.estimate-values dt {
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.estimate-values dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.estimate-values > div:first-child dd {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 550;
  line-height: 1.25;
  letter-spacing: -0.035em;
}
.estimate-values dd span {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

/* 06 · Revenue hub: three streams feed one history. */
.hub {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px 48px;
  align-items: center;
  margin-top: 24px;
}
.streams {
  display: grid;
  gap: 16px;
}
.streams .node {
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: start;
}
.streams .icon {
  grid-row: 1 / span 2;
  margin-top: 2px;
}
.hub-core {
  text-align: center;
  padding: 22px 18px;
  gap: 4px;
}
.hub-core strong {
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

/* 08 · Student week: one lesson, six days of practice, next lesson. */
.week {
  --week-gap: 6px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 28px minmax(0, 1.4fr);
  gap: var(--week-gap);
  margin-top: 28px;
  padding-bottom: 4px;
}
.week-days {
  grid-column: 1 / span 7;
  display: grid;
  grid-template-columns: subgrid;
}
.week-days li,
.week-next {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink);
}
.week-days .day-session,
.week-next {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--inverse);
}
.week-next {
  grid-column: 9;
  grid-row: 1;
  background: var(--line-strong);
  border-color: var(--line-strong);
}
.week-days .day-practice {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}
.week-days .day-event {
  border-color: var(--accent);
}
.week-days li span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.week-days li {
  position: relative;
}
.week-notes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  margin-top: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.week-notes li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-notes strong {
  color: var(--ink);
  font-size: 0.8125rem;
}
.week-notes span {
  color: var(--muted);
  text-wrap: pretty;
}
.week-notes .note-solved {
  color: var(--accent-ink);
}
.week-summary {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.week-summary h3 {
  max-width: 42ch;
  font-size: 1.125rem;
  line-height: 1.35;
  text-wrap: balance;
}
.week-summary p {
  max-width: 60ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.advantage-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.advantage-list > div {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 0.875rem;
}
dt {
  font-weight: 550;
}
dd {
  margin: 8px 0 0;
}
details {
  padding-block: 2px;
  border-block: 1px solid var(--line);
  font-size: 0.9375rem;
}
summary {
  cursor: pointer;
  color: var(--ink);
  padding-block: 18px;
  min-height: 44px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin: 6px 5px 0;
}
details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 10px;
}
.details-content {
  padding-bottom: 20px;
}
@media (hover: hover) {
  a:hover {
    text-decoration-color: var(--ink);
  }
  .button:hover {
    color: var(--on-accent);
    background: var(--accent);
  }
  .theme-toggle:hover,
  .lesson-steps button:hover {
    background: var(--surface-strong);
  }
  .section-nav a:hover {
    color: var(--ink);
  }
  .text-button:hover {
    color: var(--accent);
  }
}
@media (max-width: 1200px) {
  :root {
    --nav-width: 164px;
  }
  .page {
    padding-inline: 36px;
  }
  .chapter {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .chapter > :not(.section-copy) {
    grid-column: 1;
  }
  .section-copy {
    max-width: 680px;
  }
  h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
  }
  .intro > .section-copy {
    max-width: none;
  }
  .audience-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .page {
    padding-inline: 28px;
  }
  .masthead {
    margin-bottom: 24px;
  }
  .section-nav {
    display: none;
  }
  main {
    margin-left: 0;
  }
  .mobile-nav {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 5;
    padding-block: 12px;
    margin-bottom: 32px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .mobile-nav select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 10px 14px;
    background: var(--bg);
    color: var(--ink);
    font-size: 1rem;
  }
  html {
    scroll-padding-top: 90px;
  }
  .chapter {
    scroll-margin-top: 0;
  }
}
/* Stack the cycle before its return labels crowd the outer wire. */
@media (max-width: 800px) {
  .cycle .wire-wide {
    display: none;
  }
  .cycle {
    padding: 0 0 0 36px;
    margin-top: 20px;
  }
  .cycle-nodes {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .cycle-nodes .node {
    grid-template-columns: 24px 1fr auto;
    gap: 2px 12px;
    min-height: 0;
    padding: 12px;
  }
  .cycle-nodes .node > .index {
    grid-row: 1 / span 2;
    align-self: center;
  }
  .cycle-nodes .node > .icon {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .cycle-nodes .node > strong {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.9375rem;
  }
  .cycle-nodes .node > span:not(.index) {
    grid-column: 2;
  }
  .cycle-base {
    margin-top: 16px;
    grid-template-columns: 1fr;
    padding: 14px;
  }
}
@media (max-width: 600px) {
  .page {
    padding: 20px 20px 28px;
  }
  .masthead {
    padding-bottom: 20px;
    margin-bottom: 0;
  }
  .edition {
    display: none;
  }
  .mobile-nav {
    margin-bottom: 28px;
  }
  h1 {
    font-size: clamp(2.125rem, 8.7vw, 3.1rem);
    line-height: 1.12;
    margin-bottom: 24px;
  }
  h2 {
    font-size: 1.875rem;
  }
  .lead {
    font-size: 1rem;
  }
  .hero-context {
    font-size: 0.75rem;
  }
  .hero-actions {
    display: grid;
    justify-items: start;
    gap: 4px;
    margin-top: 24px;
  }
  .hero-actions .button {
    width: 100%;
  }
  .hero-actions .text-link {
    justify-self: center;
  }
  .chapter {
    gap: 24px;
    padding-bottom: 48px;
    margin-bottom: 48px;
  }
  .figure,
  .loop-figure {
    padding: 20px;
  }
  .figure-top {
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 16px;
  }
  .figure-index {
    padding-top: 1px;
  }
  .loop-figure {
    margin-top: 0;
  }
  /* Stacked layouts: return wires run down the left, wide-only wires hide. */
  .wire-wide {
    display: none;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 4px 4px 0;
  }
  .facts li {
    gap: 20px;
  }
  .facts strong {
    width: 22px;
    flex: none;
    font-size: 1.75rem;
  }
  .facts span {
    max-width: none;
  }
  .island-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .island-question {
    margin-top: 20px;
  }
  .audience-list {
    grid-template-columns: 1fr;
  }
  .lesson-steps {
    margin-inline: -8px;
  }
  .lesson-steps button {
    gap: 5px;
    padding-inline: 4px;
    font-size: 0.6875rem;
  }
  .lesson-content {
    min-height: 350px;
    padding-inline: 0;
  }
  .lesson-footer {
    gap: 0;
  }
  .market-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .bars-plot {
    height: 150px;
  }
  .metric strong {
    font-size: 2.5rem;
  }
  .estimate .figure-top {
    flex-wrap: wrap;
  }
  .hub {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-left: 28px;
  }
  .hub-core {
    text-align: left;
  }
  .week {
    --week-gap: 4px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .week-days li {
    min-height: 40px;
    font-size: 0.75rem;
  }
  .week-next,
  .week-wire {
    display: none;
  }
  .week-notes {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .advantage-list {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Motion. Figures arrive once when scrolled into view; wires draw after nodes.
   The lesson card crossfades between steps. Frequent controls stay instant. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  button,
  .button {
    transition:
      background-color var(--motion-fast) ease,
      color var(--motion-fast) ease,
      transform var(--motion-fast) var(--ease);
  }
  .section-nav a::before {
    transition: transform 200ms var(--ease);
  }
  .js [data-reveal] .arrive {
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity var(--motion-reveal) ease,
      transform var(--motion-reveal) var(--ease);
    transition-delay: calc(var(--i, 0) * 50ms);
  }
  .js [data-reveal] .arrive:nth-child(2) {
    --i: 1;
  }
  .js [data-reveal] .arrive:nth-child(3) {
    --i: 2;
  }
  .js [data-reveal] .arrive:nth-child(4) {
    --i: 3;
  }
  .js [data-reveal] .arrive:nth-child(5) {
    --i: 4;
  }
  .js [data-reveal] .arrive:nth-child(6) {
    --i: 5;
  }
  .js [data-reveal] .arrive:nth-child(7) {
    --i: 6;
  }
  .js [data-reveal] .arrive.arrive-late {
    --i: 5;
  }
  .js [data-reveal].is-in .arrive {
    opacity: 1;
    transform: none;
  }
  .js [data-reveal] .bar-fill {
    transform: scaleY(0.9);
    transform-origin: bottom;
    transition: transform var(--motion-wire) var(--ease) 100ms;
  }
  .js [data-reveal].is-in .bar-fill {
    transform: none;
  }
  .js [data-reveal] .wire:not([data-dash]) .wire-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset var(--motion-wire) var(--ease) 260ms;
  }
  .js [data-reveal].is-in .wire:not([data-dash]) .wire-line {
    stroke-dashoffset: 0;
  }
  .js [data-reveal] :is(.wire-head, .wire-label.is-placed, .wire[data-dash]) {
    opacity: 0;
    transition: opacity 200ms ease 620ms;
  }
  .js [data-reveal].is-in :is(.wire-head, .wire-label.is-placed, .wire[data-dash]) {
    opacity: 1;
  }
  .lesson-content > * {
    transition:
      opacity 180ms ease,
      transform 180ms var(--ease);
  }
  .lesson-content.is-leaving > * {
    opacity: 0;
    transform: translateY(-4px);
    transition-duration: 120ms;
  }
  .lesson-content.is-entering > * {
    opacity: 0;
    transform: translateY(4px);
    transition: none;
  }
  @media (pointer: fine) {
    button:active:not(:focus-visible),
    .button:active:not(:focus-visible) {
      transform: scale(0.96);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] :is(.arrive, .wires) {
    opacity: 0;
    transition: opacity 200ms ease;
  }
  .js [data-reveal].is-in :is(.arrive, .wires) {
    opacity: 1;
  }
}
.theme-changing *,
.theme-changing *::before,
.theme-changing *::after {
  transition: none !important;
}
@media (forced-colors: active) {
  :is(button, a, select, summary):focus-visible {
    outline-color: Highlight;
  }
  .button,
  .lesson-steps [aria-pressed="true"] {
    border: 1px solid ButtonText;
  }
}
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] :is(.arrive, .wires, .wire-head, .wire-label, .wire) {
    opacity: 1 !important;
    transform: none !important;
  }
  .js [data-reveal] .wire-line {
    stroke-dashoffset: 0 !important;
  }
  .theme-toggle,
  .section-nav,
  .mobile-nav,
  .skip,
  .hero-actions {
    display: none !important;
  }
  :root[data-theme] {
    --bg: #fff;
    --ink: #1d1d1a;
    --text: #4a4a44;
    --muted: #696961;
    --surface: #f4f4f0;
    --line: #deded7;
    --accent: #2d55d6;
    --accent-ink: #1d3fae;
    --accent-soft: #e8edfb;
    --on-accent: #fff;
    --inverse: #fff;
  }
  .page {
    max-width: none;
    padding: 0;
  }
  main {
    margin: 0;
  }
  .chapter {
    display: block;
    break-inside: avoid;
    margin-bottom: 26px;
    padding-bottom: 26px;
  }
  .chapter > :not(.section-copy) {
    margin-top: 20px;
  }
  .lesson-demo {
    box-shadow: none;
    border: 1px solid var(--line);
  }
  .masthead {
    margin-bottom: 32px;
  }
  a {
    color: var(--ink);
  }
}

.sound-toggle {
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 8px 0;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.sound-toggle[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .smooth-cursor-active .page,
  .smooth-cursor-active .page * { cursor: none; }
  .smooth-cursor-active .page :is(input, textarea, [contenteditable]) { cursor: text; }
  .smooth-cursor-active .page select { cursor: auto; }
}
@media screen and (max-width: 400px) {
  .masthead { flex-wrap: wrap; gap: 8px; }
  .header-right { width: 100%; justify-content: space-between; }
  .sound-toggle { min-height: 44px; }
}
