/* =====================================================================
   theme-math.css — Mathematics, "Blueprint" (design-spec §6.3 M1–M8,
   §8.0 Math column, §14 content direction). Loaded after styles.css on
   mathematics.html only. Theme-scoped additions — shared tokens and
   shared component geometry are never redefined here (§4 guard-rails).

   01 M1 constructed wordmark          07 Test prep (§14.3)
   02 M2 hero stage graph              08 M6 compass construction band
   03 M4 lab flourishes                09 M7 worked-solution story
   04 Personal plan (§14.3)            10 M8 closing CTA
   05 Professionals (§14.3)            11 Print
   06 M5 number-line roadmap           12 RULE-10 BLOCK (hidden starts)

   Rest state everywhere = final frame. Every hidden / offset / un-drawn
   starting state lives ONLY in the rule-10 media block at the end.
   ===================================================================== */

/* ---------------------------------------------------------------- 00 */
/* (motif shorthand now lives in styles.css) */

/* ---------------------------------------------------------------- 01 */
/* M1 — "Mathematics" constructed: compass arcs + baseline, outline, ink. */
.wm-math .wm-text::before {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; inset: 0; color: transparent; pointer-events: none;
  -webkit-text-stroke: 1.5px var(--accent); opacity: 0;   /* the outline is construction only; at rest the word is plain ink */
}
.wm-math .wm-construct { opacity: .35; }
.wm-math .wm-construct path { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.wm-math .wm-construct .wm-base { stroke-width: 2; }
.wm-math .pin-dot { fill: var(--accent-ink); transform-box: fill-box; transform-origin: center; }

/* ---------------------------------------------------------------- 02 */
/* M2 — self-plotting graph, tangent rider, Plot · Slope · Roots. */
.graph-plot {
  position: relative; justify-self: center; width: min(100%, 30rem); aspect-ratio: 1;
  border-radius: var(--r-lg); background: var(--card-bg); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
}
.graph-plot > svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.graph-fig .float-syms { inset: 0; }
.graph-fig .float-syms span:nth-child(n) { inset: auto; }
.graph-fig .float-syms span:nth-child(1) { top: 16%; right: 9%; }
.graph-fig .float-syms span:nth-child(2) { top: 34%; left: 6%; }
.graph-fig .float-syms span:nth-child(3) { bottom: 16%; left: 7%; }
.graph-fig .float-syms span:nth-child(4) { top: 5%; right: 32%; }
.graph-fig .float-syms span:nth-child(5) { bottom: 30%; right: 6%; }
.graph-fig .g-grid path { fill: none; stroke: rgba(180,166,255,.14); stroke-width: 1; }
.graph-fig .g-axis { stroke: var(--text-3); stroke-width: 1.5; }
.graph-fig .g-curve { stroke: var(--mark); stroke-width: 3.5; stroke-linecap: round; }
.graph-fig .g-vertex { fill: var(--mark); }
.graph-fig .tangent path { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; }
.graph-fig .tangent circle { fill: var(--gold); }
.graph-fig .roots .draw { stroke: var(--gold); stroke-width: 2; }
.graph-fig .root-dot { fill: var(--gold); transform-box: fill-box; transform-origin: center; }
.graph-fig .g-label { fill: var(--text-3); font: 600 15px var(--font-mono); }
.graph-fig .slope-label { fill: var(--gold); font-variant-numeric: tabular-nums; }
.graph-fig .slope-val { font-weight: 700; }
.graph-views { position: relative; z-index: 1; }
.graph-fig :is(.tangent, .slope-label, .roots) { transition: opacity var(--dur-ui) var(--ease-out); }

/* caption: one note per view (stacked in one cell with JS, listed without) */
.graph-cap { display: grid; gap: var(--s-3); justify-self: center; width: min(100%, 30rem); }
.view-note { margin: 0; font: 400 var(--fs-read)/1.55 var(--font-serif); color: var(--text-2); }
.roots-work { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font: 400 var(--fs-read)/1.5 var(--font-serif); color: var(--text); font-variant-numeric: tabular-nums; }
.roots-work .rw { margin: 0; }
.roots-work .rw:last-child { color: var(--accent-text); }
html.js:not(.no-m) .graph-cap > :not(.visually-hidden) { grid-area: 1 / 1; align-self: start; }
html.js:not(.no-m) .graph-fig:not([data-view="slope"]) :is(.tangent, .slope-label) { opacity: 0; }
html.js:not(.no-m) .graph-fig:not([data-view="roots"]) .roots { opacity: 0; }
html.js:not(.no-m) .graph-fig:not([data-view="plot"]) .vn-plot,
html.js:not(.no-m) .graph-fig:not([data-view="slope"]) .vn-slope,
html.js:not(.no-m) .graph-fig:not([data-view="roots"]) .roots-work { visibility: hidden; }

/* ---------------------------------------------------------------- 03 */
/* M4 — pencil-first steps get compass-ring numbers. */
[data-theme="math"] .pf-steps li::before { box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="math"] .pf-steps li::after {
  content: ""; position: absolute; left: 14px; top: 10px; width: 26px; height: 26px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--mark) var(--arc), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
}

/* ---------------------------------------------------------------- 04 */
/* #personal — four promises + "Example plans" tabs on plan cards. */
.personal-grid { display: grid; gap: var(--s-7); align-items: start; }
@media (min-width: 960px) { .personal-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-8); } }
.personal-points { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-6); }
.personal-points > li { position: relative; margin: 0; padding-left: 60px; }
.personal-points h3 { margin: 0 0 .3em; font-size: 1.1875rem; }
.personal-points p { margin: 0; color: var(--text-2); }
.pp-icon {
  position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r-md); background: var(--tint); color: var(--accent-text);
}
.pp-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.plans { display: grid; gap: var(--s-4); min-width: 0; }
.plans-head { margin: 0; color: var(--text-3); }
.plan-tabs { justify-self: start; }
.plan-card { display: grid; gap: var(--s-4); }
.plan-top { display: grid; gap: var(--s-4); align-items: start; }
@media (min-width: 560px) { .plan-top { grid-template-columns: minmax(0, 1fr) minmax(0, 200px); } }
.plan-top h3 { margin: 0; }
.plan-plot {
  display: block; width: 100%; max-width: 240px; height: auto; overflow: visible; border-radius: var(--r-sm);
  background: var(--motif), var(--tint-2); box-shadow: inset 0 0 0 1px var(--line);
}
.plan-plot .pc-axis { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.plan-plot .draw { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.plan-plot .pc-dot { fill: var(--accent-ink); transform-box: fill-box; transform-origin: center; }
.plan-plot .pc-goal { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
.plan-plot .pc-label { fill: var(--accent-ink); font: 600 10px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; }
.plan-facts { margin: 0; }
.plan-facts > div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: var(--s-3); padding: 10px 0; box-shadow: inset 0 1px 0 var(--line); }
.plan-facts dt { padding-top: .3em; font: 600 var(--fs-meta)/1.3 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.plan-facts dd { margin: 0; color: var(--text); }
.plan-sub { margin: var(--s-2) 0 0; color: var(--accent-text); }
.plan-sessions { list-style: none; margin: 0; padding: 0; counter-reset: ps; display: grid; gap: 10px; }
.plan-sessions li { counter-increment: ps; position: relative; margin: 0; padding-left: 40px; color: var(--text-2); }
.plan-sessions li::before {
  content: counter(ps); content: counter(ps) / ""; position: absolute; left: 0; top: -2px; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--mark);
  font: 600 13px/1 var(--num-font); color: var(--accent-text); font-variant-numeric: tabular-nums;
}
.plans-note { margin: 0; font-size: var(--fs-small); color: var(--text-3); }
@media (max-width: 419px) { .plan-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ---------------------------------------------------------------- 05 */
/* #professionals — real-world tiles, pull line, credibility row. */
.pro-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
/* 4 tiles: 1 → 2 columns (a 2×2 like CS #professionals; never a 3 + 1 orphan row) */
@media (min-width: 640px) { .pro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pro-card { gap: var(--s-3); margin: 0; }
.pro-card h3 { margin: 0; }
.pro-card p { margin: 0; color: var(--text-2); }
.pro-card .pro-topic { color: var(--accent-text); }
.pro-art { display: block; width: 120px; height: 80px; margin-bottom: var(--s-2); }
.pro-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pro-art path { fill: none; stroke-width: 1; }
.pro-art .pa-base { stroke: var(--line-strong); }
.pro-art .draw { stroke: var(--mark); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.pro-art .pa-line { stroke: var(--accent-ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.pro-art .pa-bar { stroke: var(--accent-bright); stroke-width: 18; stroke-linecap: butt; }   /* the 50% baseline bar must read against the card, not vanish into it */
.pro-art .pa-hot { stroke: var(--accent); }
.pro-art .pa-tick { stroke: var(--success); }
.pro-art .pa-dot { fill: var(--mark); }
.pro-art .pa-node { fill: var(--card-bg); stroke: var(--mark); stroke-width: 2; }
.pro-art .pa-txt { fill: var(--text-2); font: 600 12px var(--font-sans); }
.pro-foot { display: grid; gap: var(--s-6); justify-items: start; margin-top: var(--s-8); }
.pro-pull { max-width: 22ch; margin: 0; font: 600 var(--fs-h2)/1.1 var(--font-sans); letter-spacing: -.012em; color: var(--text); text-wrap: balance; }
.pro-pull::before { content: "∴ "; content: "∴ " / ""; color: var(--accent-text); }
.pro-by {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; max-width: none; margin: 0;
  padding: 12px 22px 12px 12px; border-radius: var(--r-xl); background: var(--card-bg); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  font-size: 15px; color: var(--text-2);
}
.pro-by strong { color: var(--text); }
.pro-by > span:not(.monogram) { flex: 1 1 16rem; }
.pro-by .link-arrow { font-size: 15px; }

/* ---------------------------------------------------------------- 06 */
/* M5 — number-line roadmap: ticked axis, plotted points, compass arcs. */
.roadmap--line::before {
  left: 17px; width: 14px; border-radius: 0;
  background:
    linear-gradient(var(--mark), var(--mark)) center / 2px 100% no-repeat,
    repeating-linear-gradient(to bottom, rgba(91,63,208,.38) 0 1.5px, transparent 1.5px 32px) center / 12px 100% no-repeat;
}
.roadmap--line .stage-num { isolation: isolate; color: var(--accent-text); }
.roadmap--line .stage-num::before {
  content: ""; position: absolute; inset: 5px; z-index: -1; border-radius: 50%; background: var(--tint);
  opacity: clamp(0, (var(--p) * var(--n) - var(--i)) * 3, 1);
}
.stage-arc { position: absolute; left: -6px; top: -6px; width: calc(100% + 12px); max-width: none; height: calc(100% + 12px); overflow: visible; pointer-events: none; }
.stage-arc .draw { stroke: var(--mark); stroke-width: 2; stroke-linecap: round; }
.roadmap-extras { margin-top: var(--s-8); }
.roadmap-extras > .section-kicker { margin-bottom: var(--s-5); }
.roadmap-extras .card > p { color: var(--text-2); }

/* ---------------------------------------------------------------- 07 */
/* #test-prep — the 3-step method on a number line + exam tiles. */
.prep-steps { position: relative; list-style: none; margin: 0 0 var(--s-8); padding: 0; display: grid; gap: var(--s-6); }
.prep-steps > li { position: relative; margin: 0; }
.prep-steps h3 { margin: 0 0 .35em; font-size: 1.1875rem; }
.prep-steps p { margin: 0; color: var(--text-2); }
.prep-num {
  position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--s-4);
  border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
  font: 600 17px/1 var(--num-font); color: var(--accent-text); font-variant-numeric: tabular-nums;
}
.prep-num::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--mark) var(--arc), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}
@media (min-width: 800px) {
  .prep-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prep-steps::before {
    content: ""; position: absolute; top: 21px; left: 22px; right: calc((100% - 2 * var(--s-6)) / 3 - 22px); height: 2px;
    background: repeating-linear-gradient(90deg, var(--mark) 0 10px, transparent 10px 16px); transform-origin: left;
  }
}
.exam-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
/* 7 exams: 1 → 2 → 4 columns; the last (college) tile spans two columns,
   so rows read 2+2+2+2 and 4+4 — never a lone tile on the last row */
@media (min-width: 640px) {
  .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-grid > .exam-card:last-child:nth-child(odd) { grid-column: span 2; }
}
@media (min-width: 1100px) { .exam-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.exam-card {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: var(--s-5); border-radius: var(--r-tile);
  background: var(--card-bg); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.exam-card h3 { margin: 0; font-size: 1.1875rem; }
.exam-card p { margin: 0; font-size: 15px; color: var(--text-2); }
.exam-card .exam-level { color: var(--accent-text); }
.bubbles { display: flex; gap: 6px; margin-bottom: var(--s-2); }
.bubbles i { display: block; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--hair-ui); }
.bubbles .is-filled { background: var(--accent-ink); box-shadow: none; }

/* ---------------------------------------------------------------- 08 */
/* M6 — compass construction on the band + the hand-to-hand statement. */
.band-split { display: grid; gap: var(--s-7); align-items: center; margin-bottom: var(--s-8); }
@media (min-width: 960px) { .band-split { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); } }
.construct {
  display: grid; gap: var(--s-3); min-width: 0; margin: 0; padding: clamp(16px, 2vw, 28px);
  border-radius: var(--r-tile); background: var(--card-bg); box-shadow: inset 0 0 0 1px var(--line);
}
.construct svg { display: block; width: 100%; height: auto; overflow: visible; }
.construct .draw { stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.construct .line-ab { stroke: var(--text); }
.construct .c-arc { stroke-width: 1.75; }
.construct .bisector { stroke: var(--gold); stroke-width: 2.5; }
.construct .c-pt { fill: var(--text); }
.construct .c-label { fill: var(--text-3); font: italic 400 22px var(--font-serif); }
.construct .ix {
  fill: var(--gold); transform-box: fill-box; transform-origin: center;
  scale: clamp(0, (var(--p) - var(--from)) / (var(--to) - var(--from)), 1);
}
/* the compass: pivots on A while the first arc draws, is lifted to B for the
   second, and is put away before the bisector — p = 1 (rest) hides it. */
.construct .compass {
  --ph1: clamp(0, (var(--p) - .15) / .3, 1);
  --ph2: clamp(0, (var(--p) - .45) / .3, 1);
  --atb: clamp(0, (var(--p) - .45) * 1000, 1);
  transform-box: view-box; transform-origin: 0 0;
  transform: translate(calc(120px + 240px * var(--atb)), 200px)
             rotate(calc((1 - var(--atb)) * (-45deg + 90deg * var(--ph1)) + var(--atb) * (225deg - 90deg * var(--ph2))))
             scale(1, calc(1 - 2 * var(--atb)));
  opacity: calc(clamp(0, (var(--p) - .1) * 20, 1) * clamp(0, (.8 - var(--p)) * 20, 1));
}
.construct .c-leg, .construct .c-head { fill: none; stroke: var(--text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.construct .c-head { stroke-width: 5; }
.construct .c-hinge { fill: var(--text); }
.construct .c-tip { fill: var(--gold); }
.construct figcaption { font-size: var(--fs-small); color: var(--text-3); }
.handwork { display: grid; gap: var(--s-4); min-width: 0; }
.handwork-kicker { margin: 0; color: var(--accent-text); }
.handwork-text { margin: 0; max-width: 30ch; font: 600 var(--fs-h3)/1.3 var(--font-sans); letter-spacing: -.008em; color: var(--text); }
.handwork-text strong { color: var(--accent-text); }
.handwork-note { margin: 0; font: 400 var(--fs-read)/1.6 var(--font-serif); color: var(--text-3); }

/* ---------------------------------------------------------------- 09 */
/* M7 — the worked solution, equals signs aligned (subgrid). */
.work {
  list-style: none; margin: 0; padding: 0; display: grid; column-gap: .35em; row-gap: .15em;
  /* fr gutters: rows that span the full width (area model, AI note) cross a
     flexible track, so they never widen the three equation columns */
  grid-template-columns: minmax(0, 1fr) max-content max-content max-content minmax(0, 1fr);
  font: 400 clamp(1.125rem, .98rem + .62vw, 1.625rem)/1.5 var(--font-serif); color: var(--text);
  font-variant-numeric: tabular-nums lining-nums;
}
.work > li { grid-column: 1 / -1; margin: 0; }
.work > .wl { grid-column: 2 / 5; display: grid; grid-template-columns: subgrid; align-items: baseline; }
.work .lhs { text-align: right; }
.work .eq { text-align: center; color: var(--text-2); }
.work .rhs { text-align: left; }
@supports not (grid-template-columns: subgrid) { .work > li, .work > .wl, .work > .qed { grid-column: 1 / -1; display: block; justify-self: stretch; text-align: center; } }
.work .wl-wrong { color: var(--text-2); }
.work .wl-wrong .strike { left: -.15em; right: -.15em; top: 54%; }
.work .ring .draw { stroke: var(--pen); stroke-width: 2.2; stroke-linecap: round; }
.work .wl-answer .rhs { text-decoration: underline double var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
.work .wl-check { color: var(--text); }
.work .wl-note { margin-top: .35em; text-align: center; line-height: 1; }
.work .wl-note .t-meta { color: var(--accent-text); }
.work .tick { display: inline-block; width: .8em; height: .8em; margin-left: .3em; vertical-align: -.04em; overflow: visible; }
.work .tick .draw { stroke: var(--success); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.work .area { justify-self: center; margin: .25em 0 .35em; }
.area-fig { display: inline-grid; grid-template-columns: auto 3.4em 2.4em; grid-template-rows: auto 2.2em; font-size: .72em; line-height: 1; text-align: center; }
.area-lab { padding-bottom: 6px; font-family: var(--font-serif); color: var(--accent-text); }
.area-x { grid-column: 2; }
.area-3 { grid-column: 3; }
.area-side { grid-row: 2; grid-column: 1; align-self: center; padding: 0 8px 0 0; }
.area-cell { grid-row: 2; display: flex; align-items: center; justify-content: center; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--accent-ink); color: var(--text); }
.area-cell:nth-child(4) { grid-column: 2; }
.area-6 { grid-column: 3; margin-left: -1.5px; background: var(--tint); font-weight: 600; }
.work .spark-note {
  justify-self: center; display: grid; gap: 4px; max-width: 26em; margin-top: .5em; padding: 10px 16px; border-radius: var(--r-md);
  background: var(--spark-tint); box-shadow: inset 0 0 0 1px rgba(196,102,134,.35);
  font: italic 400 1rem/1.4 var(--font-serif); color: var(--spark-text);
}
.work .spark-note .t-meta { font-style: normal; color: var(--spark-text); }
.work .spark-note .t-meta::before { content: "✦ "; content: "✦ " / ""; }
.work > .qed { grid-column: 4 / 5; justify-self: end; width: 14px; height: 14px; margin-top: 6px; }

/* ---------------------------------------------------------------- 10 */
/* M8 — ∎ stamps beside the closing CTA. */
.qed { display: inline-block; overflow: hidden; font-size: 0; color: transparent; background: var(--accent-ink); border-radius: 2px; }   /* ∎ drawn as a solid tombstone; the glyph stays in the (aria-hidden) markup */
.page-cta .hero-actions .qed { width: 18px; height: 18px; margin-left: 10px; margin-right: -28px; }   /* negative end margin: the button, not button + ∎, is what gets centred */
@media (max-width: 479px) { .page-cta .hero-actions .qed { display: none; } }   /* full-width button: the ∎ would wrap onto a line of its own */

/* ---------------------------------------------------------------- 11 */
@media print {
  .graph-plot, .construct { background: #FFFFFF !important; box-shadow: 0 0 0 1px #CCCCCC; }
  .graph-fig .g-grid path { stroke: #DDDDDD; }
  .graph-fig :is(.tangent path, .roots .draw), .construct .bisector { stroke: var(--accent-ink); }
  .graph-fig :is(.tangent circle, .root-dot, .slope-label), .construct :is(.ix, .c-tip) { fill: var(--accent-ink); }
  .graph-fig .float-syms { display: none; }
  /* print shows every layer of the hero graph, like no-JS (beats the html.js view rules above) */
  html.js:not(.no-m) .graph-fig[data-view] .graph-cap > :not(.visually-hidden) { grid-area: auto; visibility: visible; }
  html.js:not(.no-m) .graph-fig[data-view] :is(.tangent, .slope-label, .roots) { opacity: 1; }
}

/* ---------------------------------------------------------------- 12 */
/* =====================================================================
   RULE-10 BLOCK (theme-math.css) — hidden starting states only.
   Print, reduced motion and no-JS never see any of this.
   ===================================================================== */
@media screen and (prefers-reduced-motion: no-preference) {

  /* M1 wordmark: baseline → compass arcs → outline wipe → ink fill → settle */
  .motion-ok .wm-math .wm-construct { animation: wm-settle 600ms var(--ease-out) 1.6s both; }
  .motion-ok .wm-math .wm-construct .draw { animation: draw-on 800ms var(--ease-pencil) 400ms both; }
  .motion-ok .wm-math .wm-construct .wm-base { animation-duration: 500ms; animation-delay: 0s; }
  .motion-ok .wm-math .pin-dot { animation: pop-in 320ms var(--ease-pop) 250ms both; }
  .motion-ok .wm-math .wm-text::before { animation: wm-outline 1600ms linear 600ms both; }
  .motion-ok .wm-math .wm-text { animation: wm-fill 600ms var(--ease-out) 1.6s both; }

  /* M2 load: grid fades in → axes draw → curve plots → labels (Plot replays) */
  .motion-ok .graph-fig .g-grid path { animation: fade-in 500ms var(--ease-out) calc(150ms + var(--d) * 12ms) both; }
  .motion-ok .graph-fig .g-axis { animation: draw-on 700ms var(--ease-pencil) 350ms both; }
  .motion-ok .graph-fig .g-curve { animation: draw-on 1400ms var(--ease-out) 750ms both; }
  .motion-ok .graph-fig :is(.g-eq, .g-vertex) { animation: fade-in 500ms var(--ease-out) 1900ms both; }
  .motion-ok .graph-fig .tangent > * { animation: fade-in 400ms var(--ease-out) 2000ms both; }
  .motion-ok .graph-fig .float-syms span { animation: sym-drift 2.4s var(--ease-in-out) 2 alternate both; }
  .motion-ok .graph-fig .float-syms span:nth-child(2n) { animation-delay: .5s; }
  .motion-ok .graph-fig .float-syms span:nth-child(3n) { animation-delay: .9s; }
  /* roots view: dots pop, gold circles draw, the four lines write in */
  .motion-ok .graph-fig[data-view="roots"] .root-dot { animation: pop-in 420ms var(--ease-pop) both; }
  .motion-ok .graph-fig[data-view="roots"] .roots .draw { animation: draw-on 600ms var(--ease-pencil) 150ms both; }
  .motion-ok .graph-fig[data-view="roots"] .rw { animation: write-in 500ms var(--ease-pencil) calc(250ms + var(--i) * 120ms) both; }
  .motion-ok .graph-fig[data-view="plot"] .vn-plot,
  .motion-ok .graph-fig[data-view="slope"] .vn-slope { animation: rise-in 360ms var(--ease-out) both; }

  /* M4: the plot wipes in with its lab; each revealed pencil-first step writes on */
  .motion-ok .lab .plot canvas { transition: clip-path 900ms var(--ease-pencil) 200ms; }
  .motion-ok .lab.reveal:not(.is-visible) .plot canvas { clip-path: inset(0 100% 0 0); }
  .motion-ok .pf-steps li.is-new { animation: write-in 600ms var(--ease-pencil) both; }
  .motion-ok [data-theme="math"] .pf-steps li.is-new::after { animation: arc-spin 700ms var(--ease-pencil) 150ms both; }

  /* #personal: the plan line plots itself when the plans arrive or a tab is chosen */
  .motion-ok .plans:not(.is-in) .plan-plot .draw { stroke-dashoffset: 1.001; }
  .motion-ok .plans:not(.is-in) .plan-plot :is(.pc-dot, .pc-goal) { opacity: 0; }
  .motion-ok .plans.is-in .plan-card:not([hidden]) .plan-plot .draw { animation: draw-on 1100ms var(--ease-pencil) 150ms both; }
  .motion-ok .plans.is-in .plan-card:not([hidden]) .pc-dot { animation: pop-in 360ms var(--ease-pop) calc(350ms + var(--d) * 160ms) both; }
  .motion-ok .plans.is-in .plan-card:not([hidden]) .pc-goal { animation: pop-in 420ms var(--ease-pop) 1150ms both; }
  .motion-ok .plans.is-in .plan-card:not([hidden]) .plan-sessions li { animation: rise-in 360ms var(--ease-out) calc(250ms + var(--li) * 110ms) both; }

  /* #professionals: each tile's figure draws in turn */
  .motion-ok .pro-grid:not(.is-in) .pro-art .draw { stroke-dashoffset: 1.001; }
  .motion-ok .pro-grid .pro-art .draw { transition: stroke-dashoffset 900ms var(--ease-pencil) calc(250ms + var(--li) * 140ms); }
  .motion-ok .pro-grid:not(.is-in) .pro-art :is(.pa-dot, .pa-txt, .pa-node) { opacity: 0; }
  .motion-ok .pro-grid .pro-art :is(.pa-dot, .pa-txt, .pa-node) { transition: opacity 300ms var(--ease-out) calc(900ms + var(--li) * 140ms); }

  /* M5: cards slide off the axis; each point's compass arc sweeps once */
  .motion-ok .roadmap--line > li.reveal:not(.is-visible) { transform: translateX(-16px); }
  .motion-ok .roadmap--line > li:not(.is-visible) .stage-arc .draw { stroke-dashoffset: 1.001; }
  .motion-ok .roadmap--line .stage-arc .draw { transition: stroke-dashoffset 600ms var(--ease-pencil) 300ms; }

  /* #test-prep: the number line draws, each step's ring closes, answer bubbles fill */
  .motion-ok .prep-steps:not(.is-in)::before { transform: scaleX(0); }
  .motion-ok .prep-steps::before { transition: transform 1200ms var(--ease-pencil) 200ms; }
  .motion-ok .prep-steps:not(.is-in) .prep-num::after { --arc: 0deg; }
  .motion-ok .prep-steps.is-in .prep-num::after { animation: arc-spin 800ms var(--ease-pencil) calc(300ms + var(--li) * 350ms) both; }
  .motion-ok .exam-grid:not(.is-in) .bubbles .is-filled { scale: 0; }
  .motion-ok .exam-grid .bubbles .is-filled { transition: scale 360ms var(--ease-pop) calc(400ms + var(--li) * 90ms); }

  /* M7: the "6" from 2 × 3 slides out of the 2x cell into its own (area model) */
  .motion-ok .story:is(.is-pinned, .is-player) .area-6.tp { transform: translateX(calc((1 - var(--on)) * -3.4em)); }

  /* M8: ∎ waits for the CTA header, then stamps */
  .motion-ok .page-cta .section-head:not(.is-visible) ~ .hero-actions .qed { opacity: 0; }
  .motion-ok .page-cta .section-head.is-visible ~ .hero-actions .qed { animation: stamp-in 420ms var(--ease-pop) 600ms both; }
}

@keyframes wm-settle { from { opacity: 1; } }
@keyframes wm-fill   { from { color: transparent; } }
@keyframes wm-outline {
  from { opacity: 1; clip-path: inset(0 100% 0 0); animation-timing-function: var(--ease-pencil); }
  62%  { opacity: 1; clip-path: inset(0 0 0 0); }
  to   { opacity: 0; clip-path: inset(0 0 0 0); }
}
@keyframes sym-drift { to { translate: 0 -10px; } }
