/* ==========================================================================
   Motion
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.3, 1),
    transform 700ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

html.js .project-grid .reveal:nth-child(2),
html.js .service-grid .reveal:nth-child(2),
html.js .blog-grid .reveal:nth-child(2),
html.js .testimonial-grid .reveal:nth-child(2),
html.js .capability-grid .reveal:nth-child(2),
html.js .principle-grid .reveal:nth-child(2),
html.js .toolbox-grid .reveal:nth-child(2),
html.js .timeline .reveal:nth-child(2) {
  transition-delay: 70ms;
}

html.js .project-grid .reveal:nth-child(3),
html.js .service-grid .reveal:nth-child(3),
html.js .blog-grid .reveal:nth-child(3),
html.js .testimonial-grid .reveal:nth-child(3),
html.js .capability-grid .reveal:nth-child(3),
html.js .principle-grid .reveal:nth-child(3),
html.js .toolbox-grid .reveal:nth-child(3),
html.js .timeline .reveal:nth-child(3) {
  transition-delay: 140ms;
}

html.js .project-grid .reveal:nth-child(4),
html.js .principle-grid .reveal:nth-child(4),
html.js .toolbox-grid .reveal:nth-child(4),
html.js .timeline .reveal:nth-child(4) {
  transition-delay: 210ms;
}

html.js .project-grid .reveal:nth-child(5),
html.js .timeline .reveal:nth-child(5) {
  transition-delay: 280ms;
}

html.js .project-grid .reveal:nth-child(6),
html.js .timeline .reveal:nth-child(6) {
  transition-delay: 350ms;
}

.main-content-reveal {
  animation: page-enter 600ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.status-dot {
  animation: status-pulse 3.2s ease-in-out infinite;
}

.tech-marquee-track {
  will-change: transform;
}

@keyframes caret-blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@keyframes spin-slow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spin-reverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--color-accent-soft);
  }

  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--color-accent-soft) 40%, transparent);
  }
}

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

@keyframes preloader-progress {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(340%);
  }
}

@keyframes preloader-auto-hide {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  html.js .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .preloader {
    display: none !important;
  }

  .tech-marquee-track {
    animation: none !important;
    transform: none !important;
  }

  .rotator::after {
    animation: none !important;
  }

  .floating-card,
  .portrait-orbit,
  .status-dot {
    animation: none !important;
  }
}
