/* =========================================================
   RGRP (Resurgence RP Story) — Animations & Special FX
   Theme: Original Metallic Gold CI + Peak-RP Tactical FX
   ========================================================= */

/* Radar / Status Dot Pulse */
@keyframes onlinePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes goldPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
}

/* Ambient Logo Float with Metallic Gold Aura */
@keyframes heroLogoFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 25px rgba(212, 175, 55, 0.35));
  }
  50% {
    transform: translateY(-8px) scale(1.02);
    filter: drop-shadow(0 25px 38px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 45px rgba(245, 215, 127, 0.6));
  }
}

/* Button Metallic Sheen Sweep */
@keyframes sheenSweep {
  0% {
    left: -100%;
  }
  20%, 100% {
    left: 200%;
  }
}

/* Scroll Hint Bouncing */
@keyframes floatyHint {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* Base Animation Utility Classes */
.animate-hero-logo {
  animation: heroLogoFloat 4.5s ease-in-out infinite;
  will-change: transform, filter;
}

.dot-online {
  animation: onlinePulse 2s ease-out infinite;
}

.dot-gold {
  animation: goldPulse 2s ease-out infinite;
}

.hint-bounce {
  animation: floatyHint 2.4s ease-in-out infinite;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.stagger > :nth-child(1) { transition-delay: 0.05s; }
.stagger > :nth-child(2) { transition-delay: 0.12s; }
.stagger > :nth-child(3) { transition-delay: 0.19s; }
.stagger > :nth-child(4) { transition-delay: 0.26s; }
.stagger > :nth-child(5) { transition-delay: 0.33s; }
.stagger > :nth-child(6) { transition-delay: 0.40s; }

/* ============ FX GLITCHCORE ============ */
.fx-glitch {
  position: relative;
  display: inline-block;
}

.fx-glitch::before,
.fx-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  pointer-events: none;
  background: none !important;
}

.fx-glitch::before {
  color: var(--ink-2, #F5D77F);
  -webkit-text-fill-color: var(--ink-2, #F5D77F) !important;
  clip-path: inset(0 0 52% 0);
  animation: fx-glitch-a 4.0s steps(1) infinite;
  text-shadow: -2px 0 12px rgba(245, 215, 127, 0.85);
  z-index: 2;
}

.fx-glitch::after {
  color: var(--ink-3, #10B981);
  -webkit-text-fill-color: var(--ink-3, #10B981) !important;
  clip-path: inset(48% 0 0 0);
  animation: fx-glitch-b 4.0s steps(1) infinite;
  text-shadow: 2px 0 12px rgba(16, 185, 129, 0.85);
  z-index: 3;
}

/* 92% of the 4.0s cycle is pure calm stillness (~3.7s), 8% is a crisp single micro-burst (~0.3s) */
@keyframes fx-glitch-a {
  0%, 91.9%, 100% {
    transform: translate(0);
    opacity: 0;
  }
  92.0% {
    transform: translate(-5px, -2px);
    opacity: 0.95;
  }
  93.2% {
    transform: translate(4px, 1px);
    opacity: 0.9;
  }
  94.4% {
    transform: translate(-3px, 2px);
    opacity: 0.95;
  }
  95.6% {
    transform: translate(0);
    opacity: 0;
  }
  96.8% {
    transform: translate(3px, -1px);
    opacity: 0.85;
  }
  97.8% {
    transform: translate(0);
    opacity: 0;
  }
}

@keyframes fx-glitch-b {
  0%, 92.2%, 100% {
    transform: translate(0);
    opacity: 0;
  }
  92.5% {
    transform: translate(4px, 2px);
    opacity: 0.95;
  }
  93.6% {
    transform: translate(-4px, -1px);
    opacity: 0.9;
  }
  94.8% {
    transform: translate(3px, -2px);
    opacity: 0.95;
  }
  95.8% {
    transform: translate(0);
    opacity: 0;
  }
  97.0% {
    transform: translate(-3px, 1px);
    opacity: 0.85;
  }
  98.0% {
    transform: translate(0);
    opacity: 0;
  }
}

.fx-glitch:hover::before,
.fx-glitch:hover::after {
  animation-duration: 1.0s;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .animate-hero-logo {
    animation: none !important;
  }
}
