/* ═══════════════════════════════════════════════════════════
   ABI NEXUS — animations.css
   fadeInUp · glowPulse · scanlines · particleField ·
   weaponReveal · countUp · mapPing · biohazardRotate
   ═══════════════════════════════════════════════════════════ */

/* ── Révélations au scroll (Intersection Observer) ── */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.reveal-left { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.visible { opacity: 1; transform: none; }

/* Variantes de délais en cascade (stagger) */
.stagger-1 { --reveal-delay: 0.08s; }
.stagger-2 { --reveal-delay: 0.16s; }
.stagger-3 { --reveal-delay: 0.24s; }
.stagger-4 { --reveal-delay: 0.32s; }
.stagger-5 { --reveal-delay: 0.40s; }
.stagger-6 { --reveal-delay: 0.48s; }

/* ── fadeInUp (déclenchement chargement) ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-fade-up { animation: fadeInUp 0.8s var(--ease-out) both; }
.anim-delay-1 { animation-delay: 0.15s; }
.anim-delay-2 { animation-delay: 0.3s; }
.anim-delay-3 { animation-delay: 0.45s; }
.anim-delay-4 { animation-delay: 0.6s; }

/* ── glowPulse (éléments accentués) ── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(200,168,75,0.35); }
  50% { box-shadow: 0 0 26px rgba(200,168,75,0.75); }
}
.glow-pulse { animation: glowPulse 2.4s ease-in-out infinite; }
.glow-pulse-green { animation: glowPulse 2.4s ease-in-out infinite; }
.glow-pulse-green, .glow-pulse-green * { --glow: rgba(46,255,143,0.5); }

@keyframes textGlowPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(200,168,75,0.35); }
  50% { text-shadow: 0 0 30px rgba(200,168,75,0.85), 0 0 60px rgba(200,168,75,0.3); }
}
.text-glow { animation: textGlowPulse 3s ease-in-out infinite; }

/* ── scanlines (images hero au chargement) ── */
.scanlines { position: relative; overflow: hidden; }
.scanlines::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.14) 0px,
    rgba(0,0,0,0.14) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.scanlines::before {
  content: "";
  position: absolute; left: 0; right: 0; height: 34%;
  background: var(--gradient-scanline);
  animation: scanSweep 5.5s linear infinite;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}
@keyframes scanSweep {
  0% { top: -40%; }
  100% { top: 110%; }
}

/* ── particleField (champ de particules hero) ── */
.particle-field {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-particles);
}
.particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--color-accent-gold);
  opacity: 0;
  animation: particleFloat var(--p-dur, 9s) linear infinite;
  animation-delay: var(--p-delay, 0s);
  box-shadow: 0 0 6px currentColor;
}
@keyframes particleFloat {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  12% { opacity: 0.85; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-110vh) translateX(var(--p-drift, 30px)) scale(0.4); opacity: 0; }
}
.particle.green { background: var(--color-accent-green); }
.particle.red { background: var(--color-accent-red); }

/* ── weaponReveal (cartes armes au scroll) ── */
@keyframes weaponReveal {
  from { clip-path: inset(0 100% 0 0); opacity: 0; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}
.weapon-reveal { animation: weaponReveal 0.9s var(--ease-out) both; }

/* ── countUp (chiffres animés) ── */
.counter {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ── mapPing (hotspots carte) ── */
.map-ping { position: relative; }
.map-ping::after {
  content: "";
  position: absolute; inset: -6px;
  border: 2px solid var(--color-accent-green);
  border-radius: 50%;
  animation: mapPing 1.8s var(--ease-out) infinite;
}
@keyframes mapPing {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ── biohazardRotate (badges S7) ── */
.biohazard-spin { animation: biohazardRotate 7s linear infinite; display: inline-block; }
@keyframes biohazardRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Badge NOUVEAU animé ── */
@keyframes badgeNew {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46,255,143,0.55); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 7px rgba(46,255,143,0); }
}
.badge-new { animation: badgeNew 1.6s ease-out infinite; }

/* ── Bandeau défilant (breaking news) ── */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  border-block: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  position: relative;
}
.ticker-track {
  display: inline-flex;
  gap: 3.5rem;
  padding: 12px 0;
  animation: tickerScroll 42s linear infinite;
  font-family: var(--font-data);
  font-size: 0.92rem;
  color: var(--color-text-secondary);
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { color: var(--color-text-primary); transition: color var(--t-fast); }
.ticker-track a:hover { color: var(--color-accent-gold); }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── CTA pulsant ── */
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}
.cta-pulse { animation: ctaPulse 2s ease-in-out infinite; }

/* ── Barres de stats animées ── */
.stat-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 1.2s var(--ease-out);
  transition-delay: var(--stat-delay, 0.2s);
}
.visible .stat-fill, .stat-animate .stat-fill { width: var(--w, 0%); }

/* ── Skeleton / chargement ── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-tertiary) 25%, var(--color-bg-elevated) 50%, var(--color-bg-tertiary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

/* ── Rotation douce infinie (loader) ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent-gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ── Transitions de page (F07) ── */
.page-transition {
  position: fixed; inset: 0;
  background: var(--color-bg-primary);
  z-index: var(--z-overlay);
  transform: scaleY(1);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out);
  pointer-events: none;
}
.page-transition.done { transform: scaleY(0); }

/* ── Reduced motion (accessibilité) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
