/* ===================================================================
   VAIBHAV DATTA - CYBER SENTINEL & NETWORK ENGINEER PORTFOLIO
   Keyframe Animations, Micro-Interactions, Cyber Glitch & Motion
   =================================================================== */

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay helpers */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Subtle Glitch Text Effect */
.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text:hover {
  animation: cyber-glitch 0.35s steps(2) infinite;
}

@keyframes cyber-glitch {
  0% {
    text-shadow: 2px 0 var(--accent-secondary), -2px 0 var(--accent-danger);
    transform: translate(0);
  }
  20% {
    text-shadow: -2px 0 var(--accent-secondary), 2px 0 var(--accent-danger);
    transform: translate(-1px, 1px);
  }
  40% {
    text-shadow: 2px -1px var(--accent-secondary), -1px 2px var(--accent-danger);
    transform: translate(1px, -1px);
  }
  60% {
    text-shadow: -1px 2px var(--accent-secondary), 1px -2px var(--accent-danger);
    transform: translate(-1px, -1px);
  }
  80% {
    text-shadow: 1px -1px var(--accent-secondary), -1px 1px var(--accent-danger);
    transform: translate(1px, 1px);
  }
  100% {
    text-shadow: none;
    transform: translate(0);
  }
}

/* Cyber Radar Pulse */
.radar-pulse {
  position: relative;
}

.radar-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid var(--accent-primary);
  opacity: 0;
  animation: radar-sweep 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes radar-sweep {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Smooth Focus Glow */
.cyber-focus-glow:focus-visible {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* Scanline Sweep animation */
.scanline-sweep {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.4;
  animation: sweep 4s linear infinite;
}

@keyframes sweep {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { top: 100%; opacity: 0; }
}

/* Neon Text Pulse */
@keyframes neon-glow {
  0%, 100% {
    text-shadow: 0 0 10px var(--accent-glow), 0 0 20px var(--accent-glow);
  }
  50% {
    text-shadow: 0 0 4px var(--accent-glow), 0 0 10px var(--accent-glow);
  }
}

/* Reduced Motion preferences */
@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 !important;
    transform: none !important;
  }
}
