/* ============================================================
   GP IT Solutions — animations.css
   All animations use transform + opacity only (GPU-accelerated).
   No layout-thrashing properties (width, height, top, left, etc.)
   ============================================================ */

/* ----------------------------------------------------------
   1. Hero Staggered Fade-Up
   Applied to elements with .hero-animate class.
   JS adds .hero-animate--visible once page is ready.
   ---------------------------------------------------------- */

/* Base state — invisible and shifted down */
.hero-animate {
  opacity: 0;
  transform: translateY(28px);
}

/* Visible state */
.hero-animate.is-visible {
  animation: fadeUp var(--anim-duration, 0.7s) var(--anim-ease, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

/* Stagger delays set via class names */
.hero-animate--1 { animation-delay: 0.05s; }
.hero-animate--2 { animation-delay: 0.20s; }
.hero-animate--3 { animation-delay: 0.38s; }
.hero-animate--4 { animation-delay: 0.55s; }

/* ----------------------------------------------------------
   2. Scroll Fade-Up
   For service cards, etc. Applied via Intersection Observer.
   ---------------------------------------------------------- */
.scroll-fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity  0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays from data-delay attribute (applied by JS) */
/* Defined as inline CSS custom property --delay on the element */

/* ----------------------------------------------------------
   3. Scroll Fade-In (Testimonials)
   ---------------------------------------------------------- */
.scroll-fade-in {
  opacity: 0;
  transition: opacity 0.7s ease;
}

.scroll-fade-in.in-view {
  opacity: 1;
}

/* ----------------------------------------------------------
   4. Slide-In from Left / Right (AI Spotlight)
   ---------------------------------------------------------- */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition:
    opacity   0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition:
    opacity   0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.slide-in-left.in-view,
.slide-in-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* ----------------------------------------------------------
   5. Keyframes
   ---------------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%) skewX(-12deg); }
  100% { transform: translateX(250%) skewX(-12deg); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
  50%       { box-shadow: 0 0 24px 6px rgba(99, 102, 241, 0.45); }
}

/* ----------------------------------------------------------
   6. CTA Button — Shimmer + Glow Pulse
   ---------------------------------------------------------- */

/* Shimmer overlay */
.btn--shimmer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.30) 50%,
    transparent 100%
  );
  transform: translateX(-100%) skewX(-12deg);
  pointer-events: none;
  border-radius: inherit;
}

/* Trigger shimmer on hover */
.btn--shimmer:hover::before {
  animation: shimmer 0.65s ease forwards;
}

/* Idle glow pulse — subtle, non-distracting */
.btn--shimmer {
  animation: glowPulse 3s ease-in-out infinite;
}

/* Pause glow pulse while hovering (shimmer takes over) */
.btn--shimmer:hover {
  animation: none;
}

/* ----------------------------------------------------------
   7. Navbar Scroll Transition
   Handled in JS (adding .scrolled class to .site-header).
   The CSS transition is defined in style.css.
   Below: animate nav link underlines.
   ---------------------------------------------------------- */

/* Active nav link (scrollspy — applied by JS) */
.nav__link.active            { color: var(--color-white); }
.nav__link.active::after     { width: 100%; }

/* ----------------------------------------------------------
   8. Card Hover Lift
   Defined here for separation of concerns.
   (Base transition is in style.css, effect classes below)
   ---------------------------------------------------------- */

/* Cards get a GPU-composited lift on hover (transform only) */
.card,
.testimonial {
  will-change: transform, opacity;
}

/* ----------------------------------------------------------
   9. Chat Mockup Bubbles — staggered entrance
   ---------------------------------------------------------- */
.ai-spotlight__visual.in-view .chat-bubble {
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ai-spotlight__visual.in-view .chat-bubble:nth-child(1) { animation-delay: 0.3s; }
.ai-spotlight__visual.in-view .chat-bubble:nth-child(2) { animation-delay: 0.55s; }
.ai-spotlight__visual.in-view .chat-bubble:nth-child(3) { animation-delay: 0.80s; }
.ai-spotlight__visual.in-view .chat-bubble:nth-child(4) { animation-delay: 1.05s; }
.ai-spotlight__visual.in-view .chat-bubble:nth-child(5) { animation-delay: 1.30s; }

/* Chat bubbles initially hidden until visual section enters view */
.ai-spotlight__visual .chat-bubble {
  opacity: 0;
}

/* ----------------------------------------------------------
   10. Mobile nav overlay fade
   ---------------------------------------------------------- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.7);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ----------------------------------------------------------
   11. Reduced-motion: all transitions/animations stripped
   (also in style.css as a safety net)
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-animate,
  .scroll-fade-up,
  .scroll-fade-in,
  .slide-in-left,
  .slide-in-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .btn--shimmer {
    animation: none;
  }

  .btn--shimmer::before {
    display: none;
  }
}
