/* =========================================================
   汽车原理 · A Mechanical Atlas
   Original interactive editorial — no external dependencies
   ========================================================= */

:root {
  --paper: #f3f0e8;
  --paper-deep: #ece7db;
  --card: #faf8f2;
  --ink: #1d211e;
  --ink-soft: #4a4f49;
  --muted: #7b7f76;
  --faint: #a6a89f;
  --line: rgba(29, 33, 30, 0.14);
  --line-strong: rgba(29, 33, 30, 0.32);
  --accent: #d34e24;
  --accent-deep: #a93a19;
  --teal: #2e7065;
  --blue: #2f5c8a;
  --green: #526e4a;
  --violet: #6c5985;
  --red: #b33a2c;
  --amber: #b8832d;
  --graphite: #2b302d;
  --dark: #111614;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 62px;
  --content: 1120px;
  --copy: 690px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.no-scroll {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection {
  color: #fffaf1;
  background: var(--accent);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

p {
  margin: 0 0 1.35em;
}

strong {
  font-weight: 650;
  color: var(--ink);
}

em {
  font-style: normal;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  transition: top 0.2s;
}

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

/* ---------- typography helpers ---------- */

.kicker,
.eyebrow,
.mono,
.fig-label,
.meta,
.section-tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 0 0 26px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.kicker {
  color: var(--muted);
  margin: 0 0 14px;
}

.kicker .dot {
  color: var(--accent);
  padding: 0 0.5em;
}

.serif {
  font-family: var(--serif);
}

/* ---------- reading progress ---------- */

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  overflow: hidden;
}

.read-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: rgba(243, 240, 232, 0);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
    backdrop-filter 0.35s;
}

.site-header.is-scrolled {
  background: rgba(243, 240, 232, 0.88);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}

.header-inner {
  width: min(calc(100% - 56px), 1280px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  color: var(--ink);
  flex: 0 0 auto;
  transition: transform 0.8s var(--ease);
}

.brand:hover .brand-mark {
  transform: rotate(60deg);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-text b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-text small {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--muted);
  transform: translateY(1px);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  margin-right: 6px;
}

.header-nav a {
  position: relative;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 6px 0;
  transition: color 0.2s;
}

.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 1px;
  height: 1px;
  background: var(--accent);
  transition: right 0.3s var(--ease);
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav a:hover::after {
  right: 0;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px 7px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.menu-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.menu-btn .menu-lines {
  display: grid;
  gap: 3px;
  width: 12px;
}

.menu-btn .menu-lines i {
  display: block;
  height: 1px;
  background: currentColor;
}

.menu-btn .menu-lines i:last-child {
  width: 7px;
  margin-left: auto;
}

/* ---------- menu overlay ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  display: flex;
  align-items: stretch;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.menu-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

.menu-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(29, 33, 30, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 33, 30, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
}

.menu-panel {
  position: relative;
  width: min(100% - 64px, 1040px);
  margin: auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 72px;
  align-items: start;
}

.menu-aside {
  position: sticky;
  top: 100px;
}

.menu-aside .big-mark {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 32px;
}

.menu-aside h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.menu-aside p {
  max-width: 300px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}

.menu-list li {
  border-bottom: 1px solid var(--line);
}

.menu-list a {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 15px 4px 14px;
  transition: padding 0.25s var(--ease), color 0.2s;
}

.menu-list a:hover {
  padding-left: 14px;
  color: var(--accent-deep);
}

.menu-list .n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.menu-list .t {
  font-family: var(--serif);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 600;
  line-height: 1.3;
}

.menu-list .e {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.menu-close {
  position: absolute;
  top: 26px;
  right: 0;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.menu-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.menu-close svg {
  width: 15px;
  height: 15px;
}

.menu-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--header-h) + 92px) 0 40px;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, 1440px);
  height: 760px;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 52% at 50% 18%, rgba(211, 78, 36, 0.06), transparent 72%);
}

.hero-inner {
  position: relative;
  width: min(calc(100% - 64px), var(--content));
  margin: 0 auto;
}

.hero-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 64px;
  align-items: end;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(64px, 9.6vw, 136px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: var(--ink);
}

.hero h1 .line {
  display: block;
  white-space: nowrap;
}

.hero h1 em {
  position: relative;
  color: var(--accent);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 0;
  bottom: 0.08em;
  height: 0.035em;
  background: currentColor;
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left;
  animation: inkline 1.4s 0.55s var(--ease) forwards;
}

@keyframes inkline {
  to {
    transform: scaleX(1);
  }
}

.hero-lede {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.hero-lede strong {
  font-weight: 600;
  color: var(--ink);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-meta .sep {
  width: 18px;
  height: 1px;
  background: var(--line-strong);
}

.hero-note {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-figure {
  position: relative;
  margin: 58px 0 0;
}

.hero-figure-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.hero-figure-head .fig-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-figure-head .fig-title b {
  color: var(--ink);
  font-weight: 600;
}

.hero-stage {
  position: relative;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: #f7f3ea;
  background-image: linear-gradient(rgba(29, 33, 30, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 33, 30, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
}

.hero-stage::before,
.hero-stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.hero-stage::before {
  top: 12px;
  left: 12px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.hero-stage::after {
  bottom: 12px;
  right: 12px;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}

.hero-stage svg {
  width: 100%;
  height: auto;
  min-width: 760px;
}

.hero-stage-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.hero-fig-caption {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding-top: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-fig-caption p {
  margin: 0;
  max-width: 560px;
}

.hero-fig-caption .count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--faint);
  text-transform: uppercase;
}

.hero-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px 40px;
  align-items: center;
  padding: 20px 2px 0;
}

.hero-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.legend-item i {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--c);
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 54px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.scroll-hint .line {
  width: 44px;
  height: 1px;
  background: var(--line-strong);
  position: relative;
  overflow: hidden;
}

.scroll-hint .line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: hint-line 2.4s infinite var(--ease);
}

@keyframes hint-line {
  0% {
    transform: translateX(-100%);
  }
  45%,
  100% {
    transform: translateX(100%);
  }
}

/* ---------- intro ---------- */

.intro {
  padding: 100px 0 60px;
}

.intro-inner {
  width: min(calc(100% - 64px), var(--content));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 150px minmax(0, var(--copy)) 1fr;
  gap: 0 0;
}

.intro-marker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
  padding-top: 7px;
}

.intro-marker i {
  display: block;
  width: 1px;
  height: 42px;
  margin-top: 14px;
  background: var(--line-strong);
}

.intro-copy {
  max-width: var(--copy);
}

.intro-copy .dropcap {
  float: left;
  font-family: var(--serif);
  font-size: 4.4em;
  line-height: 0.82;
  font-weight: 700;
  padding: 0.07em 0.12em 0 0;
  color: var(--accent);
}

.intro-copy p {
  font-size: 19px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.intro-copy p:first-of-type {
  margin-top: 0;
}

.intro-copy .signature {
  margin-top: 30px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
}

.intro-aside {
  padding: 4px 0 0 36px;
  border-left: 1px solid var(--line);
  margin-left: 20px;
}

.intro-aside .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.intro-aside p {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}

.intro-aside .sys-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.intro-aside .sys-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-soft);
}

.intro-aside .sys-list span:last-child {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
}

/* ---------- chapters ---------- */

.chapter {
  position: relative;
  padding: 128px 0 20px;
}

.chapter + .chapter {
  border-top: 1px solid var(--line);
}

.chapter-inner {
  width: min(calc(100% - 64px), var(--content));
  margin: 0 auto;
}

.chapter-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 820px);
  align-items: start;
  margin-bottom: 46px;
}

.chapter-no {
  font-family: var(--serif);
  font-size: 74px;
  line-height: 0.9;
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px rgba(29, 33, 30, 0.34);
  letter-spacing: -0.04em;
  padding-top: 3px;
  user-select: none;
}

.chapter-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 4.4vw, 58px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  max-width: 780px;
}

.chapter-head h2 .accent {
  color: var(--accent);
}

.chapter-deck {
  margin: 22px 0 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}

.chapter-copy {
  margin-left: 150px;
  max-width: var(--copy);
}

.chapter-copy p {
  font-size: 18px;
  line-height: 1.95;
  color: var(--ink-soft);
}

.chapter-copy > p:first-child {
  margin-top: 0;
}

.chapter-copy .lead {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.75;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 1.3em;
}

.chapter-copy h3 {
  margin: 2.1em 0 0.8em;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.chapter-copy h3::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--accent);
  vertical-align: 0.3em;
  margin-right: 10px;
}

.chapter-copy ul {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}

.chapter-copy li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.65em;
  line-height: 1.85;
  color: var(--ink-soft);
}

.chapter-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 7px;
  height: 1px;
  background: var(--accent);
}

.chapter-copy .term {
  font-family: var(--mono);
  font-size: 0.82em;
  letter-spacing: 0.02em;
  background: rgba(29, 33, 30, 0.055);
  padding: 0.12em 0.36em;
  border-radius: 2px;
  color: var(--ink);
}

.chapter-copy .en {
  font-family: var(--mono);
  font-size: 0.72em;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.inline-formula {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06em;
  padding: 0 0.15em;
  color: var(--ink);
}

/* ---------- notes ---------- */

.note {
  position: relative;
  margin: 32px 0 12px;
  padding: 20px 24px 18px 28px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(211, 78, 36, 0.045), transparent 70%);
}

.note::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--accent);
}

.note .note-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.13em;
  color: var(--accent-deep);
  text-transform: uppercase;
}

.note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.note p + p {
  margin-top: 0.7em;
}

.note strong {
  color: var(--ink);
}

.formula-card {
  margin: 34px 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 30px;
  align-items: center;
}

.formula-card .fc-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.formula-card .fc-formula {
  grid-column: 1;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.4;
  color: var(--ink);
}

.formula-card .fc-formula i {
  color: var(--accent-deep);
  font-style: italic;
}

.formula-card .fc-note {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 200px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 20px;
}

/* ---------- figures ---------- */

.figure {
  --scene-color: var(--accent);
  position: relative;
  width: 100%;
  margin: 58px 0 72px;
  border: 1px solid var(--line);
  background: var(--card);
}

.figure--wide {
  width: 100%;
}

.figure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 44px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}

.fig-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: none;
}

.fig-label .no {
  color: var(--scene-color);
  font-weight: 650;
}

.fig-label .zh {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.fig-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.fig-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--scene-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--scene-color) 14%, transparent);
}

.figure-stage {
  position: relative;
  padding: 20px 22px 10px;
  overflow: hidden;
  background-color: #f8f5ed;
  background-image: linear-gradient(rgba(29, 33, 30, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 33, 30, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: 1px solid var(--line);
}

.figure-stage::before,
.figure-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.figure-stage::before {
  left: 10px;
  top: 10px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.figure-stage::after {
  right: 10px;
  bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
}

.figure-stage .diagram-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.figure-stage .diagram-scroll::-webkit-scrollbar {
  height: 5px;
}

.figure-stage .diagram-scroll::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

.figure-stage svg {
  width: 100%;
  height: auto;
  min-width: 0;
}

.figure-ui {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.figure-ui--stack {
  display: grid;
  gap: 14px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.control-group--buttons {
  flex: 0 0 auto;
}

.control-label {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  min-width: 150px;
}

.range-wrap input[type="range"] {
  flex: 1;
  min-width: 80px;
}

.range-value {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: right;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* range */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
  --pct: 0%;
  --track: rgba(29, 33, 30, 0.16);
  --fill: var(--scene-color, var(--accent));
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--fill) 0,
    var(--fill) var(--pct),
    var(--track) var(--pct),
    var(--track) 100%
  );
}

input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: var(--track);
}

input[type="range"]::-moz-range-progress {
  height: 2px;
  background: var(--fill);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5.5px;
  border: 1.5px solid var(--fill);
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 0 0 4px var(--card);
  transition: transform 0.15s;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.25);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--fill);
  border-radius: 50%;
  background: var(--card);
}

input[type="range"]:focus-visible {
  outline-offset: 7px;
}

/* buttons */

.play-btn,
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.play-btn:hover,
.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.play-btn svg,
.icon-btn svg {
  width: 12px;
  height: 12px;
}

.play-btn .icon-pause,
.play-btn.is-playing .icon-play {
  display: none;
}

.play-btn.is-playing .icon-pause {
  display: block;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  padding: 2px;
  background: rgba(29, 33, 30, 0.025);
}

.segmented button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.segmented button + button {
  border-left: 1px solid var(--line);
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.gear-buttons {
  display: flex;
  gap: 5px;
}

.gear-buttons button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.gear-buttons button:hover {
  border-color: var(--line-strong);
}

.gear-buttons button.is-active {
  background: var(--scene-color, var(--ink));
  border-color: var(--scene-color, var(--ink));
  color: #fff;
}

.figure-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 13px 20px 15px;
  background: var(--card);
}

.figure-foot figcaption {
  max-width: 660px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}

.figure-foot .fig-tech {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.7;
  color: var(--faint);
  text-align: right;
  text-transform: uppercase;
}

/* readouts */

.readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  background: var(--card);
}

.readout {
  padding: 14px 16px 13px;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.readout:last-child {
  border-right: 0;
}

.readout .k {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.readout .v {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.readout .v small {
  font-family: var(--sans);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0;
}

.readout.is-accent .v {
  color: var(--scene-color);
}

.readout--wide {
  grid-column: span 2;
}

/* dark figures */

.figure--dark {
  border-color: rgba(243, 240, 232, 0.14);
  background: #121715;
}

.figure--dark .figure-head,
.figure--dark .figure-ui,
.figure--dark .figure-foot {
  border-color: rgba(243, 240, 232, 0.12);
  background: #151b18;
}

.figure--dark .figure-stage {
  background-color: #0f1412;
  background-image: radial-gradient(ellipse at 50% 42%, rgba(68, 96, 82, 0.16), transparent 62%),
    linear-gradient(rgba(243, 240, 232, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 240, 232, 0.028) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  border-color: rgba(243, 240, 232, 0.12);
}

.figure--dark .figure-stage::before,
.figure--dark .figure-stage::after {
  border-color: rgba(243, 240, 232, 0.26);
}

.figure--dark .fig-label,
.figure--dark .figure-foot figcaption {
  color: #a9afa8;
}

.figure--dark .fig-label .zh {
  color: #d9ddd7;
}

.figure--dark .fig-badge,
.figure--dark .fig-tech,
.figure--dark .control-label,
.figure--dark .range-value,
.figure--dark .readout .k {
  color: #8f978f;
}

.figure--dark .fig-badge::before {
  box-shadow: 0 0 0 3px rgba(224, 86, 43, 0.16);
}

.figure--dark .readouts {
  border-color: rgba(243, 240, 232, 0.12);
  background: #151b18;
}

.figure--dark input[type="range"] {
  --track: rgba(243, 240, 232, 0.2);
  --fill: #ef6b3b;
}

.figure--dark input[type="range"]::-webkit-slider-thumb {
  background: #151b18;
  box-shadow: 0 0 0 4px #151b18;
}

.figure--dark .play-btn,
.figure--dark .icon-btn,
.figure--dark .segmented {
  border-color: rgba(243, 240, 232, 0.22);
  color: #d9ddd7;
}

.figure--dark .play-btn:hover,
.figure--dark .icon-btn:hover {
  background: #f3f0e8;
  color: #151b18;
  border-color: #f3f0e8;
}

.figure--dark .readout {
  border-color: rgba(243, 240, 232, 0.1);
}

.figure--dark .readout .v {
  color: #edf0ea;
}

.figure--dark .readout .v small {
  color: #8f978f;
}

.figure--dark .readout.is-accent .v {
  color: #f0794b;
}

.figure--dark .note-inline {
  color: #a9afa8;
}

/* figure overlays */

.stage-overlay {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.stage-overlay--tl {
  top: 22px;
  left: 24px;
}

.stage-overlay--tr {
  top: 22px;
  right: 24px;
  text-align: right;
}

.stage-overlay--bl {
  left: 24px;
  bottom: 22px;
}

.stage-overlay--br {
  right: 24px;
  bottom: 22px;
  text-align: right;
}

.hud-kicker {
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.hud-title {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.hud-title .idx {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--scene-color);
  vertical-align: 0.8em;
  margin-right: 6px;
}

.figure--dark .hud-title {
  color: #f1f3ed;
}

.figure--dark .hud-kicker {
  color: #808a82;
}

.stroke-dots {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.stroke-dots i {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(29, 33, 30, 0.16);
  transition: background 0.2s;
}

.figure--dark .stroke-dots i {
  background: rgba(243, 240, 232, 0.16);
}

.stroke-dots i.on {
  background: var(--scene-color);
}

.stage-note {
  max-width: 170px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

.figure--dark .stage-note {
  color: #7f8880;
}

/* ---------- stroke cards ---------- */

.stroke-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 10px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.stroke-card {
  position: relative;
  padding: 18px 18px 20px;
  border-right: 1px solid var(--line);
  background: transparent;
  transition: background 0.3s var(--ease);
  min-height: 150px;
}

.stroke-card:last-child {
  border-right: 0;
}

.stroke-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.stroke-card.is-active {
  background: rgba(211, 78, 36, 0.045);
}

.stroke-card.is-active::before {
  transform: scaleX(1);
}

.stroke-card .sc-no {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.stroke-card h4 {
  margin: 5px 0 8px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}

.stroke-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.75;
  color: var(--muted);
}

.stroke-card .sc-en {
  display: block;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ---------- generic data strip ---------- */

.data-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 30px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-strip > div {
  padding: 16px 20px 15px;
  border-right: 1px solid var(--line);
}

.data-strip > div:last-child {
  border-right: 0;
}

.data-strip .k {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.data-strip .v {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.data-strip .v small {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- chapter rail ---------- */

.chapter-rail {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
}

.chapter-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.chapter-rail a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: 16px;
}

.chapter-rail .rail-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0;
  transform: translateX(5px);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.chapter-rail a::after {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid var(--faint);
  border-radius: 50%;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.chapter-rail a:hover .rail-label,
.chapter-rail a.is-active .rail-label {
  opacity: 1;
  transform: translateX(0);
}

.chapter-rail a:hover::after {
  border-color: var(--ink);
}

.chapter-rail a.is-active::after {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.25);
}

/* ---------- ending / footer ---------- */

.ending {
  position: relative;
  margin-top: 120px;
  padding: 118px 0 0;
  background: var(--dark);
  color: #ecefe8;
  overflow: hidden;
}

.ending::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(236, 239, 232, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 239, 232, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

.ending-inner {
  position: relative;
  width: min(calc(100% - 64px), var(--content));
  margin: 0 auto;
}

.ending .kicker {
  color: #8e978e;
}

.ending h2 {
  max-width: 900px;
  margin: 0 0 30px;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 84px);
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #f1f3ec;
}

.ending h2 em {
  color: #ef6b3b;
}

.ending-lede {
  max-width: 640px;
  margin: 0 0 60px;
  font-size: 17px;
  line-height: 1.9;
  color: #aab2a9;
}

.ending-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 80px;
  padding: 48px 0 74px;
  border-top: 1px solid rgba(236, 239, 232, 0.16);
}

.ending-grid p {
  font-size: 15px;
  line-height: 1.9;
  color: #aab2a9;
}

.ending-grid p strong {
  color: #f1f3ec;
  font-weight: 500;
}

.ending-sign {
  margin-top: 30px;
  font-family: var(--serif);
  font-size: 15px;
  color: #d6dbd2;
}

.ending-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 32px;
  align-content: start;
}

.ending-facts .fact {
  border-top: 1px solid rgba(236, 239, 232, 0.2);
  padding-top: 12px;
}

.ending-facts .fact .n {
  display: block;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.1;
  color: #f1f3ec;
}

.ending-facts .fact .l {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.5;
  color: #8e978e;
}

.site-footer {
  position: relative;
  padding: 28px 0 36px;
  border-top: 1px solid rgba(236, 239, 232, 0.16);
}

.footer-inner {
  width: min(calc(100% - 64px), var(--content));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  font-size: 10px;
  line-height: 1.8;
  color: #7f887f;
}

.footer-inner p {
  margin: 0;
  max-width: 640px;
}

.footer-inner .foot-meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer-inner a {
  color: #c7cdc4;
  border-bottom: 1px solid rgba(199, 205, 196, 0.3);
}

.footer-inner a:hover {
  color: #fff;
  border-color: #fff;
}

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .reveal-d1 {
  transition-delay: 0.08s;
}

.js .reveal-d2 {
  transition-delay: 0.16s;
}

/* ---------- diagram shared typography ---------- */

.diagram text {
  font-family: var(--sans);
  fill: var(--ink-soft);
}

.diagram .svg-mono {
  font-family: var(--mono);
  letter-spacing: 0.06em;
}

.diagram .svg-serif {
  font-family: var(--serif);
}

.diagram .lbl {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.diagram .lbl-sm {
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.diagram .lbl-mono {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diagram .lbl-strong {
  font-weight: 600;
  fill: var(--ink);
}

.diagram--dark text {
  fill: #a9b1a9;
}

.diagram--dark .lbl-strong {
  fill: #eef1ea;
}

.diagram .leader {
  stroke: rgba(29, 33, 30, 0.3);
  stroke-width: 0.8;
  fill: none;
}

.diagram--dark .leader {
  stroke: rgba(238, 241, 234, 0.24);
}

.diagram .leader-dot {
  fill: var(--scene-color, var(--accent));
}

.diagram .axis {
  stroke: rgba(29, 33, 30, 0.16);
  stroke-width: 0.75;
}

/* ---------- misc ---------- */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.mobile-hint {
  display: none;
  margin: 0;
  padding: 7px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ---------- responsive ---------- */

@media (min-width: 1280px) {
  .chapter-rail {
    display: block;
  }
}

@media (max-width: 1180px) {
  .hero-head {
    gap: 44px;
  }

  .intro-inner {
    grid-template-columns: 110px minmax(0, var(--copy));
  }

  .intro-aside {
    grid-column: 2;
    margin: 40px 0 0;
    padding: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .intro-aside .k {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .chapter-head,
  .chapter-copy {
    margin-left: 0;
  }
}

@media (max-width: 980px) {
  body {
    font-size: 17px;
  }

  .header-nav {
    display: none;
  }

  .hero {
    padding-top: calc(var(--header-h) + 64px);
  }

  .hero-head {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
  }

  .hero h1 {
    font-size: clamp(58px, 13vw, 104px);
  }

  .hero-lede {
    max-width: 560px;
  }

  .hero-head {
    padding-bottom: 36px;
  }

  .chapter-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .chapter-no {
    font-size: 42px;
    padding-top: 0;
  }

  .chapter-head h2 {
    font-size: clamp(36px, 6.4vw, 52px);
  }

  .chapter-copy {
    margin-left: 0;
  }

  .chapter {
    padding-top: 100px;
  }

  .figure {
    margin-top: 44px;
    margin-bottom: 56px;
  }

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

  .readout:nth-child(2) {
    border-right: 0;
  }

  .readout:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stroke-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stroke-card:nth-child(2) {
    border-right: 0;
  }

  .stroke-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .ending-grid {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .ending {
    margin-top: 90px;
    padding-top: 92px;
  }

  .menu-panel {
    grid-template-columns: 1fr;
    gap: 36px;
    width: min(100% - 56px, 620px);
    padding-top: 84px;
    max-height: 100vh;
    overflow-y: auto;
  }

  .menu-aside {
    position: static;
  }

  .menu-aside .big-mark {
    display: none;
  }

  .menu-aside p {
    display: none;
  }

  .menu-foot {
    display: none;
  }

  .menu-close {
    top: 20px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 56px;
  }

  .hero-inner,
  .intro-inner,
  .chapter-inner,
  .ending-inner,
  .footer-inner {
    width: calc(100% - 36px);
  }

  .header-inner {
    width: calc(100% - 36px);
  }

  .hero-head {
    gap: 20px;
  }

  .hero h1 {
    font-size: clamp(52px, 16vw, 76px);
    line-height: 1.02;
  }

  .hero-lede {
    font-size: 15.5px;
    line-height: 1.85;
  }

  .hero-meta {
    font-size: 9px;
  }

  .hero-figure {
    margin-top: 38px;
  }

  .hero-figure-head {
    align-items: flex-start;
  }

  .hero-stage svg {
    min-width: 720px;
  }

  .hero-controls {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 16px;
  }

  .hero-fig-caption {
    display: block;
  }

  .hero-fig-caption .count {
    display: block;
    margin-top: 8px;
  }

  .intro {
    padding: 64px 0 30px;
  }

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

  .intro-marker {
    display: none;
  }

  .intro-copy p {
    font-size: 17px;
    line-height: 1.9;
  }

  .intro-aside {
    grid-column: auto;
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .chapter {
    padding-top: 76px;
  }

  .chapter-head {
    margin-bottom: 30px;
  }

  .chapter-head h2 {
    font-size: clamp(33px, 9vw, 44px);
  }

  .chapter-deck {
    font-size: 14px;
  }

  .chapter-copy p {
    font-size: 16.5px;
    line-height: 1.9;
  }

  .chapter-copy .lead {
    font-size: 21px;
  }

  .figure {
    width: calc(100% + 0px);
    margin: 38px 0 48px;
  }

  .figure-head {
    padding: 9px 13px;
    gap: 10px;
  }

  .fig-label {
    gap: 8px;
    font-size: 9px;
  }

  .fig-label .zh {
    font-size: 10px;
  }

  .fig-badge {
    font-size: 7px;
  }

  .figure-stage {
    padding: 12px 8px 6px;
  }

  .figure-stage .diagram-scroll {
    margin-right: -8px;
  }

  .figure-stage svg {
    min-width: 700px;
  }

  .figure-stage[data-mobile-fit] svg {
    min-width: 0;
  }

  .mobile-hint {
    display: block;
  }

  .figure-ui {
    padding: 12px 13px;
    gap: 12px 16px;
  }

  .figure-ui--stack {
    gap: 10px;
  }

  .control-label {
    font-size: 8px;
  }

  .range-wrap {
    flex-basis: 100%;
  }

  .range-value {
    min-width: 48px;
    font-size: 9px;
  }

  .readouts {
    grid-template-columns: 1fr 1fr;
  }

  .readout {
    padding: 11px 12px;
  }

  .readout .v {
    font-size: 16px;
  }

  .readout .k {
    font-size: 7px;
  }

  .readout--wide {
    grid-column: span 2;
  }

  .figure-foot {
    display: block;
    padding: 11px 13px 13px;
  }

  .figure-foot .fig-tech {
    display: none;
  }

  .figure-foot figcaption {
    font-size: 10.5px;
  }

  .stage-overlay--tl {
    top: 16px;
    left: 15px;
  }

  .stage-overlay--tr {
    top: 16px;
    right: 15px;
  }

  .hud-title {
    font-size: 21px;
  }

  .stage-note {
    display: none;
  }

  .stroke-cards {
    grid-template-columns: 1fr 1fr;
  }

  .stroke-card {
    padding: 14px 13px 16px;
    min-height: 0;
  }

  .stroke-card h4 {
    font-size: 19px;
  }

  .stroke-card p {
    font-size: 10px;
  }

  .note {
    padding: 16px 16px 14px 20px;
    margin-top: 26px;
  }

  .note p {
    font-size: 13px;
  }

  .formula-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .formula-card .fc-formula {
    font-size: 20px;
  }

  .formula-card .fc-note {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }

  .data-strip {
    grid-template-columns: 1fr;
  }

  .data-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .data-strip > div:last-child {
    border-bottom: 0;
  }

  .ending {
    padding-top: 72px;
  }

  .ending h2 {
    font-size: clamp(38px, 10.5vw, 58px);
  }

  .ending-lede {
    font-size: 15px;
    margin-bottom: 40px;
  }

  .ending-grid {
    padding: 34px 0 52px;
  }

  .ending-facts {
    gap: 18px;
  }

  .footer-inner {
    display: block;
  }

  .footer-inner .foot-meta {
    margin-top: 16px;
    text-align: left;
    white-space: normal;
  }

  .menu-list a {
    grid-template-columns: 32px 1fr;
    gap: 12px;
  }

  .menu-list .e {
    display: none;
  }

  .menu-panel {
    width: calc(100% - 40px);
    gap: 24px;
    padding: 78px 0 30px;
  }

  .menu-aside h2 {
    font-size: 36px;
  }

  .menu-list .t {
    font-size: 22px;
  }
}

@media (max-width: 430px) {
  .brand-text small {
    display: none;
  }

  .menu-btn {
    padding: 6px 11px 6px 13px;
    font-size: 11px;
  }

  .hero h1 {
    font-size: clamp(48px, 16.4vw, 66px);
  }

  .readouts {
    grid-template-columns: 1fr 1fr;
  }

  .readout .v {
    font-size: 14px;
  }

  .readout .v small {
    font-size: 8px;
  }

  .hero-stage svg,
  .figure-stage svg {
    min-width: 660px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .scroll-hint .line::after {
    display: none;
  }
}

/* ---------- hero drawing entry ---------- */

#hero-body-outline {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.hero-stage.is-drawn #hero-body-outline {
  animation: hero-draw 2.5s 0.15s var(--ease) forwards;
}

@keyframes hero-draw {
  to { stroke-dashoffset: 0; }
}

.hero-stage.is-drawn #hero-internals,
.hero-stage.is-drawn #hero-wheels {
  animation: hero-part-in 1.2s 0.75s var(--ease) both;
}

.hero-stage.is-drawn #hero-callouts {
  animation: hero-part-in 1s 1.3s var(--ease) both;
}

@keyframes hero-part-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-stage .callout {
  transition: opacity 0.25s linear;
}

/* ---------- engine chapter ---------- */

.engine-phase-en {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #ef6b3b;
  text-transform: uppercase;
}

.engine-hud .stage-note {
  margin-top: 14px;
  max-width: 185px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0;
  text-transform: none;
  color: #89938a;
}

.engine-hud .hud-title {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

@media (max-width: 760px) {
  .engine-hud {
    top: 14px;
    left: 14px;
  }
  .engine-hud .stage-note,
  .engine-hud .stroke-dots {
    display: none;
  }
  .engine-hud .hud-title {
    font-size: 18px;
  }
  .engine-hud .engine-phase-en {
    font-size: 8px;
  }
}

/* ---------- clutch / gearbox ---------- */

.clutch-hud {
  text-align: right;
}

.clutch-hud .hud-title {
  font-size: 23px;
}

.clutch-hud .engine-phase-en {
  color: #2f5c8a;
}

@media (max-width: 760px) {
  .clutch-hud .hud-title {
    font-size: 17px;
  }
  .clutch-hud .engine-phase-en {
    font-size: 8px;
  }
}

/* ---------- mobile hero / typography refinements ---------- */

.hero-mobile-parts {
  display: none;
}

@media (max-width: 760px) {
  .hero-stage-scroll {
    overflow: hidden;
  }

  .hero-stage svg {
    min-width: 0;
  }

  .hero-mobile-parts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
    padding: 16px 2px 4px;
    border-bottom: 1px solid var(--line);
  }

  .hero-mobile-parts span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--ink-soft);
  }

  .hero-mobile-parts i {
    display: block;
    width: 12px;
    height: 2px;
    background: var(--c);
  }

  .intro-copy .dropcap {
    font-size: 3.3em;
    line-height: 0.9;
    padding-right: 0.08em;
  }
}

@media (max-width: 760px) {
  .intro-copy .dropcap {
    font-size: 3.1em;
  }
}

/* ---------- header over dark ending ---------- */

.site-header.on-dark {
  background: rgba(15, 20, 18, 0.9);
  border-bottom-color: rgba(243, 240, 232, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
}

.site-header.on-dark .brand-mark,
.site-header.on-dark .brand-text b {
  color: #f1f3ec;
}

.site-header.on-dark .brand-text small {
  color: #8e978e;
}

.site-header.on-dark .header-nav a {
  color: #b7beb6;
}

.site-header.on-dark .header-nav a:hover {
  color: #fff;
}

.site-header.on-dark .menu-btn {
  color: #e7ebe4;
  border-color: rgba(243, 240, 232, 0.24);
}

.site-header.on-dark .menu-btn:hover {
  background: #f3f0e8;
  color: #151b18;
  border-color: #f3f0e8;
}

.figure--dark .mobile-hint {
  background: #151b18;
  border-color: rgba(243, 240, 232, 0.12);
  color: #8f978f;
}

/* ---------- supporting systems ---------- */

.minor-systems {
  margin-top: 100px;
  padding-top: 30px;
  border-top: 1px solid var(--line-strong);
}

.minor-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.minor-head .kicker {
  margin-bottom: 10px;
}

.minor-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.minor-count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
  padding-bottom: 4px;
}

.minor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.minor-item {
  padding: 20px 22px 22px;
  border-right: 1px solid var(--line);
}

.minor-item:last-child {
  border-right: 0;
}

.minor-item .mi-no {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.minor-item h4 {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.minor-item p {
  margin: 0;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
}

@media (max-width: 980px) {
  .minor-grid {
    grid-template-columns: 1fr 1fr;
  }
  .minor-item:nth-child(2n) {
    border-right: 0;
  }
  .minor-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .minor-systems {
    margin-top: 70px;
  }
  .minor-head {
    display: block;
  }
  .minor-count {
    display: block;
    margin-top: 10px;
  }
  .minor-grid {
    grid-template-columns: 1fr;
  }
  .minor-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px 4px;
  }
  .minor-item:last-child {
    border-bottom: 0;
  }
  .minor-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

.noscript-note {
  position: relative;
  z-index: 10;
  margin-top: var(--header-h);
  padding: 10px 18px;
  background: #1d211e;
  color: #f3f0e8;
  font-size: 12px;
  text-align: center;
}

/* ---------- rail hide / hero tablet fit ---------- */

.chapter-rail {
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.chapter-rail.is-hidden {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 980px) {
  .hero-stage-scroll {
    overflow: hidden;
  }
  .hero-stage svg {
    min-width: 0;
  }
}

/* ---------- anchor offset under fixed header ---------- */

.chapter,
.ending,
#intro,
#top {
  scroll-margin-top: calc(var(--header-h) + 20px);
}
