.motion-stage{overflow:hidden}
.motion-stage .scene{aspect-ratio:30/19;position:relative}
.scene-bg,.scene-layer{position:absolute;inset:0;width:100%;height:100%}
.scene-layer{pointer-events:none}
.sprite{
  display:block;position:absolute;left:var(--x);top:var(--y);width:var(--w);
  background-position:center;background-size:100% 100%;background-repeat:no-repeat;image-rendering:pixelated
}
.rock{aspect-ratio:43/35;background-image:url(art/motion/rock.webp);animation:asteroid-drift 5s ease-in-out infinite alternate}
.drift-b{animation-delay:-3.8s}
.drift-c{animation-delay:-1.45s}
.drift-d{animation-delay:-4.5s}
.paper{aspect-ratio:13/20;background-image:url(art/motion/paper.webp);background-size:200% 100%;background-position:left;animation:paper-hover 2s steps(6) infinite alternate}
.vortex{aspect-ratio:120/110;background-image:url(art/motion/vortex.webp);animation:vortex-spin 12s linear infinite;filter:drop-shadow(0 0 12px #9e61ce)}
.walker{
  aspect-ratio:15/16;background-image:url(art/motion/cat-0.webp);background-size:300% 100%;
  animation:cat-steps .42s steps(2,end) infinite alternate,cat-stroll 5.4s linear infinite;
}
.cat-1{background-image:url(art/motion/cat-1.webp);animation-delay:-.15s,-2.85s;--walk:150%}
.cat-2{background-image:url(art/motion/cat-2.webp);animation-delay:-.25s,-4s;--walk:115%}
.horse{aspect-ratio:20/16;background-image:url(art/motion/horse.webp);animation:canter .55s steps(3,end) infinite alternate;transform-origin:bottom center}
.horse-two{animation-delay:-.28s;scale:-1 1;filter:saturate(.67) brightness(1.17)}
.car{aspect-ratio:28/13;background-image:url(art/motion/car.webp)}
.flag{aspect-ratio:11/19;background-image:url(art/motion/flag.webp);transform-origin:13% 90%;animation:flag-wave .7s steps(5,end) infinite alternate}
.cup{aspect-ratio:15/18;background-image:url(art/motion/cup.webp);animation:paper-hover 2.4s steps(8,end) infinite alternate}
.letter-sprite{aspect-ratio:25/17;background-image:url(art/motion/letter.webp);animation:paper-hover 1.7s steps(6,end) infinite alternate}
.sectors{position:absolute;left:10%;top:24%;height:28%;width:57%;display:flex;align-items:end;gap:5%;border-bottom:1px solid #b5d48b99}
.sectors i{flex:1;background:#cfea98;animation:sector-pulse .8s steps(4) infinite alternate;height:82%;transform-origin:bottom}
.sectors i:nth-child(2n){height:70%;animation-delay:-.55s}
.sectors i:nth-child(3n){height:90%;animation-delay:-.2s}
.sectors i:nth-child(n+4):nth-child(-n+6){height:37%;background:#f3a584}
.confetti{position:absolute;left:45%;top:48%;width:5px;height:5px;opacity:0;background:#f7a880;box-shadow:-80px 16px #e8aaee,90px -31px #eae7a0,97px 9px #a9e3bd,-126px -22px #ef92ae,-45px -43px #e8a8ac,42px -70px #a5d6cb,140px 43px #f7a880,-150px 48px #edc6f9,12px 49px #d2ec9c}
.cup-flash{position:absolute;left:40%;top:11%;width:21%;aspect-ratio:1;opacity:0;background:radial-gradient(#f9d08588,transparent 68%)}

/* Narrative motion is triggered by visibility, independently of navigation. */
#black-hole .scene-visible .vortex{animation-duration:6s}
#horses .scene-visible .car,#telemetry .scene-visible .car,#grand-prix .scene-visible .car{animation:race-away 3.2s ease-in infinite}
#telemetry .scene-visible .sectors i{animation-duration:.55s}
.scene-visible .confetti{animation:party 3.1s linear infinite}
#awards .scene-visible .cup{animation:cup-on-shelf 3.5s ease-in-out infinite}
#awards .scene-visible .cup-flash{animation:party 3.5s ease-out infinite}
#final .scene-visible .letter-sprite{animation:letter-open 3.6s ease-out infinite}
@keyframes asteroid-drift{to{translate:16% -17%;rotate:13deg}}
@keyframes paper-hover{to{translate:0 -12%}}
@keyframes vortex-spin{to{rotate:360deg}}
@keyframes cat-steps{from{background-position:0 0}to{background-position:100% 0}}
@keyframes cat-stroll{0%,100%{translate:0 0;scale:1 1}49.9%{translate:var(--walk,135%) 14%;scale:1 1}50%{translate:var(--walk,135%) 14%;scale:-1 1}99.9%{translate:0 0;scale:-1 1}}
@keyframes canter{to{translate:9% -8%;rotate:4deg}}
@keyframes flag-wave{from{rotate:-6deg}to{rotate:8deg;scale:1.08 1}}
@keyframes sector-pulse{to{scale:1 .66}}
@keyframes race-away{0%,22%{translate:0 0}31%{translate:-6% 0}64%,91%{translate:470% -19%}93%{opacity:0;translate:470% -19%}95%{opacity:0;translate:0 0}100%{opacity:1;translate:0 0}}
@keyframes cup-on-shelf{0%,20%{translate:0 0}41%{translate:0 -18%;filter:brightness(1.3)}58%,91%{translate:0 47%}}
@keyframes party{0%,15%,96%,100%{opacity:0;scale:.25}29%{opacity:.96;scale:1}72%{opacity:0;scale:1.6;translate:0 28px}}
@keyframes letter-open{0%,16%{scale:1}36%,66%{scale:1.38;translate:0 -25%;filter:brightness(1.24)}88%,100%{scale:1}}

.growth-island{aspect-ratio:104/40;background-image:url(art/motion/growth-island.webp)}
.growth-building{transform-origin:bottom center}
.growth-low{aspect-ratio:24/28;background-image:url(art/motion/growth-low.webp);--rise-delay:120ms}
.growth-mid{aspect-ratio:28/46;background-image:url(art/motion/growth-mid.webp);--rise-delay:240ms}
.growth-high{aspect-ratio:31/63;background-image:url(art/motion/growth-high.webp);--rise-delay:400ms}
.scene-visible .growth-building{animation:city-rises .85s var(--rise-delay) cubic-bezier(.18,.78,.33,1) both}
@keyframes city-rises{
  from{scale:1 .08;opacity:.2;filter:brightness(1.3)}
  to{scale:1;opacity:1;filter:brightness(1)}
}
.birthday-cake{aspect-ratio:29/26;background-image:url(art/motion/birthday-cake.webp)}
.birthday-paw{aspect-ratio:25/22;background-image:url(art/motion/birthday-paw.webp)}
.birthday-bottle{aspect-ratio:22/35;background-image:url(art/motion/birthday-bottle.webp)}
.birthday-palm{aspect-ratio:34/38;background-image:url(art/motion/birthday-palm.webp)}
.birthday-shades{aspect-ratio:34/15;background-image:url(art/motion/birthday-shades.webp)}
.scene-visible .birthday-prop{
  animation:birthday-pop .64s var(--delay) cubic-bezier(.22,.66,.28,1.25) both,
    birthday-bob 2.4s calc(.64s + var(--delay)) ease-in-out infinite alternate;
}
@keyframes birthday-pop{
  from{opacity:0;translate:0 20px;scale:.62}
  to{opacity:1;translate:0 0;scale:1}
}
@keyframes birthday-bob{to{translate:0 -7%;rotate:4deg}}

.institute{aspect-ratio:64/52;background-image:url(art/motion/institute.webp)}
.academic-cap{aspect-ratio:42/28;background-image:url(art/motion/academic-cap.webp)}
.reading-glasses{aspect-ratio:39/20;background-image:url(art/motion/reading-glasses.webp)}
.document-stack{aspect-ratio:32/38;background-image:url(art/motion/document-stack.webp)}
.office-stamp{aspect-ratio:29/28;background-image:url(art/motion/office-stamp.webp)}
.ink-pen{aspect-ratio:34/37;background-image:url(art/motion/ink-pen.webp)}
.scene-visible .chapter-prop{animation:chapter-prop-drift 2.2s var(--prop-delay) ease-in-out infinite alternate}
@keyframes chapter-prop-drift{
  from{translate:0 0;rotate:-5deg}
  to{translate:5% -16%;rotate:5deg}
}
