/* ============================================================
   SANDBOX ATLAS — draftsman's plate
   Light theme: cream paper, navy ink, vermillion accent.
============================================================ */

:root {
  --paper:       #F2EBD8;   /* cream paper */
  --paper-deep:  #E8DFC6;   /* shadow on paper */
  --ink:         #142235;   /* deep navy ink */
  --ink-soft:    #4A5870;   /* faded ink */
  --ink-ghost:   #8E9AB0;   /* margin ink */
  --rule:        #C4B58C;   /* drafting rule (warm) */
  --hot:         #C8472D;   /* vermillion / drafting red */
  --hot-deep:    #8E2E1C;
  --mustard:     #D9A93B;   /* sodium-vapour */
  --teal:        #2F6F6A;   /* secondary accent */
  --paper-edge:  rgba(20,34,53,0.08);

  --f-display:   "Fraunces", "Cormorant Garamond", "Georgia", serif;
  --f-body:      "Atkinson Hyperlegible", "Inter", -apple-system, sans-serif;
  --f-mono:      "JetBrains Mono", "SF Mono", "Menlo", monospace;
}

/* ============================================================
   RESET-ish + base
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper texture — subtle noise + grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(20,34,53,0.04) 1px, transparent 1px),
    radial-gradient(rgba(20,34,53,0.025) 1px, transparent 1px);
  background-size: 28px 28px, 7px 7px;
  background-position: 0 0, 14px 14px;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 20% 0%, transparent 60%, rgba(0,0,0,0.05) 100%),
    radial-gradient(120% 100% at 80% 100%, transparent 60%, rgba(180,140,80,0.06) 100%);
  z-index: 0;
}

a { color: var(--ink); text-decoration: none; }
em { font-style: italic; }
code, kbd {
  font-family: var(--f-mono);
  font-size: 0.9em;
  background: rgba(20,34,53,0.06);
  padding: 0.05em 0.35em;
  border-radius: 2px;
}
kbd {
  border: 1px solid var(--ink-soft);
  background: var(--paper);
  font-size: 0.8em;
  padding: 0.05em 0.4em;
}

/* ============================================================
   MARGIN RULE — left-side drafting ruler / nav
============================================================ */
.rule {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 68px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0 19px,
      var(--rule) 19px 20px
    );
  background-size: 100% 200px;
  background-repeat: no-repeat;
  background-position: center;
}
.rule__brand {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
  color: var(--hot);
  font-variation-settings: "SOFT" 100;
}
.rule__sections {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  justify-content: center;
}
.rule__sections a {
  display: block;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 6px 4px;
  position: relative;
  transition: color 180ms ease;
}
.rule__sections a::before {
  content: attr(data-n);
  display: block;
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  margin-bottom: 2px;
}
.rule__sections a span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 9px;
  opacity: 0;
  max-height: 0;
  transition: opacity 200ms ease, max-height 200ms ease;
}
.rule__sections li.is-current a { color: var(--hot); }
.rule__sections li.is-current a::before { color: var(--hot); }
.rule:hover .rule__sections a span { opacity: 1; max-height: 80px; }
.rule__tick {
  width: 16px; height: 1px;
  background: var(--ink);
  margin-top: auto;
}

/* ============================================================
   PAPER + PLATES
============================================================ */
.paper {
  position: relative;
  margin-left: 68px;
  padding: 80px clamp(36px, 6vw, 96px) 120px;
  max-width: 1480px;
  z-index: 1;
}

.plate {
  position: relative;
  padding: 64px 0 96px;
  border-top: 1px solid var(--rule);
}
.plate:first-of-type { border-top: 0; padding-top: 0; }

.plate__num {
  position: absolute;
  top: 64px;
  right: 0;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}
.plate__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(40px, 5.6vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
  max-width: 14ch;
}
.plate__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--hot);
  margin-top: 18px;
}
.lede {
  font-family: var(--f-display);
  font-style: italic;
  font-variation-settings: "SOFT" 50, "opsz" 14;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.4;
  max-width: 60ch;
  color: var(--ink-soft);
  margin: 0 0 44px;
}

/* ============================================================
   00 — COVER PLATE
============================================================ */
.plate--cover {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  padding: 16px 0 0;
  border-top: 0;
}
.plate__header {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 60px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stamp { white-space: nowrap; }
.stamp::before { content: "▎"; color: var(--hot); margin-right: 6px; }

.cover__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "opsz" 144, "WONK" 1;
  margin: 0;
  line-height: 0.84;
  letter-spacing: -0.04em;
}
.cover__title-1, .cover__title-2 {
  display: block;
  font-size: clamp(80px, 16vw, 240px);
}
.cover__title-1 {
  font-weight: 300;
  color: var(--ink);
}
.cover__title-2 {
  font-style: italic;
  font-weight: 500;
  color: var(--hot);
  margin-left: 0.6em;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.cover__subtitle {
  font-family: var(--f-display);
  font-style: italic;
  font-variation-settings: "SOFT" 30, "opsz" 24;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.35;
  max-width: 38ch;
  margin: 60px 0 64px;
  color: var(--ink-soft);
}

.cover__meta {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 0;
  max-width: 880px;
}
.cover__dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 14px;
  column-gap: 28px;
  margin: 0;
  font-size: 15px;
}
.cover__dl dt {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}
.cover__dl dd { margin: 0; }

.cover__mark {
  position: absolute;
  top: 24px;
  right: 0;
  width: 96px;
  height: 96px;
  color: var(--ink-soft);
  opacity: 0.7;
  animation: spin 60s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   01 — CAST
============================================================ */
.cast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
}
.cast__card {
  border-left: 1px solid var(--rule);
  padding-left: 20px;
  position: relative;
}
.cast__card::before {
  content: "";
  position: absolute;
  left: -3px; top: 0;
  width: 5px; height: 16px;
  background: var(--hot);
}
.cast__card h3 {
  font-family: var(--f-display);
  font-variation-settings: "SOFT" 40, "opsz" 36;
  font-size: 24px;
  line-height: 1.1;
  margin: 0 0 10px;
  font-weight: 500;
}
.cast__card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ============================================================
   02 — CROSS-SECTION
============================================================ */
.cross {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 1080px) {
  .cross { grid-template-columns: 1fr; }
}

.cross__diagram {
  border: 1px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(20,34,53,0.04) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(20,34,53,0.04) 19px 20px),
    var(--paper);
  padding: 24px;
  position: relative;
  box-shadow: 0 1px 0 var(--paper-edge), 0 8px 24px -16px rgba(20,34,53,0.2);
}
.cross__diagram::before {
  content: "FIG. 02 — CROSS-SECTION, NTS";
  position: absolute;
  top: 8px; left: 24px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}
.cross__diagram::after {
  content: "rev. 1";
  position: absolute;
  bottom: 8px; right: 24px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

#schematic { width: 100%; height: auto; color: var(--ink); display: block; margin-top: 8px; }

.schematic__caption {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.schematic__caption--inner { text-transform: uppercase; letter-spacing: 0.18em; }
.schematic__label {
  font-family: var(--f-body);
  font-size: 12px;
  fill: var(--ink);
}
.station__n {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 600;
  font-variation-settings: "SOFT" 60;
  fill: var(--ink);
}
.station__label {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 12px;
  fill: var(--ink);
}
.station__sub {
  font-family: var(--f-mono);
  font-size: 9px;
  fill: var(--ink-soft);
}

.region { cursor: pointer; transition: opacity 200ms ease; }
.region:focus { outline: none; }
.region:hover rect, .region:hover polygon, .region:hover .pod,
.region:focus rect, .region:focus polygon, .region:focus .pod {
  fill: rgba(216, 167, 78, 0.16);
}
.region.is-selected rect,
.region.is-selected polygon,
.region.is-selected .pod {
  fill: rgba(200, 71, 45, 0.10);
  stroke: var(--hot);
  stroke-width: 2;
}
.region.is-selected .schematic__label,
.region.is-selected .schematic__caption {
  fill: var(--hot);
  font-weight: 700;
}
.station.is-active circle { fill: var(--hot); stroke: var(--hot); }
.station.is-active .station__n { fill: var(--paper); }
.station.is-active .station__label { fill: var(--hot); font-weight: 700; }

/* info panel */
.cross__panel {
  border: 1px solid var(--rule);
  padding: 24px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 200%);
  min-height: 320px;
  position: sticky;
  top: 24px;
}
.panel__placeholder {
  font-size: 14px;
  color: var(--ink-soft);
}
.panel__pre {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 12px;
}
.panel__hint {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel__hint .dot {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 8px;
  vertical-align: middle;
}
.dot--solid { background: var(--ink); }
.dot--dashed {
  border: 1px dashed var(--ink);
  background: transparent;
}
.dot--hot { background: var(--hot); }

.panel__content h3 {
  font-family: var(--f-display);
  font-variation-settings: "SOFT" 50, "opsz" 36;
  font-weight: 500;
  font-size: 28px;
  margin: 0 0 4px;
  color: var(--ink);
}
.panel__content .panel__sub {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 16px;
}
.panel__content p {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 12px;
  color: var(--ink);
}
.panel__content .panel__meta {
  margin: 18px 0 0;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.panel__content .panel__meta span { color: var(--ink); }

/* ============================================================
   03 — JOURNEY
============================================================ */
.journey {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.journey__stage {
  border: 1px solid var(--ink);
  background: var(--paper);
  padding: 16px 24px 12px;
  position: relative;
}
.journey__stage::before {
  content: "FIG. 03 — FLOW";
  position: absolute; top: 8px; left: 24px;
  font-family: var(--f-mono);
  font-size: 9px; letter-spacing: 0.2em; color: var(--ink-soft);
}
#flow-canvas { width: 100%; height: auto; color: var(--ink); margin-top: 14px; }

.journey__controls {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px 6px;
  border-top: 1px dashed var(--rule);
  margin-top: 10px;
}
.btn {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 0;
  transition: background 160ms ease, transform 80ms ease;
}
.btn:hover { background: var(--hot); }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.journey__counter {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.journey__steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px 32px;
}
.journey__steps li {
  counter-increment: step;
  position: relative;
  padding-left: 50px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  min-height: 56px;
  transition: color 220ms ease;
}
.journey__steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: -2px;
  font-family: var(--f-display);
  font-variation-settings: "SOFT" 80, "opsz" 60;
  font-size: 30px;
  font-weight: 500;
  color: var(--rule);
  line-height: 1;
  transition: color 220ms ease;
}
.journey__steps li.is-active { color: var(--ink); }
.journey__steps li.is-active::before { color: var(--hot); }
.journey__steps li strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   04 — CONCEPTS
============================================================ */
.concepts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.concept {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 22px 24px 24px;
  position: relative;
  transition: border-color 200ms ease, transform 200ms ease;
}
.concept:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.concept::before {
  content: "";
  position: absolute;
  top: 0; right: 16px;
  width: 1px; height: 14px;
  background: var(--hot);
}
.concept::after {
  content: "";
  position: absolute;
  top: 14px; right: 12px;
  width: 9px; height: 1px;
  background: var(--hot);
}
.concept header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.concept__n {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--hot);
  font-weight: 700;
}
.concept h3 {
  font-family: var(--f-display);
  font-variation-settings: "SOFT" 50, "opsz" 36;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
}
.concept__body p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.concept__body p.aside {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: 12px;
  margin-top: 14px;
}
.concept__body p.warn {
  font-family: var(--f-body);
  font-size: 13.5px;
  color: var(--hot-deep);
  border-left: 2px solid var(--hot);
  padding-left: 12px;
  margin-top: 14px;
}
.concept__body p.warn em { font-weight: 700; }

/* ============================================================
   05 — TERMINAL
============================================================ */
.terminal-shell {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1080px) {
  .terminal-shell { grid-template-columns: 1fr; }
}

.terminal-shell__menu {
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid var(--rule);
}
.terminal-shell__menu li {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 14px 0 14px 28px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
  color: var(--ink-soft);
  transition: color 160ms ease, padding-left 160ms ease;
}
.terminal-shell__menu li::before {
  content: "►";
  position: absolute;
  left: 6px;
  color: var(--hot);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 10px;
  top: 16px;
}
.terminal-shell__menu li:hover,
.terminal-shell__menu li.is-current {
  color: var(--ink);
  padding-left: 32px;
}
.terminal-shell__menu li:hover::before,
.terminal-shell__menu li.is-current::before {
  opacity: 1;
  transform: translateX(2px);
}

.terminal {
  background: #0F1A2A;
  color: #E8DFC6;
  border: 1px solid var(--ink);
  font-family: var(--f-mono);
  position: relative;
  box-shadow: 0 10px 24px -12px rgba(20,34,53,0.5);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1B2A40;
  padding: 8px 14px;
  border-bottom: 1px solid #0A1320;
}
.terminal__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--rule);
}
.terminal__dot:nth-child(1) { background: var(--hot); }
.terminal__dot:nth-child(2) { background: var(--mustard); }
.terminal__dot:nth-child(3) { background: var(--teal); }
.terminal__title {
  margin-left: 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--paper-deep);
  opacity: 0.7;
}
.terminal__screen {
  padding: 18px 20px 24px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}
.terminal__line { margin: 0 0 4px; }
.prompt { color: var(--hot); font-weight: 700; margin-right: 8px; }
.ghost { color: rgba(232,223,198,0.4); font-style: italic; }
.terminal__cmd { color: var(--mustard); }
.terminal__out  { color: var(--paper-deep); }
.terminal__hi   { color: #E8B931; }
.terminal__err  { color: #E8826E; }
.terminal__ok   { color: #9FD18E; }
.terminal__dim  { color: rgba(232,223,198,0.5); }

.terminal__cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--hot);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.terminal-shell__notes {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  position: sticky;
  top: 24px;
}
.terminal-shell__notes h4 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hot);
  margin: 0 0 10px;
}
.terminal-shell__notes ul {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.terminal-shell__notes li {
  position: relative;
  padding-left: 22px;
  font-size: 13.5px;
  line-height: 1.5;
}
.terminal-shell__notes li::before {
  content: "→";
  position: absolute;
  left: 0; top: 0;
  color: var(--hot);
  font-family: var(--f-mono);
  font-weight: 700;
}
.terminal-shell__notes code {
  background: rgba(20,34,53,0.08);
  color: var(--ink);
}

/* ============================================================
   06 — GLOSSARY
============================================================ */
.glossary {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px 32px;
  border-top: 1px solid var(--rule);
  padding-top: 32px;
}
.glossary dt {
  font-family: var(--f-display);
  font-variation-settings: "SOFT" 60, "opsz" 24;
  font-style: italic;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  padding-top: 2px;
}
.glossary dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--rule);
}

/* ============================================================
   07 — COLOPHON
============================================================ */
.plate--end { padding-bottom: 40px; }
.colophon {
  border-top: 1px solid var(--rule);
  padding-top: 32px;
  max-width: 980px;
}
.colophon dl {
  display: grid;
  grid-template-columns: 200px 1fr;
  row-gap: 16px;
  column-gap: 32px;
  margin: 0;
}
.colophon dt {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
}
.colophon dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
}
.colophon__sign {
  margin-top: 64px;
  text-align: center;
  font-family: var(--f-display);
  font-style: italic;
  font-variation-settings: "SOFT" 80, "opsz" 24;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

/* ============================================================
   GLOSSARY TOOLTIP (hover-to-define)
============================================================ */
.def {
  border-bottom: 1px dotted var(--hot);
  cursor: help;
}
.tip {
  position: fixed;
  z-index: 100;
  max-width: 280px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  box-shadow: 0 8px 20px -8px rgba(20,34,53,0.5);
}
.tip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 16px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  border-bottom: 0;
}
.tip.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   ENTRANCE ANIMATIONS — subtle, mechanical
============================================================ */
@keyframes draw-in {
  from { stroke-dashoffset: 1200; opacity: 0; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes lift {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.plate { animation: lift 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.plate__num { animation-delay: 100ms; }

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ============================================================
   SMALL SCREEN
============================================================ */
@media (max-width: 720px) {
  .rule { display: none; }
  .paper { margin-left: 0; padding: 36px 20px 64px; }
  .plate__num { position: static; margin-bottom: 12px; }
  .cover__title-1, .cover__title-2 { font-size: 64px; }
  .cover__dl { grid-template-columns: 100px 1fr; column-gap: 16px; }
  .colophon dl { grid-template-columns: 1fr; row-gap: 4px; }
  .colophon dt { margin-top: 12px; }
  .glossary { grid-template-columns: 1fr; }
}
