/* ============================================================
   ANIMATIONS.CSS
   All keyframes, scroll reveals, and entrance animations
   ============================================================ */

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
  }
}

@keyframes orbitRotate {
  from { transform: rotateX(65deg) rotateZ(0deg); }
  to   { transform: rotateX(65deg) rotateZ(360deg); }
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0px);  }
  50%       { transform: translateY(-12px); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%       { opacity: 0.3; transform: scaleY(0.6); }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(0, 230, 118, 0.3); }
  50%       { box-shadow: 0 0 20px var(--accent), 0 0 40px rgba(0, 230, 118, 0.5); }
}

@keyframes unlockFlash {
  0%   { filter: blur(4px); opacity: 0.4; }
  40%  { filter: blur(0px); opacity: 1; box-shadow: 0 0 40px rgba(0, 230, 118, 0.3); }
  100% { filter: blur(0px); opacity: 1; box-shadow: none; }
}

@keyframes particleBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes toastSlide {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes navGlow {
  0%, 100% { text-shadow: none; }
  50%       { text-shadow: 0 0 12px rgba(0, 230, 118, 0.6); }
}

@keyframes eyebrowFlash {
  0%   { color: var(--accent); opacity: 1; }
  30%  { color: #fff; opacity: 1; text-shadow: 0 0 16px var(--accent); }
  100% { color: var(--accent); opacity: 1; }
}

@keyframes cursorPop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  50%  { transform: translate(-50%, -50%) scale(1.8); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ============================================================
   HERO ENTRANCE ANIMATIONS
   ============================================================ */
.animate-up {
  opacity: 0;
  transform: translateY(28px);
  animation: fadeUp 0.8s var(--ease) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.30s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.60s; }
.delay-5 { animation-delay: 0.75s; }
.delay-6 { animation-delay: 0.90s; }

/* ============================================================
   SCROLL REVEAL
   Elements start hidden, JS adds .visible class on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

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

/* Stagger delays for reveal siblings */
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }

/* ============================================================
   CARD UNLOCK ANIMATION
   ============================================================ */
.project-card.unlocked {
  animation: unlockFlash 0.7s var(--ease) forwards;
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */
.cursor {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ============================================================
   EYEBROW SECTION FLASH
   Triggered by JS when section enters viewport
   ============================================================ */
.eyebrow.flash {
  animation: eyebrowFlash 0.6s var(--ease) forwards;
}

/* ============================================================
   PARTICLE BURST (Easter Egg)
   ============================================================ */
.particle {
  position: fixed;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: particleBurst 1.5s var(--ease) forwards;
}

/* ============================================================
   PAGE LOAD FADE IN
   ============================================================ */
body {
  animation: fadeIn 0.4s ease forwards;
}

/* ============================================================
   NAV SCROLL STATE
   ============================================================ */
.nav.scrolled {
  background: rgba(8, 12, 10, 0.97);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   SKILL BAR SHIMMER
   ============================================================ */
.skill-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2.5s ease-in-out infinite;
}

.skill-track {
  position: relative;
  overflow: hidden;
}

@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* ============================================================
   TERMINAL CARD CURSOR BLINK
   ============================================================ */
.terminal-code::after {
  content: '█';
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
  font-size: 12px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   ORBITAL GLOW
   ============================================================ */
.orb {
  animation: orbFloat 6s ease-in-out infinite, glowPulse 3s ease-in-out infinite;
}

/* ============================================================
   HOVER LIFT for cards
   ============================================================ */
.project-card,
.skill-card {
  transition:
    border-color 0.4s var(--ease),
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease),
    filter 0.7s var(--ease),
    opacity 0.7s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
}

/* ============================================================
   SCROLL INDICATOR
   ============================================================ */
.scroll-indicator {
  animation: fadeIn 1.5s ease 1.5s both;
}