/* ==========================================================================
   RaidPixels — animations.css
   Scroll-reveal, keyframes, hover motion. All gated by prefers-reduced-motion.
   ========================================================================== */

/* ---------- Scroll reveal (driven by Intersection Observer in animations.js) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* Stagger children */
[data-reveal-group] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms var(--ease), transform 560ms var(--ease);
}
[data-reveal-group].is-visible > * { opacity: 1; transform: none; }
[data-reveal-group].is-visible > *:nth-child(1) { transition-delay: 60ms; }
[data-reveal-group].is-visible > *:nth-child(2) { transition-delay: 120ms; }
[data-reveal-group].is-visible > *:nth-child(3) { transition-delay: 180ms; }
[data-reveal-group].is-visible > *:nth-child(4) { transition-delay: 240ms; }
[data-reveal-group].is-visible > *:nth-child(5) { transition-delay: 300ms; }
[data-reveal-group].is-visible > *:nth-child(6) { transition-delay: 360ms; }

/* ---------- Keyframes ---------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes float-y-slow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}
@keyframes pulse-ring {
  0%   { opacity: 0.8; transform: scale(0.9); }
  70%  { opacity: 0;   transform: scale(1.25); }
  100% { opacity: 0; }
}
@keyframes dash {
  to { stroke-dashoffset: 0; }
}
@keyframes gradient-pan {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero visual motion ---------- */
.float-a { animation: float-y 7s var(--ease) infinite; transform-origin: center; }
.float-b { animation: float-y-slow 9s var(--ease) infinite; transform-origin: center; }
.spin-ring { animation: spin-slow 38s linear infinite; transform-origin: center; transform-box: fill-box; }
.draw-path {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  animation: dash 2.4s var(--ease) forwards 0.3s;
}

/* Animated gradient headline accent */
.hero h1 .text-gradient {
  background-size: 200% auto;
  animation: gradient-pan 6s linear infinite alternate;
}

/* Hero intro for non-JS / initial paint of LCP block */
.hero-copy > * { animation: fade-up 700ms var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: 80ms; }
.hero-copy > *:nth-child(3) { animation-delay: 160ms; }
.hero-copy > *:nth-child(4) { animation-delay: 240ms; }
.hero-copy > *:nth-child(5) { animation-delay: 320ms; }

/* Pulsing live dot */
.live-dot { position: relative; }
.live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse-ring 2.4s var(--ease) infinite;
}

/* ---------- Reduced motion: disable all non-essential animation ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal], [data-reveal-group] > * { opacity: 1 !important; transform: none !important; }
  .draw-path { stroke-dashoffset: 0 !important; }
}
