/* ===================================================================
   AUDITTECH360 — GLOBAL MOTION ANIMATION SYSTEM
   Precision-engineered, performance-optimized, accessible micro-interactions
   Cubic-bezier: cubic-bezier(0.22, 1, 0.36, 1)
   Brand Theme: Premium Orange (#1677FF) + Clean White
   =================================================================== */

/* ===================================================================
   1. PROGRESSIVE ENHANCEMENT BASELINE
   By default, all content is 100% visible and un-transformed.
   Hidden states are strictly applied ONLY when JS confirms motion readiness.
   =================================================================== */
.at-reveal,
.at-reveal-up,
.at-reveal-left,
.at-reveal-right,
.at-reveal-scale,
.at-image-reveal {
  opacity: 1;
  transform: none;
}

/* ===================================================================
   2. MOTION READY PRE-ANIMATION STATES (Triggered only when JS is active)
   =================================================================== */
html.at-motion-ready .at-reveal,
html.at-motion-ready .at-reveal-up {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

html.at-motion-ready .at-reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

html.at-motion-ready .at-reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

html.at-motion-ready .at-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* Hero Elements: Snappy entrance */
html.at-motion-ready .at-hero-heading {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

html.at-motion-ready .at-hero-desc {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s,
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
  will-change: opacity, transform;
}

html.at-motion-ready .at-hero-cta {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.22s,
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.22s;
  will-change: opacity, transform;
}

/* ===================================================================
   3. REVEALED STATE (Hardware-accelerated completion)
   =================================================================== */
html.at-motion-ready .at-revealed,
html.at-motion-ready .at-reveal.at-revealed,
html.at-motion-ready .at-reveal-up.at-revealed,
html.at-motion-ready .at-reveal-left.at-revealed,
html.at-motion-ready .at-reveal-right.at-revealed,
html.at-motion-ready .at-hero-heading.at-revealed,
html.at-motion-ready .at-hero-desc.at-revealed,
html.at-motion-ready .at-hero-cta.at-revealed,
html.at-motion-ready .reveal-on-scroll.revealed,
html.at-motion-ready .reveal-on-scroll.at-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

html.at-motion-ready .at-reveal-scale.at-revealed {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ===================================================================
   4. STAGGER DELAY UTILITIES
   =================================================================== */
html.at-motion-ready .at-delay-1 { transition-delay: 0.08s !important; }
html.at-motion-ready .at-delay-2 { transition-delay: 0.16s !important; }
html.at-motion-ready .at-delay-3 { transition-delay: 0.24s !important; }
html.at-motion-ready .at-delay-4 { transition-delay: 0.32s !important; }
html.at-motion-ready .at-delay-5 { transition-delay: 0.40s !important; }
html.at-motion-ready .at-delay-6 { transition-delay: 0.48s !important; }
html.at-motion-ready .at-delay-7 { transition-delay: 0.56s !important; }
html.at-motion-ready .at-delay-8 { transition-delay: 0.64s !important; }

/* ===================================================================
   5. IMAGE REVEAL SYSTEM
   Preserves aspect-ratio, border-radius, object-fit & container geometry
   =================================================================== */
html.at-motion-ready .at-image-reveal {
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

html.at-motion-ready .at-image-reveal.at-revealed {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ===================================================================
   6. PREMIUM CARD & COMPONENT HOVER INTERACTIONS
   Strictly scoped to devices with hover capabilities (pointer: fine)
   =================================================================== */
@media (hover: hover) and (pointer: fine) {
  .at-motion-card {
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.24s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  .at-motion-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 36px rgba(22, 119, 255, 0.09), 0 4px 12px rgba(15, 23, 42, 0.05) !important;
    border-color: rgba(22, 119, 255, 0.35) !important;
  }

  /* Micro-motion on card arrow indicators */
  .at-motion-card .bi-arrow-up-right,
  .at-motion-card .arrow-icon,
  .at-motion-card .arrow-diag,
  .at-motion-card .btn-arrow-up-right {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  .at-motion-card:hover .bi-arrow-up-right,
  .at-motion-card:hover .arrow-icon,
  .at-motion-card:hover .arrow-diag,
  .at-motion-card:hover .btn-arrow-up-right {
    transform: translate(3px, -3px) !important;
  }

  /* Subtle image zoom inside card containers */
  .at-motion-card .card-img-wrap img,
  .at-motion-card .service-card-visual img,
  .at-motion-card .industry-visual img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  .at-motion-card:hover .card-img-wrap img,
  .at-motion-card:hover .service-card-visual img,
  .at-motion-card:hover .industry-visual img {
    transform: scale(1.025) !important;
  }

  /* Button micro-interaction */
  .at-btn-motion {
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.2s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  .at-btn-motion:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(22, 119, 255, 0.28) !important;
  }

  .at-btn-motion:active {
    transform: translateY(0) !important;
  }
}

/* ===================================================================
   7. MOBILE AND TABLET OPTIMIZATION (Prevent horizontal overflow)
   =================================================================== */
@media (max-width: 991.98px) {
  html.at-motion-ready .at-reveal-up,
  html.at-motion-ready .at-reveal {
    transform: translateY(16px);
  }

  /* Transform lateral slides to subtle vertical rises on mobile */
  html.at-motion-ready .at-reveal-left,
  html.at-motion-ready .at-reveal-right {
    transform: translateY(14px);
  }

  html.at-motion-ready .at-hero-heading {
    transform: translateY(18px);
  }
}

@media (max-width: 575.98px) {
  html.at-motion-ready .at-reveal-up,
  html.at-motion-ready .at-reveal,
  html.at-motion-ready .at-reveal-left,
  html.at-motion-ready .at-reveal-right {
    transform: translateY(12px);
    transition-duration: 0.55s;
  }

  html.at-motion-ready .at-hero-heading {
    transform: translateY(14px);
    transition-duration: 0.6s;
  }
}

/* ===================================================================
   8. STRICT EXCLUSIONS & SAFETY GUARDS
   Protect fixed navbar, modals, carousels, and dropdowns
   =================================================================== */
#enquiryModal,
#enquiryModal *,
.modal,
.modal *,
.navbar,
.navbar-nav,
.nav-dropdown-menu,
.dropdown-menu,
.editorial-header,
#navCollapse,
.people-carousel-track,
.marquee-track,
.carousel-track {
  transform: none;
}

/* ===================================================================
   9. ACCESSIBILITY — PREFERS-REDUCED-MOTION
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  html.at-motion-ready .at-reveal,
  html.at-motion-ready .at-reveal-up,
  html.at-motion-ready .at-reveal-left,
  html.at-motion-ready .at-reveal-right,
  html.at-motion-ready .at-reveal-scale,
  html.at-motion-ready .at-hero-heading,
  html.at-motion-ready .at-hero-desc,
  html.at-motion-ready .at-hero-cta,
  html.at-motion-ready .at-image-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .at-motion-card,
  .at-motion-card:hover,
  .at-btn-motion,
  .at-btn-motion:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}
