/* ==========================================================================
   BUSYMAN SOLUTIONS — Motion & Interaction Layer
   Complements styles.css. Loaded after GSAP + Lenis are initialized.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Smooth Scroll Body (Lenis)
   -------------------------------------------------------------------------- */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

/* --------------------------------------------------------------------------
   2. Custom Cursor (Desktop ≥1024px, no touch)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (pointer: fine) {
  .has-custom-cursor,
  .has-custom-cursor a,
  .has-custom-cursor button,
  .has-custom-cursor [role="button"] {
    cursor: none !important;
  }
}

.cursor {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  mix-blend-mode: difference;
  will-change: transform;
}

.cursor__dot {
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-radius: 50%;
  position: absolute;
  top: -4px;
  left: -4px;
  transition: transform 0.15s cubic-bezier(0.22,1,0.36,1), opacity 0.2s;
}

.cursor__ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  position: absolute;
  top: -18px;
  left: -18px;
  transition: width 0.35s cubic-bezier(0.22,1,0.36,1),
              height 0.35s cubic-bezier(0.22,1,0.36,1),
              top 0.35s cubic-bezier(0.22,1,0.36,1),
              left 0.35s cubic-bezier(0.22,1,0.36,1),
              border-color 0.25s,
              opacity 0.3s;
}

/* Hover: expand ring */
.cursor--hovering .cursor__ring {
  width: 52px;
  height: 52px;
  top: -26px;
  left: -26px;
  border-color: rgba(255,107,3,0.8);
}

.cursor--hovering .cursor__dot {
  transform: scale(1.5);
}

/* Click: pulse */
.cursor--clicking .cursor__dot {
  transform: scale(0.6);
}

/* Hidden when off-viewport */
.cursor--hidden .cursor__dot,
.cursor--hidden .cursor__ring {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   3. Magnetic Button Effect
   -------------------------------------------------------------------------- */
.magnetic-wrap {
  display: inline-block;
  position: relative;
}

.magnetic-wrap .btn,
.magnetic-wrap a {
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.2s cubic-bezier(0.22,1,0.36,1);
}

/* Button press feedback */
.btn:active,
[role="button"]:active {
  transform: scale(0.97) !important;
  transition-duration: 0.08s !important;
}

/* --------------------------------------------------------------------------
   4. Text Split Animation Containers
   -------------------------------------------------------------------------- */
.split-text {
  overflow: hidden;
}

.split-text .word {
  display: inline-block;
  overflow: hidden;
}

.split-text .word-inner {
  display: inline-block;
  will-change: transform, opacity;
}

.split-text .char {
  display: inline-block;
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   5. Hero Cinematic Entrance
   -------------------------------------------------------------------------- */
.hero-new__bg {
  will-change: transform;
}

.hero-new__label,
.hero-new__title,
.hero-new__desc,
.hero-new__actions {
  will-change: transform, opacity;
}

/* Hero title words initial state (set by JS, cleared after animation) */
.hero-anim-ready .hero-new__label,
.hero-anim-ready .hero-new__desc,
.hero-anim-ready .hero-new__actions {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   6. Clip-Path Reveals
   -------------------------------------------------------------------------- */
.clip-reveal {
  clip-path: inset(0 0 100% 0);
  will-change: clip-path;
}

.clip-reveal--left {
  clip-path: inset(0 100% 0 0);
}

.clip-reveal--right {
  clip-path: inset(0 0 0 100%);
}

.clip-reveal.revealed {
  clip-path: inset(0 0 0 0);
}

/* --------------------------------------------------------------------------
   7. Section Parallax Layers
   -------------------------------------------------------------------------- */
[data-parallax] {
  will-change: transform;
}

/* --------------------------------------------------------------------------
   8. Enhanced Link Hover Underline
   -------------------------------------------------------------------------- */
.link-reveal {
  position: relative;
  display: inline;
}

.link-reveal::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
}

.link-reveal:hover::after,
.link-reveal:focus-visible::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   9. Staggered Grid Entrance
   -------------------------------------------------------------------------- */
.stagger-grid > * {
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   10. Animated Gradient Background
   -------------------------------------------------------------------------- */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* --------------------------------------------------------------------------
   11. Service Row Hover Enhancement
   -------------------------------------------------------------------------- */
.service-row {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.4s cubic-bezier(0.22,1,0.36,1);
}

@media (min-width: 1024px) and (pointer: fine) {
  .service-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  }
}

/* --------------------------------------------------------------------------
   12. Industry Row Clip Reveal
   -------------------------------------------------------------------------- */
.industry-row {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}

/* --------------------------------------------------------------------------
   13. Bento Tile Hover Enhancement
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (pointer: fine) {
  .bento-tile {
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.45s cubic-bezier(0.22,1,0.36,1);
  }

  .bento-tile:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1);
  }
}

/* --------------------------------------------------------------------------
   14. Process Timeline Connector
   -------------------------------------------------------------------------- */
.process-timeline-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.process-timeline-line__fill {
  width: 100%;
  height: 0%;
  background: var(--orange);
  border-radius: 2px;
  will-change: height;
}

/* --------------------------------------------------------------------------
   15. Enquiry Form Enhanced States
   -------------------------------------------------------------------------- */
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,3,0.12);
  transition: border-color 0.25s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s cubic-bezier(0.22,1,0.36,1);
}

/* Step panel slide transitions (enhanced by JS) */
.step-panel {
  will-change: transform, opacity;
}

/* Confirmation entrance */
.confirmation-animate {
  animation: confirmationEnter 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes confirmationEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   16. CTA Band Entrance
   -------------------------------------------------------------------------- */
.cta-band {
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   17. Location Card Subtle Glow
   -------------------------------------------------------------------------- */
@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,3,0); }
  50%      { box-shadow: 0 0 0 8px rgba(255,107,3,0.08); }
}

.location-card-animate {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   18. Comparison Table Row Animation
   -------------------------------------------------------------------------- */
.comparison-row {
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   19. Milestone Card Hover
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (pointer: fine) {
  .milestone-card {
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.4s cubic-bezier(0.22,1,0.36,1);
  }
  
  .milestone-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  }
}

/* --------------------------------------------------------------------------
   20. Navigation Active Pill Slider
   -------------------------------------------------------------------------- */
.subnav-pill-slider {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
  will-change: transform, width;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1),
              width 0.35s cubic-bezier(0.22,1,0.36,1);
}

/* --------------------------------------------------------------------------
   21. Consultation Card 3D Tilt (Desktop)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) and (pointer: fine) {
  .consult-card {
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.4s cubic-bezier(0.22,1,0.36,1);
    transform-style: preserve-3d;
    perspective: 1000px;
  }
}

/* --------------------------------------------------------------------------
   22. Tag Entrance Animation
   -------------------------------------------------------------------------- */
.tag {
  will-change: transform, opacity;
}

/* --------------------------------------------------------------------------
   23. Reduced Motion Override — Disable ALL custom animations
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor__dot,
  .cursor__ring {
    display: none !important;
  }

  .has-custom-cursor,
  .has-custom-cursor a,
  .has-custom-cursor button {
    cursor: auto !important;
  }

  .clip-reveal,
  .clip-reveal--left,
  .clip-reveal--right {
    clip-path: none !important;
  }

  .hero-anim-ready .hero-new__label,
  .hero-anim-ready .hero-new__desc,
  .hero-anim-ready .hero-new__actions {
    opacity: 1 !important;
  }

  .animated-gradient {
    animation: none !important;
  }

  .location-card-animate {
    animation: none !important;
  }

  .confirmation-animate {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  [data-parallax],
  .stagger-grid > *,
  .split-text .word-inner,
  .split-text .char {
    will-change: auto !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
