/* ============================================================
   STRATUM.EARTH – ANIMATIONS
   Keyframes, Transitions, AOS Overrides, Micro-animations
   ============================================================ */

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

/* Float up and down */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(79,87,245,0.3), 0 0 40px rgba(79,87,245,0.1); }
  50% { box-shadow: 0 0 40px rgba(79,87,245,0.6), 0 0 80px rgba(79,87,245,0.3); }
}

/* Pulse soft */
@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Rotate */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Rotate slow */
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Gradient shift */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade in left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Particle move */
@keyframes particleMove {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

/* Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Ping */
@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Bounce */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Slide down */
@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Dash animation for SVG */
@keyframes dashMove {
  to { stroke-dashoffset: 0; }
}

/* Globe spin */
@keyframes globeSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* Data blink */
@keyframes dataBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Counter pop */
@keyframes counterPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Wave */
@keyframes wave {
  0% { transform: translateX(0) scaleY(1); }
  50% { transform: translateX(-25%) scaleY(0.8); }
  100% { transform: translateX(-50%) scaleY(1); }
}

/* Neural pulse */
@keyframes neuralPulse {
  0% { stroke-dashoffset: 1000; opacity: 0; }
  50% { opacity: 0.8; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Orbit */
@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

/* Ticker */
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   ANIMATION UTILITIES
   ============================================================ */

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-slow {
  animation: float 6s ease-in-out infinite;
}

.animate-float-2 {
  animation: float 4s ease-in-out 1s infinite;
}

.animate-float-3 {
  animation: float 4s ease-in-out 2s infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 20s linear infinite;
}

.animate-rotate-slow {
  animation: rotateSlow 40s linear infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.animate-bounce {
  animation: bounce 2s ease-in-out infinite;
}

.animate-ping {
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease both;
}

/* Stagger delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ============================================================
   SCROLL REVEAL (custom, used by JS IntersectionObserver)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger children on reveal */
.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 100ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 200ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 300ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 400ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 500ms; }
.stagger-children .reveal:nth-child(7) { transition-delay: 600ms; }
.stagger-children .reveal:nth-child(8) { transition-delay: 700ms; }
.stagger-children .reveal:nth-child(9) { transition-delay: 800ms; }

/* ============================================================
   HERO ANIMATIONS
   ============================================================ */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Particle canvas */
#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Floating analytics cards */
.float-card-1 {
  animation: float 4s ease-in-out infinite;
}

.float-card-2 {
  animation: float 5s ease-in-out 1s infinite;
}

.float-card-3 {
  animation: float 4.5s ease-in-out 0.5s infinite;
}

/* ============================================================
   SHIMMER LOADING
   ============================================================ */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    var(--bg-section) 50%,
    var(--border-light) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   HOVER MICRO ANIMATIONS
   ============================================================ */
.hover-lift {
  transition: transform var(--transition-spring), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-lift-sm:hover {
  transform: translateY(-2px);
}

.hover-scale {
  transition: transform var(--transition-spring);
}

.hover-scale:hover {
  transform: scale(1.03);
}

.hover-icon svg {
  transition: transform var(--transition-spring);
}

.hover-icon:hover svg {
  transform: translateX(4px);
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-transition-enter {
  animation: fadeIn 0.4s ease;
}

/* ============================================================
   GLOW EFFECTS
   ============================================================ */
.glow-primary {
  filter: drop-shadow(0 0 12px rgba(79,87,245,0.5));
}

.glow-text {
  text-shadow: 0 0 30px rgba(79,87,245,0.5);
}

/* ============================================================
   GLOBE RING ANIMATIONS
   ============================================================ */
.globe-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(79, 87, 245, 0.3);
  animation: rotateSlow 20s linear infinite;
}

.globe-ring-2 {
  animation: rotateSlow 30s linear infinite reverse;
}

.globe-ring-3 {
  animation: rotateSlow 15s linear infinite;
  border-color: rgba(169, 174, 255, 0.2);
}

/* ============================================================
   DATA STREAM EFFECTS
   ============================================================ */
.data-stream {
  position: absolute;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--primary), transparent);
  animation: particleMove 3s linear infinite;
}

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter-animated {
  animation: counterPop 0.3s ease;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 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;
  }
}
