/* ═══════════════════════════════════════════════
   WORK2040 — Animations
   ═══════════════════════════════════════════════ */

/* ── Keyframes ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-12px); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 10px rgba(0,255,65,0.2), 0 0 30px rgba(0,255,65,0.1); } 50% { box-shadow: 0 0 20px rgba(0,255,65,0.4), 0 0 60px rgba(0,255,65,0.2); } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes scanline { 0% { top: -100%; } 100% { top: 100%; } }

@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
  20% { clip-path: inset(20% 0 60% 0); transform: translate(-3px, 2px); }
  40% { clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
  60% { clip-path: inset(40% 0 30% 0); transform: translate(-2px, 1px); }
  80% { clip-path: inset(10% 0 80% 0); transform: translate(2px, -2px); }
}
@keyframes glitch-2 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
  20% { clip-path: inset(70% 0 5% 0); transform: translate(4px, -1px); }
  40% { clip-path: inset(10% 0 70% 0); transform: translate(-3px, 2px); }
  60% { clip-path: inset(50% 0 20% 0); transform: translate(2px, -2px); }
  80% { clip-path: inset(30% 0 40% 0); transform: translate(-4px, 1px); }
}

@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes matrixFall { 0% { transform: translateY(-100%); opacity: 1; } 100% { transform: translateY(100vh); opacity: 0; } }

/* ── Glitch Effect ── */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.glitch::before { color: var(--neon-cyan); animation: glitch-1 3s infinite linear alternate-reverse; }
.glitch::after { color: var(--neon-red); animation: glitch-2 2s infinite linear alternate-reverse; }

/* ── Scroll Reveal ── */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-scale { opacity: 0; transform: scale(0.85); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* Stagger delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ── Typing Cursor ── */
.typing-cursor::after { content: '█'; animation: blink 1s step-end infinite; color: var(--matrix-green); margin-left: 2px; }

/* ── Parallax ── */
.parallax-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── Glow Pulse ── */
.glow-pulse { animation: pulse-glow 3s ease-in-out infinite; }

/* ── Scanline sweep ── */
.scanline-sweep::before {
  content: '';
  position: absolute;
  width: 100%; height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(0,255,65,0.03), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* ── Number counter ── */
.counter { font-variant-numeric: tabular-nums; }

/* ── Prefers reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
}
