/* The orb's motion for each situation. orb.js sets body.mood-* on a blink. Timings and rules: .claude/skills/spiral-orb-motion/SKILL.md
   The eyes are always Spiral's own two eyes: they move, tilt, grow and close, and never change shape. */
.orb .face{clip-path:circle(42.5%)}
/* Room under the floating orb: the measured moods drop the ball up to 40% of its width. */
.stage{padding-bottom:48px}

/* ---------- Eyes ---------- */
.eye-move,.mood-lids{transform-box:view-box;transform-origin:250px 235px;transition:transform .24s cubic-bezier(.34,1.56,.64,1)}
#eyes path{transform-box:fill-box;transform-origin:center;transition:transform .2s cubic-bezier(.34,1.56,.64,1)}
/* Greeting, stop, dizzy and the body in annoyed and error run from the measured curves in orb-tracks.js. */
/* Thinking: looking up and to the side, drifting, as if working it out. */
body.mood-thinking .eye-move{animation:think 3.2s ease-in-out infinite}
/* Up and aside, but on the ball: with the pointer's look on top (up to 34), 62 put the right eye half off the edge (owner,
   2026-11-07; measured on the eyes' outline: 102% of the visible edge). These peak at about 80% with the look at its furthest. */
@keyframes think{0%,100%{transform:translate(14px,-14px) rotate(-4deg)}50%{transform:translate(22px,-20px) rotate(-6deg)}}
/* Working's slow eye drift loops from orb-tracks.js, as measured. */
/* Asking: something needs your yes. Looking up at you, head straight (the owner's choice: it can wait for days). */
body.mood-asking .eye-move{transform:translateY(-10px) scale(1.06)}
/* Surprised: a notice just came in. Eyes wide, a little jump. */
body.mood-surprised .eye-move{transform:translateY(-14px) scale(1.24)}
body.mood-surprised .orb{animation:surprised .7s cubic-bezier(.23,1,.32,1)}
@keyframes surprised{25%{transform:translateY(-9%) scale(.97,1.05)}60%{transform:translateY(1%)}}
/* Listening: wide awake, head a little to one side. */
body.mood-listening .eye-move{transform:scale(1.14)}
body.mood-listening .orb{transform:rotate(6deg);transition:transform .3s cubic-bezier(.34,1.56,.64,1)}
/* Speaking: the eyes keep time. */
body.mood-speaking .eye-move{animation:speak .42s ease-in-out infinite alternate}
@keyframes speak{to{transform:translateY(-8px)}}
/* Annoyed: same eyes, tilted in and half lowered. */
body.mood-annoyed .eyelids path:first-child{transform:rotate(14deg)!important}
body.mood-annoyed .eyelids path:last-child{transform:rotate(-14deg)!important}
body.mood-annoyed .mood-lids{transform:scaleY(.68)}
/* Error: drooping and low. */
body.mood-error .eye-move{transform:translateY(15px)}
body.mood-error .mood-lids{transform:scaleY(.38)}
/* Finished: looking up and away, pleased. */
body.mood-finished .eye-move{transform:translate(71px,-107px) rotate(-25deg) scale(.7)}
body.mood-finished .orb{transform:translateX(-11%)}
/* Asleep: eyes closed, breathing slowly (Coucou's rhythm), z's rising. */
body.mood-sleeping .eye-move{transform:translateY(14px)}
body.mood-sleeping .mood-lids{transform:scaleY(.09)}
body.mood-sleeping .orb{animation:breathe 3.5s ease-in-out infinite}
@keyframes breathe{50%{transform:scale(.98,1.035)}}
body.mood-sleeping .orb canvas{opacity:.62;transition:opacity .6s}
/* Waking: a stretch, and the eyes come open slowly. */
body.mood-waking .mood-lids{animation:wake-lids 1s ease-out}
@keyframes wake-lids{0%,30%{transform:scaleY(.09)}60%{transform:scaleY(.6)}70%{transform:scaleY(.4)}100%{transform:none}}
body.mood-waking .orb{animation:yawn 1s ease-in-out}
@keyframes yawn{50%{transform:scale(.94,1.12)}}
/* Focused: a timer is running. Eyes a little lowered and steady, breathing slowly, so it keeps quiet with you. */
body.mood-focused .eye-move{transform:translateY(16px)}
body.mood-focused .mood-lids{transform:scaleY(.72)}
body.mood-focused .orb{animation:breathe 4.5s ease-in-out infinite}
/* Vibing: music is playing. The head sways and the eyes bob. */
body.mood-vibing .eye-move{animation:vibe-eyes 1.1s ease-in-out infinite alternate}
@keyframes vibe-eyes{from{transform:translate(-10px,3px) rotate(-5deg)}to{transform:translate(10px,-3px) rotate(5deg)}}
body.mood-vibing .orb{animation:vibe 2.2s ease-in-out infinite}
@keyframes vibe{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(4deg)}}
/* Love: the pointer rested on it. */
body.mood-love .eye-move{transform:scale(1.08)}
body.mood-love .orb{transform:rotate(-6deg);transition:transform .3s cubic-bezier(.34,1.56,.64,1)}

/* ---------- Rising z's and hearts ---------- */
.float-bits{position:absolute;right:2%;top:2%;width:30%;height:30%;pointer-events:none;opacity:0}
body.mood-sleeping .float-bits,body.mood-love .float-bits{opacity:1}
.float-bits i{position:absolute;left:0;bottom:0;color:#fff;font:700 max(9px,calc(var(--orb,112px)*.15))/1 Manrope,system-ui,sans-serif;font-style:normal;opacity:0}
.float-bits i::before{content:'z'}
body.mood-love .float-bits i::before{content:'♥';color:rgb(var(--accent))}
body.mood-sleeping .float-bits i,body.mood-love .float-bits i{animation:rise 3.6s ease-out infinite}
.float-bits i:nth-child(2){animation-delay:1.2s!important}.float-bits i:nth-child(3){animation-delay:2.4s!important}
@keyframes rise{0%{opacity:0;transform:translate(0,0) scale(.7)}15%{opacity:.85}100%{opacity:0;transform:translate(18px,-26px) scale(1.15)}}

/* Mood colour rises from the bottom of the ball like liquid; the shader itself keeps the theme colour. */
.fill{position:absolute;inset:9%;border-radius:50%;overflow:hidden;pointer-events:none}
.fill::after{content:'';position:absolute;inset:0;background:linear-gradient(to top,rgba(var(--mood,var(--accent)),.92),rgba(var(--mood,var(--accent)),.42) 34%,transparent 60%);transform:translateY(100%);transition:transform .32s cubic-bezier(.23,1,.32,1)}
body.mood-error .fill::after{transform:none}
body.mood-error{--mood:238,92,104}

/* ---------- Upload: the ball becomes a tray, a sheet drops in, the slot closes, it becomes a ball ---------- */
.tray{position:absolute;inset:6%;border-radius:50%;background:linear-gradient(160deg,rgba(var(--accent),.95),rgba(var(--accent),.5) 55%,#120b0e);box-shadow:inset 0 0 0 1px #ffffff40;opacity:0;pointer-events:none}
.tray::before{content:'';position:absolute;left:11%;right:11%;top:9%;height:15%;border-radius:99px;background:#000}
.sheet{position:absolute;left:32%;top:0;width:44%;height:50%;border-radius:6%;background:linear-gradient(140deg,#fff,#c9c9d0);box-shadow:0 3px 10px #0007;opacity:0;pointer-events:none}
/* Timing as measured: tray in by 5%, sheet 17-40%, slot shut 43-52%, tray out by 85%. The ball's own moves are in orb-tracks.js. */
body.mood-upload .tray{animation:upload-tray 1.87s linear}
@keyframes upload-tray{0%{opacity:0;border-radius:50%}5%,72%{opacity:1;border-radius:20%}85%,100%{opacity:0;border-radius:50%}}
body.mood-upload .tray::before{animation:upload-slot 1.87s linear}
@keyframes upload-slot{0%,43%{transform:none}52%,100%{transform:scaleY(0)}}
body.mood-upload .orb canvas{animation:upload-canvas 1.87s linear}
@keyframes upload-canvas{0%{opacity:1}5%,72%{opacity:0}85%,100%{opacity:1}}
body.mood-upload .sheet{animation:upload-sheet 1.87s linear}
@keyframes upload-sheet{0%,16%{opacity:0;transform:translate(70%,-70%) rotate(26deg)}18%{opacity:1;transform:translate(66%,-66%) rotate(24deg)}30%{transform:translate(30%,-40%) rotate(-6deg)}40%{opacity:1;transform:translate(0,-14%) rotate(-30deg) scale(.72,.5)}42%,100%{opacity:0;transform:translate(0,-8%) scale(.72,.1)}}
/* A file held over the orb: tray open and waiting until it's dropped. */
body.drop-over .tray{animation:none;opacity:1;border-radius:20%}
body.drop-over .orb canvas{animation:none;opacity:0}
body.drop-over .orb,body.drop-over .tray::before,body.drop-over .sheet{animation:none}

/* ---------- Hands: two round floating blobs in the orb's colour, greeting only, moved by orb-tracks.js ---------- */
.hand{position:absolute;left:50%;top:50%;width:27%;height:27%;margin:-13.5% 0 0 -13.5%;border-radius:50%;background:radial-gradient(circle at 36% 26%,#ffffffc0,rgb(var(--accent)) 42%,rgba(var(--accent),.72));opacity:0;pointer-events:none}

/* ---------- Badge: a working icon that keeps changing; a plain dot for error and finished ---------- */
.mood-badge{position:absolute;left:9%;top:8%;width:22%;height:22%;display:grid;place-items:center;border-radius:50%;background:#2f8df0;box-shadow:0 0 0 2px #000;color:#fff;font:800 calc(var(--orb)*.075)/1 Manrope,system-ui,sans-serif;pointer-events:none;transform:scale(0);transition:transform .24s cubic-bezier(.34,1.56,.64,1)}
body.mood-error .mood-badge,body.mood-finished .mood-badge{transform:scale(.36);box-shadow:none}
body.mood-error .mood-badge{background:#f02a3c}
body.mood-finished .mood-badge{background:#3ce05a}

/* Floating orb: a small circle at its top left with a sound wave while it listens or talks, following the real level. */
.voice-badge{position:absolute;left:7%;top:6%;width:27%;height:27%;display:none;align-items:center;justify-content:center;gap:9%;border-radius:50%;background:#141418;box-shadow:0 0 0 2px #000,0 0 10px rgba(var(--accent),.5);pointer-events:none;z-index:2}
body.listening .voice-badge,body.speaking .voice-badge{display:flex}
body.style-notch .voice-badge{display:none}
.voice-badge i{width:9%;height:58%;border-radius:2px;background:rgb(var(--accent));transform:scaleY(.2)}
body.speaking .voice-badge i{background:#fff}

@media (prefers-reduced-motion:reduce){
 .limb,.orb,.eye-move,.mood-lids,#eyes path,.fill::after,.tray,.tray::before,.sheet,.orb canvas,.mood-badge,.mood-badge::after,.float-bits i{animation:none!important;transition:none!important}
 body.mood-sleeping .float-bits i{opacity:.8}
}
