/* ============================================
   DOLMSETH DIGITAL — Animations
   ============================================ */

/* --- Italic accent word reveal (signature effect, hero only) ---
   Earlier we ran this on every section h2 too, but it was too much —
   reserved now for the hero h1's "fungerer" so it stays a one-time
   moment on landing instead of repeating on every scroll. */
.hero__title em {
  opacity: 0;
  display: inline-block;
  transform: translateY(0.25em);
  animation: emReveal 0.55s var(--ease-out-expo) 0.55s forwards;
}

@keyframes emReveal {
  from {
    opacity: 0;
    transform: translateY(0.25em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Hero Entrance: Content cascade ---
   Choreography: title → italic em-word → subtitle → CTA → scroll arrow.
   Each beat lands just as the previous one settles. */
.hero__title {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out-expo) 0.15s forwards;
}

.hero__subtitle {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out-expo) 1.05s forwards;
}

.hero__cta {
  opacity: 0;
  animation: fadeUpScale 0.7s var(--ease-out-expo) 1.5s forwards;
}

.hero__scroll {
  opacity: 0;
  animation: fadeIn 0.6s ease 1.95s forwards;
}

.hero__scroll svg {
  animation: scrollBounce 2s ease-in-out 2s infinite;
}

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

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

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

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* --- Scroll Reveal System --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-medium) var(--ease-out-expo),
              transform var(--duration-medium) var(--ease-out-expo);
}

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

.reveal--left {
  transform: translateX(-60px);
}

.reveal--right {
  transform: translateX(60px);
}

.reveal--scale {
  transform: scale(0.92);
}

.reveal--left.is-visible,
.reveal--right.is-visible {
  transform: translateX(0);
}

.reveal--scale.is-visible {
  transform: scale(1);
}

/* Stagger delays */
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }
.reveal[data-delay="5"] { transition-delay: 0.5s; }

/* --- Process Number Animation --- */
.process__number {
  transform: scale(0.8);
}

.process__step.is-visible .process__number {
  transform: scale(1);
}

/* --- Process Line Draw --- */
.process__stroke {
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.5s var(--ease-out-expo) 0.2s;
}

.process.animated .process__stroke {
  stroke-dashoffset: 0;
}

/* --- Card Feature Check Animation --- */
.card.is-visible .card__features li {
  opacity: 0;
  animation: fadeUp 0.4s var(--ease-out-expo) forwards;
}

.card.is-visible .card__features li:nth-child(1) { animation-delay: 0.15s; }
.card.is-visible .card__features li:nth-child(2) { animation-delay: 0.2s; }
.card.is-visible .card__features li:nth-child(3) { animation-delay: 0.25s; }
.card.is-visible .card__features li:nth-child(4) { animation-delay: 0.3s; }
.card.is-visible .card__features li:nth-child(5) { animation-delay: 0.35s; }

/* --- CTA Section Gradient Drift ---
   Translates the radial-gradient pseudo-element horizontally so the
   blue glow drifts slowly from left to right. The pseudo extends past
   the section bounds (inset: -10% -25%) so the edges never show. */
@keyframes gradientDrift {
  0% {
    transform: translateX(-12%) translateY(-2%);
  }
  100% {
    transform: translateX(12%) translateY(2%);
  }
}

/* --- Mobile adjustments --- */
@media (max-width: 768px) {
  .reveal {
    transform: translateY(25px);
  }

  .reveal--left {
    transform: translateX(-30px);
  }

  .reveal--right {
    transform: translateX(30px);
  }

  .hero__title {
    animation-name: fadeUpMobile;
  }

  .hero__subtitle {
    animation-name: fadeUpMobile;
  }

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

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

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

  .hero__title, .hero__subtitle,
  .hero__cta, .hero__scroll,
  .hero__title em {
    opacity: 1;
    transform: none;
  }

  .process__stroke {
    stroke-dashoffset: 0;
  }
}
