/* ==========================================================================
   Keyframes + the reduced-motion contract
   Every decorative animation declared here is switched off in one place at
   the bottom of this file — that is the whole reason they live together.
   ========================================================================== */

@keyframes preloader-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes preloader-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes menu-item-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes scroll-dot {
  0% {
    transform: translateY(-6px);
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  78% {
    opacity: 1;
  }
  100% {
    transform: translateY(36px);
    opacity: 0;
  }
}

/* Track is authored as content + an identical clone, so -50% loops seamlessly. */
@keyframes marquee-loop {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes pin-pulse {
  0% {
    r: 6;
    opacity: 0.9;
  }
  70% {
    r: 18;
    opacity: 0;
  }
  100% {
    r: 18;
    opacity: 0;
  }
}

@keyframes launcher-ping {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Ken Burns — scale plus a few pixels of drift, direction set per slide. */
@keyframes hero-kenburns {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(var(--kb-x, 0), var(--kb-y, 0), 0);
  }
}

/* One diagnostic pass, top to bottom, per slide change. */
@keyframes hero-scan {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  12% {
    opacity: 0.12;
  }
  88% {
    opacity: 0.12;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh);
  }
}

/* The 24-hour duty line: a slow ring, not a blinking alarm. */
@keyframes duty-pulse {
  0% {
    opacity: 0.55;
    transform: scale(1);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(3.2);
  }
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Staggered entry for the mobile menu rows. */
.mobile-menu__item:nth-child(1) {
  animation-delay: 60ms;
}
.mobile-menu__item:nth-child(2) {
  animation-delay: 110ms;
}
.mobile-menu__item:nth-child(3) {
  animation-delay: 160ms;
}
.mobile-menu__item:nth-child(4) {
  animation-delay: 210ms;
}
.mobile-menu__item:nth-child(5) {
  animation-delay: 260ms;
}
.mobile-menu__item:nth-child(6) {
  animation-delay: 310ms;
}

/* ==========================================================================
   REDUCED MOTION
   Decorative motion off; everything still reaches its final, usable state.
   JS reads the same query and skips Lenis, scrubs and the gear rotation.
   ========================================================================== */
@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 targets must not be left invisible when their transition is gone. */
  html.reveal-armed .reveal,
  html.reveal-armed .reveal-curtain,
  .hero.is-armed [data-hero-item] {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
  }

  html.img-fade img {
    opacity: 1 !important;
  }

  /* Slider: slide 1 only, no Ken Burns, no auto-advance. The arrows stay
     functional so the user can still browse the three photographs by hand. */
  .hero-slide.is-active img {
    animation: none;
    transform: none;
  }

  .hero-ind__bar.is-active i {
    transform: scaleX(1);
    transition: none;
  }

  .hero__scan,
  .hero__spotlight,
  .hero__trace {
    display: none;
  }

  .hero-nav {
    opacity: 0.55;
    pointer-events: auto;
  }

  .hero-slide,
  .hero-slide.is-active,
  .hero-slide.is-leaving {
    transition: none !important;
  }

  .preloader__logo {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .line-mask > span {
    transform: none !important;
  }

  .marquee__track {
    animation: none;
    transform: none;
  }

  .marquee__row {
    overflow-x: auto;
  }

  .scroll-cue__track::after {
    animation: none;
    top: 16px;
  }

  .map__pin-ring {
    animation: none;
    opacity: 0.35;
  }

  .ai.is-hinting .ai__launcher::after {
    animation: none;
  }

  .stat__rule,
  .process__rail i,
  .exploded__progress i,
  .callout__line {
    transform: none !important;
  }

  .callout {
    opacity: 1 !important;
  }

  .pcard,
  [data-tilt] {
    transform: none !important;
  }

  .pulse-dot::after {
    animation: none;
    opacity: 0;
  }
}
