/* ============================================
   Motion — ambient background & micro-interactions
   ============================================ */

/* Fixed ambient layers (behind content, above base bg) */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-bg__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.ambient-bg__aurora--1 {
  width: min(70vw, 720px);
  height: min(70vw, 720px);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.45) 0%, transparent 68%);
  animation: auroraDrift1 22s ease-in-out infinite;
}

.ambient-bg__aurora--2 {
  width: min(65vw, 640px);
  height: min(65vw, 640px);
  bottom: -8%;
  right: -10%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.38) 0%, transparent 70%);
  animation: auroraDrift2 26s ease-in-out infinite;
}

.ambient-bg__shimmer {
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(124, 58, 237, 0.06) 60deg,
    transparent 120deg,
    rgba(6, 182, 212, 0.05) 200deg,
    transparent 280deg
  );
  animation: ambientShimmer 40s linear infinite;
  opacity: 0.9;
}

@keyframes auroraDrift1 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(6%, 8%) scale(1.08);
  }
}

@keyframes auroraDrift2 {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-7%, -6%) scale(1.06);
  }
}

@keyframes ambientShimmer {
  to {
    transform: rotate(360deg);
  }
}

/* Content sits above particle / ambient layers */
.section,
.hero,
.footer {
  position: relative;
  z-index: 2;
}

/* Floating gradient orbs in sections */
.gradient-orb {
  opacity: 0.85;
  will-change: transform;
}

.gradient-orb--purple {
  animation: orbFloatPurple 20s ease-in-out infinite;
}

.gradient-orb--cyan {
  animation: orbFloatCyan 24s ease-in-out infinite;
}

@keyframes orbFloatPurple {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -30px) scale(1.12);
  }
}

@keyframes orbFloatCyan {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-35px, 28px) scale(1.1);
  }
}

/* Animated gradient headlines */
.gradient-text {
  background-size: 200% auto;
  animation: gradientTextFlow 6s ease-in-out infinite;
}

@keyframes gradientTextFlow {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* Section label pulse */
.section-label {
  position: relative;
  animation: labelGlow 4s ease-in-out infinite;
}

@keyframes labelGlow {
  0%,
  100% {
    text-shadow: 0 0 0 transparent;
  }
  50% {
    text-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
  }
}

/* Hero photo gentle float */
.hero-photo-card {
  animation: heroCardFloat 5s ease-in-out infinite;
}

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

.hero-photo-wrapper {
  animation: heroPhotoGlow 4s ease-in-out infinite;
}

@keyframes heroPhotoGlow {
  0%,
  100% {
    box-shadow: var(--glow-purple), inset 0 0 30px rgba(124, 58, 237, 0.1);
  }
  50% {
    box-shadow: 0 0 55px rgba(124, 58, 237, 0.55), 0 0 35px rgba(6, 182, 212, 0.25),
      inset 0 0 40px rgba(124, 58, 237, 0.18);
  }
}

/* Card shine sweep on hover */
.project-card,
.service-card,
.testimonial-card,
.blog-card {
  position: relative;
  overflow: hidden;
}

.project-card::after,
.service-card:not(.service-card--vertical)::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 45%,
    transparent 100%
  );
  transform: skewX(-18deg);
  transition: left 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.project-card:hover::after,
.service-card:not(.service-card--vertical):hover::after {
  left: 130%;
}

/* Stat items subtle pop */
.stat-item {
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.stat-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.2);
}

/* Navbar logo subtle shimmer when scrolled */
.navbar.scrolled .brand-logo__mark {
  animation: logoShimmer 8s ease-in-out infinite;
}

@keyframes logoShimmer {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.15);
  }
}

/* Scroll-reveal helper (GSAP sets initial state) */
.motion-reveal {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .ambient-bg__aurora,
  .ambient-bg__shimmer,
  .gradient-orb--purple,
  .gradient-orb--cyan,
  .gradient-text,
  .section-label,
  .hero-photo-card,
  .hero-photo-wrapper,
  .navbar.scrolled .brand-logo__mark {
    animation: none !important;
  }

  .project-card::after,
  .service-card:not(.service-card--vertical)::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .ambient-bg__aurora--1,
  .ambient-bg__aurora--2 {
    opacity: 0.4;
    filter: blur(64px);
  }

  .hero-photo-card,
  .hero-photo-wrapper {
    animation: none;
  }

  .gradient-orb--purple,
  .gradient-orb--cyan {
    animation-duration: 28s;
  }
}
