/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  80%,
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

@keyframes shimmer {
  to {
    background-position: -250% 0;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
  }
}

@keyframes backdrop-zoom {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.1) translateX(-1.5%);
  }
}

@keyframes slide-progress {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes preloader-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

/* ==========================================================================
   Hero entrance
   ========================================================================== */
[data-hero-anim] {
  animation: hero-in 1s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
}

.is-loading:not(.preloader-done) [data-hero-anim] {
  animation-play-state: paused;
}

.seal__ring {
  animation: spin 40s linear infinite;
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
/* Uses the standalone `translate` property so hover `transform`s stay independent. */
.is-ready [data-reveal] {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms);
}

.is-ready [data-reveal].is-visible {
  opacity: 1;
  translate: none;
}

.is-ready .project-card[data-reveal],
.is-ready .service-card[data-reveal] {
  transition: opacity 0.9s var(--ease), translate 0.9s var(--ease), transform 0.5s var(--ease),
    border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow 0.5s var(--ease);
  transition-delay: calc(var(--d, 0) * 80ms), calc(var(--d, 0) * 80ms), 0s, 0s, 0s, 0s;
}

/* Image reveal */
.is-ready [data-reveal] .reveal-image {
  clip-path: inset(12% 12% 12% 12% round var(--radius-lg));
  transition: clip-path 1.3s var(--ease);
}

.is-ready [data-reveal] .reveal-image img {
  transform: scale(1.15);
  transition: opacity 0.6s var(--ease), transform 1.6s var(--ease);
}

.is-ready [data-reveal].is-visible .reveal-image {
  clip-path: inset(0 0 0 0 round var(--radius-lg));
}

.is-ready [data-reveal].is-visible .reveal-image img {
  transform: scale(1);
}

/* Filter re-entry */
.project-card.is-entering {
  animation: card-in 0.55s var(--ease) both;
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .is-ready [data-reveal] {
    opacity: 1;
    translate: none;
  }
  .is-ready [data-reveal] .reveal-image {
    clip-path: none;
  }
  .marquee__track {
    animation: none;
  }
  .marquee__viewport {
    flex-wrap: wrap;
    -webkit-mask-image: none;
    mask-image: none;
    padding-inline: var(--gutter);
  }
  .marquee__track {
    flex-wrap: wrap;
    flex-shrink: 1;
  }
  .marquee__track[aria-hidden="true"] {
    display: none;
  }
  .partners__slider {
    overflow-x: auto;
    padding-inline: var(--gutter);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .partners__track[aria-hidden="true"] {
    display: none;
  }
}
