/* ========================================
   Scroll Reveal - Initial Hidden State
   ======================================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity var(--duration-slow) var(--ease-gentle),
    transform var(--duration-slow) var(--ease-gentle);
}

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

/* Left nodes slide in from left */
.timeline__node--left.scroll-reveal {
  transform: translateX(-30px) translateY(20px);
}

.timeline__node--left.scroll-reveal.is-visible {
  transform: translateX(0) translateY(0);
}

/* Right nodes slide in from right */
.timeline__node--right.scroll-reveal {
  transform: translateX(30px) translateY(20px);
}

.timeline__node--right.scroll-reveal.is-visible {
  transform: translateX(0) translateY(0);
}

/* Stagger delay */
.scroll-reveal:nth-child(2) { transition-delay: 0s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.15s; }

/* ========================================
   CSS Scroll-Driven Animations (Progressive Enhancement)
   ======================================== */
@supports (animation-timeline: view()) {
  html.css-scroll-animations .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
    animation: scrollReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }

  html.css-scroll-animations .timeline__node--left.scroll-reveal {
    animation-name: scrollRevealLeft;
  }

  html.css-scroll-animations .timeline__node--right.scroll-reveal {
    animation-name: scrollRevealRight;
  }
}

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

@keyframes scrollRevealLeft {
  from { opacity: 0; transform: translateX(-30px) translateY(20px); }
  to   { opacity: 1; transform: translateX(0) translateY(0); }
}

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

/* ========================================
   Ambient / Decorative Animations
   ======================================== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.1); }
}

.timeline__marker {
  animation: float 4s var(--ease-gentle) infinite;
}

/* Hero entrance */
.hero__title {
  animation: fadeInUp 1.2s var(--ease-gentle) both;
}

.hero__subtitle {
  animation: fadeInUp 1.2s var(--ease-gentle) 0.3s both;
}

.hero__decoration {
  animation: fadeIn 1.5s var(--ease-gentle) both;
}

.hero__decoration--bottom {
  animation-delay: 0.5s;
}

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

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

/* Footer stars twinkle */
.footer__stars circle {
  animation: twinkle 3s var(--ease-gentle) infinite alternate;
}

.footer__stars circle:nth-child(2) { animation-delay: 0.5s; }
.footer__stars circle:nth-child(3) { animation-delay: 1s; }
.footer__stars circle:nth-child(4) { animation-delay: 1.5s; }
.footer__stars circle:nth-child(5) { animation-delay: 2s; }

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