/* ==========================================================================
   Animations & Keyframes
   ========================================================================== */

@keyframes tickerForward {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes tickerReverse {
  from {
    transform: translate3d(-50%, 0, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes heroWordIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

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

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(-1.5rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* Hero load animation */
.hero__word {
  opacity: 0;
  animation: heroWordIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__word:nth-child(1) {
  animation-delay: 0.15s;
}

.hero__word:nth-child(2) {
  animation-delay: 0.35s;
}

.hero__eyebrow,
.hero__role,
.hero__subtitle,
.hero__chips,
.hero__actions {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero__eyebrow {
  animation-delay: 0.45s;
}

.hero__role {
  animation-delay: 0.55s;
}

.hero__subtitle {
  animation-delay: 0.65s;
}

.hero__chips {
  animation-delay: 0.72s;
}

.hero__actions {
  animation-delay: 0.8s;
}

.hero__frame {
  opacity: 0;
  animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.hero__scroll {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

.hero__status-dot {
  animation: pulseDot 2.5s ease-in-out infinite;
}

/* Ticker motion */
.ticker__track--forward {
  animation: tickerForward 32s linear infinite;
}

/* Scroll reveals */
.reveal {
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.experience-feature.reveal.is-visible {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.experience-register__row.reveal.is-visible {
  transition-delay: calc(var(--reveal-index, 0) * 0.06s);
}

.experience-register__row:nth-child(1) { --reveal-index: 1; }
.experience-register__row:nth-child(2) { --reveal-index: 2; }
.experience-register__row:nth-child(3) { --reveal-index: 3; }
.experience-register__row:nth-child(4) { --reveal-index: 4; }

.contact__grid.reveal.is-visible {
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.skills__group.reveal.is-visible .skill-tag {
  animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.skills__group.reveal.is-visible .skill-tag:nth-child(1) { animation-delay: 0.05s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(2) { animation-delay: 0.1s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(3) { animation-delay: 0.15s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(4) { animation-delay: 0.2s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(5) { animation-delay: 0.25s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(6) { animation-delay: 0.3s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(7) { animation-delay: 0.35s; }
.skills__group.reveal.is-visible .skill-tag:nth-child(8) { animation-delay: 0.4s; }

.work-card.reveal.is-visible {
  transition-delay: calc(var(--reveal-index, 0) * 0.08s);
}

.work-showcase__item.reveal.is-visible {
  transition-delay: calc(var(--reveal-index, 0) * 0.07s);
}

.work-showcase__group.reveal.is-visible {
  transition-delay: 0.14s;
}

.work-showcase__item:nth-child(1) { --reveal-index: 0; }
.work-showcase__item:nth-child(2) { --reveal-index: 1; }
.work-showcase__item:nth-child(3) { --reveal-index: 2; }
.work-showcase__item:nth-child(4) { --reveal-index: 3; }
.work-showcase__item:nth-child(5) { --reveal-index: 4; }
.work-showcase__item:nth-child(6) { --reveal-index: 5; }

.work-bento__card:nth-child(1) { --reveal-index: 0; }
.work-bento__card:nth-child(2) { --reveal-index: 1; }
.work-bento__card:nth-child(3) { --reveal-index: 2; }
.work-bento__card:nth-child(4) { --reveal-index: 3; }
.work-bento__card:nth-child(5) { --reveal-index: 4; }
.work-bento__card:nth-child(6) { --reveal-index: 5; }
.work-bento__card:nth-child(7) { --reveal-index: 6; }
.work-bento__card:nth-child(8) { --reveal-index: 7; }
.work-bento__card:nth-child(9) { --reveal-index: 8; }

.work-bento__card.reveal.is-visible {
  transition-delay: calc(var(--reveal-index, 0) * 0.08s);
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .ticker__track--forward {
    animation: none;
  }

  .ticker__track--static {
    justify-content: center;
  }

  html {
    scroll-behavior: auto;
  }
}
