/* =====================================================================
   Edumaze motion layer (motion-animator). Pairs with motion-boot.js + motion.js.
   Rules:
   - Every "before" state is scoped to html.motion-on, which exists only when
     full motion is allowed AND the boot script ran. No JS -> nothing is hidden.
   - Only transform / opacity / clip-path / SVG stroke are animated.
   - Colours come from tokens.css only. Timing + easing come from tokens.css only.
   ===================================================================== */

/* ---------- Page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-group(root) { animation-duration: var(--dur-base); animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation: var(--dur-fast) var(--ease-in) both edz-vt-out; }
::view-transition-new(root) { animation: var(--dur-base) var(--ease-out) both edz-vt-in; }
@keyframes edz-vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes edz-vt-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .site-header { view-transition-name: none; }
}
/* Fallback when View Transitions are not available (or file://): quick leave fade */
html.is-leaving body { opacity: 0; transform: translateY(-8px); transition: opacity var(--dur-fast) var(--ease-in), transform var(--dur-fast) var(--ease-in); }

/* ---------- Shared reveal family (below-the-fold content) ---------- */
html.motion-on :where(.section__lead, .levelup, .levelup-step, .note-box, .tick-list > li,
  .parents__copy > .btn, .parents__copy > .small-print, .quiz, .contact-list > div,
  .map-placeholder, .enquiry) {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger) + var(--d, 0ms));
}
html.motion-on :where(.section__lead, .levelup, .levelup-step, .note-box, .tick-list > li,
  .parents__copy > .btn, .parents__copy > .small-print, .quiz, .contact-list > div,
  .map-placeholder, .enquiry):not(.is-in) {
  opacity: 0;
  transform: translateY(28px);
}
/* Direction variety. Rule: a before-state never pushes content sideways past the
   viewport on phones (it widens the page = horizontal scroll). Phones: rise / scale only.
   Wide screens: lists may slide in from the left (inward, never outward). */
html.motion-on :where(.enquiry, .quiz):not(.is-in) { transform: translateY(36px) scale(0.96); }
@media (min-width: 900px) {
  html.motion-on :where(.levelup-step, .contact-list > div, .tick-list > li):not(.is-in) { transform: translateX(-28px); }
}
/* Safety net for short in-place slides (quiz steps, login panels): clip sideways overflow
   without creating a scroll container (sticky still works). */
html.motion-on main { overflow-x: clip; }
html.motion-on :where(.section__lead) { --d: 160ms; }

/* Eyebrows wipe in like a path being drawn */
html.motion-on .section .eyebrow { transition: clip-path var(--dur-slow) var(--ease-out); }
html.motion-on .section .eyebrow:not(.is-in) { clip-path: inset(0 100% 0 0); }

/* ---------- Headlines: word by word ----------
   Nothing is hidden until motion.js has actually split the words (.is-split is set
   only after a successful split). No JS, an error, or a failed split = plain, fully
   readable heading. */
.mw { display: inline-block; }
html.motion-on .is-split .mw {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-word) + var(--d, 0ms));
}
html.motion-on .is-split:not(.is-in) .mw { opacity: 0; transform: translateY(0.7em) rotate(3deg); }
/* First view (hero / app titles): text stays readable – it only settles */
/* First view (hero / app titles): full opacity from the first frame – words only settle
   (transform). If motion.js arrives late, motion.js skips the settle entirely. */
html.motion-on :where(.hero__title, .app-title, [data-motion="admissions-title"]).is-split:not(.is-in) .mw { opacity: 1; transform: translateY(0.3em); }

/* Hero copy: full opacity at first paint and never hidden. It settles with a pure-CSS
   transform animation that starts on the first frame (html.motion-on is set by the
   inline boot script), so it never waits for motion.js and never dims the LCP text.
   fill-mode backwards: after the settle nothing stays applied (no override of later
   transforms). Transform only = no layout shift. */
html.motion-on :where(.hero__lead, .hero__ctas, .hero__note, .hero .eyebrow, .app-lead, .tabs, .form-card) {
  animation: edz-settle var(--dur-slow) var(--ease-out) backwards;
  animation-delay: var(--d, 0ms);
}
@keyframes edz-settle { from { transform: translateY(12px); } }
html.motion-on .hero .eyebrow { --d: 0ms; }
html.motion-on .hero__lead { --d: 140ms; }
html.motion-on .hero__ctas { --d: 240ms; }
html.motion-on .hero__note { --d: 320ms; }
html.motion-on .app-lead { --d: 120ms; }
html.motion-on .tabs { --d: 180ms; }
html.motion-on .form-card { --d: 220ms; }

/* ---------- Logo: first page of the visit draws the mark (motion-intro set in <head>) ---------- */
html.motion-intro [data-motion="logo-mark"]:not(.is-armed) { opacity: 0; }
.logo-mark__path, .logo-mark__gap { transition: none; }

/* ---------- Admissions banner: alive while on screen ---------- */
.fx-spark {
  position: absolute;
  z-index: 0;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--admit-accent);
  opacity: 0;
  pointer-events: none;
  animation: edz-spark var(--dur-loop) var(--ease-in-out) 2; /* WCAG 2.2.2: twice, then rest (opacity 0) */
  animation-delay: calc(var(--i, 0) * 430ms);
}
.fx-spark:nth-child(3n) { width: 4px; height: 4px; margin: -2px 0 0 -2px; }
@keyframes edz-spark { 0%, 100% { opacity: 0; transform: scale(0.3); } 45% { opacity: 0.75; transform: scale(1); } }
html.motion-on .fx-admit::after {
  opacity: 1;
  transform: translateX(-100%);
  animation: edz-sheen calc(var(--dur-loop) * 2.5) var(--ease-in-out) 1; /* one sweep (~2.4 s of movement) */
  animation-delay: 1.4s;
}
@keyframes edz-sheen { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }
html.motion-on .fx-admit [data-motion="admissions-star"] { animation: edz-breathe var(--dur-loop) var(--ease-in-out) 2 2.2s; } /* twice, ends at rest */
@keyframes edz-breathe { 50% { transform: scale(1.14) rotate(12deg); } }
.fx-admit:not(.is-live)::after,
.fx-admit:not(.is-live) .fx-spark,
.fx-admit:not(.is-live) [data-motion="admissions-star"] { animation-play-state: paused; }
.fx-admit [data-motion="admissions-session"] { transform-origin: center; }
.fx-pulse {
  position: absolute;
  inset: -2px;
  border: 2px solid var(--admit-accent);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Home hero: the path to the star ---------- */
/* Before motion.js arms the scene (a few ms after first paint), the drawn layers wait
   unseen so they do not flash in full and then "re-draw". Failsafe in motion-boot.js. */
html.motion-on [data-motion="hero-visual"]:not(.is-armed) [data-motion="hero-path"],
html.motion-on [data-motion="hero-visual"]:not(.is-armed) [data-motion="hero-dot"],
html.motion-on [data-motion="hero-visual"]:not(.is-armed) [data-motion="hero-maze-bg"],
html.motion-on [data-motion="hero-visual"]:not(.is-armed) [data-motion="hero-swoosh"],
html.motion-on [data-motion="hero-visual"]:not(.is-armed) .hero-trail { opacity: 0; }
/* the star waits, small and faint, until the dot reaches it */
html.motion-on [data-motion="hero-visual"]:not(.is-done) [data-motion="hero-star"] { opacity: 0.35; transform: scale(0.7); }
.hero-trail { fill: none; stroke: var(--maze-path-glow); stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; }
.hero-glint { fill: none; stroke: var(--surface); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.08 3; stroke-dashoffset: 0.08; opacity: 0.9; }
.hero-dot-halo { fill: var(--maze-dot-halo); }
.hero-halo { fill: var(--maze-dot-halo); opacity: 0; }
.hero-ring { fill: none; stroke: var(--star); stroke-width: 2; opacity: 0; }
.hero-spark { fill: var(--star); opacity: 0; }
.hero-spark--navy { fill: var(--brand-navy); }
.hero-dot-halo, .hero-halo, .hero-ring, .hero-spark { transform-box: fill-box; transform-origin: center; }
.hero-dot, .hero-dot-halo { will-change: transform; }

/* Desktop: the layers drift apart toward the pointer (depth). transform only. */
html.motion-hover [data-motion="hero-visual"] > :is([data-motion="hero-art-back"], [data-motion="hero-art-front"]) {
  transition: transform var(--dur-slow) var(--ease-out);
}
html.motion-hover [data-motion="hero-visual"].is-tracking > * { transition-duration: var(--dur-base); }
html.motion-hover [data-motion="hero-visual"] > [data-motion="hero-art-back"] { transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px), 0); }
html.motion-hover [data-motion="hero-visual"] > [data-motion="hero-art-front"] { transform: translate3d(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 10px), 0); }

/* Scroll parallax depth layers (CSS scroll-driven where supported; no scroll JS).
   Uses the `translate` property, so it never fights the transform-based entrances. */
@supports (animation-timeline: view()) {
  html.motion-on [data-motion="hero-art-back"] { animation: edz-par-back linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  html.motion-on [data-motion="hero-copy"] { animation: edz-par-copy linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  html.motion-on [data-motion="admissions-art"] { animation: edz-par-copy linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  html.motion-on .parents__card { animation: edz-par-card linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  html.motion-on :is(.page-home, .page-course) .site-header::after { animation: edz-progress linear both; animation-timeline: scroll(root); }
}
@keyframes edz-par-back { to { translate: 0 18%; } }
@keyframes edz-par-copy { to { translate: 0 -8%; } }
@keyframes edz-par-card { from { translate: 0 40px; } to { translate: 0 -40px; } }
@keyframes edz-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
html.motion-on :is(.page-home, .page-course) .site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--maze-path);
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}
/* Header tucks away while reading down, returns on scroll up (home only) */
html.motion-on .page-home .site-header { transition: transform var(--dur-base) var(--ease-out); }
html.motion-on .page-home .site-header.is-tucked:not(:focus-within) { transform: translateY(-100%); }

/* ---------- Programs: the three exits open ---------- */
html.motion-on [data-motion="program-card"]:not(.has-doors):not(.is-in) { opacity: 0; }
.has-doors { overflow: hidden; }
.exit-door {
  position: absolute;
  top: 0; bottom: 0;
  width: 50.5%;
  z-index: 2;
  background:
    repeating-linear-gradient(90deg, transparent 0 18px, var(--border) 18px 20px),
    var(--surface-2);
  transition: transform var(--dur-slow) var(--ease-in-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-door) + 120ms);
  pointer-events: none;
}
.exit-door--l { left: 0; border-right: 2px solid var(--maze-path); }
.exit-door--r { right: 0; border-left: 2px solid var(--maze-path); }
.has-doors.is-in .exit-door--l { transform: translateX(-102%); }
.has-doors.is-in .exit-door--r { transform: translateX(102%); }
.has-doors > :not(.exit-door) {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-door) + 420ms);
}
.has-doors:not(.is-in) > :not(.exit-door) { opacity: 0; transform: translateY(14px); }
/* the path reaching this exit */
html.motion-on .has-doors::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--maze-path);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger-door) + 700ms);
  z-index: 3;
}
html.motion-on .has-doors.is-in::after { transform: scaleX(1); }

/* 3D tilt + cursor glow (desktop pointers only) */
html.motion-hover :where([data-motion="program-card"], [data-motion="course-price-card"]) {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform var(--dur-slow) var(--ease-out);
}
html.motion-hover :where([data-motion="program-card"], [data-motion="course-price-card"]).is-tracking { transition-duration: var(--dur-fast); }
/* the icon tile hops on hover */
html.motion-hover [data-motion="program-card"] .program-card__icon { transition: transform var(--dur-base) var(--ease-spring); }
html.motion-hover [data-motion="program-card"]:hover .program-card__icon { transform: translateY(-3px) rotate(-6deg); }
html.motion-hover :where([data-motion="program-card"], [data-motion="course-price-card"], [data-motion="course-item"], .quiz, .tst-form, .enquiry, .form-card) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
html.motion-hover :where([data-motion="program-card"], [data-motion="course-price-card"], [data-motion="course-item"], .quiz, .tst-form, .enquiry, .form-card)::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 380px; height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-cursor), transparent);
  transform: translate(var(--gx, -999px), var(--gy, -999px));
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
html.motion-hover :where([data-motion="program-card"], [data-motion="course-price-card"], [data-motion="course-item"], .quiz, .tst-form, .enquiry, .form-card):hover::before { opacity: 1; }

/* ---------- Level-up path ---------- */
.levelup__dot, .lane-test, .fx-ring { transform-box: fill-box; transform-origin: center; }
.lane-test { transition: transform var(--dur-base) var(--ease-spring); }
.lane-test.is-passed { fill: var(--lane-test); transform: scale(1.25); }
.lane--advanced { transition: opacity var(--dur-slow) var(--ease-out); }
html.motion-on .levelup.is-driven .lane--advanced:not(.is-lit) { opacity: 0.35; }
.lane-return { transition: opacity var(--dur-slow) var(--ease-out); }
html.motion-on .levelup.is-driven .lane-return:not(.is-lit) { opacity: 0; }
.levelup__dot--b { opacity: 0.9; }
.fx-ring { fill: none; stroke: var(--lane-checkpoint); stroke-width: 2.5; }
.levelup-step__num { transition: transform var(--dur-base) var(--ease-spring); }
.levelup-step.is-active .levelup-step__num { transform: scale(1.18); }
/* active card: an orange outline fades in (opacity only) */
[data-motion="levelup-step"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid var(--brand-orange);
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
[data-motion="levelup-step"].is-active::after { opacity: 1; }
.fx-host { position: relative; }

/* ---------- Report card ---------- */
html.motion-on :where([data-motion="sample-card"], [data-motion="portal-card"]):not(.is-in) .rc { opacity: 0; }
/* NB: never set transform-origin on SVG nodes that carry a transform="" attribute (e.g. .rc-ring__arc) */
.rc-extra-dot, .rc-icon, .chart-point, .chart-gridline { transform-box: fill-box; transform-origin: center; }
.chart-gridline { transform-origin: left center; }
.topic__fill, .retest__fill { transform-origin: left center; }
html.motion-hover .parents__card .rc { transition: transform var(--dur-slow) var(--ease-out); }
html.motion-hover .parents__card .rc { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
html.motion-hover .parents__card .rc.is-tracking { transition-duration: var(--dur-fast); }
.rc-stat.is-updated { animation: edz-nudge var(--dur-slow) var(--ease-spring); }
@keyframes edz-nudge { 30% { transform: translateX(6px); } }

/* Portal: "Path unlocked" moment after sign up / log in */
.fx-unlock {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-3);
  background: var(--overlay-scrim);
  pointer-events: none;
  text-align: center;
}
.fx-unlock__svg { width: 120px; height: 120px; overflow: visible; }
.fx-unlock__body { fill: var(--accent); }
.fx-unlock__shackle { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; }
.fx-unlock__hole { fill: var(--on-accent); }
.fx-unlock__path { fill: none; stroke: var(--maze-path); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.fx-unlock__shackle, .fx-unlock__hole { transform-box: fill-box; transform-origin: center bottom; }
.fx-unlock__text { margin: 0; font-family: var(--font-heading); font-size: var(--fs-2xl); font-weight: 700; color: var(--text); }

/* Portal details: weak topic -> extra class -> re-test path line */
.fx-flow { position: relative; }
.fx-flow__line, .fx-flow__dot { position: absolute; pointer-events: none; }
.fx-flow__line { left: 5px; top: 16px; bottom: 16px; width: 2px; border-radius: 2px; background: var(--card-good); transform-origin: top; opacity: 0.55; }
.fx-flow__dot { left: 2px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Quiz ---------- */
html.motion-on #quiz > .container { position: relative; }
.quiz__progress-dot { transform-origin: center; }
.fx-burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 5; }
.fx-p { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; }
.fx-p--sq { border-radius: 2px; }
.fx-p--bar { width: 14px; height: 4px; left: -7px; top: -2px; border-radius: 2px; }
.fx-p--c0 { background: var(--accent); }
.fx-p--c1 { background: var(--maze-path); }
.fx-p--c2 { background: var(--maze-dot); }
.fx-p--c3 { background: var(--accent-strong); }

/* ---------- Micro-interactions ---------- */
/* Press feedback (all pointers) – uses the individual `scale` property so it composes with magnetic `translate` */
html.motion-on :where(.btn, .choice, .roll-item, .tab, .icon-btn) {
  transition-property: scale, translate;
  transition-duration: var(--dur-fast), var(--dur-base);
  transition-timing-function: var(--ease-spring), var(--ease-spring);
}
html.motion-on :where(.btn, .choice, .roll-item, .tab, .icon-btn):active:not(:disabled) { scale: 0.97; }
html.motion-on :where(.btn, .choice, .roll-item, .tab, .icon-btn) { position: relative; }
/* Press feedback, on brand: a short path line draws out from the press point under the
   label, then fades (replaces the generic ripple). transform + opacity only. */
.fx-press {
  position: absolute;
  left: 18%; right: 18%; bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0);
  pointer-events: none;
}
html.motion-on .is-magnetic { transition-duration: var(--dur-fast), var(--dur-fast); }

/* ---------- Login: tabs pill, steps bar, OTP boxes ---------- */
html.motion-on .tabs.has-pill { position: relative; }
html.motion-on .tabs.has-pill .tab { position: relative; z-index: 1; background: transparent; transition-property: scale; }
html.motion-on .tabs.has-pill .tab[aria-selected="true"] { color: var(--on-accent); }
.tabs__pill {
  position: absolute;
  top: var(--space-1); bottom: var(--space-1); left: var(--space-1);
  width: calc(50% - var(--space-1) * 1.5);
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: transform var(--dur-base) var(--ease-spring);
  pointer-events: none;
}
.tabs[data-active="signup"] .tabs__pill { transform: translateX(calc(100% + var(--space-1))); }
html.motion-on .steps__item { position: relative; }
html.motion-on .steps__item[aria-current="step"], html.motion-on .steps__item.is-done { border-top-color: var(--border); }
html.motion-on .steps__item::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: -4px;
  height: 4px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--dur-slow) var(--ease-out);
}
html.motion-on .steps__item[aria-current="step"]::after { transform: scaleX(1); }
html.motion-on .steps__item.is-done::after { background: var(--success); transform: scaleX(1); }

.otp { position: relative; }
.otp__input {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  z-index: 1;
  cursor: text;
}
.otp__boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.otp__box {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 54px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.otp__box.is-filled { border-color: var(--accent); }
.otp.is-focus .otp__box.is-active { border-color: var(--accent); box-shadow: var(--glow-accent); }
.otp.is-focus .otp__box.is-active:not(.is-filled)::after {
  content: "";
  width: 2px; height: 1.2em;
  background: var(--accent);
  animation: edz-caret 1s steps(1) 5; /* blinks 5 s, then stays solid (WCAG 2.2.2) */
}
.otp.is-error .otp__box { border-color: var(--danger); }
.otp.is-ok .otp__box { border-color: var(--success); }
@keyframes edz-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .otp.is-focus .otp__box.is-active:not(.is-filled)::after { animation: none; } }
@media (max-width: 360px) { .otp__box { height: 48px; } }
.demo-otp__code { display: inline-block; }

/* ---------- Staff: the roll is a path ----------
   A thin green line runs down the left gutter of the roll and fills as names are
   marked; it ends in a goal tick once the day is saved. State, not decoration, so it
   also shows (without movement) under reduced motion. */
.roll-item__icon { transform-origin: center; }
.fx-rollpath {
  position: relative;
  /* the gutter lives INSIDE the roll, so the line keeps clear of the screen edge and
     the sticky save bar (which paints over the roll) covers it as it scrolls past */
  padding-left: 18px;
}
.fx-rollpath::before,
.fx-rollpath::after {
  content: "";
  position: absolute;
  left: 5px; top: var(--space-2);
  bottom: 30px; /* ends at the middle of the last roll item, not past it */
  pointer-events: none;
}
/* the "not yet marked" track: a dashed line (shape, not just a faint fill) */
.fx-rollpath::before {
  width: 0;
  border-left: 3px dashed var(--border-strong);
}
.fx-rollpath::after {
  width: 3px;
  border-radius: 3px;
  background: var(--maze-path);
  transform-origin: top;
  transform: scaleY(var(--edz-fill, 0));
  transition: transform var(--dur-base) var(--ease-out);
}
.fx-rollpath ~ .staff-save { z-index: 1; }
/* goal tick sits at the end of the line, on the last roll item */
.fx-rollgoal { display: block; position: relative; height: 0; }
.fx-rollgoal__tick {
  position: absolute;
  left: -2px; top: -38px;
  width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--maze-path);
  color: var(--on-accent);
  font-size: 11px; font-weight: 700; line-height: 1;
  transform: scale(0);
  transition: transform var(--dur-base) var(--ease-spring);
}
.fx-rollgoal.is-goal .fx-rollgoal__tick { transform: scale(1); }
@media (max-width: 340px) { .fx-rollpath { padding-left: 0; } .fx-rollpath::before, .fx-rollpath::after, .fx-rollgoal { display: none; } }

/* ---------- Home: section dividers – a thin path joins one section to the next ---------- */
.has-divider { position: relative; }
.fx-divider {
  position: absolute;
  left: 0; right: 0; top: -12px;
  max-width: var(--container);
  height: 24px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  pointer-events: none;
  z-index: 1;
}
.fx-divider__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fx-divider__path { fill: none; stroke: var(--maze-path); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; vector-effect: non-scaling-stroke; }
.fx-divider__node {
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--maze-path);
}
html.motion-on .fx-divider__svg { transition: clip-path var(--dur-slow) var(--ease-in-out); }
html.motion-on .fx-divider:not(.is-in) .fx-divider__svg { clip-path: inset(-4px 100% -4px 0); }
html.motion-on .fx-divider--rtl:not(.is-in) .fx-divider__svg { clip-path: inset(-4px 0 -4px 100%); }
html.motion-on .fx-divider .fx-divider__svg { clip-path: inset(-4px 0 -4px 0); }
html.motion-on .fx-divider__node { transition: transform var(--dur-base) var(--ease-spring); transition-delay: calc(var(--dur-slow) * 0.5); }
html.motion-on .fx-divider:not(.is-in) .fx-divider__node { transform: scale(0); }

/* ---------- Course pages + generic JS-added reveal classes ----------
   These classes are added by motion.js only, so without JS nothing is hidden. */
html.motion-on :where(.fx-rise, .fx-pop, .fx-lift) {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger) + var(--d, 0ms));
}
html.motion-on .fx-rise:not(.is-in) { opacity: 0; transform: translateY(26px); }
html.motion-on .fx-pop:not(.is-in) { opacity: 0; transform: translateY(18px) scale(0.92); }
html.motion-on .fx-lift:not(.is-in) { opacity: 0; transform: perspective(1000px) translateY(46px) rotateX(12deg); }
html.motion-on .fx-lift { transform-origin: 50% 100%; }
@media (min-width: 760px) {
  html.motion-on [data-motion="course-who"] .fx-rise:not(.is-in) { transform: translateY(26px) rotate(-1.5deg); }
}
.fx-count { font-variant-numeric: tabular-nums; }
/* one-off warm sheen across a price card (multiply: text stays crisp) */
.fx-shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; mix-blend-mode: multiply; }
.fx-shine__bar {
  position: absolute;
  top: -10%; bottom: -10%; left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--brand-orange-soft), transparent);
  transform: translateX(-120%) skewX(-18deg);
}
/* CTA band: a small path-to-star swoosh draws above the title (inside the band padding) */
.fx-band__copy { position: relative; }
.fx-band__art { position: absolute; left: 0; bottom: 100%; width: 200px; height: 25px; margin-bottom: var(--space-2); overflow: visible; pointer-events: none; }
.fx-band__path { fill: none; stroke: var(--on-panel-accent); stroke-width: 3; stroke-linecap: round; }
.fx-band__star { fill: var(--on-panel-accent); transform-box: fill-box; transform-origin: center; }

/* ---------- Talent Search Test bands + parents' trust cards ---------- */
html.motion-on :where([data-motion="tst-band"], [data-motion="course-tst-band"]) { position: relative; }
html.motion-on .assure-card__icon { position: relative; }
/* one soft ring ping (JS-added, runs once; used by the health-strip dot) */
.fx-ping {
  position: absolute; inset: 0;
  border-radius: inherit;
  border: 2px solid var(--accent-strong);
  opacity: 0;
  pointer-events: none;
}
html.motion-hover :where([data-motion="tst-band"], [data-motion="course-tst-band"], [data-motion="parents-assurance"]) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
html.motion-hover :where([data-motion="tst-band"], [data-motion="course-tst-band"], [data-motion="parents-assurance"])::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 380px; height: 380px;
  margin: -190px 0 0 -190px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-cursor), transparent);
  transform: translate(var(--gx, -999px), var(--gy, -999px));
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
  z-index: -1;
}
html.motion-hover :where([data-motion="tst-band"], [data-motion="course-tst-band"], [data-motion="parents-assurance"]):hover::before { opacity: 1; }

/* ---------- Coaching Act disclosures: calm and quick ----------
   Short fade + small rise only (no tilt, no spring, no word split). */
html.motion-on .fx-calm {
  transition: opacity calc(var(--dur-base) + var(--dur-fast)) var(--ease-out), transform calc(var(--dur-base) + var(--dur-fast)) var(--ease-out);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
html.motion-on .fx-calm:not(.is-in) { opacity: 0; transform: translateY(12px); }
/* shared reveals on this page use the same calm timing */
html.motion-on .page-disclosures :where(.section__lead, .note-box) {
  transition-duration: calc(var(--dur-base) + var(--dur-fast));
  --d: 0ms;
}
html.motion-on .page-disclosures :where(.section__lead, .note-box):not(.is-in) { transform: translateY(12px); }
/* first view: the draft note in the hero is never hidden (motion.js only settles it) */
html.motion-on .disc-hero .note-box:not(.is-in) { opacity: 1; transform: none; }

/* Buttons that also reveal (fx-rise / fx-calm) keep their press + magnetic transitions,
   and those two never wait for the reveal delay */
html.motion-on .btn:where(.fx-rise, .fx-calm) {
  transition-property: opacity, transform, scale, translate;
  transition-duration: var(--dur-slow), var(--dur-slow), var(--dur-fast), var(--dur-base);
  transition-timing-function: var(--ease-out), var(--ease-out), var(--ease-spring), var(--ease-spring);
  transition-delay: calc(var(--i, 0) * var(--stagger)), calc(var(--i, 0) * var(--stagger)), 0ms, 0ms;
}
html.motion-on .btn.fx-calm { transition-duration: calc(var(--dur-base) + var(--dur-fast)), calc(var(--dur-base) + var(--dur-fast)), var(--dur-fast), var(--dur-base); }

/* ---------- How we fix weak topics: the loop (home, v1.2) ----------
   .fx-loop is added by motion.js (full motion only). Before the figure is revealed the
   paths are undrawn and nodes 2-4, labels, the Repeat arrow, star and "Improved" label are hidden;
   the WAAPI run then holds each start state until its own moment. */
html.motion-on .fx-loop:not(.is-in) :where(.loop__entry, .loop__ring, .loop__exit) { stroke-dasharray: 1 2; stroke-dashoffset: 1.02; }
html.motion-on .fx-loop:not(.is-in) :where(.loop__maze, .loop__repeat, .loop__labels text, .loop__star, .loop__label--goal, .loop__node:not([data-node="test"]) > *) { opacity: 0; }
.loop__repeat-arrow { transform-box: fill-box; transform-origin: center; }
.loop__labels text, .loop__label--goal { transform-box: fill-box; transform-origin: center; }
/* the second lap's orange trail (JS-added, fades away once the exit path is drawn) */
.fx-loop-trail { fill: none; stroke: var(--loop-exit); stroke-width: 5; stroke-linecap: round; pointer-events: none; }
.fx-loop-ping { opacity: 0; fill: none; stroke: var(--loop-dot); stroke-width: 2.5; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.loop-step__link { transform-origin: 50% 0; }
.loop-step__repeat > [aria-hidden="true"] { display: inline-block; }
/* desktop cursor glow on step cards (2+ columns only: the 1-column connector sits outside the card) */
@media (min-width: 600px) {
  html.motion-hover [data-motion="loop-step"] { isolation: isolate; overflow: hidden; }
  html.motion-hover [data-motion="loop-step"]::before {
    content: ""; position: absolute; left: 0; top: 0; width: 380px; height: 380px; margin: -190px 0 0 -190px;
    border-radius: 50%; background: radial-gradient(closest-side, var(--glow-cursor), transparent);
    transform: translate(var(--gx, -999px), var(--gy, -999px)); opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out); pointer-events: none; z-index: -1;
  }
  html.motion-hover [data-motion="loop-step"]:hover::before { opacity: 1; }
}

/* ---------- What your fee includes (home + Class 9/10 course pages) ---------- */
html.motion-on [data-motion="fee-item"] { position: relative; }
html.motion-hover [data-motion="fee-item"] { isolation: isolate; overflow: hidden; }
html.motion-hover [data-motion="fee-item"]::before {
  content: ""; position: absolute; left: 0; top: 0; width: 380px; height: 380px; margin: -190px 0 0 -190px;
  border-radius: 50%; background: radial-gradient(closest-side, var(--glow-cursor), transparent);
  transform: translate(var(--gx, -999px), var(--gy, -999px)); opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out); pointer-events: none; z-index: -1;
}
html.motion-hover [data-motion="fee-item"]:hover::before { opacity: 1; }

/* ---------- Sample Topic Health strip (home) ---------- */
html.motion-on .fx-health:not(.is-in) :where(.health-topic, .health-strip__legend, .health-ba) { opacity: 0; }
.fx-health-row { position: relative; }
.fx-health-row .health-dot { position: relative; }
/* the red "Needs work" chip the fixed topic starts as: an aria-hidden copy laid over the real chip */
.fx-health-was { position: absolute; display: flex; align-items: center; pointer-events: none; white-space: nowrap; }
.fx-health-was .health-chip { transform-origin: 100% 50%; }
/* thin score meter on the row's bottom border: red to 48%, then green to 81% (transform only) */
.fx-meter { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; border-radius: 2px; overflow: hidden; }
.fx-meter__bar { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); border-radius: 2px; }
.fx-meter__bar--red { background: var(--health-red); }
.fx-meter__bar--green { background: var(--health-green); }
.fx-ping--dot { border-radius: 50%; border-color: var(--health-green); }
.health-ba__before, .health-ba__after, .health-ba__arrow { display: inline-block; }

/* ---------- How admission works (home + 3 course pages, v1.8) ----------
   .fx-adm is added by motion.js (full motion only). Steps rise in sequence (--d from JS);
   a short orange link draws across the gap into steps 2 and 3. Mobile: the steps stack,
   the link runs down from number to number; 760px+: 3 columns, it runs across. */
.fx-adm { position: relative; }
.fx-adm .adm-step__num { position: relative; }
html.motion-on .fx-adm {
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
html.motion-on .fx-adm:not(.is-in) { opacity: 0; transform: translateY(22px); }
.fx-adm + .fx-adm::before {
  content: ""; position: absolute; pointer-events: none;
  left: calc(var(--space-5) + 19px); top: calc(-1 * var(--space-4) - 2px);
  width: 3px; height: calc(var(--space-4) + 4px);
  border-radius: 2px; background: var(--brand-orange);
  transform-origin: 50% 0;
}
html.motion-on .fx-adm + .fx-adm::before {
  transition: transform var(--dur-base) var(--ease-in-out);
  transition-delay: calc(var(--d, 0ms) - var(--dur-fast));
}
html.motion-on .fx-adm + .fx-adm:not(.is-in)::before { transform: scaleY(0); }
@media (min-width: 760px) {
  .fx-adm + .fx-adm::before {
    left: calc(-1 * var(--space-4) - 2px); top: calc(var(--space-4) + 19px);
    width: calc(var(--space-4) + 4px); height: 3px;
    transform-origin: 0 50%;
  }
  html.motion-on .fx-adm + .fx-adm:not(.is-in)::before { transform: scaleX(0); }
}
.fx-ping--adm { border-radius: 50%; border-color: var(--brand-orange); }

/* ---------- Safety nets ---------- */
@media print {
  html.motion-on * { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .exit-door, .fx-burst, .fx-unlock, .fx-press, .fx-divider, .fx-spark, .fx-pulse, .fx-shine, .fx-ping, .fx-band__art, .hero-glint, .fx-loop-trail, .fx-loop-ping, .fx-health-was, .fx-meter, .fx-adm::before { display: none !important; }
  html.motion-on .fx-loop :where(.loop__entry, .loop__ring, .loop__exit) { stroke-dasharray: none !important; }
}
