/* assets/css/home-tinku.css — "Tinku on the home page" (assets/js/home-tinku.js). Plain CSS, kept out of the Tailwind build.
   Idle: only Tinku's head (.hk, placed by the JS: hero bottom-right · on the two course cards · above each section title).
   The hero head ("I'm Tinku") is always awake; the others sleep and only the section in the middle of the screen wakes up
   (states on .hk: awake · wake (one-time) · drowsy (falling asleep slowly) · sleep). Look and timings = the approved demo.
   Tap: .hk-pop opens from the head — the whole Tinku floating on his rocket flame (.hk-fig) + the speech bubble.
   Every pose and prop is a plain transform; animations only move around it, so with reduced motion all props still show. */
.hk-host { position: relative; }
.hk { position: absolute; z-index: 4; left: 0; top: 0; width: 76px; height: 66px; pointer-events: none; }
.hk.hk-hero { width: 96px; height: 83px; }
.hk.on { z-index: 30; }

/* ---------- idle head ---------- */
.hk-head { position: absolute; inset: 0; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  -webkit-tap-highlight-color: transparent; font: inherit; color: inherit; appearance: none; }
.hk-head:focus { outline: none; }
.hk-head:focus-visible { outline: 3px solid #FDE047; outline-offset: 4px; border-radius: 18px; }
.hk-hsvg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 7px rgba(15, 23, 42, .3)); }
.hk.on .hk-head { visibility: hidden; }
.hk-head .hk-sleep, .hk-head .hk-star, .hk-head .hk-happy { opacity: 0; }
.hk-eyes { transform-origin: 210px 133px; }
.hk-head .hk-ant { transform-origin: 210px 80px; }
/* awake: blink + look around + nod */
.hk.awake .hk-head .hk-hsvg { animation: hkh-nod 3.2s ease-in-out infinite; }
.hk.awake .hk-head .hk-eyes { animation: hkh-blink 6s infinite; }
.hk.awake .hk-head .hk-look { animation: hkh-look 6s ease-in-out infinite; }
@keyframes hkh-nod { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-2px) rotate(-3deg); } 60% { transform: translateY(0) rotate(2deg); } }
@keyframes hkh-blink { 0%, 40%, 44%, 100% { transform: scaleY(1); } 42% { transform: scaleY(.1); } }
@keyframes hkh-look { 0%, 15%, 60%, 100% { transform: translateX(0); } 22%, 32% { transform: translateX(-7px); } 38%, 50% { transform: translateX(7px); } }
/* sleeping: eyes closed, slow breathing, tilted, Zzz, antenna dim */
.hk.sleep .hk-head .hk-eyes, .hk.sleep .hk-head .hk-mouth { opacity: 0; }
.hk.sleep .hk-head .hk-sleep { opacity: 1; }
.hk.sleep .hk-head .hk-hsvg { animation: hkh-breathe 3.6s ease-in-out infinite; transform-origin: 50% 90%; }
.hk.sleep .hk-head .hk-ant { opacity: .45; }
@keyframes hkh-breathe { 0%, 100% { transform: rotate(-9deg) scale(1); } 50% { transform: rotate(-9deg) scale(1.035, .97); } }
.hk-zz { position: absolute; left: 62px; top: -6px; font: 900 15px/1 'Baloo 2', sans-serif; color: #818CF8; pointer-events: none; opacity: 0; }
.hk.sleep .hk-zz { animation: hkh-z 3s linear infinite; }
.hk.sleep .hk-zz:nth-child(2) { animation-delay: 1s; }
.hk.sleep .hk-zz:nth-child(3) { animation-delay: 2s; }
@keyframes hkh-z { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -30px) scale(1.25); } }
.tp-feat .hk-zz { color: #E0E7FF; }   /* on the coloured sections */
/* falling asleep slowly (another section became active) */
.hk.drowsy .hk-head .hk-hsvg { animation: hkh-drowse 1.6s ease-in-out both; transform-origin: 50% 90%; }
.hk.drowsy .hk-head .hk-eyes { animation: hkh-eyesclose 1.6s ease-in both; }
.hk.drowsy .hk-head .hk-sleep { animation: hkh-sleepin 1.6s ease-in both; }
.hk.drowsy .hk-head .hk-ant { transition: opacity 1.6s; opacity: .45; }
@keyframes hkh-drowse { 0% { transform: none; } 35% { transform: translateY(2px) rotate(-3deg); } 55% { transform: translateY(-1px) rotate(-2deg); } 100% { transform: rotate(-9deg); } }
@keyframes hkh-eyesclose { 0% { transform: scaleY(1); opacity: 1; } 40% { transform: scaleY(.45); opacity: 1; } 55% { transform: scaleY(.7); } 85% { transform: scaleY(.1); opacity: 1; } 100% { transform: scaleY(.1); opacity: 0; } }
@keyframes hkh-sleepin { 0%, 80% { opacity: 0; } 100% { opacity: 1; } }
/* waking up (one time when the section becomes active): stretch, pop, smile, sparkles */
.hk.wake .hk-head .hk-hsvg { animation: hkh-wake 1.2s cubic-bezier(.3, 1.6, .5, 1) both; }
.hk.wake .hk-head .hk-happy { animation: hkh-showhappy 1.2s both; }
.hk.wake .hk-head .hk-eyes { animation: hkh-hideeyes 1.2s both; }
@keyframes hkh-wake { 0% { transform: rotate(-9deg) scale(1); } 25% { transform: rotate(0) scale(1.15, .85) translateY(4px); } 55% { transform: translateY(-14px) scale(.95, 1.1); } 75% { transform: translateY(0) rotate(6deg); } 100% { transform: none; } }
@keyframes hkh-showhappy { 0%, 30% { opacity: 0; } 40%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hkh-hideeyes { 0%, 30% { opacity: 0; } 40%, 85% { opacity: 0; } 100% { opacity: 1; } }
.hk-spark { position: absolute; width: 10px; height: 10px; pointer-events: none; opacity: 0; }
.hk-spark::before { content: '✦'; position: absolute; font-size: 14px; font-style: normal; color: #FDE047; text-shadow: 0 0 6px #FACC15; }
.hk.wake .hk-spark, .hk .hk-head:hover .hk-spark { animation: hkh-spark .9s ease-out both; }
.hk-spark.s1 { left: -6px; top: 8px; --dx: -16px; --dy: -14px; }
.hk-spark.s2 { left: 64px; top: 4px; --dx: 16px; --dy: -16px; animation-delay: .1s !important; }
.hk-spark.s3 { left: 30px; top: -10px; --dx: 0; --dy: -20px; animation-delay: .2s !important; }
@keyframes hkh-spark { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.3); } }
/* hover / keyboard focus: excited — bouncy wiggle, star eyes, bigger smile, antenna shake, "Click me!" */
.hk .hk-head:hover .hk-hsvg, .hk .hk-head:focus-visible .hk-hsvg { animation: hkh-excite .55s ease-in-out infinite; }
.hk .hk-head:hover .hk-eyes, .hk .hk-head:focus-visible .hk-eyes { opacity: 0; }
.hk .hk-head:hover .hk-star, .hk .hk-head:focus-visible .hk-star { opacity: 1; }
.hk .hk-head:hover .hk-sleep, .hk .hk-head:focus-visible .hk-sleep { opacity: 0; }
.hk .hk-head:hover .hk-mouth, .hk .hk-head:focus-visible .hk-mouth { opacity: 1; transform-origin: 210px 168px; transform: scale(1.35); }
.hk .hk-head:hover .hk-ant, .hk .hk-head:focus-visible .hk-ant { opacity: 1; animation: hkh-ant .3s ease-in-out infinite; }
.hk .hk-head:hover .hk-zz { display: none; }
@keyframes hkh-excite { 0%, 100% { transform: translateY(0) rotate(-6deg) scale(1.1); } 50% { transform: translateY(-7px) rotate(6deg) scale(1.14); } }
@keyframes hkh-ant { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.hk-click { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%) scale(.6); opacity: 0; white-space: nowrap; padding: 3px 11px; border-radius: 99px;
  background: #fff; color: #C2410C; border: 2px solid #FDBA74; font: 900 13px/1.4 'Nunito', sans-serif; box-shadow: 0 6px 14px -6px rgba(30, 27, 75, .5); transition: .2s; pointer-events: none; z-index: 2; }
.hk .hk-head:hover .hk-click, .hk .hk-head:focus-visible .hk-click { opacity: 1; transform: translateX(-50%) scale(1); }
/* no room under the head (the section cuts it off): beside him, or over his chin */
.hk-head[data-click="r"] .hk-click, .hk-head[data-click="l"] .hk-click { bottom: auto; top: 50%; transform: translateY(-50%) scale(.6); }
.hk-head[data-click="r"] .hk-click { left: calc(100% + 2px); } .hk-head[data-click="l"] .hk-click { left: auto; right: calc(100% + 2px); }
.hk .hk-head[data-click="r"]:hover .hk-click, .hk .hk-head[data-click="l"]:hover .hk-click, .hk .hk-head[data-click="r"]:focus-visible .hk-click, .hk .hk-head[data-click="l"]:focus-visible .hk-click { transform: translateY(-50%) scale(1); }
.hk-head[data-click="u"] .hk-click { bottom: 2px; }
/* the curved "I'm Tinku" over the hero head */
.hk-arc { position: absolute; left: 50%; top: -21px; width: 112px; height: 40px; transform: translateX(-50%); pointer-events: none; overflow: visible; }
.hk-arc text { font: 900 17px 'Baloo 2', sans-serif; fill: #FDE047; letter-spacing: 1px; paint-order: stroke; stroke: #4C1D95; stroke-width: 4px; stroke-linejoin: round; }

/* touch screens (no hover): a "Tap me" hint until the first tap ever */
.hk-tap { position: absolute; top: 50%; left: calc(100% + 4px); transform: translateY(-50%); white-space: nowrap; pointer-events: auto; cursor: pointer;
  padding: 2px 9px; border-radius: 999px; background: #fff; color: #C2410C; font: 900 12px/1.4 'Nunito', system-ui, sans-serif;
  box-shadow: 0 4px 12px -4px rgba(30, 27, 75, .45); border: 2px solid #FDBA74; animation: hk-tap 1.8s ease-in-out infinite; }
.hk[data-tap="l"] .hk-tap { left: auto; right: calc(100% + 4px); }
.hk[data-tap="t"] .hk-tap { top: auto; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); animation: none; }
.hk[data-tap="n"] .hk-tap { display: none; }   /* no clear spot beside or above the head */
.hk-tapped .hk-tap, .hk.on .hk-tap { display: none; }
.hk[data-g="learn-instructor"] .hk-tap { display: none; }   /* the #learn pair shares one hint (the kids one) */
@media (hover: hover) { .hk-tap { display: none; } }   /* mouse: "Click me!" shows on hover instead */
@keyframes hk-tap { 0%, 100% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.08); } }

/* ---------- popup: whole Tinku + bubble ---------- */
/* a section that clips (overflow hidden) gets the popup in its own layer on <body>, placed over the head by the JS */
.hk.hk-float { position: absolute; z-index: 45; pointer-events: none; }
.hk.hk-float:not(.on) { display: none; }
.hk-pop { position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; gap: 26px;   /* room for props held out to the side */
  width: max-content; pointer-events: auto; }
.hk-pop[hidden] { display: none; }
.hk[data-dir$="l"] .hk-pop { flex-direction: row-reverse; }
.hk[data-dir^="u"] .hk-pop { align-items: flex-end; }
.hk-fig { flex: none; width: 150px; height: 250px; padding-top: 36px; box-sizing: content-box; animation: hk-rise .55s cubic-bezier(.34, 1.56, .64, 1); }
.hk-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hk:not(.on) .hk-p { display: none; }
@keyframes hk-rise { from { opacity: 0; transform: translateY(40px) scale(.4); } to { opacity: 1; transform: none; } }

/* floating on the rocket flame: hover, tilt, flicker, breathing shadow */
.hk-fly { transform-origin: 210px 300px; animation: hk-fly 2.6s ease-in-out infinite; }
.hk-shd { transform-origin: 210px 502px; animation: hk-shd 2.6s ease-in-out infinite; }
.hk-f1, .hk-f2 { transform-origin: 210px 342px; animation: hk-flick .16s ease-in-out infinite alternate; }
.hk-f2 { animation-duration: .11s; }
.hk-f3 { transform-origin: 210px 344px; animation: hk-flick .09s ease-in-out infinite alternate; }
.hk-fglow, .hk-puff { transform-origin: 210px 420px; animation: hk-glow .5s ease-in-out infinite alternate; }
.hk-sparks { animation: hk-sparks .7s linear infinite; }
@keyframes hk-fly { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes hk-shd { 0%, 100% { transform: scale(1); opacity: .2; } 50% { transform: scale(.78); opacity: .12; } }
@keyframes hk-flick { from { transform: scale(1, 1); } to { transform: scale(.88, 1.12); } }
@keyframes hk-glow { from { transform: scale(.94); opacity: .8; } to { transform: scale(1.06); opacity: 1; } }
@keyframes hk-sparks { from { transform: translateY(-8px); opacity: 1; } to { transform: translateY(18px); opacity: .2; } }

/* the whole Tinku: blink, antenna, arms, talking mouth */
.hk-svg .hk-eyes { transform-origin: 210px 133px; animation: hk-blink 4.6s infinite; }
.hk-ant { transform-origin: 210px 78px; animation: hk-ant 2.6s ease-in-out infinite alternate; }
.hk-al { transform-origin: 150px 236px; transform: rotate(var(--al, 0deg)); animation: hk-swL var(--lt, 1s) ease-in-out .3s infinite alternate; }
.hk-ar { transform-origin: 270px 236px; transform: rotate(var(--ar, 0deg)); animation: hk-swR var(--at, 1s) ease-in-out .3s infinite alternate; }
.hk-mouth { transform-origin: 210px 164px; }
@keyframes hk-blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hk-ant { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes hk-swR { from { transform: rotate(calc(var(--ar, 0deg) - var(--aa, 0deg))); } to { transform: rotate(calc(var(--ar, 0deg) + var(--aa, 0deg))); } }
@keyframes hk-swL { from { transform: rotate(calc(var(--al, 0deg) - var(--la, 0deg))); } to { transform: rotate(calc(var(--al, 0deg) + var(--la, 0deg))); } }
.hk.talk .hk-mouth { animation: hk-talk .2s ease-in-out infinite alternate; }
@keyframes hk-talk { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
.hk-svg .hk-glo { animation: hk-pulse 1.2s ease-in-out infinite alternate; }

/* shared prop bits */
.hk-spk { transform-box: fill-box; transform-origin: 50% 50%; animation: hk-pop 1.4s ease-in-out infinite; }
.hk-k2 { animation-delay: -.45s; } .hk-k3 { animation-delay: -.9s; }
@keyframes hk-pop { 0%, 100% { transform: scale(.2); opacity: 0; } 30%, 60% { transform: scale(1.15); opacity: 1; } }
@keyframes hk-pulse { from { opacity: .45; } to { opacity: 1; } }
.hk-led { animation: hk-led .9s steps(1) infinite; } .hk-led2 { animation-delay: -.3s; } .hk-led3 { animation-delay: -.6s; }
@keyframes hk-led { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* hero: waves, the bulb lights up */
.hk-glass { animation: hk-lit 2.6s ease-in-out infinite; }
.hk-rays, .hk-bglow { animation: hk-rays 2.6s ease-in-out infinite; }
@keyframes hk-lit { 0%, 18% { fill: #F1F5F9; } 24% { fill: #FDE047; } 27% { fill: #F1F5F9; } 32%, 92% { fill: #FDE047; } 100% { fill: #F1F5F9; } }
@keyframes hk-rays { 0%, 28% { opacity: 0; } 36%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* make: the wrench turns on the bolt with the hand (he holds still above the toolbox) */
.hk[data-p="make"] .hk-fly { animation: none; }
.hk[data-p="make"] .hk-shd { animation: none; }
.hk-wr { transform-origin: 326px 349px; animation: hk-wr .55s ease-in-out .3s infinite alternate; }
@keyframes hk-wr { from { transform: rotate(9.7deg); } to { transform: rotate(-9.7deg); } }

/* learn (kids): reads, then tosses the cap */
.hk[data-p="learn"] .hk-ar { animation: hk-lR 4.4s ease-in-out infinite; }
.hk[data-p="learn"] .hk-al { animation: hk-lL 4.4s ease-in-out infinite; }
.hk[data-p="learn"] .hk-svg .hk-eyes { animation: hk-read 4.4s ease-in-out infinite; }
.hk-book { transform-origin: 210px 300px; animation: hk-book 4.4s ease-in-out infinite; }
.hk-cap { transform-origin: 180px 62px; animation: hk-cap 4.4s ease-in-out infinite; }
[data-p="learn"] .hk-spk { animation: hk-capst 4.4s ease-in-out infinite; }
@keyframes hk-lR { 0%, 46%, 96%, 100% { transform: rotate(50deg); } 58% { transform: rotate(-150deg); } 80% { transform: rotate(-120deg); } }
@keyframes hk-lL { 0%, 46%, 96%, 100% { transform: rotate(-50deg); } 60%, 84% { transform: rotate(-10deg); } }
@keyframes hk-read { 0%, 44% { transform: translateY(6px); } 50%, 100% { transform: none; } }
@keyframes hk-book { 0%, 44%, 100% { transform: none; opacity: 1; } 50%, 92% { transform: scale(.2) translateY(60px); opacity: 0; } }
@keyframes hk-cap { 0%, 54% { transform: none; } 70% { transform: translate(8px, -130px) rotate(-200deg); } 84% { transform: translate(2px, -24px) rotate(-340deg); } 90%, 100% { transform: rotate(-360deg); } }
@keyframes hk-capst { 0%, 60% { transform: scale(.2); opacity: 0; } 70%, 80% { transform: scale(1.2); opacity: 1; } 90%, 100% { transform: scale(.2); opacity: 0; } }

/* learn-instructor: presents the chart, the bars grow */
.hk-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: hk-bar 3s ease-out infinite; }
.hk-bar.hk-k2 { animation-delay: .25s; } .hk-bar.hk-k3 { animation-delay: .5s; }
.hk-arw { stroke-dasharray: 90; animation: hk-arw 3s ease-out .6s infinite; }
@keyframes hk-bar { 0% { transform: scaleY(.1); } 30%, 88% { transform: scaleY(1); } 100% { transform: scaleY(.1); } }
@keyframes hk-arw { 0% { stroke-dashoffset: 90; } 30%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 90; } }

/* flash-firmware: plugs in, power-up glow */
.hk[data-p="flash-firmware"] .hk-ar { animation: hk-plug 3.6s ease-in-out infinite; }
.hk-pow { animation: hk-pow 3.6s ease-out infinite; }
.hk-zap { transform-box: fill-box; transform-origin: 50% 50%; }
.hk[data-p="flash-firmware"] .hk-svg .hk-eyes { animation: hk-zapeye 3.6s ease-out infinite; }
[data-p="flash-firmware"] .hk-pow:not(.hk-zap) { transform-origin: 210px 250px; }
@keyframes hk-plug { 0%, 6% { transform: rotate(20deg); } 32%, 94% { transform: rotate(43.2deg); } 100% { transform: rotate(20deg); } }
@keyframes hk-pow { 0%, 32% { opacity: 0; transform: scale(.6); } 40% { opacity: 1; transform: scale(1.08); } 52%, 88% { opacity: .8; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hk-zapeye { 0%, 34%, 52%, 100% { transform: none; } 40% { transform: scale(1.12); } }

/* tinkerpy-code: types fast, code floats up */
.hk-fl { animation: hk-fl 2.4s ease-out infinite; }
.hk-f2.hk-fl { animation-delay: -.6s; } .hk-f3.hk-fl { animation-delay: -1.2s; } .hk-f4.hk-fl { animation-delay: -1.8s; }
.hk[data-p="tinkerpy-code"] .hk-al { animation-delay: .21s; }   /* the two hands type in turn */
.hk[data-p="tinkerpy-code"] .hk-svg .hk-eyes { transform: translateY(4px); animation: none; }
@keyframes hk-fl { 0% { transform: translateY(30px); opacity: 0; } 20% { opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-110px); opacity: 0; } }

/* simlab: the bubbles rise out of the flask */
.hk-bb { animation: hk-bb 1.8s ease-in infinite; }
@keyframes hk-bb { 0% { transform: translateY(40px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }

/* community: cheers, bigger hops */
.hk[data-p="community"] .hk-fly { animation: hk-hop .7s ease-in-out infinite alternate; }
@keyframes hk-hop { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-18px) rotate(2deg); } }

/* projects: 3, 2, 1 … lift-off! */
.hk-rkt { animation: hk-rkt 3.8s ease-in infinite; }
.hk-rfl { transform-origin: 340px 442px; animation: hk-rfl 3.8s linear infinite; }
.hk-smk { opacity: 0; transform-origin: 340px 446px; animation: hk-smk 3.8s ease-out infinite; }
@keyframes hk-rkt { 0% { transform: none; opacity: 0; } 8%, 24% { transform: none; opacity: 1; } 21%, 23% { transform: translateX(-1.5px); } 22%, 24.5% { transform: translateX(1.5px); } 62% { transform: translateY(-620px); opacity: 1; } 63%, 100% { transform: translateY(-620px); opacity: 0; } }
@keyframes hk-rfl { 0%, 16% { transform: scaleY(0); } 20%, 62% { transform: scaleY(1); } 22%, 30%, 40%, 50% { transform: scaleY(1.25); } 26%, 35%, 45%, 55% { transform: scaleY(.9); } 63%, 100% { transform: scaleY(0); } }
@keyframes hk-smk { 0%, 22% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 50% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }

/* ---------- inner pages (page mode) ---------- */
.hub-tabs-bar > .hk { z-index: 25; width: 60px; height: 52px; }   /* the tabs Tinku sits on the open tab, above the tab buttons */
.hub-tabs-bar > .hk.on { z-index: 40; }
/* folder ("My Projects"): papers pop up and down */
.hk-ppr { animation: hk-ppr 1.8s ease-in-out infinite; }
.hk-ppr.hk-k2 { animation-delay: -.9s; }
@keyframes hk-ppr { 0%, 100% { transform: translateY(12px); } 50% { transform: translateY(-14px); } }
[data-p="folder"] .hk-svg .hk-eyes, [data-p="gift"] .hk-svg .hk-eyes, [data-p="clipboard"] .hk-svg .hk-eyes { transform: translateY(4px); animation: none; }
/* gift ("Shared with me"): the lid pops, hearts float up */
.hk-lid { transform-origin: 210px 262px; animation: hk-lid 2.4s ease-in-out infinite; }
@keyframes hk-lid { 0%, 35%, 92%, 100% { transform: none; } 48% { transform: translateY(-24px) rotate(-10deg); } 64% { transform: translateY(-24px) rotate(8deg); } 78% { transform: translateY(-6px); } }
.hk-ht { opacity: 0; animation: hk-ht 2.4s ease-out infinite; }
.hk-ht.hk-k2 { animation-delay: .2s; } .hk-ht.hk-k3 { animation-delay: .4s; }
@keyframes hk-ht { 0%, 40% { opacity: 0; transform: translateY(20px) scale(.5); } 55% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1.15); } }
/* bell ("Notifications"): rings */
.hk-bel { transform-origin: 338px 146px; animation: hk-bel .9s ease-in-out infinite; }
@keyframes hk-bel { 0%, 50%, 100% { transform: rotate(0); } 10% { transform: rotate(16deg); } 20% { transform: rotate(-14deg); } 30% { transform: rotate(10deg); } 40% { transform: rotate(-6deg); } }
.hk-rng { animation: hk-pulse .45s ease-in-out infinite alternate; }
/* clipboard ("Your checklist"): the boxes tick one by one */
.hk-tk { stroke-dasharray: 22; stroke-dashoffset: 22; animation: hk-tk 3.6s ease-out infinite; }
.hk-t2 { animation-delay: .5s; } .hk-t3 { animation-delay: 1s; }
@keyframes hk-tk { 0%, 8% { stroke-dashoffset: 22; } 22%, 86% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 22; } }
/* quiz: the ? card wiggles */
.hk-qz { transform-origin: 338px 212px; animation: hk-qz 1.6s ease-in-out infinite; }
@keyframes hk-qz { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-6px); } }
/* phone (apps): coloured blocks drop in and stack */
.hk-blk { animation: hk-blk 3.2s ease-out infinite; }
.hk-b2 { animation-delay: .35s; } .hk-b3 { animation-delay: .7s; } .hk-b4 { animation-delay: 1.05s; }
@keyframes hk-blk { 0% { transform: translateY(-40px); opacity: 0; } 12%, 85% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }

/* course cards (/course/kids/): the footer is [button][Tinku] — Tinku next to the button, a little taller than it.
   Desktop: Tinku shows on the hovered card (until another card is hovered). Touch: the footer says "Explore" until the
   card is tapped; then the button and an awake Tinku show (tapping another card moves them there). */
.hk-cards .ch-course-foot { flex-wrap: nowrap; justify-content: flex-start; align-items: center; gap: 8px; --bh: 32px; min-height: calc(var(--bh) * 1.3 + 9px); }
.hk-cards .ch-course-foot > span:not(.ch-go):not(.ch-explore) { display: none; }   /* (the chapters line) */
.hk-cards .ch-course .ch-go { min-width: 0; }
.ch-explore { white-space: nowrap; }
.hk-cards .ch-course .ch-go { flex: 1; justify-content: center; height: var(--bh); padding-top: 0; padding-bottom: 0; }
.ch-course-foot > .hk.hk { position: relative; left: auto; top: auto; flex: none; height: calc(var(--bh, 32px) * 1.3); width: calc(var(--bh, 32px) * 1.5); pointer-events: auto; }
.ch-course .hk-tap, .ch-course .hk-click, .ch-course .hk-zz { display: none; }
.hk-cards .ch-course:not(.hk-sel) .hk:not(.on) .hk-head { opacity: 0; transform: scale(.4) translateY(10px); pointer-events: none; }
.hk-cards .ch-course .hk-head { transition: opacity .25s, transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.ch-explore { display: none; }
@media (max-width: 599px) { .hk-cards .ch-course-foot { --bh: 28px; gap: 6px; } }
@media (hover: none), (pointer: coarse) {
  .hk-cards:not(.hk-off) .ch-course:not(.hk-sel) .ch-go, .hk-cards:not(.hk-off) .ch-course:not(.hk-sel) .ch-course-foot > .hk { display: none; }
  .hk-cards:not(.hk-off) .ch-course:not(.hk-sel) .ch-explore { display: flex; align-items: center; height: calc(var(--bh) * 1.3); font-size: 12.5px; font-weight: 900; color: #64748B; }
  .hk-cards .ch-course.hk-sel .ch-go { animation: hk-gopop .4s cubic-bezier(.34, 1.56, .64, 1); }
}
@keyframes hk-gopop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.hk-off .ch-course-foot > .hk { display: none; }

/* ---------- the speech bubble ---------- */
.hk-bub { position: relative; flex: none; width: 330px; max-height: min(420px, 78vh); overflow: auto; box-sizing: border-box; margin-top: 20px;
  padding: 16px 18px 12px; border-radius: 22px; background: #fff; color: #1E1B4B; text-align: left; border: 3px solid #FDBA74;
  box-shadow: 0 24px 50px -18px rgba(30, 27, 75, .55); font-family: 'Nunito', system-ui, sans-serif; animation: hk-bub .35s cubic-bezier(.34, 1.56, .64, 1); }
.hk[data-dir^="u"] .hk-bub { margin: 0 0 30px; }
.hk-bub:focus { outline: none; }
@keyframes hk-bub { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.hk-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #F1F5F9; color: #475569; font: 900 15px/32px system-ui, sans-serif; cursor: pointer; }
.hk-x:hover { background: #E2E8F0; }
.hk-in { margin: 0 34px 6px 0; font-size: 13.5px; font-weight: 700; font-style: italic; color: #64748B; }
.hk-in:empty { display: none; }
.hk-t { margin: 0 34px 6px 0; font: 800 21px/1.15 'Baloo 2', 'Nunito', system-ui, sans-serif; color: #EA580C; }
.hk-txt { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.5; color: #334155; }
.hk-txt span { opacity: .3; transition: opacity .2s; }
.hk-txt span.on { opacity: 1; }
.hk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hk-go, .hk-nx, .hk-mu { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  font: 800 14px/1 'Nunito', system-ui, sans-serif; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.hk-go { background: #F97316; color: #fff; box-shadow: 0 6px 14px -8px #F97316; }
.hk-go:hover { background: #EA580C; }
.hk-go[hidden] { display: none; }
.hk-nx { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.hk-nx:hover { background: #E0E7FF; }
.hk-mu { width: 38px; padding: 0; margin-left: auto; background: #F8FAFC; border-color: #E2E8F0; font-size: 17px; }
.hk-go:focus-visible, .hk-nx:focus-visible, .hk-mu:focus-visible, .hk-x:focus-visible, .hk-hide:focus-visible, .hk-foot button:focus-visible { outline: 3px solid #6366F1; outline-offset: 2px; }
.hk-hide { display: block; margin: 8px 0 0 auto; padding: 2px 4px; border: 0; background: none; color: #94A3B8; font: 700 12px 'Nunito', system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.hk-foot { margin: 18px 0 6px; text-align: center; }
.hk-foot button { border: 0; background: none; color: #94A3B8; font: 700 12.5px 'Nunito', system-ui, sans-serif; text-decoration: underline; cursor: pointer; padding: 4px 8px; }
.hk-off .hk { display: none; }

/* ---------- phones: smaller head; the popup stacks Tinku over (or under) the bubble ---------- */
@media (max-width: 719px) {
  .hk.hk-hero { width: 72px; height: 62px; }
  .hk:not(.hk-hero) { width: 60px; height: 52px; }
  .hk-spark.s2 { left: 44px; }   /* keep the wake sparkle inside a right-edge perch (no sideways scroll on phones) */
  .tp-band.hk-host-br > .tp-band-in { padding-bottom: 66px; }   /* bottom-right hero head + "Tap me" stay clear of the subtitle */
  .hub-tabs-bar > .hk { width: 48px; height: 42px; }
  .hk-pop { flex-direction: column; align-items: flex-start; gap: 0; width: min(340px, calc(100vw - 24px)); }
  .hk[data-dir$="l"] .hk-pop { flex-direction: column; align-items: flex-end; }
  .hk[data-dir^="u"] .hk-pop { flex-direction: column-reverse; align-items: flex-end; }
  .hk-fig { width: 96px; height: 160px; padding-top: 24px; }
  .hk-bub, .hk[data-dir^="u"] .hk-bub { width: 100%; margin: -14px 0 0; max-height: 60vh; }
  .hk[data-dir^="u"] .hk-bub { margin: 0 0 -14px; }
  .hk-t { font-size: 19px; }
  .hk-txt { font-size: 14.5px; }
}

/* ---------- reduced motion: no big movement; every pose and prop still shows ---------- */
@media (prefers-reduced-motion: reduce) {
  .hk *, .hk *::before, .hk *::after, .hk-bub, .hk-tap { animation: none !important; transition: none !important; }
  .hk-smk { opacity: 0; }
  .hk-tk { stroke-dashoffset: 0; }
  .hk-ht { opacity: 1; }
}

/* TinkerPy App / AppSpace / Games cards (home #get-apps): a small Tinku in each card's top-right corner */
.ga-card > .hk.hk { position: absolute; z-index: 4; width: 60px; height: 52px; }
.ga-card.hk-host .ga-head { padding-right: 66px; }
.hk-off .ga-card.hk-host .ga-head { padding-right: 0; }
