/* =========================================================================
   Lead Collector — animations.css
   Ambient CSS keyframes (floating, orbit rotation, pulses, caption reveal).
   Story animation is driven by the JS timeline; these loops add life and
   pause automatically when the presentation is paused.
   ========================================================================= */

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
@keyframes ringOut { from { transform: scale(1); opacity: .8; } to { transform: scale(1.35); opacity: 0; } }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .7); } 100% { box-shadow: 0 0 0 14px rgba(34, 197, 94, 0); } }
@keyframes shine { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@keyframes glowBreath { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@keyframes capWord { from { opacity: 0; transform: translateY(.45em); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes capFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Ambient loops */
.flt { animation: float 6s ease-in-out infinite; }
.scrap-w:nth-of-type(2n) .flt, .s2-card:nth-of-type(2n) .flt, .s11-f:nth-of-type(2n) .flt { animation-duration: 7.5s; animation-delay: -2s; }
.scrap-w:nth-of-type(3n) .flt, .s2-card:nth-of-type(3n) .flt, .s11-f:nth-of-type(3n) .flt { animation-duration: 6.8s; animation-delay: -4s; }
.spin-slow { animation: spin 40s linear infinite; }
.spin-rev { animation: spinRev 60s linear infinite; }
.s4-node .ring.r1 { animation: spin 18s linear infinite; }
.orb { animation: glowBreath 4s ease-in-out infinite; }

/* Caption reveal (re-triggered on every scene change). Not paused, so
   seeking while paused still shows the headline. */
#caption.anim .cap-kicker { animation: capFade .6s .05s both; }
#caption.anim .cap-h .w { animation: capWord .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 55ms + 150ms); }
#caption.anim .cap-sub span { display: inline-block; animation: capFade .7s .7s both; }

/* Pause ambient loops together with the timeline */
body.paused .scene *, body.paused .scene *::before, body.paused .scene *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .flt, .spin-slow, .spin-rev, .orb { animation: none; }
  #caption.anim .cap-h .w { animation-duration: .01s; animation-delay: 0s; }
}
