/* Where is Alex: what head.js and orb.js need. No external requests. */

/* The drawings are measured in content-box, as in the design; a page-wide
   border-box reset must not reach inside them. */
.wia-head, .wia-head *, .wia-orb, .wia-orb * { box-sizing: content-box; }
.wia-head, .wia-orb { line-height: normal; letter-spacing: normal; text-transform: none; }
.wia-orb svg { max-width: none; max-height: none; }

/* The crew blinks together: head.js toggles .wia-blink on <html> for 125 ms. */
.wia-blink .wia-live .wia-eye { transform: scaleY(.08); }

/* The orb. obShake and obSweat* come from the design as written. */
@keyframes obShake { 0%,100% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) } }
@keyframes obSweatA { 0% { transform: translate(0,0) scale(.4); opacity: 0 } 22% { transform: translate(-7px,-7px) scale(1); opacity: 1 } 100% { transform: translate(-27px,-31px) scale(.75); opacity: 0 } }
@keyframes obSweatB { 0% { transform: translate(0,0) scale(.4); opacity: 0 } 22% { transform: translate(1px,-9px) scale(1); opacity: 1 } 100% { transform: translate(5px,-39px) scale(.75); opacity: 0 } }
@keyframes obSweatC { 0% { transform: translate(0,0) scale(.4); opacity: 0 } 22% { transform: translate(7px,-7px) scale(1); opacity: 1 } 100% { transform: translate(29px,-29px) scale(.75); opacity: 0 } }

/* The design names these without defining them; the shapes are the app's
   (OrbView.swift). Each runs `alternate` where the app autoreverses. */
/* Resting: a 4-unit float, 3.8 s each way. */
@keyframes obBob { from { transform: translateY(0) } to { transform: translateY(-4px) } }
/* Has news: wait 3 s, one 10-unit hop (0.22 s up, 0.22 s down), never a jiggle. */
@keyframes obHop {
  0%, 88.2% { transform: translateY(0); animation-timing-function: ease-out }
  94.1% { transform: translateY(-10px); animation-timing-function: ease-in }
  100% { transform: translateY(0) }
}
/* Scheming: the ball squashes on its base (transform-origin set by orb.js). */
@keyframes obSquash { from { transform: scale(1, 1) } to { transform: scale(1.05, .93) } }
/* The orb's own blink: about 90 ms shut, once a cycle. */
@keyframes obBlink { 0%, 96%, 99%, 100% { transform: scaleY(1) } 97.5% { transform: scaleY(.1) } }
/* Has news: the ochre ring grows off the ball and fades. */
@keyframes obRing { from { transform: scale(1); opacity: .9 } to { transform: scale(1.35); opacity: 0 } }
/* Scheming: fingers tap in a wave, left hand clockwise, right hand counter. */
@keyframes orbTapL { from { transform: rotate(-4deg) } to { transform: rotate(6deg) } }
@keyframes orbTapR { from { transform: rotate(4deg) } to { transform: rotate(-6deg) } }

@media (prefers-reduced-motion: reduce) {
  .wia-head, .wia-head *, .wia-orb, .wia-orb * { animation: none !important; transition: none !important; }
  .wia-blink .wia-live .wia-eye { transform: none; }
}
