/* ========= KEYFRAMES ========= */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

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

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* ========= SCROLL-REVEAL ========= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 90ms; }
.reveal.delay-2 { transition-delay: 180ms; }
.reveal.delay-3 { transition-delay: 270ms; }
.reveal.delay-4 { transition-delay: 360ms; }
.reveal.delay-5 { transition-delay: 450ms; }

/* Variants */
.reveal.from-left { transform: translateX(-32px); }
.reveal.from-left.is-visible { transform: translateX(0); }
.reveal.from-right { transform: translateX(32px); }
.reveal.from-right.is-visible { transform: translateX(0); }
.reveal.scale { transform: scale(0.96); }
.reveal.scale.is-visible { transform: scale(1); }

/* Initial page entrance */
.page-entrance {
  animation: fadeUp 900ms var(--ease-out) both;
}

/* Hero title per-word stagger */
.hero-title .years,
.hero-title .line-small {
  animation: fadeUp 900ms var(--ease-out) both;
}
.hero-title .years { animation-delay: 120ms; }
.hero-title .line-small { animation-delay: 240ms; }

.hero-content > * { animation: fadeUp 900ms var(--ease-out) both; }
.hero-content > *:nth-child(1) { animation-delay: 60ms; }
.hero-content > *:nth-child(2) { animation-delay: 120ms; }
.hero-content > *:nth-child(3) { animation-delay: 260ms; }
.hero-content > *:nth-child(4) { animation-delay: 380ms; }
.hero-content > *:nth-child(5) { animation-delay: 500ms; }

.hero-visual { animation: scaleIn 1100ms var(--ease-out) both; animation-delay: 200ms; }
.hero-card { animation: fadeUp 1100ms var(--ease-out) both; animation-delay: 700ms; }

/* Button ripple on hover */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.16), transparent 40%);
  opacity: 0;
  transition: opacity var(--duration-fast);
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }

/* Marquee track */
.marquee {
  overflow: hidden;
  position: relative;
}
.marquee-track {
  display: flex;
  gap: var(--space-7);
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Link underline */
.link-underline {
  position: relative; display: inline-block;
}
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--duration-base) var(--ease-in-out);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
