/* McNova motion system
   Motion communicates hierarchy and feedback. It must remain calm and purposeful. */

:root {
  --ease-standard: cubic-bezier(.16, .8, .3, 1);
  --ease-emphasized: cubic-bezier(.22, 1, .36, 1);
  --motion-fast: 180ms;
  --motion-medium: 420ms;
  --motion-slow: 760ms;
}

/* Hero entrance sequence */
.hero-animate {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(4px);
}

body.is-ready .hero-animate {
  animation: hero-enter var(--motion-slow) var(--ease-emphasized) forwards;
}

body.is-ready [data-hero-item]:nth-child(1) { animation-delay: 100ms; }
body.is-ready [data-hero-item]:nth-child(2) { animation-delay: 190ms; }
body.is-ready [data-hero-item]:nth-child(3) { animation-delay: 290ms; }
body.is-ready [data-hero-item]:nth-child(4) { animation-delay: 390ms; }
body.is-ready [data-hero-item]:nth-child(5) { animation-delay: 500ms; }

@keyframes hero-enter {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Subtle cinematic motion for the background */
.hero-video {
  animation: hero-drift 18s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes hero-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.09) translate3d(-1.2%, -0.8%, 0); }
}

/* Scroll indicator */
.scroll-indicator span:last-child {
  animation: scroll-nudge 1.8s ease-in-out infinite;
}

@keyframes scroll-nudge {
  0%, 100% { transform: translateY(0); opacity: .65; }
  50% { transform: translateY(7px); opacity: 1; }
}

/* Capability marquee */
.capability-marquee {
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(11,36,56,.1);
  background: var(--gold-300);
  color: var(--navy-950);
}

.marquee-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 22px;
  padding: 16px 0;
  animation: marquee-move 30s linear infinite;
  will-change: transform;
}

.marquee-track span {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marquee-track i {
  font-style: normal;
  opacity: .45;
}

.capability-marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-move {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Reveal variations */
.service-card.reveal:nth-child(2),
.process-card.reveal:nth-child(2),
.why-item.reveal:nth-child(2) { transition-delay: 70ms; }

.service-card.reveal:nth-child(3),
.process-card.reveal:nth-child(3),
.why-item.reveal:nth-child(3) { transition-delay: 140ms; }

.service-card.reveal:nth-child(4),
.process-card.reveal:nth-child(4),
.why-item.reveal:nth-child(4) { transition-delay: 210ms; }

.service-card.reveal:nth-child(5) { transition-delay: 280ms; }
.service-card.reveal:nth-child(6) { transition-delay: 350ms; }

/* Refined card interactions */
.service-card,
.project-card,
.process-card,
.why-item {
  will-change: transform;
}

.service-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--gold-500);
  transition: transform var(--motion-medium) var(--ease-standard);
}

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-card:hover .service-number {
  transform: translateX(5px);
}

.service-number {
  transition: transform var(--motion-medium) var(--ease-standard);
}

.text-link span {
  transition: transform var(--motion-fast) var(--ease-standard);
}

.text-link:hover span {
  transform: translate(3px, -3px);
}

/* Project slider */
.project-slider {
  position: relative;
}

.project-slider-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.project-slider-track {
  display: flex;
  transition: transform 680ms var(--ease-emphasized);
  will-change: transform;
}

.project-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.project-slider-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}

.project-slider-buttons {
  display: flex;
  gap: 10px;
}

.slider-button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--navy-900);
  cursor: pointer;
  font-size: 1.1rem;
  transition: transform var(--motion-fast), background var(--motion-fast), color var(--motion-fast);
}

.slider-button:hover {
  transform: translateY(-2px);
  background: var(--navy-900);
  color: var(--white);
}

.project-slider-dots {
  display: flex;
  align-items: center;
  gap: 9px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(11,36,56,.22);
  cursor: pointer;
  transition: width var(--motion-medium) var(--ease-standard), background var(--motion-fast);
}

.slider-dot.active {
  width: 34px;
  background: var(--gold-500);
}

.project-slider-count {
  justify-self: end;
  margin: 0;
  color: var(--ink-muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
}

/* Project media hover */
.project-media video {
  transition: transform 900ms var(--ease-emphasized), filter 500ms ease;
}

.project-card:hover .project-media video {
  transform: scale(1.035);
  filter: saturate(1.05);
}

.project-status span {
  animation: status-pulse 2.3s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228,200,113,.42); }
  50% { box-shadow: 0 0 0 7px rgba(228,200,113,0); }
}

/* Form step motion */
.form-step.active {
  animation: form-step-enter 420ms var(--ease-emphasized) both;
}

@keyframes form-step-enter {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stepper li {
  transition: color var(--motion-medium), background var(--motion-medium);
}

.stepper li.active {
  background: rgba(228,200,113,.06);
}

.form-error:not(:empty) {
  animation: error-shake 260ms ease both;
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.success-mark {
  animation: success-pop 520ms var(--ease-emphasized) both;
}

@keyframes success-pop {
  0% { opacity: 0; transform: scale(.55) rotate(-8deg); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Mobile menu entrance */
.mobile-menu:not([hidden]) {
  animation: mobile-menu-enter 300ms var(--ease-emphasized) both;
}

@keyframes mobile-menu-enter {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .project-slider-controls {
    grid-template-columns: 1fr auto;
  }

  .project-slider-dots {
    order: 3;
    grid-column: 1 / -1;
    justify-content: center;
  }

  .marquee-track {
    animation-duration: 24s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-animate {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .hero-video,
  .marquee-track,
  .scroll-indicator span:last-child,
  .project-status span,
  .success-mark {
    animation: none !important;
  }

  .project-slider-track,
  .project-media video,
  .service-card::after,
  .slider-dot {
    transition: none !important;
  }

  .marquee-track {
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }
}
