/* Spectral Effects — Ghost Frequency Animations */

/* Ecto-pulse: green glow pulsing on panels */
@keyframes ecto-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(57, 255, 142, 0.05); }
  50% { box-shadow: 0 0 20px rgba(57, 255, 142, 0.15), 0 0 40px rgba(57, 255, 142, 0.05); }
}

.ecto-pulse {
  animation: ecto-pulse 3s ease-in-out infinite;
}

/* Static-flicker: random opacity flicker like bad TV reception */
@keyframes static-flicker {
  0%, 100% { opacity: 1; }
  10% { opacity: 0.95; }
  20% { opacity: 1; }
  30% { opacity: 0.92; }
  40% { opacity: 1; }
  50% { opacity: 0.97; }
  55% { opacity: 0.88; }
  60% { opacity: 1; }
  70% { opacity: 0.94; }
  80% { opacity: 1; }
  90% { opacity: 0.96; }
}

.static-flicker {
  animation: static-flicker 0.8s steps(1) infinite;
}

/* Spirit-drift: slow floating upward motion */
@keyframes spirit-drift {
  0% { transform: translateY(0) scale(1); opacity: 0.6; }
  50% { transform: translateY(-12px) scale(1.02); opacity: 0.8; }
  100% { transform: translateY(0) scale(1); opacity: 0.6; }
}

.spirit-drift {
  animation: spirit-drift 6s ease-in-out infinite;
}

/* Detector-ping: ripple/pulse for triangulation circles */
@keyframes detector-ping {
  0% { stroke-opacity: 0.6; stroke-width: 2; }
  50% { stroke-opacity: 0.3; stroke-width: 3; }
  100% { stroke-opacity: 0.6; stroke-width: 2; }
}

.detector-ping {
  animation: detector-ping 2s ease-in-out infinite;
}

/* Waveform-scroll: horizontal scroll for spectrogram */
@keyframes waveform-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.waveform-scroll {
  animation: waveform-scroll 20s linear infinite;
}

/* Symbol-reveal: fade-in with scale + blur clear */
@keyframes symbol-reveal {
  0% { opacity: 0; transform: scale(0.8); filter: blur(4px); }
  60% { opacity: 1; transform: scale(1.05); filter: blur(1px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.symbol-reveal {
  animation: symbol-reveal 0.5s ease-out forwards;
}

/* Glow text */
@keyframes ghost-glow {
  0%, 100% { text-shadow: 0 0 8px rgba(57, 255, 142, 0.3); }
  50% { text-shadow: 0 0 16px rgba(57, 255, 142, 0.5), 0 0 30px rgba(57, 255, 142, 0.2); }
}

.ghost-glow {
  animation: ghost-glow 2s ease-in-out infinite;
}

/* EVP tape spin */
@keyframes tape-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tape-spin {
  animation: tape-spin 2s linear infinite;
}

/* Signal lock */
@keyframes signal-lock {
  0% { border-color: var(--ghost-green); box-shadow: 0 0 0 rgba(57, 255, 142, 0); }
  50% { border-color: var(--ghost-green); box-shadow: 0 0 20px rgba(57, 255, 142, 0.4); }
  100% { border-color: var(--ghost-green); box-shadow: 0 0 0 rgba(57, 255, 142, 0); }
}

.signal-lock {
  animation: signal-lock 1.5s ease-in-out infinite;
}

/* Fade in */
@keyframes fade-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fade-in 0.4s ease-out forwards;
}

/* Pulse ring (for crosshair / target) */
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2); opacity: 0; }
}

.pulse-ring {
  animation: pulse-ring 1.5s ease-out infinite;
}

/* Phase complete flash */
@keyframes phase-complete {
  0% { background: transparent; }
  30% { background: rgba(57, 255, 142, 0.08); }
  100% { background: transparent; }
}

.phase-complete {
  animation: phase-complete 1.2s ease-out;
}

/* Accessibility: disable all motion */
@media (prefers-reduced-motion: reduce) {
  .ecto-pulse,
  .static-flicker,
  .spirit-drift,
  .detector-ping,
  .waveform-scroll,
  .symbol-reveal,
  .ghost-glow,
  .tape-spin,
  .signal-lock,
  .fade-in,
  .pulse-ring,
  .phase-complete {
    animation: none !important;
  }

  .symbol-reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}
