/* ============================================================
   MOTION — unit page styles
   Hero film strip · 10-cm dash · odometer vs ruler · Speed
   Board · race graph scrubber · graph matcher · velocity ·
   myth flips · flashcards · exit ticket
   ============================================================ */

/* the hidden attribute must always win over the display rules below */
[hidden] { display: none !important; }

/* ---------- hero ---------- */
.mo-hero {
  position: relative;
  padding-top: clamp(150px, 20vh, 200px);
  overflow: hidden;
  background: linear-gradient(180deg, #F7F2E4 0%, var(--sand-50) 60%, var(--sand-100) 100%);
}
.mo-hero-grid {
  position: relative; z-index: 1; /* above .sun */
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  align-items: center; gap: clamp(30px, 5vw, 60px);
  padding-bottom: 70px;
}
.mo-hero-grid > * { min-width: 0; }
.mo-title { font-size: clamp(2.9rem, 6.5vw, 5.4rem); margin-bottom: 26px; }
.mo-title .char { display: inline-block; }
.mo-hero .lede em { font-style: italic; color: var(--iris-500); }
.mo-chips { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }

/* film strip */
.hero-film {
  max-width: 440px; margin-left: auto; width: 100%;
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 20px 20px 14px;
}
.film-top { margin-bottom: 12px; }
.spec-label {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--iris-500);
}
.film-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding: 10px 8px; border-radius: 12px;
  background: #0D0D11;
}
.film-frame {
  position: relative;
  background: #F3EDDC; border-radius: 7px;
  aspect-ratio: 3 / 4.4;
  display: flex; flex-direction: column; justify-content: flex-end;
  overflow: hidden;
}
.film-frame::before, .film-frame::after { /* sprocket holes */
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 8px; height: 4px; border-radius: 2px; background: #0D0D11;
}
.film-frame::before { top: 4px; }
.film-frame::after { bottom: 4px; }
.film-beetle {
  position: absolute; left: 6%; bottom: 30%; width: 62%;
  height: auto; display: block;
}
.film-sniff .film-beetle { animation: sniff-nod 2.2s ease-in-out infinite; }
@keyframes sniff-nod {
  0%, 100% { transform: translateX(16px) rotate(0deg); }
  50% { transform: translateX(16px) rotate(-6deg); }
}
.film-tag {
  position: absolute; top: 16%; left: 50%; transform: translateX(-50%) rotate(-6deg);
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  color: var(--amber-500); letter-spacing: 0.06em;
}
.film-t, .film-d {
  position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: 8.5px; line-height: 1.5;
  color: var(--ink-500); text-align: center;
}
.film-d { color: var(--ink-900); font-weight: 700; padding-bottom: 7px; }
.film-cap { margin-top: 10px; }

/* ---------- the phenomenon ---------- */
.mo-race { background: var(--sand-100); }
.race-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: clamp(36px, 5vw, 54px);
}
.race-card { text-align: center; padding: 28px 18px 24px; }
.race-num {
  display: block; font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem); letter-spacing: -0.03em;
  color: var(--ink-900); line-height: 1;
}
.race-num small { font-size: 0.4em; font-weight: 500; color: var(--ink-300); }
.race-odd .race-num { color: #C26A2B; }
.race-label {
  display: block; margin-top: 12px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-300);
}
.race-verdict { max-width: 780px; }
.race-q {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2.1rem); letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.race-a { font-size: 16.5px; line-height: 1.7; color: var(--ink-700); max-width: 68ch; }
.race-a strong { color: var(--ink-900); }

/* ---------- odometer vs ruler ---------- */
.mo-position { background: var(--sand-50); }
.odo-wrap { max-width: 900px; margin-inline: auto; }
.odo-readouts {
  display: flex; align-items: baseline; gap: clamp(20px, 4vw, 48px);
  margin-bottom: 18px; flex-wrap: wrap;
}
.odo-read { display: flex; flex-direction: column; gap: 4px; }
.odo-num {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 2.1rem; line-height: 1; color: var(--ink-900); letter-spacing: -0.02em;
}
.odo-disp { color: var(--iris-500); }
.odo-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-300);
}
.odo-readouts .lab-reset { margin-left: auto; }
.odo-track {
  position: relative; height: 190px; border-radius: 16px;
  background: linear-gradient(180deg, #F7EFDC 0%, #F0E5C9 100%);
  border: 1px solid rgb(13 13 17 / 0.1);
  overflow: hidden;
}
.odo-lane {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44%;
  background: linear-gradient(180deg, #E8DFC7, #DCCFAE);
  border-top: 1px solid rgb(13 13 17 / 0.07);
}
.odo-zero {
  position: absolute; left: 5.4%; bottom: 12%; width: 2px; height: 52%;
  background: var(--amber-500); opacity: 0.6;
}
.odo-beetle {
  position: absolute; left: 4%; bottom: 16%; width: 11%; min-width: 56px;
  z-index: 2; transform: scaleX(-1); /* face right along the ruler */
  transition: left 0.55s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.odo-beetle svg { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
.odo-beetle .beetle-shadow {
  position: absolute; bottom: -3%; left: 6%; right: 6%; height: 9%;
  background: radial-gradient(ellipse at center, rgb(13 13 17 / 0.3), transparent 68%);
  border-radius: 50%;
}
.odo-beetle.bump { animation: bump 0.4s; }
@keyframes bump {
  25% { transform: scaleX(-1) translateX(-6px) rotate(-3deg); }
  60% { transform: scaleX(-1) translateX(4px); }
}
.odo-marks {
  position: absolute; left: 5%; right: 6%; bottom: 4%;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-300);
}
.odo-controls {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
  justify-content: center;
}
.odo-note {
  margin-top: 14px; min-height: 1.6em; text-align: center;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6;
  color: var(--ink-500);
}
.odo-note.ok { color: #2F9E5F; }

/* ---------- speed board ---------- */
.mo-speed { background: var(--sand-100); }
.speed-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px;
  align-items: start; max-width: 1000px;
}
.speed-panel { display: flex; flex-direction: column; gap: 8px; }
.speed-label {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--iris-500); margin-top: 12px;
}
.speed-select {
  appearance: none; -webkit-appearance: none;
  background: var(--sand-50);
  border: 1.5px solid rgb(13 13 17 / 0.16);
  color: var(--ink-900);
  font-family: var(--font-body); font-size: 15.5px; font-weight: 500;
  padding: 14px 44px 14px 16px; border-radius: 14px;
  cursor: pointer; width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A5A64' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.3s;
}
.speed-select:hover, .speed-select:focus { border-color: var(--iris-500); outline: none; }
.speed-out {
  margin-top: 24px; padding: 22px;
  border: 1px dashed rgb(91 84 214 / 0.4); border-radius: 16px;
  text-align: center;
}
.speed-time {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -0.02em;
  color: var(--ink-900); line-height: 1.05;
}
.speed-quip {
  display: block; margin-top: 10px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
  color: var(--ink-500);
}
.speed-def h3 { margin-bottom: 12px; }
.landing { font-size: 14.5px; line-height: 1.6; color: var(--ink-700); padding: 8px 0; }
.landing + .landing { border-top: 1px dashed rgb(13 13 17 / 0.1); }
.landing strong { color: var(--ink-900); }

/* ---------- the race graph ---------- */
.mo-graphs { background: var(--sand-50); }
.graph-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px;
  align-items: start; margin-bottom: 46px;
}
.graph-card { padding: 20px; }
.race-graph { display: block; width: 100%; height: auto; touch-action: none; }
.graph-read { margin-top: 10px; min-height: 1.6em; text-align: center; }
.graph-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.slope-vocab { display: flex; flex-direction: column; gap: 4px; }
.sv-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; line-height: 1.5; color: var(--ink-700);
  padding: 8px 0;
}
.sv-row + .sv-row { border-top: 1px dashed rgb(13 13 17 / 0.1); }
.sv-chip {
  flex: none; width: 74px; text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 0; border-radius: 999px;
}
.sv-steep { color: var(--iris-500); border: 1px solid rgb(91 84 214 / 0.4); }
.sv-flat { color: #C26A2B; border: 1px solid rgb(194 106 43 / 0.4); }
.sv-down { color: var(--ink-900); border: 1px solid rgb(13 13 17 / 0.3); }
.slope-math h3 { margin-bottom: 10px; }
.slope-math p { font-size: 14.5px; line-height: 1.65; color: var(--ink-700); }
.slope-math strong { color: var(--ink-900); }

/* bins: 4 across with sparklines */
.sorter-bins.bins-4 { grid-template-columns: repeat(4, 1fr); }
.bin-spark { display: block; width: 84px; height: auto; margin-bottom: 10px; }

.standards-note {
  margin-top: 44px;
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7;
  color: var(--ink-300); max-width: 70ch;
}
.standards-note strong { color: var(--ink-500); }

/* ---------- velocity ---------- */
.mo-velocity { background: var(--sand-100); }
.vel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.vel-card { text-align: center; padding: 30px 24px 26px; }
.vel-num {
  display: block; font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.03em;
  color: var(--ink-900); line-height: 1; margin-bottom: 16px;
}
.vel-num small { font-size: 0.38em; font-weight: 500; color: var(--ink-300); }
.vel-card p { font-size: 14.5px; line-height: 1.6; color: var(--ink-700); }

/* ---------- sorters (shared manipulative) ---------- */
.sorter-status {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55;
  color: var(--ink-500); min-height: 1.55em; margin-bottom: 14px;
  transition: color 0.3s;
}
.sorter-status.ok { color: #2F9E5F; }
.sorter-status.hint { color: #C26A2B; }
.sorter-bank {
  display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
  min-height: 96px; padding: 14px;
  border: 1.5px dashed rgb(13 13 17 / 0.2); border-radius: 18px;
  background: rgb(255 253 246 / 0.55);
}
.sort-card {
  font: inherit; font-size: 14px; line-height: 1.4; text-align: left;
  padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid rgb(13 13 17 / 0.14);
  background: #FFFDF6; color: var(--ink-900);
  cursor: pointer;
  box-shadow: 0 2px 8px -4px rgb(13 13 17 / 0.18);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s, border-color 0.22s;
}
.sort-card:hover { transform: translateY(-2px); border-color: var(--iris-500); }
.sort-card:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 2px; }
.sort-card.selected {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgb(232 112 58 / 0.25), 0 10px 22px -8px rgb(13 13 17 / 0.3);
  transform: translateY(-3px) rotate(-1deg);
}
.sorter-bins { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sorter-bins.bins-3 { grid-template-columns: repeat(3, 1fr); }
.sort-bin {
  border: 1.5px dashed rgb(13 13 17 / 0.22); border-radius: 18px;
  padding: 16px; min-height: 128px; cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
}
.sort-bin:hover, .sort-bin:focus-visible { border-color: var(--iris-500); outline: none; }
.sorter.armed .sort-bin { border-style: solid; }
.sorter.armed .sort-bin:hover, .sorter.armed .sort-bin:focus-visible {
  border-color: var(--amber-500); background: rgb(232 112 58 / 0.05);
}
.bin-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
.bin-sub { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--ink-300); margin-top: 3px; }
.bin-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.bin-cards .sort-card {
  cursor: default; font-size: 13px;
  background: rgb(123 227 154 / 0.12);
  border-color: rgb(47 158 95 / 0.45);
  box-shadow: none;
}
.bin-cards .sort-card::before { content: "✓ "; color: #2F9E5F; font-weight: 700; }
.bin-cards .sort-card:hover { transform: none; }
.sort-card.just-placed { animation: pop-in 0.38s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.85) translateY(8px); }
}
.sort-bin.done { border-color: rgb(47 158 95 / 0.55); background: rgb(123 227 154 / 0.07); border-style: solid; }
.sort-bin.shake { animation: shake 0.42s; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
.sorter-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 15px;
}
.sorter-progress { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); }
.sorter-reset {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink-500); background: none; border: 0; cursor: pointer;
  border-bottom: 1px dashed var(--ink-300); padding: 2px 0;
}
.sorter-reset:hover { color: var(--amber-500); border-color: var(--amber-500); }
.sorter-wide { max-width: 940px; margin-inline: auto; }
.sorter-kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--amber-500); margin-bottom: 10px;
  text-align: center;
}
.sorter-wide .sorter-status { text-align: center; }

/* shared resets used by several interactives */
.lab-reset {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--ink-500); background: none; border: 0; cursor: pointer;
  border-bottom: 1px dashed var(--ink-300); padding: 2px 0;
}
.lab-reset:hover { color: var(--amber-500); border-color: var(--amber-500); }

/* antenna wiggle — applies to every <use> of the beetle symbol */
.beetle-antenna { transform-origin: 11px 54px; animation: ant-wig 2.6s ease-in-out infinite; }
@keyframes ant-wig {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-7deg); }
}

/* ---------- myth flip cards ---------- */
.mo-myths { background: var(--sand-50); }
.myth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.myth-flip {
  position: relative; min-height: 210px; padding: 0; border: 0;
  background: none; cursor: pointer; font: inherit; text-align: left;
  perspective: 1100px; border-radius: var(--radius);
}
.myth-flip:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 3px; }
.myth-face {
  position: absolute; inset: 0; border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.65s cubic-bezier(0.3, 1.3, 0.4, 1);
  font-family: var(--font-display); font-weight: 600; font-size: 1.14rem;
  line-height: 1.3; letter-spacing: -0.01em;
}
.myth-front {
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  box-shadow: var(--shadow-card); color: var(--ink-900);
}
.myth-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-500);
  border: 1px solid rgb(232 112 58 / 0.4); border-radius: 999px;
  padding: 4px 10px; align-self: flex-start;
}
.myth-back {
  background: var(--ink-900); color: var(--sand-50);
  font-family: var(--font-body); font-weight: 400; font-size: 0.98rem;
  line-height: 1.55; letter-spacing: 0;
  transform: rotateY(180deg);
}
.myth-back strong { color: var(--amber-300); font-family: var(--font-display); font-size: 1.15rem; display: block; margin-bottom: 4px; }
.myth-flip.flipped .myth-front { transform: rotateY(-180deg); }
.myth-flip.flipped .myth-back { transform: rotateY(0deg); }

/* ============================================================
   FLASHCARDS (spaced repetition)
   ============================================================ */
.mo-cards { background: var(--sand-100); }
.deck-wrap {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 22px; align-items: start; max-width: 980px; margin-inline: auto;
}
.deck-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.deck-stat { text-align: center; }
.deck-stat-num {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: 1.9rem; line-height: 1.05; color: var(--ink-900);
}
.deck-stat-label {
  display: block; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-300);
  margin-top: 5px;
}
.deck-bar {
  grid-column: 1 / -1; height: 8px; border-radius: 4px;
  background: var(--sand-200); overflow: hidden; margin-top: 6px;
}
.deck-bar-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--iris-500), var(--amber-500));
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.deck-next { grid-column: 1 / -1; margin-top: 4px; line-height: 1.6; }
.deck-stats .sorter-reset { grid-column: 1 / -1; justify-self: start; }
.deck-main { min-width: 0; }
.flashcard {
  position: relative; display: block; width: 100%; height: 270px;
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit;
  perspective: 1300px; border-radius: var(--radius);
}
.flashcard:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 3px; }
.fc-face {
  position: absolute; inset: 0; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform 0.62s cubic-bezier(0.3, 1.25, 0.4, 1);
}
.fc-front {
  background: #FFFDF6; border: 1px solid rgb(13 13 17 / 0.08);
  box-shadow: var(--shadow-card);
}
.fc-back {
  background: var(--ink-900); color: var(--sand-50);
  transform: rotateY(180deg);
}
.flashcard.flipped .fc-front { transform: rotateY(-180deg); }
.flashcard.flipped .fc-back { transform: rotateY(0deg); }
.fc-kicker {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--iris-500);
}
.fc-back .fc-kicker { color: var(--amber-300); }
.fc-term {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.02em;
  color: var(--ink-900); text-align: center;
}
.fc-def {
  font-size: clamp(0.98rem, 2vw, 1.2rem); line-height: 1.55;
  color: rgb(250 246 235 / 0.88); text-align: center; max-width: 46ch;
}
.fc-hint {
  position: absolute; bottom: 18px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--ink-300);
}
.deck-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.grade-btn {
  font: inherit; font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid; background: none;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.grade-btn small { font-family: var(--font-mono); font-weight: 400; font-size: 10px; opacity: 0.75; }
.grade-btn:hover { transform: translateY(-2px); }
.grade-btn:disabled { opacity: 0.35; pointer-events: none; }
.grade-again { border-color: var(--amber-500); color: var(--amber-500); }
.grade-again:hover { box-shadow: 0 8px 20px -8px rgb(232 112 58 / 0.5); }
.grade-good { border-color: var(--iris-500); background: var(--iris-500); color: #fff; }
.grade-good:hover { box-shadow: 0 8px 20px -8px rgb(91 84 214 / 0.6); }
.grade-easy { border-color: var(--ink-900); color: var(--ink-900); }
.grade-easy:hover { box-shadow: 0 8px 20px -8px rgb(13 13 17 / 0.4); }
.deck-status { margin-top: 14px; text-align: center; }

/* ============================================================
   EXIT TICKET
   ============================================================ */
.mo-quiz { background: var(--sand-50); }
.quiz { max-width: 780px; margin-inline: auto; }
.quiz-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.quiz-dots { display: flex; gap: 7px; }
.quiz-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sand-300); transition: background 0.3s;
}
.quiz-dots i.current { background: var(--amber-500); }
.quiz-dots i.answered { background: var(--iris-500); }
.quiz-q {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem); line-height: 1.25;
  letter-spacing: -0.01em; margin-bottom: 20px;
}
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt {
  font: inherit; font-size: 15px; text-align: left;
  padding: 13px 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid rgb(13 13 17 / 0.14);
  background: var(--sand-50); color: var(--ink-900);
  transition: border-color 0.25s, background 0.25s, transform 0.2s, opacity 0.25s;
}
.quiz-opt:hover { border-color: var(--iris-500); transform: translateY(-1px); }
.quiz-opt:focus-visible { outline: 2px solid var(--iris-500); outline-offset: 2px; }
.quiz-opt.correct { border-color: #2F9E5F; background: rgb(123 227 154 / 0.14); }
.quiz-opt.wrong { border-color: #D64545; background: rgb(214 69 69 / 0.08); animation: shake 0.42s; }
.quiz-opt.dim { opacity: 0.45; pointer-events: none; }
.quiz-opt.locked { pointer-events: none; }
.quiz-feedback {
  min-height: 1.7em; margin-top: 14px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  color: var(--ink-500);
}
.quiz-feedback.ok { color: #2F9E5F; }
.quiz-feedback.no { color: #C26A2B; }
.quiz-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.quiz-result { text-align: center; padding-top: 10px; }
.quiz-stamp { width: 150px; margin: 0 auto 20px; color: var(--iris-500); animation: stamp-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1); }
.quiz-stamp svg { width: 100%; height: auto; display: block; }
@keyframes stamp-in {
  from { transform: rotate(-9deg) scale(2.3); opacity: 0; }
}
.quiz-score {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: -0.02em;
}
.quiz-note { color: var(--ink-500); font-size: 15px; margin-top: 8px; }
.quiz-result .sorter-reset { margin-top: 18px; }

/* ---------- closer ---------- */
.mo-closer { padding: clamp(80px, 10vw, 130px) 0; text-align: center; background: var(--sand-100); }
.mo-closer .btn { margin: 6px; }
.mo-closer-big {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 34px;
}

/* ---------- chapter dots ---------- */
.chapters {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
  z-index: 900; display: flex; flex-direction: column; gap: 13px;
}
.chapters a {
  position: relative; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid var(--ink-500);
  box-shadow: 0 0 0 3px rgb(250 246 235 / 0.5);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.chapters a:hover { transform: scale(1.35); }
.chapters a.active { background: var(--amber-500); border-color: var(--amber-500); }
.chapters a span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; white-space: nowrap;
  background: var(--ink-900); color: var(--sand-50);
  padding: 4px 9px; border-radius: 7px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.chapters a:hover span, .chapters a:focus-visible span { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .chapters { display: none; }
}
@media (max-width: 1020px) {
  .mo-hero-grid { grid-template-columns: 1fr; }
  .hero-film { margin: 10px auto 0; max-width: 420px; }
  .race-grid { grid-template-columns: repeat(2, 1fr); }
  .speed-grid { grid-template-columns: 1fr; }
  .graph-grid { grid-template-columns: 1fr; }
  .vel-grid { grid-template-columns: 1fr; }
  .sorter-bins.bins-4 { grid-template-columns: repeat(2, 1fr); }
  .myth-grid { grid-template-columns: 1fr; }
  .myth-flip { min-height: 170px; }
  .deck-wrap { grid-template-columns: 1fr; }
  .deck-stats { max-width: 460px; }
}
@media (max-width: 640px) {
  .race-grid { grid-template-columns: 1fr; }
  .film-strip { gap: 5px; }
  .sorter-bins, .sorter-bins.bins-3, .sorter-bins.bins-4 { grid-template-columns: 1fr; }
  .sort-bin { min-height: 0; }
  .flashcard { height: 300px; }
  .odo-readouts { gap: 18px; }
  .odo-readouts .lab-reset { margin-left: 0; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .beetle-antenna, .film-sniff .film-beetle { animation: none !important; }
  .odo-beetle { transition: none; }
}
