/* ═══════════════════════════════════════════════
   LOGITONIX — ANIMATIONS v3
   Antimatter-inspired motion system
═══════════════════════════════════════════════ */

/* ─── Gradient Spin (CTA button border) ──────── */
@keyframes gradientSpin {
  to { --angle: 360deg; }
}

/* ─── Hero Word Slide Up ─────────────────────── */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.hero-word {
  display: inline-block;
  overflow: hidden;
}
.hero-word > span {
  display: inline-block;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero-word:nth-child(1) > span { animation-delay: 0.1s; }
.hero-word:nth-child(2) > span { animation-delay: 0.2s; }
.hero-word:nth-child(3) > span { animation-delay: 0.3s; }
.hero-word:nth-child(4) > span { animation-delay: 0.4s; }
.hero-word:nth-child(5) > span { animation-delay: 0.5s; }
.hero-word:nth-child(6) > span { animation-delay: 0.6s; }

/* ─── Fade In Up (generic) ───────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.fade-in-up--d1 { animation-delay: 0.1s; }
.fade-in-up--d2 { animation-delay: 0.2s; }
.fade-in-up--d3 { animation-delay: 0.35s; }
.fade-in-up--d4 { animation-delay: 0.5s; }

/* ─── Scroll-Driven Section Reveal ───────────── */
@keyframes revealSection {
  from {
    opacity: 0;
    clip-path: inset(8% 0 0 0);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
}

.reveal-section {
  animation: revealSection linear both;
  animation-timeline: view();
  animation-range: entry 0% entry 50%;
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: view()) {
  .reveal-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1);
  }
  .reveal-section.in-view {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Marquee Ticker ─────────────────────────── */
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}
.ticker__track {
  display: flex;
  gap: var(--space-12);
  animation: marquee 30s linear infinite;
  width: max-content;
}
.ticker__track:hover {
  animation-play-state: paused;
}

/* ─── Hero Background Pulse ──────────────────── */
@keyframes heroPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.05);
  }
}
.hero__glow {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(79,142,247,0.08) 0%, transparent 70%);
  animation: heroPulse 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* ─── Card Hover ─────────────────────────────── */
.card-hover {
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s cubic-bezier(0.16,1,0.3,1), border-color 0.3s var(--ease);
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--color-border-hover);
}

/* ─── Stagger Children ───────────────────────── */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16,1,0.3,1), transform 0.5s cubic-bezier(0.16,1,0.3,1);
}
.stagger.in-view > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger.in-view > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger.in-view > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger.in-view > *:nth-child(4) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger.in-view > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger.in-view > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }

/* ─── Stat Counter Pop ───────────────────────── */
@keyframes countPop {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.stat-counter.counted .stat-counter__number {
  animation: countPop 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* ─── Reduced Motion ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-word > span,
  .fade-in-up,
  .reveal-section,
  .ticker__track,
  .hero__glow,
  .card-hover,
  .stagger > * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
