/* ============================================
   ANIMATIONS - CYBERPUNK EFFECTS
   ============================================ */

/* === GLITCH EFFECT === */
.glitch {
  position: relative;
  color: var(--text-primary);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch::before {
  color: #ffffff;
  animation: glitch-1 3s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch::after {
  color: #ffffff;
  animation: glitch-2 2.5s infinite linear alternate-reverse;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
  0%, 90%   { transform: translate(0); }
  91%       { transform: translate(-3px, 1px); }
  92%       { transform: translate(3px, -1px); }
  93%       { transform: translate(-2px, 2px); }
  94%       { transform: translate(2px, 0); }
  95%, 100% { transform: translate(0); }
}

@keyframes glitch-2 {
  0%, 88%   { transform: translate(0); }
  89%       { transform: translate(2px, -1px); }
  90%       { transform: translate(-3px, 2px); }
  91%       { transform: translate(1px, -2px); }
  92%       { transform: translate(-2px, 1px); }
  93%, 100% { transform: translate(0); }
}

/* === REVEAL ON SCROLL === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.reveal-left {
  transform: translateX(-40px) translateY(0);
}

.reveal-left.visible {
  transform: translateX(0) translateY(0);
}

.reveal-right {
  transform: translateX(40px) translateY(0);
}

.reveal-right.visible {
  transform: translateX(0) translateY(0);
}

/* Stagger children */
.services-grid .service-card.reveal:nth-child(1) { transition-delay: 0s; }
.services-grid .service-card.reveal:nth-child(2) { transition-delay: 0.15s; }
.services-grid .service-card.reveal:nth-child(3) { transition-delay: 0.3s; }

/* === NEON GLOW PULSE === */
@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 5px rgba(139, 92, 246, 0.3),
      0 0 20px rgba(139, 92, 246, 0.15);
  }
  50% {
    box-shadow:
      0 0 10px rgba(139, 92, 246, 0.5),
      0 0 40px rgba(139, 92, 246, 0.25),
      0 0 80px rgba(139, 92, 246, 0.1);
  }
}

.neon-glow {
  animation: neonPulse 3s ease-in-out infinite;
}

/* === 3D TILT CARD === */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
}

/* === TYPING CURSOR === */
.cursor {
  display: inline-block;
  color: var(--neon-purple);
  font-weight: 100;
  margin-left: 2px;
}

/* === FLOATING ANIMATION === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* === LINE DECORATION === */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  box-shadow: 0 0 10px var(--neon-purple);
}

/* === LINK HOVER GLOW === */
.nav-link:hover,
.footer-links a:hover {
  text-shadow: 0 0 8px currentColor;
}

/* === CARD BORDER ANIMATION === */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.service-card:hover::before {
  opacity: 1;
}

/* === MOBILE: REDUCE ANIMATIONS === */
@media (prefers-reduced-motion: reduce) {
  .glitch::before,
  .glitch::after {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .neon-glow {
    animation: none;
  }

  .cursor {
    animation: none;
  }
}

@media (max-width: 768px) {
  .glitch::before,
  .glitch::after {
    animation-duration: 6s;
  }

  .neon-glow {
    animation-duration: 5s;
  }
}
