/* 
  ========================================
  INDEX PAGE ANIMATIONS (Motion & Scroll)
  ========================================
*/

:root {
  --reveal-speed: 1s;
  --reveal-easing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Viewport Entrance (Page Load) */
.index-page-body {
  animation: indexEntrance 1.2s var(--reveal-easing) forwards;
  opacity: 0;
}

@keyframes indexEntrance {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 2. Scroll Reveal Utility */
.animate-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s var(--reveal-easing);
}

.animate-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 3. Staggered Grid Reveal (Auto-staggering with nth-child) */
.grid-stagger > * {
  opacity: 0;
  transform: translateY(30px);
}

.grid-stagger.in-view > * {
  animation: fadeInUp 0.6s var(--reveal-easing) forwards;
}

.grid-stagger.in-view > *:nth-child(1) { animation-delay: 0.1s; }
.grid-stagger.in-view > *:nth-child(2) { animation-delay: 0.2s; }
.grid-stagger.in-view > *:nth-child(3) { animation-delay: 0.3s; }
.grid-stagger.in-view > *:nth-child(4) { animation-delay: 0.4s; }
.grid-stagger.in-view > *:nth-child(5) { animation-delay: 0.5s; }
.grid-stagger.in-view > *:nth-child(6) { animation-delay: 0.6s; }
.grid-stagger.in-view > *:nth-child(7) { animation-delay: 0.7s; }
.grid-stagger.in-view > *:nth-child(8) { animation-delay: 0.8s; }

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

/* 4. Native CSS Scroll Parallax (Modern Browsers) */
@supports (animation-timeline: view()) {
  .parallax-item {
    animation: parallaxReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }

  @keyframes parallaxReveal {
    from {
      opacity: 0;
      transform: translateY(100px) scale(0.9);
      filter: blur(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
      filter: blur(0);
    }
  }
  
  .hero-parallax {
    animation: heroFading linear both;
    animation-timeline: scroll(root);
    animation-range: 0 500px;
  }
  
  @keyframes heroFading {
    to {
      opacity: 0.5;
      transform: translateY(100px) scale(0.95);
    }
  }
}

/* 5. Floating Animation for Decorative Elements */
.animate-float {
  animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* 6. Glow Interactive */
.hover-glow {
  transition: all 0.4s var(--reveal-easing);
}

.hover-glow:hover {
  box-shadow: 0 0 30px oklch(0.55 0.25 265 / 0.2);
  transform: translateY(-5px);
}
