/* ============================================
   TrainO Website - Centralized Animations
   All @keyframes and animation utilities
   ============================================ */

/* Float phone — 8px translateY oscillation */
@keyframes floatPhone {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Breathe glow — box-shadow pulse matching app's 2.8s rhythm */
@keyframes breatheGlow {
  0%, 100% {
    box-shadow: var(--glow-ring);
  }
  50% {
    box-shadow: var(--glow-ring-active);
  }
}

/* Reveal line — clip-path text reveal */
@keyframes revealLine {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* Count up — opacity fade for number counters */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Gradient shift — slow radial gradient position morph */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Stagger fade up */
@keyframes staggerFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dot pulse — subtle opacity pulse for grid dots */
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* Ring rotate — slow 360deg rotation for decorative rings */
@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ring glow — for brand/ring breathing */
@keyframes ringGlow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(47, 143, 131, 0.3))
            drop-shadow(0 0 20px rgba(47, 143, 131, 0.08));
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(47, 143, 131, 0.5))
            drop-shadow(0 0 32px rgba(47, 143, 131, 0.15));
  }
}

/* Fade in up — general entrance */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scale in */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Fade left/right */
@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Step fill — circle border fill animation */
@keyframes stepFill {
  from {
    background: transparent;
    border-color: rgba(47, 143, 131, 0.25);
  }
  to {
    background: rgba(47, 143, 131, 0.15);
    border-color: rgba(47, 143, 131, 0.5);
  }
}

/* Hero H1 shimmer — teal light sweeps across text once on load */
@keyframes heroShimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Hero ring glow pulse — 3 pulses then stop */
@keyframes heroRingPulse {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(95, 175, 166, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(95, 175, 166, 0.7))
            drop-shadow(0 0 40px rgba(95, 175, 166, 0.3));
  }
}

/* ============================================
   Stagger delay utilities
   ============================================ */
.delay-1 { animation-delay: 80ms !important; }
.delay-2 { animation-delay: 160ms !important; }
.delay-3 { animation-delay: 240ms !important; }
.delay-4 { animation-delay: 320ms !important; }
.delay-5 { animation-delay: 400ms !important; }
.delay-6 { animation-delay: 480ms !important; }

/* ============================================
   Scroll-triggered animation base
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll[data-animation="fade-left"] {
  transform: translateX(-28px);
}

.animate-on-scroll[data-animation="fade-left"].visible {
  transform: translateX(0);
}

.animate-on-scroll[data-animation="fade-right"] {
  transform: translateX(28px);
}

.animate-on-scroll[data-animation="fade-right"].visible {
  transform: translateX(0);
}

.animate-on-scroll[data-animation="scale-in"] {
  transform: scale(0.92);
}

.animate-on-scroll[data-animation="scale-in"].visible {
  transform: scale(1);
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
