/*! learn.pranaymahendrakar.com — animate.css
 *  Styles for assets/js/animate.js. Uses site.css tokens only, so light,
 *  dark and the explicit theme toggle all work without extra rules.
 *  Every selector here targets markup animate.js injects (or classes it
 *  adds), so with the script absent this file changes nothing.
 */

/* ============================================================ scene player */
.anim {
  --a-c0: var(--accent);
  --a-c1: var(--green);
  --a-c2: var(--amber);
  margin: 1.75rem 0 2rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 80% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--bg-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease, transform .5s ease;
}
.anim.is-ready { opacity: 1; transform: none; }

.anim__head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem;
  padding: .9rem 1.1rem .4rem;
}
.anim__badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--on-accent); background: var(--accent);
  padding: .2rem .6rem; border-radius: var(--r-pill);
}
.anim__badge::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: currentColor; animation: anim-blink 1.6s ease-in-out infinite;
}
.anim__title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.anim__sub { flex-basis: 100%; font-size: var(--fs-sm); color: var(--ink-soft); }

.anim__stage { padding: .25rem .75rem 0; }
.anim__svg { display: block; width: 100%; height: auto; max-height: 420px; overflow: visible; stroke: none; fill: var(--ink); }
.anim__svg text { stroke: none; }

.anim__cap {
  min-height: 3.4em; margin: .25rem 1.1rem .5rem !important;
  font-size: .975rem; line-height: 1.55; color: var(--ink);
  border-left: 3px solid var(--accent); padding-left: .75rem;
  animation: anim-cap .45s ease;
}
.anim__cap b { color: var(--accent); }

.anim__params { display: grid; gap: .4rem; padding: 0 1.1rem .5rem; }
.anim__param {
  display: grid; grid-template-columns: auto 1fr 3.2rem; align-items: center; gap: .75rem;
  font-size: var(--fs-sm); color: var(--ink-soft);
  background: var(--bg); border: 1px solid var(--rule); border-radius: var(--r);
  padding: .45rem .75rem;
}
.anim__plabel { font-weight: 600; color: var(--ink); }
.anim__param input[type=range] { width: 100%; accent-color: var(--accent); }
.anim__pval { font-family: var(--font-mono); font-weight: 700; color: var(--accent); text-align: right; }

.anim__ctrl {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .6rem 1.1rem .8rem; border-top: 1px solid var(--rule);
  background: var(--bg);
}
.anim__btn {
  display: inline-grid; place-items: center;
  min-width: 2.25rem; height: 2.25rem; padding: 0 .55rem;
  border: 1px solid var(--rule-strong); border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--ink); font: inherit; font-size: .9rem;
  cursor: pointer; transition: background var(--speed), transform var(--speed), border-color var(--speed);
}
.anim__btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--accent-line); }
.anim__btn:active:not(:disabled) { transform: scale(.94); }
.anim__btn:disabled { opacity: .4; cursor: default; }
.anim__btn:focus-visible, .anim__dot:focus-visible { outline: var(--ring); outline-offset: var(--ring-off); }
.anim__btn--play {
  min-width: 2.75rem; height: 2.75rem; font-size: 1rem;
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-line);
}
.anim__btn--play:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.anim:not(.is-playing) .anim__btn--play { animation: anim-ring 2.2s ease-out infinite; }
.anim__btn--spd { font-family: var(--font-mono); font-size: var(--fs-xs); margin-left: auto; }
.anim__dots { display: flex; gap: .3rem; flex-wrap: wrap; margin-left: .35rem; }
.anim__dot {
  width: .7rem; height: .7rem; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--edge); background: transparent; cursor: pointer;
  transition: background var(--speed), transform var(--speed), border-color var(--speed);
}
.anim__dot.is-done { background: var(--accent-line); border-color: var(--accent-line); }
.anim__dot.is-now { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.anim__count { font-size: var(--fs-xs); color: var(--ink-faint); font-family: var(--font-mono); margin-left: .25rem; }

/* ---- SVG vocabulary ---------------------------------------------- */
.anim__svg * { transition: opacity .55s ease, transform .7s cubic-bezier(.3,.7,.2,1), fill .4s, stroke .4s, stroke-width .4s, fill-opacity .4s; }
.anim--fast *, .anim--fast { transition: none !important; animation: none !important; }
.anim__svg .is-off { opacity: 0; pointer-events: none; }

.a-t   { font: 500 14px/1 var(--font-sans); fill: var(--ink); }
.a-ts  { font: 500 12px/1 var(--font-sans); fill: var(--ink); }
.a-tl  { font: 700 17px/1 var(--font-sans); fill: var(--ink); }
.a-b   { font-weight: 700; }
.a-mono { font-family: var(--font-mono); }
.a-dim { fill: var(--ink-faint); }
.a-acc-t { fill: var(--accent); }
.a-red-t { fill: var(--red); }
.a-green-t { fill: var(--green); }
.a-amber-t { fill: var(--amber); }

.a-box { fill: var(--bg); stroke: var(--rule-strong); stroke-width: 1.5; }
.a-box--acc { fill: var(--accent-soft); stroke: var(--accent-line); }
.a-box--green { fill: var(--green-soft); stroke: var(--green); }
.a-panel { fill: var(--bg); stroke: var(--rule); }
.a-node, .a-chip, .a-pt, .a-cen, .a-ball, .a-star { transform-box: fill-box; transform-origin: center; }
.a-node.is-hot .a-box, .a-chip.is-hot .a-box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--accent-line)); }
.a-node.is-q .a-box { fill: var(--accent); stroke: var(--accent); }
.a-node.is-q text { fill: var(--on-accent); font-weight: 700; }
.a-node.is-glow .a-kv { stroke: var(--green); stroke-width: 2; }
.a-node.is-pop, .a-pt.is-pop, .a-cen.is-pop, text.is-pop { animation: anim-pop .6s ease; }
.a-node.is-alarm .a-box { fill: var(--red-soft); stroke: var(--red); stroke-width: 2.5; animation: anim-alarm 1s ease-in-out infinite; }
.a-leaf--ok .a-box { fill: var(--green-soft); stroke: var(--green); }
.a-leaf--bad .a-box { fill: var(--red-soft); stroke: var(--red); }
.a-click { cursor: pointer; }
.anim.is-interactive .a-click:hover .a-box { stroke: var(--accent); }

.a-ln { stroke: var(--edge); stroke-width: 1.5; fill: none; }
.a-ln--acc { stroke: var(--accent); stroke-width: 2; }
.a-ln--red { stroke: var(--red); stroke-width: 2.5; }
.a-ln--green { stroke: var(--green); stroke-width: 2.5; }
.a-ln--dash { stroke-dasharray: 5 5; }
.a-ln.is-path { stroke: var(--accent); stroke-width: 3; }
.a-mk { fill: var(--edge); }
.a-grid { stroke: var(--rule); stroke-width: 1; }
.a-track { fill: var(--bg-sunken); }
.a-bar { transform-box: fill-box; transform-origin: left center; }
.a-fill-acc { fill: var(--accent); }
.a-fill-red { fill: var(--red); }
.a-fill-green { fill: var(--green); }
.a-fill-amber { fill: var(--amber); }
.a-kv { fill: var(--green-soft); stroke: var(--green); stroke-width: 1; }
.a-arc { fill: none; stroke: var(--accent); stroke-linecap: round; animation: anim-draw .9s ease both; stroke-dasharray: 600; }
.a-hull { fill: var(--accent-soft); fill-opacity: .55; stroke: var(--accent-line); stroke-dasharray: 6 5; }
.a-pt circle { stroke: var(--bg); stroke-width: 2; }
.a-c0 circle, circle.a-c0, .a-c0 path { fill: var(--a-c0); }
.a-c1 circle, circle.a-c1, .a-c1 path { fill: var(--a-c1); }
.a-c2 circle, circle.a-c2, .a-c2 path { fill: var(--a-c2); }
.a-q circle { fill: var(--red); animation: anim-throb 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.a-chunk rect { fill: var(--bg-soft); stroke: var(--rule-strong); }
.a-chunk { transform-box: fill-box; transform-origin: center; }
.a-chunk.is-dim { opacity: .45; }
.a-chunk.is-hot rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.a-packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.a-edge { stroke: var(--rule-strong); stroke-width: 1; }
.a-edge.is-live.a-edge--pos, .a-edge.is-shimmer.a-edge--pos { stroke: var(--green); }
.a-edge.is-live.a-edge--neg, .a-edge.is-shimmer.a-edge--neg { stroke: var(--red); }
.a-edge.is-live { stroke-dasharray: 6 6; animation: anim-flow .6s linear infinite; }
.a-edge.is-shimmer { opacity: .5; animation: anim-shimmer 2.4s ease-in-out infinite; }
.a-neuron__bg { fill: var(--bg); stroke: var(--accent-line); stroke-width: 2; }
.a-neuron__fill { fill: var(--accent); }
.a-neuron .a-ts { fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.a-neuron { transform-box: fill-box; transform-origin: center; }
.a-curve { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1.4s ease !important; }
.a-curve--fit { stroke: var(--accent); transition: d .6s ease, opacity .5s !important; }
.a-curve--red { stroke: var(--red); }
.a-ball circle { fill: var(--amber); stroke: var(--bg); stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.a-trail { fill: var(--amber); opacity: .45; }
.a-dot { stroke: var(--bg); stroke-width: 1.5; fill: var(--edge); }
.a-dot--val { fill: var(--amber); }
.a-dot--ok { fill: var(--green); }
.a-dot--bad { fill: var(--red); }
.a-link { stroke-width: 1.2; opacity: .5; }
.a-link.a-c0 { stroke: var(--a-c0); } .a-link.a-c1 { stroke: var(--a-c1); } .a-link.a-c2 { stroke: var(--a-c2); }
.a-cen path { stroke: var(--bg); stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.a-px { fill: var(--term-bg); stroke: var(--rule); }
.a-px--on { fill: #f4f6f9; }
.a-px-t { fill: var(--term-dim); }
.a-px--on + .a-px-t { fill: #57606a; }
.a-win { fill: var(--accent); fill-opacity: .18; stroke: var(--accent); stroke-width: 3; }
.a-k { fill: var(--bg); stroke: var(--rule-strong); }
.a-k--pos { fill: var(--green-soft); stroke: var(--green); }
.a-k--neg { fill: var(--red-soft); stroke: var(--red); }
.a-out { fill: var(--accent); fill-opacity: .05; stroke: var(--rule-strong); }
.a-out.is-set { stroke: var(--accent-line); }
.a-node.is-glow .a-out.is-set { filter: drop-shadow(0 0 5px var(--accent-line)); }
.a-split { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 7 5; }
.a-region { opacity: .14; }
.a-region--red { fill: var(--red); }
.a-region--green { fill: var(--green); }
.a-star path { fill: var(--amber); stroke: var(--bg); stroke-width: 1.5; animation: anim-throb 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.a-orbit { fill: none; stroke: var(--accent-line); stroke-width: 2; stroke-dasharray: 4 8; animation: anim-flow 1.2s linear infinite; }
text.is-pulse { animation: anim-pop .8s ease 2; }

/* ---- set 2 -------------------------------------------------------- */
.anim__svg .is-dim { opacity: .28; }
.a-ln--thick { stroke-width: 3; }
.a-ln.is-faded { opacity: .25; }
.a-dot--idle { fill: var(--bg-sunken); stroke: var(--rule-strong); }
.a-dot--conv { fill: var(--accent); }
.a-dot--no { fill: var(--rule-strong); }
.a-dot.is-flag { stroke: var(--ink); stroke-width: 2.5; }
.a-ci__ln { stroke-width: 5; stroke-linecap: round; transition: none; }
.a-ci--a .a-ci__ln { stroke: var(--edge); } .a-ci--a circle { fill: var(--edge); }
.a-ci--b .a-ci__ln { stroke: var(--accent); } .a-ci--b circle { fill: var(--accent); }
.a-ci circle { stroke: var(--bg); stroke-width: 2; }
.a-pix { stroke: none; transition: fill .45s ease !important; }
.a-frame { fill: none; stroke: var(--rule-strong); stroke-width: 2; }
.a-cell { fill: var(--bg); stroke: var(--rule); }
.a-cell--pit { fill: var(--red-soft); stroke: var(--red); }
.a-cell--goal { fill: var(--amber-soft); stroke: var(--amber); }
.a-heat { fill: var(--accent); }
/* Deep learning scenes */
.a-code--s { font-size: 10px; }
.a-py .a-edge--pos { stroke: var(--green); opacity: .45; }
.a-py .a-edge--neg { stroke: var(--red); opacity: .45; }
.a-py .a-edge.is-live { opacity: 1; stroke-width: 2.5; }
.anim__svg text.a-halo { paint-order: stroke; stroke: var(--bg-soft); stroke-width: 3px; }
.a-vbar { transform-box: fill-box; transform-origin: center bottom; }
.a-pix--on { fill: var(--accent); fill-opacity: .85; }
.a-pix--off { fill: var(--bg-sunken); stroke: var(--rule); }
.anim__svg text.a-pix-t--on { fill: var(--on-accent); }
.a-win { fill: none; stroke: var(--amber); stroke-width: 3; }
.a-memline { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; opacity: .55; }
.a-tap { fill: var(--bg); stroke: var(--rule-strong); stroke-width: 2; }
.a-tap.is-open { fill: var(--green-soft); stroke: var(--green); stroke-width: 2.5; }
.a-tap.is-shut { fill: var(--red-soft); stroke: var(--red); stroke-width: 2.5; }
.a-arc2 { fill: none; stroke: var(--accent); stroke-linecap: round; opacity: .7; }
.a-cellbox { fill: var(--bg); stroke: var(--rule); }
.a-cellbox.is-masked { fill: var(--bg-sunken); stroke-dasharray: 3 3; }
.a-neck { stroke: var(--accent); stroke-width: 3; }
.a-dist { stroke-width: 2; }
.a-dist--real { fill: var(--green-soft); stroke: var(--green); }
.a-dist--fake { fill: var(--amber); fill-opacity: .35; stroke: var(--amber); transition: d .8s ease, opacity .5s !important; }
/* Machine learning scenes */
.a-dot--q { fill: var(--accent); }
.a-dot--c0 { fill: var(--a-c0); } .a-dot--c1 { fill: var(--a-c1); } .a-dot--c2 { fill: var(--a-c2); }
path.a-c0 { fill: var(--a-c0); } path.a-c1 { fill: var(--a-c1); } path.a-c2 { fill: var(--a-c2); }
.a-zone { stroke: none; } .a-zone--ok { fill: var(--green); fill-opacity: .1; } .a-zone--warn { fill: var(--amber); fill-opacity: .1; }
.a-pix--wrong { stroke: var(--red); stroke-width: 2.5; }
.a-tower { fill: var(--amber); stroke: var(--bg); stroke-width: 2; }
.a-chip-scam { fill: var(--red-soft); stroke: var(--red); } .a-chip-safe { fill: var(--green-soft); stroke: var(--green); }
.a-sq { fill: var(--accent); fill-opacity: .7; transition: transform .7s cubic-bezier(.3,.7,.2,1), fill .4s !important; }
.a-sq--val { fill: var(--amber); } .a-sq--test { fill: var(--red); fill-opacity: .55; } .a-sq--leak { fill: var(--amber); fill-opacity: 1; stroke: var(--ink); stroke-width: 2; }
.a-lockbox { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 6 4; }
.a-pat { fill: var(--bg); stroke: var(--rule-strong); stroke-width: 2; } .a-pat--sick { fill: var(--red-soft); stroke: var(--red); }
.a-pat--wrong { stroke: var(--amber); stroke-width: 4; }
/* Python for AI scenes */
.a-py text { transform-box: fill-box; transform-origin: center; }
.a-codebg { fill: var(--bg-code); stroke: var(--rule); }
.a-code { font: 500 11px/1 var(--font-mono); fill: var(--ink-soft); white-space: pre; }
.a-code.is-cur { fill: var(--ink); font-weight: 700; }
.a-code.a-green-t { fill: var(--green); } .a-code.a-red-t { fill: var(--red); }
.a-hl { fill: var(--accent-soft); stroke: var(--accent-line); }
.a-tag .a-box { fill: var(--amber-soft); stroke: var(--amber); }
.a-node.is-gone, g.is-gone { opacity: .35; }
.a-parcel .a-box { stroke-dasharray: 4 3; }
.a-node.is-ok .a-box, .a-chip.is-ok .a-box { fill: var(--green-soft); stroke: var(--green); }
.a-node.is-bad .a-box { fill: var(--red-soft); stroke: var(--red); }
.a-dia { fill: var(--bg); stroke: var(--rule-strong); stroke-width: 1.5; }
.a-dia.is-yes { fill: var(--green-soft); stroke: var(--green); stroke-width: 2.5; }
.a-dia.is-no { fill: var(--red-soft); stroke: var(--red); stroke-width: 2.5; }
.a-water { fill: var(--accent); fill-opacity: .35; transform-box: fill-box; transform-origin: center bottom; }
.a-sheet { fill: var(--bg); stroke: var(--rule-strong); stroke-dasharray: 6 4; }
.a-plot { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; transition: stroke-dashoffset 1.4s ease, opacity .5s !important; }
.a-arrowglyph { fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.a-bot { transform-box: fill-box; transform-origin: center; }
.a-bot circle:first-child { fill: var(--amber); stroke: var(--bg); stroke-width: 2.5; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
.a-bot__eye { fill: #1b1f24; }
.a-bot.is-alarm circle:first-child { fill: var(--red); animation: anim-pop .5s ease 2; }
.a-bot.is-pop { animation: anim-pop .6s ease 2; }
.a-season { fill: var(--amber); fill-opacity: .1; }
.a-band { fill: var(--accent); fill-opacity: .16; stroke: none; }
.a-curve--fc { stroke-dasharray: 7 6; }
.a-curve--thin { stroke-width: 1.5; }
.a-ent { stroke-width: 1.5; }
.a-ent--per { fill: var(--accent-soft); stroke: var(--accent); }
.a-ent--loc { fill: var(--green-soft); stroke: var(--green); }
.a-ent--date { fill: var(--amber-soft); stroke: var(--amber); }
.a-ent--org { fill: var(--red-soft); stroke: var(--red); }
.a-ent-t--per { fill: var(--accent); } .a-ent-t--loc { fill: var(--green); } .a-ent-t--date { fill: var(--amber); } .a-ent-t--org { fill: var(--red); }
.a-scan { fill: var(--accent); fill-opacity: .14; stroke: var(--accent); stroke-width: 2; }
.a-node.is-struck .a-box { opacity: .35; }
.a-node.is-struck text { text-decoration: line-through; fill: var(--ink-faint); }
.a-gauge { fill: none; stroke-width: 16; stroke-linecap: round; }
.a-gauge--neg { stroke: var(--red); opacity: .75; }
.a-gauge--pos { stroke: var(--green); opacity: .75; }
.a-needle line { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.a-needle circle { fill: var(--ink); }
.a-needle { transition: transform .9s cubic-bezier(.3,1.4,.5,1) !important; }
.a-tick { stroke: var(--accent); stroke-width: 1.5; }
.a-tick--faint { stroke: var(--rule-strong); stroke-width: 1; }
.a-err { stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.a-spec { fill: var(--accent); stroke: none; }
.a-flagzone { fill: var(--accent); fill-opacity: .08; transition: x .5s, width .5s !important; }
.a-thr { transform-box: view-box; }
.a-cm { fill: var(--bg); stroke: var(--rule-strong); stroke-width: 1.5; }
.a-cm.is-hot { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.a-guard { fill: var(--amber-soft); stroke: var(--amber); }

/* ============================================================ diagrams */
.code-block.dg { position: relative; }
.dg__btn {
  position: absolute; top: .45rem; right: .45rem; z-index: 2;
  font: 600 var(--fs-xs)/1 var(--font-sans);
  padding: .4rem .65rem; border-radius: var(--r-pill);
  border: 1px solid var(--accent-line); background: var(--bg); color: var(--accent);
  cursor: pointer; opacity: .85; transition: opacity var(--speed), background var(--speed);
}
.dg__btn:hover, .dg__btn:focus-visible { opacity: 1; background: var(--accent-soft); }
.dg__btn:focus-visible { outline: var(--ring); outline-offset: var(--ring-off); }
.dg__ln { display: inline-block; min-width: 1px; border-radius: 3px; }
.dg--play .dg__ln { visibility: hidden; }
.dg--play .dg__ln--in { visibility: visible; animation: dg-type .38s steps(24, end) both; }
.dg__ln--now { background: var(--accent-soft); box-shadow: -4px 0 0 var(--accent-soft), 4px 0 0 var(--accent-soft); }
.dg__arrow { color: var(--accent); font-weight: 700; }
.dg--done .dg__arrow { display: inline-block; animation: dg-arrow 1.1s ease-in-out 3; }

/* ============================================================ flashcards */
.fc {
  position: relative; margin: 1.25rem 0 2rem; padding: 1rem;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft) 55%);
}
.fc__head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-bottom: .85rem; }
.fc__title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.fc__title::before { content: "🧠 "; }
.fc__hint { font-size: var(--fs-sm); color: var(--ink-soft); flex: 1 1 14rem; }
.fc__meter { width: 7rem; height: .5rem; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.fc__meter-fill { display: block; height: 100%; background: var(--green); transform: scaleX(0); transform-origin: left; transition: transform .5s cubic-bezier(.3,.7,.2,1); }
.fc__prog { font: 700 var(--fs-xs) var(--font-mono); color: var(--ink-soft); }
.fc__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.fc__card { perspective: 900px; min-height: 9.5rem; cursor: pointer; border-radius: var(--r); outline: none; }
.fc__card:focus-visible .fc__face { outline: var(--ring); outline-offset: var(--ring-off); }
.fc__inner { position: relative; height: 100%; min-height: inherit; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.fc__card.is-flipped .fc__inner, .fc__card.is-ok .fc__inner { transform: rotateY(180deg); }
.fc__face {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: .5rem;
  padding: .85rem .95rem; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--rule-strong); box-shadow: var(--shadow-sm);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-size: .95rem; line-height: 1.5; color: var(--ink); overflow: auto;
}
.fc__card:hover .fc__front { border-color: var(--accent-line); box-shadow: var(--shadow); }
.fc__back { transform: rotateY(180deg); border-color: var(--accent-line); background: var(--bg); }
.fc__back strong { color: var(--accent); background: var(--mark-bg); color: var(--mark-ink); padding: 0 .2em; border-radius: 3px; }
.fc__kind { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.fc__body { flex: 1; }
.fc__body > * { margin: 0; }
.fc__tap { font-size: var(--fs-xs); color: var(--ink-faint); align-self: flex-end; }
.fc__blank {
  display: inline-block; height: 1.05em; vertical-align: -.15em;
  border-bottom: 2px dashed var(--accent); background: var(--accent-soft); border-radius: 3px 3px 0 0;
}
.fc__acts { display: flex; gap: .45rem; justify-content: flex-end; }
.fc__acts button {
  font: 600 var(--fs-sm) var(--font-sans); padding: .35rem .75rem; border-radius: var(--r-pill);
  cursor: pointer; border: 1px solid var(--rule-strong); background: var(--bg-soft); color: var(--ink);
}
.fc__acts .fc__yes { background: var(--green); border-color: var(--green); color: var(--green-on); }
.fc__acts button:focus-visible { outline: var(--ring); outline-offset: var(--ring-off); }
.fc__card.is-ok .fc__back { border-color: var(--green); background: var(--green-soft); }
.fc__card.is-ok .fc__acts { display: none; }
.fc__card.is-ok .fc__back::after { content: "✓"; position: absolute; top: .45rem; right: .65rem; font-weight: 800; color: var(--green); }
.fc__card.is-shake { animation: fc-shake .5s ease; }
.fc__win {
  margin-top: .9rem; padding: .7rem .9rem; border-radius: var(--r);
  background: var(--green-soft); border: 1px solid var(--green); color: var(--ink);
  animation: anim-pop .6s ease;
}
.fc__win strong { color: var(--green); }
.fc__win::before { content: "🎉 "; }
.fc__burst { position: absolute; left: 50%; bottom: 3rem; width: 0; height: 0; pointer-events: none; }
.fc__burst i {
  position: absolute; width: .55rem; height: .8rem; border-radius: 2px;
  background: var(--accent); animation: fc-burst 1.6s cubic-bezier(.2,.7,.3,1) forwards;
}
.fc__burst i.c1 { background: var(--green); }
.fc__burst i.c2 { background: var(--amber); }
.fc__burst i.c3 { background: var(--red); }
.fc__burst i.c4 { background: #e2b714; }
.fact--mastered span { color: var(--green); font-weight: 700; }

/* ============================================================ progress + reveal */
.rprog { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; }
.rprog span {
  display: block; height: 100%; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--green));
}
:root[data-present] .rprog { display: none; }
.rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.rv.rv--in { opacity: 1; transform: none; }

/* ============================================================ keyframes */
@keyframes anim-blink { 50% { opacity: .35; } }
@keyframes anim-cap { from { opacity: 0; transform: translateY(4px); } }
@keyframes anim-ring { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes anim-pop { 40% { transform: scale(1.12); } }
@keyframes anim-alarm { 50% { filter: drop-shadow(0 0 8px var(--red)); } }
@keyframes anim-draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
@keyframes anim-flow { to { stroke-dashoffset: -12; } }
@keyframes anim-shimmer { 50% { opacity: .9; } }
@keyframes anim-throb { 50% { transform: scale(1.25); } }
@keyframes dg-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes dg-arrow { 50% { transform: translateX(3px); text-shadow: 0 0 8px var(--accent-line); } }
@keyframes fc-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes fc-burst {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(calc(var(--x) * 260px), calc(var(--y) * 220px + 120px)) rotate(var(--r)); opacity: 0; }
}

@media (max-width: 560px) {
  .anim__head, .anim__ctrl { padding-left: .8rem; padding-right: .8rem; }
  .anim__cap { margin-left: .8rem !important; margin-right: .8rem !important; font-size: .925rem; }
  .anim__stage { padding: 0 .25rem; }
  .anim__dots { order: 9; flex-basis: 100%; margin: .2rem 0 0; }
  .anim__param { grid-template-columns: 1fr 3rem; }
  .anim__plabel { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .anim, .anim *, .fc *, .dg__ln, .dg__arrow, .rv { transition: none !important; animation: none !important; }
  .anim { opacity: 1; transform: none; }
}
@media print {
  .anim__ctrl, .anim__params, .dg__btn, .rprog { display: none !important; }
  .fc { display: none; }
}
