/* animations.css — Animaciones y transiciones */

/* ========================================
   Keyframes
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 20px rgba(250, 204, 21, 0.15);
  }
  50% {
    text-shadow: 0 0 40px rgba(250, 204, 21, 0.3);
  }
}

/* ========================================
   Hero Entry Animations
   ======================================== */
.hero-title,
.hero-subtitle,
.hero-cta {
  opacity: 0;
  animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title {
  animation-delay: 0.3s;
  animation-duration: 1.2s;
}

.hero-subtitle {
  animation-delay: 0.7s;
}

.hero-cta {
  animation-delay: 1.1s;
}

/* Glow sutil en el título después de la entrada */
.hero-title {
  animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ========================================
   Scroll-triggered Animations
   ======================================== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Typing Cursor
   ======================================== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-cursor::after {
  content: '|';
  color: var(--color-accent-yellow);
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
  margin-left: 1px;
}

/* ========================================
   Lluvia de código (Hero background)
   ======================================== */
@keyframes codeFall {
  0% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(105vh);
  }
}

.code-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.code-rain-drop {
  position: absolute;
  top: -30px;
  font-family: var(--font-family-mono);
  color: var(--color-accent-yellow);
  white-space: nowrap;
  animation: codeFall linear forwards;
  pointer-events: none;
  user-select: none;
}

/* ========================================
   Lluvia de estrellas (Easter egg)
   ======================================== */
@keyframes starFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}

.star-rain-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.star-rain-particle {
  position: absolute;
  top: -30px;
  color: var(--color-accent-yellow);
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.6);
  animation: starFall linear forwards;
  pointer-events: none;
}

/* ========================================
   Reduced Motion: Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .hero-title,
  .hero-subtitle,
  .hero-cta {
    opacity: 1;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .typing-cursor::after {
    animation: none;
    content: '';
  }
}
