/* /css/pages/frontpage-demos.css: the homepage "showcase" block. One audience segment (section.hp-show) shows up to
 * three REAL lessons as demo cards (li.hp-demo) that solve themselves once: the given is drawn, each step is written
 * onto its numbered line while the figure acts it out, and the answer lands last in a box that turns "correct".
 * Linked after frontpage-anims.css. This file = the shared frame; the figures' own rules (hpd-<card id>-*) follow it.
 *
 * Contract (SPEC.md is the long form)
 *   rest      THE SOLVED CARD. No base rule hides anything: every start state lives only in an @keyframes from{} with
 *             fill-mode both. No-js, data-hp-motion="still", reduced motion and a card that never played show the
 *             finished lesson. (__gone parts rest dimmed to .65 and lifted, struck through: still readable.)
 *   play      /js/frontpage-demos.js adds .hp-demo--play when ~35% of a card is on screen, and again on Replay;
 *             html.hp-preview (the editor's script-free preview) plays every card once at load.
 *   timeline  delay = (lead + (beat + offset) × slot + n × gap) × speed        one card ≤ ~9 s at speed 1
 *     beat    --hp-demo-b    0 = the prompt, k = step k, end = the answer (steps + 1). HTML parts take theirs from
 *                            their position; figure parts from .hp-demo--b0…b5 / .hp-demo--end (inherited by children)
 *     offset  --hp-demo-o    .hp-demo--o1…o9: tenths of a beat (a beat class resets it to 0)
 *     n       --hp-demo-n    a child's index inside .hp-demo__seq (gap .1 s; __seq--fast .06 s; __seq--slow .2 s)
 *     slot    --hp-demo-slot 1.5 s for 3 steps; 1.7 / 1.9 s for 2 / 1, 1.35 / 1.15 s for 4 / 5 (set by :has)
 *     speed   --hp-demo-speed 1; data-hp-motion="calm" 2
 *   motion    __fade __rise __pop __draw (pathLength="1") __grow (scaleX from the left) __drop (scaleY from the top)
 *             __fall __slide (from --hp-demo-dx/dy) __hop (an arc of --hp-demo-dy, back to rest) __gone (taken away)
 *             __halo (a stroke swell from 0) __flash (a swell of a drawn stroke). One animation per element: nest groups.
 *   paint     transform, opacity, stroke-dashoffset, stroke-width, fill-opacity only; one-shot, never infinite
 *   colour    only --hp-* tokens, through the --hp-demo-* helpers set per preset on .hp-show
 *   names     .hp-show… the block · .hp-demo… every card · .hpd-<card id>-… one figure · keyframes hp-demo-…/hpd-<id>-… */

/* ---- per-element knobs: registered so they never inherit (a group's own length or slide cannot leak into its children) */
@property --hp-demo-n{syntax:"<number>";inherits:false;initial-value:0}
@property --hp-demo-len{syntax:"<time>";inherits:false;initial-value:.5s}
@property --hp-demo-dx{syntax:"<length>";inherits:false;initial-value:0px}
@property --hp-demo-dy{syntax:"<length>";inherits:false;initial-value:0px}
@property --hp-demo-ease{syntax:"*";inherits:false}

/* ---- colour helpers (what each one means is constant; its token differs per preset)
   c / on-c      the solution's ink (shading, x, the answer) and text on a c fill
   ok            "correct": the answer box and its tick, the check. Never red or rose on any skin
   cool / warm   temperature only (below / above zero); -t = the text-safe variant
   ink, ink-2    figure strokes and labels · quiet: minor ticks · paper: an empty cell · tile: a neutral weight
   stage         the figure's panel · dots: its dot grid · blank: the worksheet placeholders (rings, rules, slots) */
.hp-show{
--hp-demo-c:var(--hp-accent1);--hp-demo-on-c:var(--hp-on-accent1);--hp-demo-ok:var(--hp-accent3);
--hp-demo-cool:var(--hp-accent1);--hp-demo-warm:var(--hp-gold);--hp-demo-cool-t:var(--hp-demo-cool);--hp-demo-warm-t:var(--hp-demo-warm);
--hp-demo-ink:var(--hp-ink);--hp-demo-ink-2:var(--hp-ink-2);--hp-demo-quiet:var(--hp-edge);--hp-demo-paper:var(--hp-surface);
--hp-demo-tile:color-mix(in srgb,var(--hp-ink) 13%,var(--hp-surface));
--hp-demo-stage:color-mix(in srgb,var(--hp-demo-c) 6%,var(--hp-surface));
--hp-demo-dots:color-mix(in srgb,var(--hp-demo-c) 20%,transparent);
--hp-demo-blank:color-mix(in srgb,var(--hp-ink-2) 50%,transparent);
--hp-demo-shadow:color-mix(in srgb,var(--hp-ink) 14%,transparent)}
html[data-hp-preset="everyday"] .hp-show{
--hp-demo-cool:color-mix(in srgb,var(--hp-dot2) 80%,var(--hp-ink));--hp-demo-cool-t:var(--hp-demo-cool);
--hp-demo-warm:color-mix(in srgb,var(--color-warning) 72%,var(--hp-ink));--hp-demo-warm-t:color-mix(in srgb,var(--color-warning) 52%,var(--hp-ink))}
html[data-hp-preset="everyday"][data-theme="dark"] .hp-show{
--hp-demo-cool:color-mix(in srgb,var(--hp-dot2) 45%,var(--hp-ink));--hp-demo-warm:var(--color-warning);--hp-demo-warm-t:var(--color-warning);
--hp-demo-tile:color-mix(in srgb,var(--hp-ink) 24%,var(--hp-surface));--hp-demo-shadow:color-mix(in srgb,var(--hp-bg) 80%,transparent)}
html[data-hp-preset="night"] .hp-show{
--hp-demo-c:var(--hp-accent3);--hp-demo-on-c:var(--hp-bg);--hp-demo-ok:var(--hp-accent2);
--hp-demo-cool:var(--hp-accent3);--hp-demo-warm:var(--hp-accent1);
--hp-demo-tile:color-mix(in srgb,var(--hp-ink) 27%,var(--hp-surface));--hp-demo-shadow:color-mix(in srgb,var(--hp-bg) 80%,transparent)}
html[data-hp-preset="winter"] .hp-show{
--hp-demo-c:var(--hp-accent2);--hp-demo-on-c:var(--hp-bg);--hp-demo-ok:color-mix(in oklch,var(--hp-accent2),var(--hp-gold));
--hp-demo-cool:var(--hp-accent2);--hp-demo-warm:var(--hp-accent1);
--hp-demo-tile:color-mix(in srgb,var(--hp-ink) 27%,var(--hp-surface));--hp-demo-shadow:color-mix(in srgb,var(--hp-bg) 80%,transparent)}
html[data-hp-preset="tsagaansar"] .hp-show{
--hp-demo-ok:color-mix(in oklch longer hue,var(--hp-accent1) 55%,var(--hp-accent2));
--hp-demo-cool:var(--hp-accent1);--hp-demo-warm:var(--hp-accent2)}

/* named colours: a lesson that says "red" and "blue" (the bag's balls) gets a red and a blue on every skin, 3:1 or
   better against the stage and apart from the solution ink and from "correct". Only a figure whose lesson names the
   colour uses them; nothing that means right, done or the answer is ever red */
.hp-show{--hp-demo-red:#c2455e;--hp-demo-blue:#2f80ed}
html:is([data-hp-preset="night"],[data-hp-preset="winter"],[data-hp-preset="everyday"][data-theme="dark"]) .hp-show{--hp-demo-red:#ff7a7a;--hp-demo-blue:#4f8cff}

/* ---- the block: head (kicker, h2, lead), the cards, the action after them */
.hp-show__head{display:grid;justify-items:start;gap:14px}
.hp-show h2{font-size:clamp(1.5rem,1.1rem + 1.6vw,2.125rem);font-weight:700;line-height:1.15;letter-spacing:-.015em;text-wrap:balance}
/* the section's tone (the teacher's pick, .hp-tone--*) colours its kicker; the cards keep the solution ink */
.hp-show .hp-kicker{border-color:color-mix(in srgb,var(--hp-tone,var(--hp-accent1)) 50%,transparent);background:color-mix(in srgb,var(--hp-tone,var(--hp-accent1)) 8%,transparent);color:var(--hp-tone,var(--hp-accent1))}
.hp-show__lead{max-width:var(--measure);font-size:clamp(1.0625rem,1rem + .3vw,1.1875rem);line-height:1.55;color:var(--hp-ink-2);text-wrap:pretty}
.hp-show__list{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;margin-top:clamp(24px,3.4vw,40px)}
.hp-show__cta{margin-top:clamp(24px,3vw,36px)}
.hp-show__cta .lucide{width:20px;height:20px;stroke-width:2.2}

/* ---- the card: the figure leads; then title and grade, the prompt, the numbered steps, the answer, the source */
.hp-demo{
--hp-demo-speed:1;--hp-demo-lead:.3s;--hp-demo-slot:1.5s;--hp-demo-gap:.1s;--hp-demo-end:4;--hp-demo-b:0;--hp-demo-o:0;
position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto 1fr auto auto;min-width:0;padding:8px 8px 2px;
border:1px solid var(--hp-line);border-radius:22px;background:var(--hp-surface);color:var(--hp-ink);
box-shadow:0 1px 2px var(--hp-demo-shadow),0 22px 44px -30px var(--hp-demo-shadow)}
.hp-demo>:not(.hp-demo__stage){margin-inline:12px}
[data-hp-motion="calm"] .hp-demo{--hp-demo-speed:2}
.hp-demo:not(:has(.hp-demo__step:nth-child(3))){--hp-demo-end:3;--hp-demo-slot:1.7s}
.hp-demo:not(:has(.hp-demo__step:nth-child(2))){--hp-demo-end:2;--hp-demo-slot:1.9s}
.hp-demo:has(.hp-demo__step:nth-child(4)){--hp-demo-end:5;--hp-demo-slot:1.35s}
.hp-demo:has(.hp-demo__step:nth-child(5)){--hp-demo-end:6;--hp-demo-slot:1.15s}

.hp-demo__stage{position:relative;border-radius:15px;background-color:var(--hp-demo-stage);
background-image:radial-gradient(circle,var(--hp-demo-dots) 1px,transparent 1.5px);background-size:16px 16px;background-position:8px 8px}
.hp-demo__head{display:flex;flex-direction:column-reverse;justify-content:flex-end;gap:4px;margin-top:16px}
.hp-demo__eyebrow{display:flex;align-items:center;gap:8px;font-size:.8125rem;font-weight:650;line-height:1.35;color:var(--hp-ink-2);font-variant-numeric:lining-nums}
.hp-demo__eyebrow::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--hp-demo-c)}
.hp-demo__title{font-size:1.125rem;font-weight:750;line-height:1.3;letter-spacing:-.01em;text-wrap:balance}
.hp-demo__prompt{align-self:start;margin-top:12px;padding:1px 0 1px 12px;border-left:3px solid var(--hp-demo-c);font-size:1rem;font-weight:600;line-height:1.45;text-wrap:pretty}
.hp-demo__nw{white-space:nowrap}

/* the steps: numbered lines of a worksheet. An empty ring and a dashed rule wait for each step; its disc and words
   arrive on its beat (the ring and the rule stay, so a card mid-play is never a blank page) */
.hp-demo__steps{counter-reset:hp-demo-step;display:grid;align-content:start;margin-top:8px}
.hp-demo__step{counter-increment:hp-demo-step;display:grid;grid-template-columns:24px minmax(0,1fr);column-gap:10px;align-items:start;
padding:9px 0 10px;border-bottom:1px dashed var(--hp-demo-blank);font-size:.9375rem;line-height:1.45;text-wrap:pretty}
.hp-demo__step::before,.hp-demo__step::after{grid-area:1 / 1;width:24px;height:24px;margin-top:-1px;border-radius:50%}
.hp-demo__step::before{content:"";box-shadow:inset 0 0 0 1.5px var(--hp-demo-blank)}
.hp-demo__step::after{content:counter(hp-demo-step);display:grid;place-items:center;background:var(--hp-demo-c);color:var(--hp-demo-on-c);font-size:.75rem;font-weight:800;line-height:1}
.hp-demo__text{grid-area:1 / 2;min-width:0}

/* the answer: a dashed slot reading "Хариу ____" with an empty ring; when the answer lands it turns "correct"
   (an ok-tinted layer of its own, so it can arrive with the tick) and the value is underlined in the solution's ink */
.hp-demo__answer{position:relative;isolation:isolate;container-type:inline-size;display:flex;align-items:center;gap:12px;margin-top:16px;
padding:10px 12px 12px 14px;border:1.5px dashed var(--hp-demo-blank);border-radius:14px}
.hp-demo__answer::before{content:"";position:absolute;inset:-1.5px;z-index:-1;border-radius:inherit;
background:color-mix(in srgb,var(--hp-demo-ok) 10%,var(--hp-surface));box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--hp-demo-ok) 85%,var(--hp-surface))}
.hp-demo__result{flex:1;min-width:0;display:grid;justify-items:start;gap:3px}
.hp-demo__label{font-size:.8125rem;font-weight:700;line-height:1.3;color:var(--hp-ink-2)}
.hp-demo__value{position:relative;max-width:100%;padding-bottom:6px;font-size:clamp(1.375rem,9cqi,1.875rem);font-weight:800;line-height:1.15;
letter-spacing:-.01em;color:var(--hp-demo-c);font-variant-numeric:lining-nums;text-wrap:balance;transform-origin:0 100%}
/* a long answer (the renderer splits it into two or more spans) is set smaller, so a word answer stays two lines */
.hp-demo__value--long{font-size:clamp(1.125rem,6.5cqi,1.375rem);line-height:1.25}
.hp-demo__value::before{content:"";position:absolute;inset:auto 0 0;border-bottom:2px dotted var(--hp-demo-blank)}
.hp-demo__value::after{content:"";position:absolute;inset:auto 0 -1px;height:3px;border-radius:2px;background:var(--hp-demo-c);transform-origin:0 50%}
.hp-demo__tick{flex:none;width:30px;height:30px;overflow:visible;fill:none;stroke-linecap:round;stroke-linejoin:round}
.hp-demo__tick-slot{stroke:var(--hp-demo-blank);stroke-width:1.5;stroke-dasharray:2.5 3}
.hp-demo__tick-ok{stroke:var(--hp-demo-ok);stroke-width:2.2}

/* the foot: where the lesson comes from, and Replay (a light text button; the only button-shaped thing in the
   section is the primary action). Replay's name carries the lesson title for screen readers. */
.hp-demo__foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0 8px;min-height:50px;padding-top:6px}
.hp-demo__src{display:inline-flex;align-items:center;gap:6px;font-size:.8125rem;font-weight:650;line-height:1.3;color:var(--hp-ink-2)}
.hp-demo__src .lucide{width:16px;height:16px;color:var(--hp-demo-ok)}
.hp-demo__replay{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin:0 -10px 0 auto;padding:0 10px;border:0;border-radius:999px;
background:transparent;color:var(--hp-demo-c);font-size:.875rem;font-weight:700;letter-spacing:.01em;white-space:nowrap;cursor:pointer;transition:background-color .16s}
.hp-demo__replay .lucide{width:16px;height:16px;stroke-width:2.4}
.hp-demo__replay:focus-visible{outline:3px solid var(--hp-focus);outline-offset:2px;border-radius:999px}
@media (hover:hover) and (pointer:fine){.hp-demo__replay:hover{background:var(--hp-hover);color:var(--hp-hover-ink)}}

/* ---- layouts. Phone: one column. 640–959 px: a wide card (figure and answer left, words right). From 960 px: three
   cards in a row on a shared subgrid, so prompts, steps, answers and sources sit on common lines */
@media (min-width:640px) and (max-width:959.98px){
.hp-demo{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:auto auto 1fr auto auto;column-gap:18px;padding:8px 8px 2px;
grid-template-areas:"stage head" "stage prompt" "stage steps" "answer steps" "foot foot"}
.hp-demo>:not(.hp-demo__stage){margin-inline:0 12px}
.hp-demo__stage{grid-area:stage;align-self:start}
.hp-demo__head{grid-area:head;margin-top:12px}
.hp-demo__prompt{grid-area:prompt}
.hp-demo__steps{grid-area:steps}
.hp-demo__answer{grid-area:answer;align-self:end;margin:14px 0 4px}
.hp-demo__foot{grid-area:foot;margin-inline:12px}}
@media (min-width:960px){
.hp-show__head{grid-template-columns:minmax(0,5fr) minmax(0,6fr);column-gap:clamp(32px,5vw,72px);align-items:end}
.hp-show__head>:not(.hp-show__lead){grid-column:1}
.hp-show__lead{grid-column:2;grid-row:1 / span 2;justify-self:end}
.hp-show__list{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 clamp(16px,1.8vw,24px)}
.hp-show__list:not(:has(>li:nth-child(3))){grid-template-columns:repeat(2,minmax(0,1fr))}
/* three cards start together when the row comes into view: let them follow one another */
.hp-show__list>.hp-demo:nth-child(3n+2){--hp-demo-lead:.5s}
.hp-show__list>.hp-demo:nth-child(3n){--hp-demo-lead:.7s}
/* on the subgrid a short title or prompt leaves room in its row: the prompt sits on the steps, so the room gathers
   in one gap above it instead of two */
@supports (grid-template-rows:subgrid){.hp-demo{grid-row:span 6;grid-template-rows:subgrid;row-gap:0}.hp-demo__prompt{align-self:end}}}
/* beside a hero (.hp-pair, a 7/12 column from 960 px) the block is too narrow for a row: one card under another */
.hp-pair .hp-show__head,.hp-pair .hp-show__list,.hp-pair .hp-show__list:not(:has(>li:nth-child(3))){grid-template-columns:minmax(0,1fr)}
.hp-pair .hp-show__lead{grid-column:1;grid-row:auto;justify-self:start}
.hp-pair .hp-show__list{gap:16px;justify-items:center}
.hp-pair .hp-show__list>.hp-demo{grid-row:auto;grid-template-rows:auto auto auto 1fr auto auto;width:100%;max-width:440px;--hp-demo-lead:.3s}

/* ---- the figure's shared paint. viewBox 0 0 320 200; SVG text holds digits and maths only, every word is HTML */
.hp-demo__svg{display:block;width:100%;height:auto;overflow:visible;fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;font-family:inherit}
.hp-demo__svg *{transform-box:fill-box;transform-origin:50% 50%}
.hp-demo__t{fill:var(--hp-demo-ink);stroke:none;font-size:17px;font-weight:800;text-anchor:middle;font-variant-numeric:lining-nums tabular-nums}
.hp-demo__t--q{fill:var(--hp-demo-ink-2);font-size:15px;font-weight:700}
.hp-demo__t--p{font-size:15px}
.hp-demo__t--l{font-size:19px}
.hp-demo__t--xl{font-size:22px}
.hp-demo__t--tile{font-size:23px}
.hp-demo__t--c{fill:var(--hp-demo-c)}

/* ---- the timeline. Rest styles first: each of them is the solved picture */
.hp-demo--b0{--hp-demo-b:0;--hp-demo-o:0}.hp-demo--b1{--hp-demo-b:1;--hp-demo-o:0}.hp-demo--b2{--hp-demo-b:2;--hp-demo-o:0}
.hp-demo--b3{--hp-demo-b:3;--hp-demo-o:0}.hp-demo--b4{--hp-demo-b:4;--hp-demo-o:0}.hp-demo--b5{--hp-demo-b:5;--hp-demo-o:0}
.hp-demo--end{--hp-demo-b:var(--hp-demo-end);--hp-demo-o:0}
.hp-demo--o1{--hp-demo-o:.1}.hp-demo--o2{--hp-demo-o:.2}.hp-demo--o3{--hp-demo-o:.3}.hp-demo--o4{--hp-demo-o:.4}.hp-demo--o5{--hp-demo-o:.5}
.hp-demo--o6{--hp-demo-o:.6}.hp-demo--o7{--hp-demo-o:.7}.hp-demo--o8{--hp-demo-o:.8}.hp-demo--o9{--hp-demo-o:.9}
.hp-demo__seq>:nth-child(2){--hp-demo-n:1}.hp-demo__seq>:nth-child(3){--hp-demo-n:2}.hp-demo__seq>:nth-child(4){--hp-demo-n:3}
.hp-demo__seq>:nth-child(5){--hp-demo-n:4}.hp-demo__seq>:nth-child(6){--hp-demo-n:5}.hp-demo__seq>:nth-child(7){--hp-demo-n:6}
.hp-demo__seq>:nth-child(8){--hp-demo-n:7}.hp-demo__seq>:nth-child(9){--hp-demo-n:8}.hp-demo__seq>:nth-child(10){--hp-demo-n:9}
.hp-demo__seq--fast{--hp-demo-gap:.06s}.hp-demo__seq--slow{--hp-demo-gap:.2s}
/* the HTML track times itself: prompt = beat 0, step k = beat k, the answer = the end beat. No beat class in it */
.hp-demo__step:nth-child(1){--hp-demo-b:1}.hp-demo__step:nth-child(2){--hp-demo-b:2}.hp-demo__step:nth-child(3){--hp-demo-b:3}
.hp-demo__step:nth-child(4){--hp-demo-b:4}.hp-demo__step:nth-child(5){--hp-demo-b:5}
.hp-demo__answer{--hp-demo-b:var(--hp-demo-end)}
.hp-demo__text{--hp-demo-o:.06}
/* each motion's own length and easing, and the rests that are not the plain element */
.hp-demo__fade,.hp-demo__rise,.hp-demo__text{--hp-demo-len:.5s}
.hp-demo__pop{--hp-demo-len:.5s;--hp-demo-ease:cubic-bezier(.34,1.56,.64,1)}
.hp-demo__draw{--hp-demo-len:.6s;stroke-dasharray:1 1}
.hp-demo__grow,.hp-demo__drop{--hp-demo-len:.45s}
.hp-demo__svg .hp-demo__grow{transform-origin:0 50%}
.hp-demo__svg .hp-demo__drop{transform-origin:50% 0}
.hp-demo__fall{--hp-demo-len:.55s;--hp-demo-ease:cubic-bezier(.3,1.35,.6,1)}
.hp-demo__slide,.hp-demo__hop{--hp-demo-len:.45s}
.hp-demo__gone{--hp-demo-len:.6s;opacity:.65;transform:translateY(-6px)}
.hp-demo__halo{--hp-demo-len:.8s;--hp-demo-ease:ease-in-out;stroke-width:0}
.hp-demo__flash{--hp-demo-len:.8s;--hp-demo-ease:ease-in-out}
.hp-demo__value{--hp-demo-len:.6s;--hp-demo-ease:cubic-bezier(.3,1.4,.55,1)}

/* playing: one rule gives every timed element its clock, one rule per motion names its keyframes */
:is(.hp-demo--play,.hp-preview .hp-demo) :is(.hp-demo__fade,.hp-demo__rise,.hp-demo__pop,.hp-demo__draw,.hp-demo__grow,.hp-demo__drop,
.hp-demo__fall,.hp-demo__slide,.hp-demo__hop,.hp-demo__gone,.hp-demo__halo,.hp-demo__flash,.hp-demo__text,.hp-demo__value){
animation-duration:calc(var(--hp-demo-len) * var(--hp-demo-speed));
animation-delay:calc((var(--hp-demo-lead) + (var(--hp-demo-b) + var(--hp-demo-o)) * var(--hp-demo-slot) + var(--hp-demo-n) * var(--hp-demo-gap)) * var(--hp-demo-speed));
animation-timing-function:var(--hp-demo-ease,var(--hp-ease));animation-fill-mode:both;animation-iteration-count:1}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__fade{animation-name:hp-demo-fade}
:is(.hp-demo--play,.hp-preview .hp-demo) :is(.hp-demo__rise,.hp-demo__text){animation-name:hp-demo-rise}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__pop{animation-name:hp-demo-pop}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__draw{animation-name:hp-demo-draw}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__grow{animation-name:hp-demo-grow}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__drop{animation-name:hp-demo-drop}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__fall{animation-name:hp-demo-fall}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__slide{animation-name:hp-demo-slide}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__hop{animation-name:hp-demo-hop}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__gone{animation-name:hp-demo-gone}
:is(.hp-demo--play,.hp-preview .hp-demo) :is(.hp-demo__halo,.hp-demo__flash){animation-name:hp-demo-swell}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__value{animation-name:hp-demo-land}
/* the worksheet: a step's disc pops onto its ring; the words of earlier steps (and the prompt) dim while a later step
   is written, so the current one reads strongest, and all come back as the answer lands; the box turns "correct" and
   the underline is drawn under the value */
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__step::after{animation:hp-demo-pop calc(.45s * var(--hp-demo-speed)) cubic-bezier(.34,1.56,.64,1)
calc((var(--hp-demo-lead) + var(--hp-demo-b) * var(--hp-demo-slot)) * var(--hp-demo-speed)) 1 both}
/* (the dimming sits on .hp-demo__dim, a wrapper that is never hidden: a language span comes back from display:none
   when the visitor switches МН/EN, and an animation on it would start again from its own zero) */
:is(.hp-demo--play,.hp-preview .hp-demo) :is(.hp-demo__prompt,.hp-demo__text)>.hp-demo__dim{animation:hp-demo-recede
calc((var(--hp-demo-end) - var(--hp-demo-b) - 1) * var(--hp-demo-slot) * var(--hp-demo-speed)) linear
calc((var(--hp-demo-lead) + (var(--hp-demo-b) + 1) * var(--hp-demo-slot)) * var(--hp-demo-speed)) 1 both}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__answer::before{animation:hp-demo-fade calc(.5s * var(--hp-demo-speed)) var(--hp-ease)
calc((var(--hp-demo-lead) + (var(--hp-demo-b) + .15) * var(--hp-demo-slot)) * var(--hp-demo-speed)) 1 both}
:is(.hp-demo--play,.hp-preview .hp-demo) .hp-demo__value::after{animation:hp-demo-grow calc(.45s * var(--hp-demo-speed)) var(--hp-ease)
calc((var(--hp-demo-lead) + (var(--hp-demo-b) + .25) * var(--hp-demo-slot)) * var(--hp-demo-speed)) 1 both}
@keyframes hp-demo-fade{from{opacity:0}}
@keyframes hp-demo-rise{from{opacity:0;transform:translateY(8px)}}
@keyframes hp-demo-pop{from{opacity:0;transform:scale(.3)}}
@keyframes hp-demo-draw{from{opacity:0;stroke-dashoffset:1}8%{opacity:1}}
@keyframes hp-demo-grow{from{transform:scaleX(0)}}
@keyframes hp-demo-drop{from{transform:scaleY(0)}}
@keyframes hp-demo-fall{from{opacity:0;transform:translateY(-26px)}}
@keyframes hp-demo-slide{from{transform:translate(var(--hp-demo-dx),var(--hp-demo-dy))}}
@keyframes hp-demo-hop{from{transform:none;animation-timing-function:cubic-bezier(.33,.67,.67,1)}
50%{transform:translateY(var(--hp-demo-dy));animation-timing-function:cubic-bezier(.33,0,.67,.33)}}
@keyframes hp-demo-gone{from{opacity:1;transform:none}}
@keyframes hp-demo-swell{50%{stroke-width:7px}}
@keyframes hp-demo-land{from{opacity:0;transform:translateY(10px) scale(.85)}}
@keyframes hp-demo-recede{0%,100%{opacity:1}10%,90%{opacity:.6}}

/* ---- more contrast, forced colours (frontpage.css lists only its own boxes) */
@media (prefers-contrast:more){
.hp-demo{border-color:var(--hp-edge)}
.hp-show{--hp-demo-dots:transparent;--hp-demo-blank:var(--hp-edge)}}
@media (forced-colors:active){
.hp-demo,.hp-demo__answer{border:1px solid CanvasText}
.hp-show{--hp-demo-c:Highlight;--hp-demo-on-c:HighlightText;--hp-demo-ok:Highlight;--hp-demo-cool:LinkText;--hp-demo-warm:Highlight;
--hp-demo-cool-t:LinkText;--hp-demo-warm-t:Highlight;--hp-demo-ink:CanvasText;--hp-demo-ink-2:CanvasText;--hp-demo-quiet:CanvasText;
--hp-demo-paper:Canvas;--hp-demo-tile:Canvas;--hp-demo-stage:Canvas;--hp-demo-dots:transparent;--hp-demo-blank:GrayText}
.hp-demo__svg,.hp-demo__tick,.hp-demo__step::after,.hp-demo__value::after{forced-color-adjust:none}
.hp-demo__answer::before{display:none}}
