/* PD Slides · motion kit (the "g" kit, ported from the Canine Conference 2026 deck, refine seat g + fx.js, 2026-11-17).
   Eye-drawing motion for the moment Partner is talking about a part of the page: builds that walk, a mark that swipes under
   the key phrase, numbers that count and land, a stamp on the verdict, soft light behind. Linked after pd-slides.css; drawn
   by core/js/kit-motion.js (word splitting, number prep, the shader light and the network canvas).

   Every rule acts only on an element that carries a kit class, so a deck that uses none of them renders unchanged.
   Every loop pauses under body.calm (press M) and stops under prefers-reduced-motion. ?static (render.py, the PDF) and print
   show every final state. Backgrounds stay inside the 1920x1080 slide, never in the ridge's room below it.
   Docs, one line and one markup example per effect: presentation-system/COMPONENTS.md, "Motion kit".
   Preview: presentation-system/_preview-motion-kit.html */

/* nth-child order for the helpers that step through their children (kit-motion.js also sets --g-n for any count) */
.g-build > :nth-child(1), .g-pop > :nth-child(1), .g-strip > :nth-child(1), .g-collage > :nth-child(1), .g-chips > :nth-child(1) { --g-n: 0; }
.g-build > :nth-child(2), .g-pop > :nth-child(2), .g-strip > :nth-child(2), .g-collage > :nth-child(2), .g-chips > :nth-child(2) { --g-n: 1; }
.g-build > :nth-child(3), .g-pop > :nth-child(3), .g-strip > :nth-child(3), .g-collage > :nth-child(3), .g-chips > :nth-child(3) { --g-n: 2; }
.g-build > :nth-child(4), .g-pop > :nth-child(4), .g-strip > :nth-child(4), .g-collage > :nth-child(4), .g-chips > :nth-child(4) { --g-n: 3; }
.g-build > :nth-child(5), .g-pop > :nth-child(5), .g-strip > :nth-child(5), .g-collage > :nth-child(5), .g-chips > :nth-child(5) { --g-n: 4; }
.g-build > :nth-child(6), .g-pop > :nth-child(6), .g-strip > :nth-child(6), .g-collage > :nth-child(6), .g-chips > :nth-child(6) { --g-n: 5; }
.g-build > :nth-child(7), .g-pop > :nth-child(7), .g-strip > :nth-child(7), .g-chips > :nth-child(7) { --g-n: 6; }
.g-build > :nth-child(8), .g-pop > :nth-child(8), .g-strip > :nth-child(8), .g-chips > :nth-child(8) { --g-n: 7; }
.g-build > :nth-child(9), .g-pop > :nth-child(9), .g-chips > :nth-child(9) { --g-n: 8; }
.g-build > :nth-child(10), .g-pop > :nth-child(10), .g-chips > :nth-child(10) { --g-n: 9; }
.g-build > :nth-child(11), .g-pop > :nth-child(11) { --g-n: 10; }
.g-build > :nth-child(12), .g-pop > :nth-child(12) { --g-n: 11; }

/* ---------- g-build: the children build in order (their own .in), then a light walks through them, the .boss step lit yellow.
   The walk is a box-shadow ring, so it never moves the layout. --g-step (gap), --g-cycle (repeat), --g-lead (first walk). ---------- */
.g-build { --g-step: .8s; --g-cycle: 5s; --g-lead: 1.8s; --g-rest: 0 0 0 0 transparent;
  --g-on: 0 0 0 4px var(--teal), 0 0 46px rgba(52, 198, 185, .42); --g-boss-on: 0 0 0 5px var(--yellow), 0 0 64px rgba(255, 222, 89, .5); }
.g-build.light, :is(.t-teal, .t-yellow, .t-butter) .g-build:not(.dark) {
  --g-on: 0 0 0 4px var(--navy), 0 0 40px rgba(255, 255, 255, .7); --g-boss-on: 0 0 0 5px var(--navy), 0 0 56px rgba(255, 255, 255, .85); }
:is(.t-light, .t-cream, .t-board, .t-graph, .t-dot) .g-build:not(.dark) {
  --g-on: 0 0 0 4px var(--teal-deep), 0 0 40px rgba(30, 158, 147, .32); --g-boss-on: 0 0 0 5px var(--navy), 0 0 50px rgba(255, 222, 89, .6); }
.g-build:has(> :nth-child(6)) { --g-cycle: 6.4s; }
.g-build:has(> :nth-child(8)) { --g-cycle: 8s; }
.reveal .slides section.present .g-build > :not(.fragment) {
  animation: gWalk var(--g-cycle) ease-in-out infinite; animation-delay: calc(var(--g-n, 0) * var(--g-step) + var(--g-lead));
}
.reveal .slides section.present .g-build > .in:not(.fragment) {
  animation: rise var(--dur-3, .9s) var(--ease-out) both, gWalk var(--g-cycle) ease-in-out infinite;
  animation-delay: calc(var(--i, var(--g-n, 0)) * var(--stagger, 110ms) + 150ms), calc(var(--g-n, 0) * var(--g-step) + var(--g-lead));
}
.reveal .slides section.present .g-build > .fragment.visible { animation: gWalk var(--g-cycle) ease-in-out infinite; animation-delay: calc(var(--g-n, 0) * var(--g-step) + var(--g-lead)); }
.reveal .slides section.present .g-build > .boss:not(.in) { animation-name: gWalkBoss; }
.reveal .slides section.present .g-build > .boss.in:not(.fragment) { animation-name: rise, gWalkBoss; }
@keyframes gWalk { 0%, 24%, 100% { box-shadow: var(--g-rest); } 8% { box-shadow: var(--g-on); } }
@keyframes gWalkBoss { 0%, 24%, 100% { box-shadow: var(--g-rest); scale: 1; } 8% { box-shadow: var(--g-boss-on); scale: 1.03; } }
/* .g-grid .c2 .c3 .c4: on a card grid the light sweeps as a diagonal wave */
.g-build.g-grid { --g-cycle: 5.6s; --g-step: .55s; }
.g-build.g-grid.c2 > :nth-child(2n+2), .g-build.g-grid.c3 > :nth-child(3n+2), .g-build.g-grid.c4 > :nth-child(4n+2) { --g-col: 1; }
.g-build.g-grid.c3 > :nth-child(3n+3), .g-build.g-grid.c4 > :nth-child(4n+3) { --g-col: 2; }
.g-build.g-grid.c4 > :nth-child(4n+4) { --g-col: 3; }
.g-build.g-grid.c2 > :nth-child(n+3), .g-build.g-grid.c3 > :nth-child(n+4), .g-build.g-grid.c4 > :nth-child(n+5) { --g-row: 1; }
.g-build.g-grid.c2 > :nth-child(n+5), .g-build.g-grid.c3 > :nth-child(n+7), .g-build.g-grid.c4 > :nth-child(n+9) { --g-row: 2; }
.g-build.g-grid > * { --g-n: calc(var(--g-col, 0) + var(--g-row, 0)); }
/* .g-chain: a second container that carries the same walk on (--g-prev = children before it) */
.g-build.g-chain { --g-lead: calc(1.8s + var(--g-prev, 4) * var(--g-step)); }
/* .g-line (.v down a column): a dashed signal flows behind the row */
.g-build.g-line { position: relative; isolation: isolate; }
.g-build.g-line::before {
  content: ""; position: absolute; z-index: -1; left: 3%; right: 3%; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(52, 198, 185, .75) 0 14px, transparent 14px 26px); animation: gFlow 1.1s linear infinite;
}
.g-build.g-line.v::before { left: var(--g-line-x, 36px); right: auto; top: 2%; bottom: 2%; width: 4px; height: auto; margin: 0 0 0 -2px;
  background: repeating-linear-gradient(180deg, rgba(52, 198, 185, .75) 0 14px, transparent 14px 26px); animation-name: gFlowV; }
@keyframes gFlow { to { background-position: 26px 0; } }
@keyframes gFlowV { to { background-position: 0 26px; } }

/* ---------- g-chips: a row of pills (what is in this part, the parts of a thing), lit in turn like g-build ---------- */
.g-chips { display: flex; flex-wrap: wrap; gap: 14px 16px; --g-step: .6s; --g-cycle: 5.4s; --g-lead: 1.6s; --g-rest: 0 0 0 0 transparent;
  --g-on: 0 0 0 4px var(--teal), 0 0 36px rgba(52, 198, 185, .4); }
:is(.t-teal, .t-yellow, .t-butter) .g-chips { --g-on: 0 0 0 4px var(--navy), 0 0 34px rgba(255, 255, 255, .7); }
:is(.t-light, .t-cream, .t-board, .t-graph, .t-dot) .g-chips { --g-on: 0 0 0 4px var(--teal-deep), 0 0 30px rgba(30, 158, 147, .3); }
.g-chips > * { font: 700 30px/1 var(--f-body); white-space: nowrap; padding: 14px 26px 15px; border-radius: 999px;
  color: var(--fg, #fff); background: color-mix(in srgb, var(--fg, #fff) 10%, transparent); border: 2px solid color-mix(in srgb, var(--fg, #fff) 22%, transparent); }
.g-chips > .boss { background: var(--navy); color: var(--yellow); border-color: var(--navy); }
.reveal .slides section .g-chips > * { opacity: 0; }
.reveal .slides section.present .g-chips > * {
  animation: gPop .6s var(--ease-pop) both, gWalk var(--g-cycle) ease-in-out infinite;
  animation-delay: calc(var(--g-n, 0) * 90ms + 400ms), calc(var(--g-n, 0) * var(--g-step) + var(--g-lead));
}

/* ---------- g-widget: a small card pops in, then breathes (a slow bob; .shine adds a light sweep), staggered by --i ---------- */
.reveal .slides section .g-widget { opacity: 0; }
.reveal .slides section.present .g-widget {
  animation: gPop .75s cubic-bezier(.2, 1.45, .4, 1) both, gBob 6.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 120ms + 250ms), calc(var(--i, 0) * -1.1s);
}
.reveal .slides section.present .fragment:not(.visible) .g-widget { animation: none; }
.reveal .slides section.present .g-widget.still { animation-name: gPop, none; }
.g-widget.shine { position: relative; overflow: hidden; }
.g-widget.shine::after { content: ""; position: absolute; top: -10%; bottom: -10%; left: -60%; width: 40%; pointer-events: none; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent); transform: skewX(-18deg); opacity: 0; }
.reveal .slides section.present .g-widget.shine::after { animation: gShine 8s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .9s + 1.6s); }
@keyframes gPop { from { opacity: 0; transform: translateY(26px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes gBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes gShine { 0% { transform: translateX(0) skewX(-18deg); opacity: 1; } 22% { transform: translateX(420%) skewX(-18deg); opacity: 1; } 23%, 100% { opacity: 0; } }

/* ---------- g-pop: a stack (speech bubbles, short lines) pops in one after another from its tail corner (.me / .r: from the right) ---------- */
.g-pop { --g-gap: 420ms; }
.g-pop > * { transform-origin: 0 100%; }
.g-pop > :is(.me, .r) { transform-origin: 100% 100%; }
.reveal .slides section .g-pop > :not(.fragment) { opacity: 0; }
.reveal .slides section.present .g-pop > :not(.fragment) { animation: gBubble .6s cubic-bezier(.2, 1.5, .4, 1) both; animation-delay: calc(var(--g-n, 0) * var(--g-gap) + 300ms); }
.reveal .slides section .g-pop > .fragment.visible { animation: gBubble .6s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes gBubble { from { opacity: 0; transform: translateY(18px) scale(.7); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
/* typing dots, the beat before a reply: <span class="g-typing"><i></i><i></i><i></i></span> */
.g-typing { display: inline-flex; width: max-content; gap: 9px; align-items: center; padding: 20px 26px; border-radius: 22px 22px 22px 6px; background: var(--navy-card); }
.g-typing i { width: 13px; height: 13px; border-radius: 50%; background: var(--grey); animation: gDots 1.2s ease-in-out infinite; }
.g-typing i:nth-child(2) { animation-delay: .15s; } .g-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gDots { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-8px); opacity: 1; } }

/* ---------- g-strip / g-collage: real photos dealt in as a polaroid strip (bobbing) or a fanned stack ---------- */
.g-strip { display: flex; gap: 26px; align-items: center; }
.g-strip img, .g-collage img { aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; border: 10px solid #fff; background: #fff;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .6); margin: 0; max-width: none; max-height: none; box-sizing: border-box; }
.g-strip img { flex: 1 1 0; min-width: 0; width: 100%; }
.g-strip img:nth-child(odd) { rotate: -2.5deg; } .g-strip img:nth-child(even) { rotate: 2deg; }
.g-strip.square img, .g-collage.square img { aspect-ratio: 1; } .g-strip.wide img, .g-collage.wide img { aspect-ratio: 4 / 3; }
.g-collage { position: relative; height: var(--g-h, 620px); }
.g-collage img { position: absolute; top: 50%; width: var(--g-w, 44%); translate: -50% -50%; }
.g-collage img:nth-child(1) { left: 27%; rotate: -8deg; top: 54%; } .g-collage img:nth-child(2) { left: 50%; rotate: 1deg; top: 46%; z-index: 2; }
.g-collage img:nth-child(3) { left: 73%; rotate: 7deg; top: 55%; } .g-collage img:nth-child(4) { left: 38%; rotate: -3deg; top: 62%; z-index: 3; }
.g-collage img:nth-child(5) { left: 62%; rotate: 4deg; top: 60%; z-index: 3; } .g-collage img:nth-child(6) { left: 50%; rotate: -1deg; top: 66%; z-index: 4; }
.reveal .slides section :is(.g-strip, .g-collage) img { opacity: 0; }
.reveal .slides section.present .g-strip img { animation: gDeal .85s var(--ease-out) both, gBob 7s ease-in-out infinite;
  animation-delay: calc(var(--g-n, 0) * 130ms + 250ms), calc(var(--g-n, 0) * -1.4s); }
.reveal .slides section.present .g-collage img { animation: gDeal .85s var(--ease-out) both; animation-delay: calc(var(--g-n, 0) * 160ms + 250ms); }
@keyframes gDeal { from { opacity: 0; transform: translateY(70px) rotate(7deg) scale(.9); } to { opacity: 1; transform: none; } }

/* ---------- g-mark: a line swipes in under the one key phrase (after --mk-delay; inside a fragment, when it shows).
   Default yellow (navy on a yellow page, deep teal on white paper); .teal; .navy; .solid = a full yellow block with navy text
   for one or two words. Measured at the conference: a band BEHIND headline letters reads as overlap, so it stays under. ---------- */
.g-mark { --mk: var(--yellow); --mk-h: .11em; background: linear-gradient(var(--mk), var(--mk)) no-repeat 0 100% / 0% var(--mk-h);
  padding-bottom: .04em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
:is(.t-yellow, .t-butter) .g-mark { --mk: var(--navy); }
:is(.t-light, .t-cream, .t-board, .t-graph, .t-dot) .g-mark { --mk: var(--teal-deep); }
.g-mark.teal { --mk: var(--teal); } .g-mark.navy { --mk: var(--navy); } .g-mark.y { --mk: var(--yellow); }
.g-mark.solid { --mk: var(--yellow); --mk-h: 100%; color: var(--navy); padding: 0 .14em; margin: 0 -.04em; border-radius: .14em; background-position: 0 0; }
.reveal .slides section.present .g-mark:not(.fragment .g-mark):not(.fragment),
.reveal .slides section .fragment.visible .g-mark, .reveal .slides section .g-mark.fragment.visible { animation: gMark .7s var(--ease-out) both; animation-delay: var(--mk-delay, .9s); }
.reveal .slides section .fragment.visible .g-mark, .reveal .slides section .g-mark.fragment.visible { animation-delay: .25s; }
@keyframes gMark { to { background-size: 100% var(--mk-h); } }

/* ---------- g-sheen: one light sweep across a word or big number, once, after it lands (text colour from --sheen:
   yellow default; .t teal, .w white, .n navy). Not on the same element as .g-mark (both use the background). ---------- */
.g-sheen { --sheen: var(--yellow); color: var(--sheen); -webkit-text-fill-color: transparent;
  background: linear-gradient(100deg, var(--sheen) 0 40%, rgba(255, 255, 255, .95) 49%, var(--sheen) 58% 100%) 100% 0 / 260% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.g-sheen.t { --sheen: var(--teal); } .g-sheen.w { --sheen: #fff; } .g-sheen.n { --sheen: var(--navy); } .g-sheen.d { --sheen: var(--teal-deep); }
.reveal .slides section.present .g-sheen:not(.fragment .g-sheen):not(.fragment),
.reveal .slides section .fragment.visible .g-sheen, .reveal .slides section .g-sheen.fragment.visible { animation: gSheen 1.3s var(--ease-in-out) var(--sheen-delay, 1.4s) both; }
@keyframes gSheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- g-shine: one soft light band sweeps across a headline (or any block) after it lands; the words keep their own
   ink, marks and print effects (a layer over the box, not a text fill). --shine-delay (default 1.3 s). ---------- */
.g-shine { position: relative; }
.g-shine::after { content: ""; position: absolute; inset: -6% -2%; pointer-events: none; z-index: 2; mix-blend-mode: soft-light; opacity: 0;
  background: linear-gradient(100deg, transparent 0 38%, rgba(255, 255, 255, .55) 50%, transparent 62% 100%) 120% 0 / 260% 100% no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 34%, #000 66%, transparent); mask-image: linear-gradient(180deg, transparent, #000 34%, #000 66%, transparent); }
/* kit-motion.js shrinks a left-set .g-shine block to its words (width: fit-content), so the band never crosses empty page */
.reveal .slides section.present .g-shine::after { animation: gShineBand 1.6s var(--ease-in-out) var(--shine-delay, 1.3s) both; }
@keyframes gShineBand { 0% { opacity: 1; background-position: 120% 0; } 90% { opacity: 1; } 100% { opacity: 0; background-position: -20% 0; } }

/* ---------- g-glow: one hero element breathes a soft glow (.y yellow, .w white, .text a glow round the letters) ---------- */
.g-glow { --glow: rgba(52, 198, 185, .42); }
.g-glow.y { --glow: rgba(255, 222, 89, .48); } .g-glow.w { --glow: rgba(255, 255, 255, .6); }
.reveal .slides section.present .g-glow:not(.in) { animation: gGlow 4.8s ease-in-out 1.6s infinite; }
.reveal .slides section.present .g-glow.text:not(.in) { animation-name: gGlowText; }
.reveal .slides section.present .g-glow.in:not(.fragment) { animation: rise var(--dur-3, .9s) var(--ease-out) both, gGlow 4.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * var(--stagger, 110ms) + 150ms), 1.6s; }
.reveal .slides section.present .g-glow.text.in:not(.fragment) { animation-name: rise, gGlowText; }
@keyframes gGlow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 64px 4px var(--glow); } }
@keyframes gGlowText { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 28px var(--glow); } }

/* ---------- g-num: a stat figure that counts up (pd-slides.js data-count; kit-motion.js fills it in from the text when it is
   missing), then lands with a small pop and one light glow. --land is set by kit-motion.js from the count's own timing. ---------- */
.g-num { display: inline-block; font-variant-numeric: tabular-nums; }
.reveal .slides section.present .g-num { animation: gLand .55s var(--ease-pop) var(--land, 1.7s) both; }
@keyframes gLand { 0% { scale: 1; text-shadow: 0 0 0 transparent; } 40% { scale: 1.08; text-shadow: 0 0 26px rgba(255, 222, 89, .55); } 100% { scale: 1; text-shadow: 0 0 0 transparent; } }

/* ---------- g-stamp: a verdict word presses down like a rubber stamp once its slide arrives (after --st-d, default 1.2 s).
   Works on .stamp, .stamp-ink or any inline box; inside a fragment it stamps when the fragment shows. ---------- */
.reveal .slides section .g-stamp { opacity: 0; }
.reveal .slides section.present .g-stamp:not(.fragment .g-stamp):not(.fragment), .reveal .slides section .fragment.visible .g-stamp,
.reveal .slides section .g-stamp.fragment.visible { animation: gStamp .5s var(--ease-pop) var(--st-d, 1.2s) both; }
.reveal .slides section .fragment.visible .g-stamp, .reveal .slides section .g-stamp.fragment.visible { --st-d: .2s; }
@keyframes gStamp { 0% { opacity: 0; transform: scale(1.9) rotate(-8deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }

/* ---------- g-words: a line's words rise in one after another (kit-motion.js wraps each word; marks and links stay whole).
   On an .in element the words carry the entrance instead of the block. --w-gap (default 60 ms), --w-start (180 ms). ---------- */
.g-words > .g-w { display: inline-block; }
.reveal .slides section .g-words > .g-w { opacity: 0; }
.reveal .slides section.present .g-words.in:not(.fragment) { animation: none; opacity: 1; }
.reveal .slides section.present .g-words > .g-w { animation: gWord .7s var(--ease-out) both; animation-delay: calc(var(--w, 0) * var(--w-gap, 60ms) + var(--w-start, 180ms)); }
.reveal .slides section .fragment.visible .g-words > .g-w, .reveal .slides section .g-words.fragment.visible > .g-w { animation: gWord .7s var(--ease-out) both; animation-delay: calc(var(--w, 0) * var(--w-gap, 60ms)); }
.reveal .slides section.present .fragment:not(.visible) .g-words > .g-w, .reveal .slides section.present .g-words.fragment:not(.visible) > .g-w { animation: none; }
@keyframes gWord { from { opacity: 0; transform: translateY(.42em); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- g-orbit: one or two slow rings orbit a round thing (a number disc, an icon, a hub); the parent needs position.
   <i class="g-orbit"></i><i class="g-orbit o2"></i> inside it. .ink = navy rings for teal, yellow or white pages. ---------- */
.g-orbit { position: absolute; inset: -40px; border-radius: 50%; border: 3px dashed rgba(52, 198, 185, .55); pointer-events: none; }
.g-orbit.o2 { inset: -90px; border: 2px solid rgba(52, 198, 185, .25); }
.g-orbit.ink, :is(.t-teal, .t-yellow, .t-butter, .t-light, .t-cream, .t-board) .g-orbit:not(.lt) { border-color: rgba(2, 45, 65, .3); }
:is(.t-teal, .t-yellow, .t-butter, .t-light, .t-cream, .t-board) .g-orbit.o2:not(.lt) { border-color: rgba(2, 45, 65, .14); }
.g-orbit::before { content: ""; position: absolute; top: -12px; left: 50%; margin-left: -12px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 6px rgba(2, 45, 65, .14); }
.g-orbit.o2::before { top: auto; bottom: -9px; margin-left: -9px; width: 18px; height: 18px; background: var(--teal); box-shadow: none; }
.reveal .slides section .g-orbit { opacity: 0; }
.reveal .slides section.present .g-orbit { animation: gFadeIn .9s ease .45s both, gSpin 48s linear infinite; }
.reveal .slides section.present .g-orbit.o2 { animation: gFadeIn .9s ease .6s both, gSpin 76s linear infinite reverse; }
@keyframes gFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gSpin { to { rotate: 360deg; } }

/* ---------- g-arc: a progress ring that sweeps from --a0 to --a1 (of 600, the ring's length) round a number or a part.
   <svg class="g-arc" viewBox="0 0 200 200" style="--a0:0;--a1:300"><circle class="trk" cx="100" cy="100" r="95"/><circle class="val" .../></svg> ---------- */
.g-arc { overflow: visible; rotate: -90deg; pointer-events: none; }
.g-arc circle { fill: none; stroke-width: 10; }
.g-arc .trk { stroke: color-mix(in srgb, var(--fg, #fff) 14%, transparent); }
.g-arc .val { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: var(--a1, 300) 600; }
:is(.t-teal, .t-yellow, .t-butter) .g-arc .val { stroke: var(--navy); }
.reveal .slides section.present .g-arc .val { animation: gArc 1.3s var(--ease-out) .6s both; }
@keyframes gArc { from { stroke-dasharray: var(--a0, 0) 600; } to { stroke-dasharray: var(--a1, 300) 600; } }

/* ---------- g-aurora: a slow drifting light behind the content (CSS only; it moves its light, never its box, so it stays in
   the slide). <div class="g-aurora"></div> first in the <section>. .ink for teal, yellow or white pages. ---------- */
.reveal .slides section .g-aurora { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(34% 40% at 50% 50%, rgba(52, 198, 185, .16), transparent 70%) 0 0 / 140% 140% no-repeat,
              radial-gradient(30% 36% at 50% 50%, rgba(255, 222, 89, .08), transparent 70%) 100% 100% / 140% 140% no-repeat; }
.reveal .slides section .g-aurora.ink {
  background: radial-gradient(34% 40% at 50% 50%, rgba(255, 255, 255, .22), transparent 70%) 0 0 / 140% 140% no-repeat,
              radial-gradient(30% 36% at 50% 50%, rgba(2, 45, 65, .06), transparent 70%) 100% 100% / 140% 140% no-repeat; }
.reveal .slides section.present .g-aurora { animation: gAurora 26s ease-in-out infinite alternate; }
@keyframes gAurora { 0% { background-position: 0% 10%, 100% 90%; } 50% { background-position: 60% 40%, 40% 60%; } 100% { background-position: 100% 0%, 0% 100%; } }

/* ---------- canvas.g-shader: soft moving light (kit-motion.js, one small WebGL renderer for the deck, 320x180 at about 30 fps,
   only on the current slide). Without WebGL, under reduced motion, in ?static and print it is a still gradient (.g-still).
   .ink = white light for teal, yellow or white pages; data-at="x,y" (0 to 1) moves it; data-k scales it; data-c1 / data-c2. ---------- */
.reveal .slides section canvas.g-shader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block;
  opacity: 0; transition: opacity 1.4s ease; }
.reveal .slides section canvas.g-shader.on { opacity: 1; }
.reveal .slides section canvas.g-shader.g-still { opacity: 1;
  background: radial-gradient(42% 60% at 76% 46%, rgba(52, 198, 185, .2), transparent 70%), radial-gradient(36% 50% at 18% 88%, rgba(255, 222, 89, .08), transparent 70%); }
.reveal .slides section canvas.g-shader.ink.g-still {
  background: radial-gradient(40% 58% at 78% 48%, rgba(255, 255, 255, .26), transparent 70%), radial-gradient(40% 50% at 26% 50%, rgba(255, 255, 255, .12), transparent 70%); }

/* ---------- canvas.g-net: the moving knowledge network as a faint background (kit-motion.js draws it at half size, current
   slide only; ?static and reduced motion get one still frame). .ink = navy for teal, yellow or white pages; .full .left .edges
   change where it shows (default: fading in from the right). ---------- */
.reveal .slides section canvas.g-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .42;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .15) 10%, #000 70%); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .15) 10%, #000 70%); }
.reveal .slides section canvas.g-net.ink { filter: brightness(0); opacity: .14; }
.reveal .slides section canvas.g-net.full { -webkit-mask-image: none; mask-image: none; }
.reveal .slides section canvas.g-net.left { -webkit-mask-image: linear-gradient(270deg, rgba(0, 0, 0, .15) 10%, #000 70%); mask-image: linear-gradient(270deg, rgba(0, 0, 0, .15) 10%, #000 70%); }
.reveal .slides section canvas.g-net.edges { -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 50%, rgba(0, 0, 0, .1) 30%, #000 85%); mask-image: radial-gradient(ellipse 55% 55% at 50% 50%, rgba(0, 0, 0, .1) 30%, #000 85%); }
/* the content sits above the light: .frame is already z-index 2 (base.css); the light layers are z-index 0 */

/* ---------- section.g-open: the part opener treatment (motion_enrich.py puts it on every l-section). The title's words rise in
   one after another and one light band sweeps across them, the part number presses in like a sticker, the lede follows, and
   this part's stop on the part map glows once. Everything is on screen inside about 1.5 s. ---------- */
.reveal .slides section.g-open.present .num.plate-num { animation: gPlate .9s cubic-bezier(.2, 1.3, .4, 1) .15s both; }
@keyframes gPlate { from { opacity: 0; scale: .7; rotate: -6deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
.reveal .slides section.g-open.present .part-map li.on { animation: gGlowOnce 1.6s ease-in-out 1.5s both; border-radius: 999px; }
@keyframes gGlowOnce { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 45% { box-shadow: 0 0 0 4px var(--yellow), 0 0 40px rgba(255, 222, 89, .55); } }

/* ---------- calm (M): loops pause; entrances still play ---------- */
body.calm :is(.g-build, .g-chips) > *, body.calm .g-widget, body.calm .g-strip img, body.calm .g-glow, body.calm .g-aurora,
body.calm .g-orbit, body.calm .g-typing i, body.calm .g-build.g-line::before, body.calm .g-widget.shine::after { animation-play-state: paused !important; }
body.calm canvas.g-net { visibility: hidden; }

/* ---------- reduced motion: no motion, every final state ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal .slides section :is(.g-build > *, .g-chips > *, .g-widget, .g-pop > *, .g-strip img, .g-collage img, .g-mark, .g-sheen, .g-glow, .g-num, .g-stamp,
    .g-words > .g-w, .g-orbit, .g-aurora, .g-arc .val, .g-typing i), .g-build.g-line::before, .g-widget.shine::after, .g-shine::after,
  .reveal .slides section.g-open :is(.num.plate-num, .part-map li.on) { animation: none !important; }
  .reveal .slides section :is(.g-chips > *, .g-widget, .g-pop > :not(.fragment), .g-strip img, .g-collage img, .g-stamp, .g-words > .g-w, .g-orbit) { opacity: 1 !important; }
  .g-mark { background-size: 100% var(--mk-h) !important; }
  .g-sheen { background-position: 0 0 !important; }
}

/* ---------- ?static (render.py, the PDF) and print: the final state of every effect ---------- */
html.static .reveal .slides section :is(.g-build > *, .g-chips > *, .g-widget, .g-pop > *, .g-strip img, .g-collage img, .g-mark, .g-sheen, .g-glow, .g-num, .g-stamp,
  .g-words > .g-w, .g-orbit, .g-aurora, .g-arc .val, .g-typing i),
html.static .g-build.g-line::before, html.static .g-widget.shine::after, html.static .g-shine::after,
html.static .reveal .slides section.g-open :is(.num.plate-num, .part-map li.on) { animation: none !important; }
html.static .reveal .slides section :is(.g-chips > *, .g-widget, .g-pop > *, .g-strip img, .g-collage img, .g-stamp, .g-words > .g-w, .g-orbit) { opacity: 1 !important; }
html.static .g-mark { background-size: 100% var(--mk-h) !important; }
html.static .g-sheen { background-position: 0 0 !important; }
html.static .g-shine::after { opacity: 0 !important; }
@media print {
  .reveal .slides section :is(.g-build > *, .g-chips > *, .g-widget, .g-pop > *, .g-strip img, .g-collage img, .g-mark, .g-sheen, .g-glow, .g-num, .g-stamp,
    .g-words > .g-w, .g-orbit, .g-aurora, .g-arc .val) { animation: none !important; }
  .reveal .slides section :is(.g-chips > *, .g-widget, .g-pop > *, .g-strip img, .g-collage img, .g-stamp, .g-words > .g-w, .g-orbit) { opacity: 1 !important; }
  .g-mark { background-size: 100% var(--mk-h) !important; }
  .g-sheen { background-position: 0 0 !important; }
  .g-shine::after { display: none; }
}
