/* AhSok, the cursor buddy (9 Nov 2026, Eunice: "floating and following the mouse cursor, not that he is the cursor,
   he is watching it; moving left to right he follows on the left of the cursor, and vice versa; lively, blinking,
   a little arm movement"). Built by ahsok-buddy.js from layers cut out of the existing AhSok picture
   (make_layers.py: body with the eyes painted out, left arm, right arm). The eyes and the antenna glow are drawn here.
   Desktop with a mouse only; hidden on phones and touch screens (since 25 Nov 2026 shown with Reduce Motion too). */
.ahsok{position:fixed;left:0;top:0;z-index:70;width:clamp(84px,7.2vw,118px);aspect-ratio:1.2557;pointer-events:none;opacity:0;transition:opacity .45s ease;will-change:transform}
.ahsok.is-on{opacity:1}
/* Turning round to face the cursor: a quick, slightly springy flip. */
.ahsok-flip{position:absolute;inset:0;transition:transform .34s cubic-bezier(.34,1.45,.5,1)}
.ahsok.face-left .ahsok-flip{transform:scaleX(-1)}
/* Floating: a slow bob, and one soft shadow for the whole robot. */
.ahsok-bob{position:absolute;inset:0;animation:ahsok-bob 3.4s ease-in-out infinite;filter:drop-shadow(0 7px 9px rgba(10,20,40,.28));transition:translate .25s ease}
.ahsok-bob>img{position:absolute;inset:0;width:100%;height:100%;display:block;user-select:none;-webkit-user-drag:none}
/* Arms swing from their shoulder sockets (pivots from layers.json). The left arm only sways a little; the right arm
   lifts (it waves now and then). Ranges are kept to what the cut-out layers allow without showing a gap. */
.ahsok-arm-l{transform-origin:26.43% 68.75%;animation:ahsok-arm-l 2.8s ease-in-out infinite}
.ahsok-arm-r{transform-origin:78.91% 54.2%;animation:ahsok-arm-r 3.3s ease-in-out infinite}
.ahsok.wave .ahsok-arm-r{animation:ahsok-wave 1.5s ease-in-out 1}
/* Idle nudge (9 Nov 2026; v2 more dramatic): while pointing at the scroll cue ahsok-buddy.js drives the right arm
   (two jabs every 1.5s, in time with his lunges), so its idle sway is off; each jab pops his eyes wide (.pop),
   flashes the antenna (.flash) and sends a warm ring out from the cue (.ahsok-ripple). */
.ahsok.point .ahsok-arm-r{animation:none}
.ahsok.point .ahsok-glow{animation-duration:1s}
.ahsok.flash .ahsok-glow{animation:ahsok-flash .38s ease-out 1}
.ahsok-ripple{position:fixed;z-index:69;pointer-events:none;border-radius:50%;border:2.5px solid rgba(255,238,196,.97);box-shadow:0 0 0 1.5px rgba(255,166,52,.8),0 0 18px 4px rgba(255,170,60,.55),inset 0 0 10px rgba(255,190,80,.45),0 2px 10px rgba(10,30,60,.25);animation:ahsok-ripple .95s cubic-bezier(.2,.7,.3,1) forwards}
/* Eyes: glowing amber ovals on the face screen, where the picture's own eyes were. They look at the cursor
   (ahsok-buddy.js moves .ahsok-eyes) and blink. */
.ahsok-eyes{position:absolute;inset:0}
.ahsok-eyes i{position:absolute;border-radius:50%;background:radial-gradient(ellipse at 44% 38%,#fff7cf 0,#ffdc74 30%,#ffbb44 70%,#f79d26 100%);box-shadow:0 0 3px 1px rgba(255,196,80,.85),0 0 10px 3px rgba(255,160,48,.4);transform:rotate(-8deg) scaleY(1);transition:transform .07s ease-in}
.ahsok-eyes .l{left:42.08%;top:50%;width:7.24%;height:11.36%}
.ahsok-eyes .r{left:62.71%;top:40.12%;width:6.88%;height:11.36%}
.ahsok.pop .ahsok-eyes i{transform:rotate(-8deg) scale(1.25)}
.ahsok.blink .ahsok-eyes i{transform:rotate(-8deg) scaleY(.12)}
/* Over a link or button he looks pleased: eyes squint a little and the antenna pulses faster. */
.ahsok.happy .ahsok-eyes i{transform:rotate(-8deg) translateY(12%) scaleY(.62)}
.ahsok.happy.blink .ahsok-eyes i{transform:rotate(-8deg) translateY(12%) scaleY(.12)}
.ahsok-glow{position:absolute;left:30.77%;top:7.61%;width:24%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgba(255,240,180,.9) 0,rgba(255,200,90,.5) 24%,rgba(255,170,60,0) 66%);mix-blend-mode:screen;animation:ahsok-glow 2.4s ease-in-out infinite}
.ahsok.happy .ahsok-glow{animation-duration:.8s}
@keyframes ahsok-bob{0%,100%{transform:translateY(-3%)}50%{transform:translateY(3%)}}
@keyframes ahsok-arm-l{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(3deg)}}
@keyframes ahsok-arm-r{0%,100%{transform:rotate(1deg)}50%{transform:rotate(-7deg)}}
@keyframes ahsok-wave{0%{transform:rotate(0)}16%{transform:rotate(-26deg)}32%{transform:rotate(-11deg)}48%{transform:rotate(-26deg)}64%{transform:rotate(-11deg)}80%{transform:rotate(-22deg)}100%{transform:rotate(0)}}
@keyframes ahsok-flash{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}35%{opacity:1;transform:translate(-50%,-50%) scale(1.8)}100%{opacity:.6;transform:translate(-50%,-50%) scale(1)}}
@keyframes ahsok-ripple{0%{opacity:.95;transform:scale(.5)}100%{opacity:0;transform:scale(2.4)}}
@keyframes ahsok-glow{0%,100%{opacity:.5;transform:translate(-50%,-50%) scale(.85)}50%{opacity:1;transform:translate(-50%,-50%) scale(1.14)}}
@media (max-width:820px),(hover:none),(pointer:coarse){.ahsok,.ahsok-ripple{display:none}} /* 25 Nov 2026 (Zen): no longer hidden with Reduce Motion (was also (prefers-reduced-motion:reduce)) */

.ahsok-speech{position:absolute;left:calc(100% + 8px);top:51%;opacity:0;translate:-4px -50%;transition:opacity .2s ease,translate .3s ease}
.ahsok.is-speaking .ahsok-speech{opacity:1;translate:0 -50%}
.ahsok.is-speaking-nav .ahsok-bob{translate:0 -18%}
