/* RHCES Academy - academy-motion.css v1 (10 Nov 2026). Motion, plus three still drawings on the home page
   (grid, portal frame, beam-check sheet). Colours are --cad-* tokens only; no theme rule is overridden.
   The script line in <head> puts ONE class on <html>:
     am-on     the drawing is shown and moves
     am-still  reduced motion, Data Saver or failed script: finished still drawing
     (none)    no JavaScript: today's page; decorative blocks stay [hidden]
   Every rule that moves, hides or animates is in part 7 and starts with .am-on.
   Keyframes are "from" only: they end on the base CSS. */

:root { --am-ease: cubic-bezier(.2,.7,.2,1); }

/* 1. SWITCH: un-hide the blocks; position helpers */
.am-on .am-sheet-wrap, .am-still .am-sheet-wrap { display: block; }
@media (min-width: 1180px) { .am-on .am-grid-wrap, .am-still .am-grid-wrap, .am-on .am-frame, .am-still .am-frame { display: block; } }
/* under 1180 px: grid in dark only (light text contrast as today) */
:root[data-theme="dark"].am-on .am-grid-wrap, :root[data-theme="dark"].am-still .am-grid-wrap { display: block; }
.am-hero .hero-content, .lesson-page .quiz-card, .am-cert, .am-ticks { position: relative; }

/* 2. GRID (home hero) */
.am-grid-wrap {
  --am-grid-mid: 0;   /* light: no grid behind the text column */
  --am-m1: linear-gradient(to bottom, transparent 0, #000 72px, #000 72%, transparent 100%);
  --am-m2: linear-gradient(to right, #000 calc(50% - 560px), rgba(0,0,0,var(--am-grid-mid)) calc(50% - 440px), rgba(0,0,0,var(--am-grid-mid)) calc(50% + 440px), #000 calc(50% + 560px));
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;
  -webkit-mask-image: var(--am-m1); mask-image: var(--am-m1);
}
:root[data-theme="dark"] .am-grid-wrap { --am-grid-mid: .3; }
.am-grid { position: absolute; top: -100px; left: -100px; right: 0; bottom: 0; }
.am-grid::before, .am-grid::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background-image: linear-gradient(to right, var(--cad-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--cad-grid) 1px, transparent 1px);
}
.am-grid::before { background-size: 20px 20px; opacity: .3; }   /* under 1180 px: dark only */
.am-grid::after { background-size: 100px 100px; opacity: .6; }
@media (min-width: 1180px) {   /* behind the text: none (light), faint (dark) */
  .am-grid-wrap { -webkit-mask-image: var(--am-m1), var(--am-m2); -webkit-mask-composite: source-in; mask-image: var(--am-m1), var(--am-m2); mask-composite: intersect; }
  .am-grid::before { opacity: .24; }
  .am-grid::after { opacity: .55; }
  :root[data-theme="dark"] .am-grid::before { opacity: .45; }
  :root[data-theme="dark"] .am-grid::after { opacity: .9; }
}

/* 3. PORTAL FRAME round the hero text (1180 px up) */
.am-frame { position: absolute; z-index: -1; left: -123px; right: -123px; top: -82px; bottom: -55px; pointer-events: none; }
.am-frame span { position: absolute; }
.am-ax { top: 0; bottom: 31px; width: 1px; opacity: .45; background: repeating-linear-gradient(to bottom, var(--cad-accent) 0 18px, transparent 18px 23px, var(--cad-accent) 23px 26px, transparent 26px 31px); }
.am-ax.am-l { left: 0; } .am-ax.am-r { right: 0; }
.am-bub { bottom: 0; width: 30px; height: 30px; border: 1px solid var(--cad-accent); border-radius: 50%; background: var(--cad-ground); color: var(--cad-accent); font: 700 16px/28px var(--font-display); text-align: center; }
.am-bub.am-l { left: -15px; } .am-bub.am-r { right: -15px; }
.am-foot { bottom: 61px; width: 96px; height: 22px; border: 1px solid var(--cad-ink-3); opacity: .6; }
.am-foot.am-l { left: -48px; } .am-foot.am-r { right: -48px; }
.am-col { top: 12px; bottom: 83px; width: 24px; opacity: .6; }
.am-col.am-l { left: -12px; } .am-col.am-r { right: -12px; }
.am-col::before, .am-col::after { content: ""; position: absolute; bottom: 0; width: 1px; background: var(--cad-ink-3); }
.am-col::before { top: 0; } .am-col::after { top: 26px; }
.am-col.am-l::before, .am-col.am-r::after { left: 0; } .am-col.am-l::after, .am-col.am-r::before { right: 0; }
.am-beam { top: 12px; left: -12px; right: -12px; height: 26px; opacity: .6; }
.am-beam::before, .am-beam::after { content: ""; position: absolute; height: 1px; background: var(--cad-ink-3); }
.am-beam::before { top: 0; left: 0; right: 0; } .am-beam::after { bottom: 0; left: 24px; right: 24px; }
/* the first screen would cut the bubbles in half here */
@media (min-height: 750px) and (max-height: 839px) { .am-bub { display: none; } .am-ax { bottom: 0; } }

/* 4. BEAM-CHECK SHEET (home; do not change its numbers) */
.am-sheet { max-width: 820px; margin: 0 auto; overflow: hidden; text-align: left; background: var(--cad-panel); border: 1px solid var(--cad-rule); border-radius: 4px; color: var(--cad-ink); }
.sheet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 9px 16px; border-bottom: 1px solid var(--cad-rule); }
.sheet-id { font: 600 .7rem/1.4 var(--font-mono); letter-spacing: .04em; color: var(--cad-ink-2); }
.sheet-codes { display: inline-flex; }
.am-sheet .code { font: 600 .68rem/1 var(--font-mono); letter-spacing: .04em; white-space: nowrap; padding: 5px 10px; border: 1px solid var(--cad-accent); color: var(--cad-accent); background: var(--cad-panel); }
.code-a { border-radius: 999px 0 0 999px; }
.code-b { border-radius: 0 999px 999px 0; margin-left: -1px; }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.sheet-draw { display: flex; align-items: center; justify-content: center; padding: 12px; border-bottom: 1px solid var(--cad-rule); }
.am-sheet .sd { display: block; width: 100%; max-width: 380px; height: auto; aspect-ratio: 340 / 236; overflow: visible; }
.sheet-calc { display: flex; flex-direction: column; justify-content: center; padding: 14px 16px; }
@media (min-width: 720px) {
  .sheet-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .sheet-draw { padding: 16px 20px; border-bottom: 0; border-right: 1px solid var(--cad-rule); }
  .sheet-calc { padding: 18px 22px; }
}
.am-sheet .ink { fill: none; stroke: var(--cad-ink); stroke-width: 1.4; stroke-linejoin: round; }
.am-sheet .thin { fill: none; stroke: var(--cad-ink-3); stroke-width: 1; }
.am-sheet .beam { fill: var(--cad-stage); stroke: var(--cad-ink); stroke-width: 1.4; }
.am-sheet .roll { fill: none; stroke: var(--cad-ink); stroke-width: 1.2; }
.am-sheet .load { fill: var(--cad-accent); stroke: var(--cad-accent); stroke-width: 1.2; }
.am-sheet .ll { fill: none; }
.am-sheet .txt { fill: var(--cad-ink-2); font: 600 14px var(--font-mono); text-anchor: middle; }
.md-curve { fill: none; stroke: var(--cad-accent); stroke-width: 1.6; }
.am-sheet .hl { fill: none; stroke: var(--cad-accent); stroke-width: 1; opacity: .5; }
.mu-old { opacity: 0; }
.am-sheet .mu-new { fill: var(--cad-accent); }
.am-sheet .stamp path { fill: none; stroke: var(--cad-ok); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.am-sheet .stamp .tick { stroke-width: 2.2; }
.calc-status { display: grid; margin: 0 0 12px; font: 600 .75rem/1.5 var(--font-mono); letter-spacing: .02em; }
.am-sheet .st { grid-area: 1 / 1; opacity: 0; }
.am-sheet .st::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; vertical-align: .08em; border-radius: 50%; background: currentColor; }
.am-sheet .st-1 { color: var(--cad-warn); }
.am-sheet .st-2 { color: var(--cad-accent); }
.am-sheet .st-3 { color: var(--cad-ok); opacity: 1; }
.am-sheet .calc { list-style: none; margin: 0; padding: 0; font: 600 .86rem/1 var(--font-mono); color: var(--cad-ink); }
.am-sheet .calc li { position: relative; isolation: isolate; display: flex; align-items: center; gap: 10px; min-height: 29px; white-space: nowrap; }
.am-sheet .ln { position: relative; display: inline-block; }
.am-sheet .tx { display: inline-block; padding: 3px 0 4px; }
.am-sheet .lhs { display: inline-block; width: 3.6em; }
.am-sheet .calc sub { font-size: .72em; line-height: 0; vertical-align: -.28em; }
.am-sheet .wrong { position: relative; color: var(--cad-ink-2); }
.am-sheet .wrong::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 1.5px; background: var(--cad-danger); transform-origin: 0 50%; }
.cl-2::before { content: ""; position: absolute; z-index: -1; top: 1px; bottom: 1px; left: -8px; right: -8px; border-radius: 3px; background: var(--cad-accent-soft); opacity: 0; }
.cl-3 { color: var(--cad-accent); }
.am-sheet .ln::after { content: ""; position: absolute; top: 4px; bottom: 4px; left: 0; width: 100%; margin-left: 1px; background: linear-gradient(var(--cad-accent), var(--cad-accent)) 0 0 / .5em 100% no-repeat; opacity: 0; pointer-events: none; }
.am-sheet .pass { display: inline-block; padding: 4px 9px; border-radius: 999px; font: 600 .66rem/1 var(--font-mono); letter-spacing: .1em; background: var(--cad-ok); color: var(--cad-accent-ink); }
.sheet-cap { margin: 0; padding: 10px 16px; border-top: 1px solid var(--cad-rule); font-size: .85rem; line-height: 1.5; color: var(--cad-ink-2); text-align: center; }
@media (max-width: 400px) {
  .am-sheet .calc { font-size: .76rem; }
  .calc-status { font-size: .7rem; }
  .sheet-draw { padding: 10px 8px; }
}

/* 5. CHECK SEAL (script) */
.am-stamp { position: absolute; top: -13px; right: -13px; width: 32px; height: 32px; pointer-events: none; }
.am-stamp circle { fill: var(--cad-panel); }
.am-stamp path { fill: none; stroke: var(--cad-ok); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.am-stamp .am-tick { stroke-width: 2.2; }

/* 6. HIGH CONTRAST, PRINT */
@media (forced-colors: active) { .am-deco { display: none !important; } }
@media print {
  .am-deco, .am-progress, .am-stamp { display: none !important; }
  .am-rise, .am-sheet { opacity: 1 !important; transform: none !important; animation: none !important; }
}

/* 7. MOTION (not indented) */
@media (prefers-reduced-motion: no-preference) {
@keyframes amk-rise { from { opacity: .01; transform: translateY(var(--am-y, 14px)); } }   /* .01, not 0: painted at once (LCP) */
@keyframes amk-fade { from { opacity: 0; } }
@keyframes amk-drop { from { opacity: 0; transform: translateY(-10px); } }
@keyframes amk-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes amk-grow-x { from { transform: scaleX(0); } }
@keyframes amk-grow-y { from { transform: scaleY(0); } }
@keyframes amk-pop { from { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } to { opacity: 1; transform: scale(1); } }
@keyframes amk-drift { to { background-position: 100px 100px; } }
@keyframes amk-lit { 35% { border-color: var(--cad-accent); background-color: var(--cad-accent-soft); } }
@keyframes amk-ink { from { color: var(--cad-ink-2); } }
@keyframes amk-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes amk-mid { 0% { opacity: 0; } 12%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes amk-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes amk-caret { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 1; } }
@keyframes amk-slide-l { from { opacity: 0; transform: translateX(-28px); } }
@keyframes amk-slide-r { from { opacity: 0; transform: translateX(28px); } }
@keyframes amk-lock { 50% { transform: scale(1.07); } }
@keyframes amk-beam { from { stroke-dashoffset: 1; fill-opacity: 0; } 70% { fill-opacity: 0; } to { stroke-dashoffset: 0; fill-opacity: 1; } }
@keyframes amk-md { 0%, 85% { transform: scaleY(.8); } 94% { transform: scaleY(1.05); } 100% { transform: scaleY(1); } }
@keyframes amk-dim { from { color: var(--cad-ink); } }

/* only hidden state: set by the script on blocks below the screen */
.am-on .am-wait { opacity: 0; }

/* stagger index, max 7 */
.am-on .am-load, .am-on .am-page li { --am-i: 7; }
.am-on .am-load:nth-of-type(1), .am-on .am-page li:nth-child(1) { --am-i: 0; }
.am-on .am-load:nth-of-type(2), .am-on .am-page li:nth-child(2) { --am-i: 1; }
.am-on .am-load:nth-of-type(3), .am-on .am-page li:nth-child(3) { --am-i: 2; }
.am-on .am-load:nth-of-type(4), .am-on .am-page li:nth-child(4) { --am-i: 3; }
.am-on .am-load:nth-of-type(5), .am-on .am-page li:nth-child(5) { --am-i: 4; }
.am-on .am-load:nth-of-type(6), .am-on .am-page li:nth-child(6) { --am-i: 5; }
.am-on .am-load:nth-of-type(7), .am-on .am-page li:nth-child(7) { --am-i: 6; }

/* HOME hero, on load */
.am-on .am-grid-wrap { animation: amk-fade 1.2s ease-out backwards; }
@media (min-width: 1180px) {   /* the one loop. No transform: a moving layer under the text switches ClearType off */
  .am-on .am-grid::before, .am-on .am-grid::after { animation: amk-drift 60s steps(100) 1.2s infinite; }
  .am-on.am-hero-off .am-grid::before, .am-on.am-hero-off .am-grid::after { animation-play-state: paused; }
}
.am-on .am-hero .hero-badge, .am-on .am-hero .hero-title, .am-on .am-hero .hero-sub,
.am-on .am-hero .hero-desc, .am-on .am-hero .hero-actions { animation: amk-rise .55s var(--am-ease) backwards; }
.am-on .am-hero .hero-title { animation-delay: .06s; }
.am-on .am-hero .hero-sub { animation-delay: .12s; }
.am-on .am-hero .hero-desc { animation-delay: .18s; }
.am-on .am-hero .hero-actions { animation-delay: .24s; }
.am-on .am-bub { animation: amk-pop .45s ease .2s backwards; }
.am-on .am-ax { transform-origin: 50% 100%; animation: amk-grow-y .9s cubic-bezier(.4,0,.2,1) .35s backwards; }
.am-on .am-foot { animation: amk-fade .5s ease .5s backwards, amk-grow-x .5s ease .5s backwards; }
.am-on .am-col { transform-origin: 50% 100%; animation: amk-grow-y .8s ease-in-out .8s backwards; }
.am-on .am-beam { transform-origin: 0 50%; animation: amk-grow-x .9s ease-in-out 1.4s backwards; }

/* HOME steps and note (script: .am-in, --am-d) */
.am-on .am-rise.am-in { --am-y: 24px; animation: amk-rise .7s var(--am-ease) var(--am-d, 0s) backwards; }
.am-on .am-steps .card.am-in { animation: amk-rise .7s var(--am-ease) var(--am-d, 0s) backwards, amk-lit .8s ease calc(.6s + var(--am-d, 0s) * 2.2); }

/* HOME sheet, once (script: .am-play) */
.am-on .am-sheet.am-play { --am-y: 18px; animation: amk-rise .6s var(--am-ease) backwards; }
.am-on .am-play .code-a { animation: amk-slide-l .6s cubic-bezier(.2,.8,.2,1) .15s backwards; }
.am-on .am-play .code-b { animation: amk-slide-r .6s cubic-bezier(.2,.8,.2,1) .15s backwards; }
.am-on .am-play .sheet-codes { animation: amk-lock .3s ease .75s; }
.am-on .am-play :is(.sup, .ll, .dimp, .md-base, .md-curve, .hl, .stamp path, .beam) { stroke-dasharray: 1 2; }
.am-on .am-play .sup { animation: amk-draw .5s ease .35s backwards; }
.am-on .am-play .gnd { animation: amk-fade .4s ease .6s backwards; }
.am-on .am-play .roll { transform-box: fill-box; transform-origin: center; animation: amk-pop .3s ease .7s backwards; }
.am-on .am-play .beam { animation: amk-beam .75s ease-in-out .45s backwards; }
.am-on .am-play .ll { animation: amk-draw .45s ease .85s backwards; }
.am-on .am-play .ar { animation: amk-drop .35s cubic-bezier(.3,.6,.3,1.3) calc(.95s + var(--i, 0) * .045s) backwards; }
.am-on .am-play .loadtxt { animation: amk-fade .4s ease .9s backwards; }
.am-on .am-play .dimp { animation: amk-draw .45s ease 1.25s backwards; }
.am-on .am-play .dimtxt { animation: amk-fade .35s ease 1.5s backwards; }
.am-on .am-play .md-base { animation: amk-draw .4s ease 2.4s backwards; }
.am-on .am-play .md { transform-origin: 170px 130px; animation: amk-md 4.8s linear backwards; }
.am-on .am-play .md-curve { animation: amk-draw .8s ease-in-out 2.5s backwards; }
.am-on .am-play .hl { animation: amk-draw .25s ease calc(2.7s + var(--i, 0) * .035s) backwards; }
.am-on .am-play .mu-old { animation: amk-mid 1.05s ease 3.2s backwards; }
.am-on .am-play .mu-new { --am-y: 6px; animation: amk-rise .4s ease 4.3s backwards; }
.am-on .am-play .ring { animation: amk-draw .45s ease 6.35s backwards; }
.am-on .am-play .tick { animation: amk-draw .3s ease 6.7s backwards; }
.am-on .am-play .st-1 { animation: amk-out .25s ease 3.3s backwards; }
.am-on .am-play .st-2 { animation: amk-mid 3.1s ease 3.35s backwards; }
.am-on .am-play .st-3 { animation: amk-fade .3s ease 6.4s backwards; }
.am-on .am-play .tx { animation: amk-type var(--td) steps(var(--n)) var(--t0) backwards; }
.am-on .am-play .ln::after { animation: amk-caret var(--td) steps(var(--n)) var(--t0); }
.am-on .am-play .cl-1 { --t0: 1.7s; --td: .75s; --n: 28; }
.am-on .am-play .cl-2 { --t0: 2.45s; --td: .8s; --n: 26; }
.am-on .am-play .cl-3 { --t0: 4s; --td: .75s; --n: 24; }
.am-on .am-play .cl-4 { --t0: 4.95s; --td: .8s; --n: 26; }
.am-on .am-play .cl-5 { --t0: 5.9s; --td: .35s; --n: 10; }
.am-on .am-play .cl-2::before { animation: amk-mid 1.1s ease 3.35s backwards; }
.am-on .am-play .wrong { animation: amk-dim .3s ease 3.7s backwards; }
.am-on .am-play .wrong::after { animation: amk-grow-x .35s ease 3.6s backwards; }
.am-on .am-play .pass { animation: amk-pop .45s cubic-bezier(.3,.7,.3,1.3) 6.3s backwards; }
.am-on .am-play .sheet-cap { animation: amk-rise .6s ease 6.8s backwards; }

/* PAGE HEADS. :has() keeps the /learn title still */
.am-on .am-page > .container:has(> .page-sub) > .page-title { --am-y: 10px; animation: amk-rise var(--am-u, .45s) var(--am-ease) var(--am-d, 0s) backwards; }
.am-on .am-page > .container > .page-sub, .am-on .am-page > .container > .pill { --am-y: 10px; animation: amk-rise var(--am-u, .45s) var(--am-ease) var(--am-d, 0s) backwards; }
.am-on .am-page > .container > .page-sub, .am-on .am-page .pill + .page-title { --am-d: .06s; }
.am-on .am-page > .container > .pill + .page-title + .page-sub { --am-d: .12s; }
.am-on .am-page .crumbs + .page-title { --am-u: .4s; }
.am-on .am-page > .container > .crumbs + .page-title + .page-sub { --am-u: .4s; --am-d: .05s; }

/* CARDS: /courses, downloads; list items */
.am-on .course-cards > .am-load { --am-y: 12px; animation: amk-rise .45s var(--am-ease) calc(.08s + var(--am-i) * .06s) backwards; }
.am-on .am-page > .container > .am-load { --am-y: 10px; animation: amk-rise .4s var(--am-ease) calc(.06s + min(var(--am-i), 5) * .04s) backwards; }
.am-on .am-list li { --am-y: 6px; animation: amk-rise .3s var(--am-ease) calc(var(--am-l, .25s) + var(--am-i) * .05s) backwards; }
.am-on .course-cards .am-list { --am-l: .3s; }

/* CORNER TICKS (no lift) */
.am-on .am-ticks::after {
  --am-t: linear-gradient(var(--cad-accent), var(--cad-accent));
  content: ""; position: absolute; top: -7px; right: -7px; bottom: -7px; left: -7px; pointer-events: none; opacity: 0; transition: opacity .2s ease;
  background: var(--am-t) 0 0 / 12px 1px, var(--am-t) 0 0 / 1px 12px, var(--am-t) 100% 0 / 12px 1px, var(--am-t) 100% 0 / 1px 12px,
    var(--am-t) 0 100% / 12px 1px, var(--am-t) 0 100% / 1px 12px, var(--am-t) 100% 100% / 12px 1px, var(--am-t) 100% 100% / 1px 12px;
  background-repeat: no-repeat;
}
@media (hover: hover) { .am-on .am-ticks:hover::after { opacity: 1; } }
.am-on .am-ticks:focus-within::after { opacity: 1; }

/* MY LEARNING (title and cards stay still) */
.am-on .am-page .learn-bar span { transform-origin: 0 50%; animation: amk-grow-x .6s var(--am-ease) .15s backwards; }
.am-on .am-page .learn-days li { --am-y: 6px; animation: amk-rise .3s var(--am-ease) calc(.1s + var(--am-i) * .03s) backwards; }
.am-on .am-page .learn-days li.done .learn-state { animation: amk-ink .3s ease calc(.35s + var(--am-i) * .03s) backwards; }
.am-on .am-page .learn-days li > a { transition: transform .15s ease; }
@media (hover: hover) { .am-on .am-page .learn-days li > a:hover { transform: translateX(3px); } }
.am-on .am-page .learn-days li > a:focus-visible { transform: translateX(3px); }

/* LESSON. ".day-stepper ~" skips the final-project page */
.am-on .lesson-page .day-stepper a.step { transition: border-color .15s ease, color .15s ease; }
.am-on .lesson-page .day-stepper ~ .code-switch .chip { transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.am-on .lesson-page .day-stepper ~ .code-switch .chip:active { transform: scale(.97); }
.am-on .lesson-page .day-stepper ~ .lesson-body [data-code] { transition: background-color .25s ease; }
.am-on .lesson-page .day-stepper ~ .lesson-body .prompt-msg:not(:empty) { animation: amk-fade .2s ease backwards; }
.am-on .lesson-page .day-stepper ~ .task-card .task-msg:not(:empty) { animation: amk-fade .25s ease backwards; }
.am-on .lesson-page .day-stepper ~ .quiz-card .quiz-q { transition: border-color .25s ease; }
.am-on .lesson-page .day-stepper ~ .quiz-card .quiz-fb:not([hidden]) { --am-y: 4px; animation: amk-rise .25s ease backwards; }
.am-on .lesson-page .day-stepper ~ .quiz-card .quiz-result:not(:empty) { animation: amk-fade .2s ease backwards; }

/* READING LINE (remove with "reading" in the script) */
.am-on .am-progress {
  position: fixed; left: 0; right: 0; top: calc(var(--nav-h) + env(safe-area-inset-top)); z-index: 998; height: 2px;
  background: var(--cad-accent); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* CHECK SEAL draw; CERTIFICATE ready card */
.am-on .am-stamp { --am-s: 0s; }
.am-on .am-cert > .am-stamp { --am-s: .4s; }
.am-on .am-stamp path { stroke-dasharray: 1 2; }
.am-on .am-stamp circle { animation: amk-fade .3s ease var(--am-s) backwards; }
.am-on .am-stamp .am-ring { animation: amk-draw .45s ease var(--am-s) backwards; }
.am-on .am-stamp .am-tick { animation: amk-draw .3s ease calc(var(--am-s) + .4s) backwards; }
.am-on .am-cert { --am-y: 12px; animation: amk-rise .5s var(--am-ease) .06s backwards; }
.am-on .am-cert #copyv-ok:not([hidden]) { animation: amk-fade .2s ease backwards; }

/* SHELL, opted-in pages. Each :has() rule stands alone */
.am-on .acad-bar:has(~ main > .am-page) :is(.bar-links, .bar-right) a { position: relative; }
.am-on .acad-bar:has(~ main > .am-page) :is(.bar-links, .bar-right) a:not([aria-current="page"])::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--cad-ink-3);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .15s ease;
}
@media (hover: hover) { .am-on .acad-bar:has(~ main > .am-page) :is(.bar-links, .bar-right) a:not([aria-current="page"]):hover::after { transform: scaleX(1); } }
.am-on .acad-bar:has(~ main > .am-page) :is(.bar-links, .bar-right) a:not([aria-current="page"]):focus-visible::after { transform: scaleX(1); }
.am-on main > .container:has(+ .am-page) > .flash { --am-y: -6px; animation: amk-rise .3s var(--am-ease) backwards; }
}
