/* ============================================
   Animations & Transitions
   ============================================ */

/* Fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

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

/* Stagger children */
.stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
.stagger > .reveal:nth-child(5) { transition-delay: 0.32s; }
.stagger > .reveal:nth-child(6) { transition-delay: 0.40s; }
.stagger > .reveal:nth-child(7) { transition-delay: 0.48s; }
.stagger > .reveal:nth-child(8) { transition-delay: 0.56s; }

/* Hero entrance */
.hero__content > * {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
}

.hero__content > *:nth-child(1) { animation-delay: 0.1s; }
.hero__content > *:nth-child(2) { animation-delay: 0.2s; }
.hero__content > *:nth-child(3) { animation-delay: 0.3s; }
.hero__content > *:nth-child(4) { animation-delay: 0.4s; }
.hero__content > *:nth-child(5) { animation-delay: 0.5s; }

/* Counter animation class */
.counter-animate {
  font-feature-settings: "tnum";
}

/* Page transition */
#home-page {
  transition: opacity var(--duration-normal) var(--ease-out);
}

#home-page.hidden {
  display: none;
}

/* Glow effect on accent elements */
@keyframes subtleGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(224, 90, 51, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(224, 90, 51, 0.35));
  }
}

/* Card hover glow */
.card:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--border-hover);
}

/* Smooth scroll anchor offset */
.section[id] {
  scroll-margin-top: 80px;
}

/* 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 {
    opacity: 1;
    transform: none;
  }

  .hero__content > * {
    opacity: 1;
  }
}
