.mascot-rig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.mascot-rig { visibility: hidden; }

.mascot-motion.rig-playing .mascot-rig { visibility: visible; }
.mascot-mesh {
  position: absolute; inset: 0; width: 100%; height: 100%;
  visibility: hidden; pointer-events: none;
}
.mascot-motion.rig-playing.mesh-visible .mascot-hero { opacity: 0; }
.mascot-motion.rig-playing.mesh-visible .mascot-mesh { visibility: visible; }
.mascot-rig-ready .mascot-sparks { display: none; }
@media (hover: hover) {
  .mascot-rig-ready { pointer-events: auto; }
}

.rig-spark { opacity: 0; }
.rig-lid-reveal { opacity: 0; }
.rig-lid-window { transform: scaleY(0); transform-box: fill-box; transform-origin: top; }

.rig-playing .rig-clock { animation: rig-cycle 3.55s linear both; }
.rig-playing .rig-lid-reveal { animation: rig-lid-reveal 3.55s ease-in-out both; }
.rig-playing .rig-lid-window { animation: rig-lid-window 3.55s ease-in-out both; }
.rig-playing .rig-spark { animation: rig-starlight 1.04s var(--delay) cubic-bezier(.18,.6,.36,1) both; }
.rig-spark-a { --delay: .68s; --dx: -55px; --dy: -45px; }
.rig-spark-b { --delay: .76s; --dx: -90px; --dy: -23px; }
.rig-spark-c { --delay: .89s; --dx: -61px; --dy: -78px; }

@keyframes rig-cycle { from { opacity: 0; } to { opacity: 1; } }
@keyframes rig-lid-reveal {
  0%, 53.8%, 61.2%, 100% { opacity: 0; }
  55%, 59.7% { opacity: 1; }
}
@keyframes rig-lid-window {
  0%, 53.8%, 61.2%, 100% { transform: scaleY(0); }
  56.7%, 57.8% { transform: scaleY(1); }
}
@keyframes rig-starlight {
  from { opacity: 0; transform: translate(0, 0) scale(.25); }
  20%, 47% { opacity: 1; }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.6) rotate(54deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot-motion.rig-playing .mascot-rig { visibility: hidden; }
  .mascot-motion.rig-playing.mesh-visible .mascot-mesh { visibility: hidden; }
  .mascot-motion.rig-playing.mesh-visible .mascot-hero { opacity: 1; }
  .mascot-rig * { animation: none !important; }
}
