/* ==========================================================================
   Animations - Design Skills 2030
   ========================================================================== */

/* -------------------------------------------------------------------------
   Scroll Reveal
   ------------------------------------------------------------------------- */

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

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

/* Staggered reveal for children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 480ms; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Fade only (no movement) */
.reveal-fade {
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.reveal-fade.visible {
  opacity: 1;
}

/* Scale reveal */
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-spring);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* -------------------------------------------------------------------------
   Hero Animations
   ------------------------------------------------------------------------- */

/* Title entrance */
.hero__title {
  opacity: 0;
  transform: translateY(40px);
  animation: hero-title-in 1s var(--ease-out) 0.2s forwards;
}

@keyframes hero-title-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content paragraphs entrance */
.hero__content.prose p {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-content-in 0.8s var(--ease-out) forwards;
}

.hero__content.prose p:nth-of-type(1) { animation-delay: 0.4s; }
.hero__content.prose p:nth-of-type(2) { animation-delay: 0.6s; }
.hero__content.prose p:nth-of-type(3) { animation-delay: 0.8s; }

@keyframes hero-content-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll indicator bounce */
.hero__scroll {
  opacity: 1;
  transition: opacity 0.3s var(--ease-out);
}

.hero__scroll-icon {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

/* -------------------------------------------------------------------------
   Link Underline Animation
   ------------------------------------------------------------------------- */

.link-animated {
  position: relative;
  display: inline-block;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width var(--duration-normal) var(--ease-out);
}

.link-animated:hover::after {
  width: 100%;
}

/* -------------------------------------------------------------------------
   Accordion Animation
   ------------------------------------------------------------------------- */

.accordion__content {
  transition: max-height var(--duration-slow) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
  opacity: 0;
}

.accordion__item.open .accordion__content {
  opacity: 1;
}

/* -------------------------------------------------------------------------
   Parallax - GPU acceleration
   ------------------------------------------------------------------------- */

.hero__title,
.hero__content,
.hero__scroll,
.section-header {
  will-change: transform, opacity;
}

/* -------------------------------------------------------------------------
   Reduced Motion
   ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal-stagger > *,
  .reveal-fade,
  .reveal-scale,
  .hero__title,
  .hero__content.prose p,
  .hero__scroll {
    opacity: 1;
    transform: none;
  }
}
