/* ============================================================
   IOL Intro Page — Animations
   Scroll-triggered reveals + hero load sequence
   ============================================================ */

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulseDown {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
  50%      { transform: translateX(-50%) translateY(10px); opacity: 0.8; }
}

/* --- Hero Load Sequence --- */
.hero__logo {
  opacity: 0;
  animation: scaleIn 0.7s ease-out 0.3s both;
}

.hero__tagline {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.7s both;
}

.hero__subtitle {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 1.3s both;
}

.hero__affiliations {
  opacity: 0;
  animation: fadeIn 0.5s ease-out 1.7s both;
}

.hero__institutions {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 1.9s both;
}

.hero__scroll-hint {
  opacity: 0;
  animation: fadeIn 0.4s ease-out 2.4s forwards,
             pulseDown 2.5s ease-in-out 2.8s infinite;
}

/* --- Scroll-Triggered Elements --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}

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

/* Slide from left variant */
.animate-on-scroll.animate--left {
  transform: translateX(-30px) translateY(0);
}
.animate-on-scroll.animate--left.is-visible {
  transform: translateX(0) translateY(0);
}

/* Scale variant */
.animate-on-scroll.animate--scale {
  transform: scale(0.92) translateY(0);
}
.animate-on-scroll.animate--scale.is-visible {
  transform: scale(1) translateY(0);
}

/* --- Stagger Delays: Award Items --- */
.award-item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.award-item.animate-on-scroll:nth-child(2) { transition-delay: 60ms; }
.award-item.animate-on-scroll:nth-child(3) { transition-delay: 120ms; }
.award-item.animate-on-scroll:nth-child(4) { transition-delay: 180ms; }
.award-item.animate-on-scroll:nth-child(5) { transition-delay: 240ms; }
.award-item.animate-on-scroll:nth-child(6) { transition-delay: 300ms; }
.award-item.animate-on-scroll:nth-child(7) { transition-delay: 360ms; }
.award-item.animate-on-scroll:nth-child(8) { transition-delay: 420ms; }

/* --- Stagger Delays: Interest Columns --- */
.interests-col.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.interests-col.animate-on-scroll:nth-child(2) { transition-delay: 150ms; }

/* --- Who institutions: fade in after roles --- */
.who__institutions.animate-on-scroll {
  transition-delay: 400ms;
}

/* --- Stagger Delays: Research Cards --- */
.research-card.animate-on-scroll:nth-child(1)  { transition-delay: 0ms; }
.research-card.animate-on-scroll:nth-child(2)  { transition-delay: 70ms; }
.research-card.animate-on-scroll:nth-child(3)  { transition-delay: 140ms; }
.research-card.animate-on-scroll:nth-child(4)  { transition-delay: 210ms; }
.research-card.animate-on-scroll:nth-child(5)  { transition-delay: 280ms; }
.research-card.animate-on-scroll:nth-child(6)  { transition-delay: 350ms; }
.research-card.animate-on-scroll:nth-child(7)  { transition-delay: 420ms; }
.research-card.animate-on-scroll:nth-child(8)  { transition-delay: 490ms; }

/* --- Stagger Delays: Role Items --- */
.role-list__item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.role-list__item.animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.role-list__item.animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.role-list__item.animate-on-scroll:nth-child(4) { transition-delay: 300ms; }

/* --- Stagger Delays: Highlight Items --- */
.highlight-item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.highlight-item.animate-on-scroll:nth-child(2) { transition-delay: 120ms; }
.highlight-item.animate-on-scroll:nth-child(3) { transition-delay: 240ms; }
.highlight-item.animate-on-scroll:nth-child(4) { transition-delay: 360ms; }

/* --- Stagger Delays: Project Cards --- */
.project-card.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.project-card.animate-on-scroll:nth-child(2) { transition-delay: 150ms; }
.project-card.animate-on-scroll:nth-child(3) { transition-delay: 300ms; }

/* --- Stagger Delays: Software Items --- */
.software-item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.software-item.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.software-item.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.software-item.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }

/* --- Stagger Delays: Stats --- */
.stat.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stat.animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.stat.animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.stat.animate-on-scroll:nth-child(4) { transition-delay: 300ms; }

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__logo,
  .hero__tagline,
  .hero__subtitle,
  .hero__affiliations,
  .hero__institutions,
  .hero__scroll-hint {
    opacity: 1 !important;
  }
  .highlight-item::before {
    width: 14px !important;
  }
}
