/* ==========================================================================
   M&M Clean Services - Advanced Kinetic & Architectural Animations
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
  }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes auroraShift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-3%, 4%) scale(1.08);
  }
  100% {
    transform: translate(3%, -2%) scale(0.96);
  }
}

@keyframes marqueeScroll {
  0% {
    transform: translate3d(0%, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes handlePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5), 0 8px 24px rgba(5, 12, 22, 0.45);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(56, 189, 248, 0), 0 8px 24px rgba(5, 12, 22, 0.45);
  }
}

.animate-fade-in {
  animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-glow {
  animation: pulseGlow 2.6s infinite;
}

.animate-float {
  animation: floatGentle 5s ease-in-out infinite;
}

/* Scroll Reveal Choreography */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger delays for grid children */
.services-grid > *:nth-child(2),
.trust-grid > *:nth-child(2),
.reviews-grid > *:nth-child(2),
.gallery-grid > *:nth-child(2) {
  transition-delay: 0.07s;
}

.services-grid > *:nth-child(3),
.trust-grid > *:nth-child(3),
.reviews-grid > *:nth-child(3),
.gallery-grid > *:nth-child(3) {
  transition-delay: 0.14s;
}

.services-grid > *:nth-child(4),
.trust-grid > *:nth-child(4),
.reviews-grid > *:nth-child(4),
.gallery-grid > *:nth-child(4) {
  transition-delay: 0.21s;
}

/* Radial Cursor Spotlight Effect on Cards */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    550px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(14, 165, 233, 0.12),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* Kinetic Infinite Marquee */
.kinetic-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #050C16;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.95rem 0;
  user-select: none;
}

.kinetic-marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 34s linear infinite;
}

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

.kinetic-marquee-group {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  padding-right: 2.25rem;
}

.kinetic-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

.kinetic-sep {
  color: #38BDF8;
  display: inline-flex;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .kinetic-marquee-track,
  .animate-float,
  .animate-pulse-glow {
    animation: none !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
