/* ═══════════════════════════════════════════════════════════════════════════
   ESKALAR — mountain & lab, editorial scale.
   Display: Fraunces (self-hosted). Body: humanist system stack.
   Type is deliberately book-sized: headlines lead, they don't shout.
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Fraunces Eskalar";
  src: url("/assets/fraunces-var.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --night: #0c1220;
  --night-deep: #070b14;
  --panel: #111a2c;
  --panel-raise: #16213a;
  --chalk: #f4eee3;
  --muted: #bdb4a4;
  --faint: #837b6e;
  --field-blue: #78dce8;
  --beam-gold: #f2a63b;
  --pine: #2a9174;
  --answer-green: #7ed3a7;
  --error-red: #f08a96;
  --ink: #160f08;
  --line: rgba(244, 238, 227, 0.15);
  --line-soft: rgba(244, 238, 227, 0.07);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
  --radius: 16px;
  --display: "Fraunces Eskalar", "Iowan Old Style", Georgia, serif;
  --body: "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--chalk);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.62;
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse 60rem 28rem at 78% 4%, rgba(242, 166, 59, 0.07), transparent 62%),
    radial-gradient(ellipse 54rem 26rem at 12% 14%, rgba(120, 220, 232, 0.07), transparent 62%),
    linear-gradient(140deg, #090e1c 0%, var(--night) 50%, #0f1728 100%);
  overflow-x: hidden;
}

/* faint ridge line, no graph paper — quieter than before */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='920' height='620' viewBox='0 0 920 620'%3E%3Cg fill='none' stroke='%23f4eee3' stroke-opacity='0.045' stroke-width='1.2'%3E%3Cpath d='M30 530c80-120 170-170 268-150s142 112 250 84 142-142 328-112'/%3E%3Cpath d='M30 478c86-94 170-130 252-106s128 96 236 62 150-120 356-92'/%3E%3Cpath d='M42 418c100-70 174-92 246-70s130 76 222 46 152-92 350-72'/%3E%3C/g%3E%3C/svg%3E");
  background-size: min(920px, 92vw) auto;
  background-position: right 8rem top 10rem;
  background-repeat: no-repeat;
  mask-image: linear-gradient(black 0 80%, transparent 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.65'/%3E%3C/svg%3E");
}

main, .nav, .footer { position: relative; z-index: 1; }
::selection { background: rgba(242, 166, 59, 0.32); }

/* skip link: invisible until keyboard focus — never part of the page flow */
.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  color: var(--ink);
  background: var(--beam-gold);
  font-weight: 700;
  text-decoration: none;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus-visible {
  clip-path: none;
  opacity: 1;
  pointer-events: auto;
}

/* ── nav ─────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--night) 84%, transparent);
  backdrop-filter: blur(12px);
}

.brand, .nav a, .button, .footer a { color: inherit; text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 620;
}
.brand-mark { width: 1.7rem; height: 1.7rem; color: var(--beam-gold); }

.nav-links {
  display: flex;
  gap: clamp(0.75rem, 2vw, 1.4rem);
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.nav-links a:hover { color: var(--chalk); }

.locale-switch {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.locale-button {
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 0.4rem 0.68rem;
  font: 700 0.8rem var(--body);
  cursor: pointer;
}
.locale-button.active { color: var(--ink); background: var(--beam-gold); }

/* ── route rail ──────────────────────────────────────────────────────────── */

.route-rail {
  position: fixed;
  z-index: 30;
  left: clamp(0.7rem, 1.7vw, 1.7rem);
  top: 50%;
  display: flex;
  gap: 0.7rem;
  height: min(58vh, 480px);
  transform: translateY(-50%);
}
.route-rail-track { width: 2px; overflow: hidden; border-radius: 2px; background: var(--line); }
.route-rail-progress {
  width: 100%;
  height: 100%;
  transform: scaleY(0);
  transform-origin: top;
  background: linear-gradient(var(--beam-gold), var(--field-blue), var(--pine));
}
.route-rail-stops {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.route-rail-stops li { display: flex; align-items: center; gap: 0.45rem; }
.route-rail-stops li::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.route-rail-stops li.active { color: var(--beam-gold); }
.route-rail-stops li.active::before { background: currentColor; box-shadow: 0 0 0 5px rgba(242, 166, 59, 0.1); }

/* ── layout & type scale (the fix: book-sized, never billboard) ─────────── */

.hero, .section, .footer { width: min(1080px, calc(100% - 36px)); margin: 0 auto; }
.hero, .section { padding: clamp(3.6rem, 7vw, 5.6rem) 0; }

.waypoint {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  color: var(--field-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.wp-dot {
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(120, 220, 232, 0.1);
}

.eyebrow, .card-kicker {
  margin: 0 0 0.7rem;
  color: var(--beam-gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 580;
  line-height: 1.12;
  letter-spacing: -0.015em;
}
h1 { max-width: 18ch; font-size: clamp(2.3rem, 3.6vw, 3.45rem); }
h2 { max-width: 26ch; font-size: clamp(1.7rem, 2.5vw, 2.35rem); }
h3 { font-size: clamp(1.2rem, 1.6vw, 1.4rem); }
h4 { font-size: 1.02rem; letter-spacing: 0.01em; }

.hero-lede, .section-head p, .definition-card p, .offer-card span,
.comparison-card li, .result-copy, .quiz-feedback, .footer, .form-status,
.lab-note, .station-script, .rubric-honesty {
  color: var(--muted);
  line-height: 1.7;
}
.section-head p { max-width: 62ch; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.86fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  min-height: min(680px, calc(100vh - 200px));
}
.hero-lede { max-width: 56ch; margin: 1.2rem 0 1.8rem; font-size: 1.06rem; }
.hero-actions, .quiz-tools { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font: 650 0.93rem var(--body);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--ink); background: var(--beam-gold); box-shadow: 0 14px 40px rgba(242, 166, 59, 0.18); }
.button-ghost { color: var(--chalk); border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.button-small { min-height: 2.35rem; padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.button:focus-visible, .locale-button:focus-visible, .prediction-button:focus-visible,
.quiz-option:focus-visible, .chip:focus-visible, .lesson-open:focus-visible,
input:focus-visible, select:focus-visible {
  outline: 3px solid var(--field-blue);
  outline-offset: 3px;
}

/* ── hero panel ──────────────────────────────────────────────────────────── */

.hero-panel, .course-lab, .measurement-ledger, .start-grid {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(circle at 26% 16%, rgba(120, 220, 232, 0.09), transparent 16rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero-panel { overflow: hidden; padding: clamp(1rem, 2.6vw, 1.5rem); }
.hero-panel .mountain-mark { display: block; width: 100%; min-height: 210px; }

.ridge-back { fill: rgba(120, 220, 232, 0.07); stroke: rgba(120, 220, 232, 0.3); stroke-width: 2.5; }
.ridge-front { fill: none; stroke: var(--chalk); stroke-width: 3; stroke-linejoin: round; opacity: 0.7; }
.route-line {
  fill: none;
  stroke: var(--beam-gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 8 11;
  filter: drop-shadow(0 0 10px rgba(242, 166, 59, 0.4));
}
.route-node { fill: var(--field-blue); stroke: var(--night); stroke-width: 3; }

.panel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }
.panel-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(0, 0, 0, 0.14);
}
.panel-grid strong { display: block; font-family: var(--display); font-size: 1.55rem; line-height: 1.1; }
.panel-grid span { display: block; margin-top: 0.4rem; color: var(--muted); font-size: 0.82rem; }

/* ── sections & cards ────────────────────────────────────────────────────── */

.section { border-top: 1px solid var(--line-soft); }
.section-head { max-width: 760px; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.section-head.compact { margin-bottom: 0; }

.definition-grid, .offer-grid, .comparison-grid { display: grid; gap: 0.9rem; }
.definition-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.offer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; margin: 0; list-style: none; }

.definition-card, .offer-card, .comparison-card, .demo-controls,
.experiment-panel, .quiz-card, .lead-form {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}
.definition-card, .offer-card, .comparison-card { padding: 1.2rem; }

.offer-card i {
  display: block;
  margin-bottom: 0.85rem;
  color: var(--field-blue);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.offer-card strong, .offer-card span { display: block; }
.offer-card strong { margin-bottom: 0.55rem; font-family: var(--display); font-size: 1.22rem; font-weight: 600; line-height: 1.15; }
.offer-card span { font-size: 0.92rem; }

.comparison-grid { grid-template-columns: 0.9fr 1.1fr; }
.comparison-card ul { margin: 0.9rem 0 0; padding-left: 1.1rem; }
.comparison-card li + li { margin-top: 0.6rem; }
.highlight-card { border-color: rgba(242, 166, 59, 0.4); background: linear-gradient(145deg, rgba(242, 166, 59, 0.1), rgba(120, 220, 232, 0.05)); }
.muted-card { opacity: 0.85; }

/* ── course: level switch + stations ─────────────────────────────────────── */

.level-switch { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.3rem; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--chalk);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1rem;
  font: 650 0.88rem var(--body);
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.chip:hover { border-color: rgba(244, 238, 227, 0.4); }
.chip.active { color: var(--ink); background: var(--field-blue); border-color: var(--field-blue); }
.level-blurb { flex-basis: 100%; margin: 0.4rem 0 0; color: var(--faint); font-size: 0.88rem; }

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.6rem 0 0;
  padding: 0;
  list-style: none;
}
.lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)), var(--panel-raise);
}
.lesson-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(120, 220, 232, 0.14);
  border-radius: 50%;
}
.lesson-kicker {
  display: block;
  color: var(--field-blue);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.lesson-card h3 { font-size: 1.12rem; line-height: 1.22; }
.lesson-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.lesson-open {
  margin-top: auto;
  align-self: flex-start;
  border: 0;
  padding: 0.2rem 0;
  color: var(--beam-gold);
  background: none;
  font: 650 0.88rem var(--body);
  cursor: pointer;
}
.lesson-open::after { content: " →"; }

/* station dialog */
.station-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(84vh, 900px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 0;
  color: var(--chalk);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.station-dialog::backdrop { background: rgba(5, 8, 15, 0.72); backdrop-filter: blur(4px); }
.station-scroll { max-height: inherit; overflow-y: auto; padding: clamp(1.1rem, 3vw, 1.7rem); }
.station-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.station-kicker { color: var(--field-blue); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.station-dialog h3 { max-width: 24ch; font-size: 1.45rem; }
.station-video { margin: 1.1rem auto; max-width: 320px; }
.station-video video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #05080f;
  object-fit: cover;
}
.station-video figcaption { margin-top: 0.5rem; color: var(--faint); font-size: 0.84rem; text-align: center; }

.station-figure { margin: 1.1rem 0; }
.station-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(0, 0, 0, 0.18); padding: 0.6rem; }
.station-figure figcaption { margin-top: 0.5rem; color: var(--faint); font-size: 0.84rem; }
.station-objectives ul { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.station-objectives li + li { margin-top: 0.35rem; }
.station-script { margin: 1.1rem 0; }
.station-deeper {
  border-left: 3px solid var(--pine);
  border-radius: 0 12px 12px 0;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  background: rgba(42, 145, 116, 0.08);
}
.station-deeper h4 { color: var(--pine); margin-bottom: 0.35rem; }
.station-deeper p { margin: 0; color: var(--muted); }
.station-prediction { border-top: 1px solid var(--line-soft); margin-top: 1.2rem; padding-top: 1rem; }
.station-prediction p { color: var(--muted); }
.station-reveal { min-height: 1.4rem; }
.station-reveal strong { color: var(--chalk); }

/* ── lab ─────────────────────────────────────────────────────────────────── */

.course-lab { padding: clamp(1rem, 2.6vw, 1.6rem); }
.lab-head { margin-bottom: 1.1rem; }

.quantum-shell { display: grid; grid-template-columns: minmax(250px, 0.72fr) 1.28fr; gap: 0.9rem; }

.demo-controls, .experiment-panel, .quiz-card, .lead-form { padding: 1.05rem; background: rgba(7, 11, 20, 0.4); }
.demo-controls label, .lead-form label { display: block; margin-bottom: 0.4rem; color: var(--field-blue); font-weight: 650; font-size: 0.9rem; }

input, select {
  width: 100%;
  margin-bottom: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--chalk);
  background: var(--night-deep);
  padding: 0.72rem 0.85rem;
  font: inherit;
}

.scenario-prompt { min-height: 3.4rem; color: var(--muted); font-size: 0.94rem; }
.lab-note { margin: 0.9rem 0 0; font-size: 0.8rem; color: var(--faint); }

.prediction-options, .quiz-options, .hint-list { display: grid; gap: 0.55rem; margin: 0.9rem 0; padding: 0; list-style: none; }
.prediction-button, .quiz-option {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--chalk);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.72rem 0.85rem;
  font-size: 0.94rem;
  text-align: left;
  cursor: pointer;
}
.prediction-button.selected, .quiz-option.selected { border-color: var(--field-blue); box-shadow: 0 0 0 3px rgba(120, 220, 232, 0.12); }
.quiz-option.correct { border-color: var(--answer-green); background: rgba(126, 211, 167, 0.08); }
.quiz-option.wrong { border-color: var(--error-red); background: rgba(240, 138, 150, 0.07); }
.quiz-option:disabled { cursor: default; }
.quiz-option:disabled:not(.correct):not(.wrong) { opacity: 0.55; }

/* the lab stage: one coherent SVG scene drawn by app.js */
.beamline-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 50%, rgba(242, 166, 59, 0.06), transparent 14rem),
    #080d18;
}
.lab-stage .st-rail { stroke: rgba(244, 238, 227, 0.14); stroke-width: 1.5; stroke-dasharray: 2 7; }
.lab-stage .st-source { fill: rgba(242, 166, 59, 0.16); stroke: var(--beam-gold); stroke-width: 2; }
.lab-stage .st-box { stroke-width: 2; rx: 12; }
.lab-stage .st-box-z { fill: rgba(120, 220, 232, 0.12); stroke: var(--field-blue); }
.lab-stage .st-box-x { fill: rgba(42, 145, 116, 0.14); stroke: var(--pine); }
.lab-stage .st-beam { fill: none; stroke: var(--beam-gold); stroke-width: 2.6; stroke-linecap: round; }
.lab-stage .st-beam-soft { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 7 8; }
.lab-stage .st-beam-up { stroke: var(--beam-gold); }
.lab-stage .st-beam-down { stroke: var(--field-blue); }
.lab-stage .st-blocked { stroke: var(--error-red); stroke-width: 4; stroke-linecap: round; }
.lab-stage .st-screen { fill: rgba(244, 238, 227, 0.06); stroke: rgba(244, 238, 227, 0.35); stroke-width: 1.6; rx: 8; }
.lab-stage .st-dot { r: 5; }
.lab-stage .st-dot-up { fill: var(--beam-gold); }
.lab-stage .st-dot-down { fill: var(--field-blue); }
.lab-stage text {
  fill: var(--muted);
  font: 600 15px var(--body);
}
.lab-stage .st-axis { fill: var(--chalk); font-weight: 700; }
.lab-stage .st-pct { fill: var(--chalk); font-weight: 650; }
.result-copy { margin-top: 0.9rem; font-size: 0.95rem; }
.result-copy strong { color: var(--chalk); }

/* ── practice / quiz ─────────────────────────────────────────────────────── */

.measurement-ledger { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr); gap: 0.9rem; padding: clamp(1rem, 2.6vw, 1.5rem); }

.quiz-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.8rem; color: var(--field-blue); font-weight: 650; font-size: 0.86rem; }
.quiz-level-tag { color: var(--faint); font-weight: 600; }
.quiz-stem { margin: 0 0 0.4rem; font-family: var(--display); font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.3; }

.confidence-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.7rem 0; }
.confidence-row .confidence-label { color: var(--faint); font-size: 0.84rem; }

.hint-list li {
  border-left: 3px solid var(--beam-gold);
  border-radius: 0 10px 10px 0;
  padding: 0.6rem 0.85rem;
  color: var(--muted);
  background: rgba(242, 166, 59, 0.07);
  font-size: 0.92rem;
}
.hint-kind { display: block; margin-bottom: 0.15rem; color: var(--faint); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.quiz-feedback { min-height: 1.6rem; font-size: 0.94rem; }
.quiz-feedback strong { color: var(--chalk); }
.mc-tag {
  display: inline-block;
  margin-top: 0.4rem;
  border: 1px solid rgba(240, 138, 150, 0.4);
  border-radius: 8px;
  padding: 0.22rem 0.55rem;
  color: var(--error-red);
  font-size: 0.78rem;
}

/* typeset math — tiny TeX subset rendered by app.js into real notation */
.math {
  font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "STIX Two Text", "Times New Roman", serif;
  font-size: 1.05em;
  color: var(--chalk);
}
.math i {
  font-style: italic;
  letter-spacing: 0.01em;
}
.math sup,
.math sub {
  font-size: 0.7em;
  line-height: 1;
}
.math .mop {
  font-style: normal;
  margin-right: 0.06em;
}
.math-display {
  display: block;
  margin: 0.85em auto 0.9em;
  text-align: center;
  font-size: 1.12em;
}
.mfrac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.14em;
  font-size: 0.78em;
  line-height: 1.15;
  text-align: center;
  vertical-align: -0.42em;
}
.math-display .mfrac {
  font-size: 0.95em;
  vertical-align: middle;
}
.mfrac .mnum {
  padding: 0 0.3em 0.1em;
}
.mfrac .mden {
  border-top: 1px solid currentColor;
  padding: 0.1em 0.3em 0;
}
.msqrt {
  display: inline-flex;
  align-items: stretch;
}
.msqrt .mroot {
  border-top: 1px solid currentColor;
  margin-left: -0.06em;
  padding: 0.08em 0.18em 0 0.1em;
}

/* rubric */
.rubric { margin-top: 1.4rem; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: clamp(1rem, 2.6vw, 1.5rem); background: rgba(255, 255, 255, 0.03); }
.rubric-head p:last-child { max-width: 60ch; color: var(--muted); }
.rubric-rows { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.rubric-rows li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  background: rgba(7, 11, 20, 0.35);
}
.rubric-num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--pine);
  border-radius: 50%;
  color: var(--pine);
  font: 700 0.85rem var(--body);
}
.rubric-rows strong { display: block; font-size: 0.95rem; }
.rubric-rows span { display: block; margin-top: 0.2rem; color: var(--faint); font-size: 0.85rem; }
.rubric-honesty { margin: 1rem 0 0; padding-top: 0.9rem; border-top: 1px dashed var(--line-soft); font-size: 0.9rem; }

/* ── start & footer ──────────────────────────────────────────────────────── */

.start-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); gap: 0.9rem; align-items: start; padding: clamp(1rem, 2.6vw, 1.5rem); }
.lead-form { display: grid; }
.form-status { min-height: 1.7rem; margin: 0.7rem 0 0; font-size: 0.9rem; }
.form-status.success { color: var(--answer-green); }
.form-status.error { color: var(--error-red); }

.footer { display: flex; flex-wrap: wrap; gap: 0.7rem 1.3rem; padding: 1.8rem 0 2.6rem; border-top: 1px solid var(--line-soft); font-size: 0.9rem; }
.footer a { color: var(--field-blue); }

/* ── motion ──────────────────────────────────────────────────────────────── */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms ease, transform 600ms ease; }
.js .reveal.in-view, .reveal.in-view { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: 80ms; }
.js .reveal.d2 { transition-delay: 160ms; }

@media (max-width: 1180px) {
  .route-rail { display: none; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero, .quantum-shell, .measurement-ledger, .start-grid,
  .comparison-grid, .definition-grid, .offer-grid { grid-template-columns: 1fr; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: auto; }
}

@media (max-width: 620px) {
  .hero, .section, .footer { width: min(100% - 26px, 1080px); }
  .nav { padding-inline: 0.85rem; }
  .brand { font-size: 1.05rem; }
  .lesson-grid { grid-template-columns: 1fr; }
  .rubric-rows li { grid-template-columns: 1fr; }
  .rubric-num { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * , *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
