/* ==========================================================================
   GROUPZON - Animations Stylesheet  |  css/animations.css
   All keyframe animations, transition classes, and hero stagger timing.
   ========================================================================== */

/* ==========================================================================
   01. HERO ENTRY ANIMATION SEQUENCE
   Failure-safe CSS-only staggered entry. Elements visible by default.
   ========================================================================== */

/* Elements are fully visible and in normal position by default. */
.hero-eyebrow,
.hero-title,
.hero-desc,
.hero-actions,
.hero-floating-cards {
  opacity: 1;
  transform: none;
}

/* Animations applied immediately on load using 'both' fill-mode to prevent FOUC 
   while ensuring they remain visible if CSS animations fail. Added 0.2s delay for loader. */
.hero-eyebrow {
  animation: fadeSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both;
}

.hero-title {
  animation: fadeSlideUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

.hero-desc {
  animation: fadeSlideUp 0.60s cubic-bezier(0.22, 1, 0.36, 1) 0.58s both;
}

.hero-actions {
  animation: fadeSlideUp 0.60s cubic-bezier(0.22, 1, 0.36, 1) 0.72s both;
}

.hero-floating-cards {
  animation: fadeSlideScale 0.80s cubic-bezier(0.22, 1, 0.36, 1) 0.40s both;
}

/* ==========================================================================
   02. KEYFRAME DEFINITIONS
   ========================================================================== */

/* Slide up + fade in */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide from left + fade in */
@keyframes fadeSlideLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide from right + fade in */
@keyframes fadeSlideRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale up + fade in (for visual panels) */
@keyframes fadeSlideScale {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Fade in only */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Gentle float for decorative elements */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* Reusable Corporate Floating Animations */
@keyframes floatSlow {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes floatMedium {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes floatFast {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-4px);
  }
}

.float-slow {
  animation: floatSlow 6s ease-in-out infinite;
  will-change: transform;
}

.float-medium {
  animation: floatMedium 4.8s ease-in-out infinite;
  animation-delay: 0.8s;
  will-change: transform;
}

.float-fast {
  animation: floatFast 3.6s ease-in-out infinite;
  animation-delay: 1.4s;
  will-change: transform;
}

.float-delayed {
  animation: floatSlow 6.5s ease-in-out infinite;
  animation-delay: 2s;
  will-change: transform;
}

/* Shimmer loading skeleton */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

/* Spin for loaders */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Branded Groupzon Loader Animations */
@keyframes groupzonOrbitSpin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes networkDotPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes brandBreathing {

  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 4px rgba(69, 182, 73, 0.3));
  }

  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 10px rgba(69, 182, 73, 0.6));
  }
}

/* Pulsing ring (for accent dots) */
@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(69, 182, 73, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(69, 182, 73, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(69, 182, 73, 0);
  }
}

/* ==========================================================================
   03. SCROLL REVEAL SYSTEM
   Applied by IntersectionObserver in animations.js (animates only once).
   ========================================================================== */
.js-animations-ready .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js-animations-ready .reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js-animations-ready .reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js-animations-ready .reveal-scale {
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.js-animations-ready .reveal-down {
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

/* Active revealed state — set once by observer */
.js-animations-ready .reveal.is-revealed,
.js-animations-ready .reveal-left.is-revealed,
.js-animations-ready .reveal-right.is-revealed,
.js-animations-ready .reveal-scale.is-revealed,
.js-animations-ready .reveal-down.is-revealed {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger groups — children reveal with delay */
.stagger-group .reveal:nth-child(1) {
  transition-delay: 0ms;
}

.stagger-group .reveal:nth-child(2) {
  transition-delay: 80ms;
}

.stagger-group .reveal:nth-child(3) {
  transition-delay: 160ms;
}

.stagger-group .reveal:nth-child(4) {
  transition-delay: 240ms;
}

.stagger-group .reveal:nth-child(5) {
  transition-delay: 320ms;
}

.stagger-group .reveal:nth-child(6) {
  transition-delay: 400ms;
}

.stagger-group .reveal:nth-child(7) {
  transition-delay: 480ms;
}

.stagger-group .reveal:nth-child(8) {
  transition-delay: 560ms;
}

.stagger-group .reveal:nth-child(9) {
  transition-delay: 640ms;
}

.stagger-group .reveal:nth-child(10) {
  transition-delay: 720ms;
}

/* ==========================================================================
   04. CARD HOVER MICRO-ANIMATIONS
   ========================================================================== */

/* Service card: icon lifts slightly on hover */
.service-card:hover .service-card-icon {
  animation: cardIconPop 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cardIconPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1.05);
  }
}

/* Solution card: header gradient shift */
.solution-card-header {
  background-size: 200% 200%;
  background-position: 0% 0%;
  transition: background-position 0.5s ease;
}

.solution-card:hover .solution-card-header {
  background-position: 100% 100%;
}

/* ==========================================================================
   05. NAVBAR SCROLL EFFECT
   .is-scrolled class added by navbar.js â€” shadow already in style.css.
   Additional backdrop blur ramp on scroll.
   ========================================================================== */
.site-header {
  transition:
    box-shadow 250ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 250ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   06. DROPDOWN SMOOTH ENTRY
   ========================================================================== */
.dropdown {
  transform-origin: top center;
}

.dropdown--wide {
  transform-origin: top left;
}

/* ==========================================================================
   07. BUTTON RIPPLE EFFECT
   Add .btn-ripple class to enable.
   The ripple span is injected by JS when clicked.
   ========================================================================== */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleEffect 0.55s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ==========================================================================
   08. FLOATING HERO BADGE
   The badge on the hero visual gently floats.
   ========================================================================== */
.hero-badge {
  animation: float 4s ease-in-out infinite;
  animation-delay: 1s;
}

/* ==========================================================================
   Storytelling & Telemetry Micro-Animations
   ========================================================================== */

/* Telemetry radar ripple */
@keyframes radar-ripple {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }

  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* Panel Active Glowing Accent Animation */
.video-story-panel {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s ease,
    background 0.35s ease;
}

.video-story-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #22c55e, #15803d);
  border-radius: 4px 0 0 4px;
  opacity: 0;
  transform: scaleY(0.4);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-story-panel.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.video-story-panel:hover {
  transform: translateY(-4px) scale(1.012);
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 14px 28px -6px rgba(22, 101, 52, 0.12);
}

.video-story-panel.is-active {
  transform: scale(1.02);
  box-shadow: 0 16px 36px -6px rgba(22, 101, 52, 0.18);
}

/* Video Frame Hover Depth & HUD Corner Expansion */
.story-video-display {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease;
}

.story-video-display:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 50px -10px rgba(16, 185, 129, 0.25), 0 0 20px rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.6);
}

.story-video-display:hover .hud-bracket--tl {
  top: 6px;
  left: 6px;
}

.story-video-display:hover .hud-bracket--br {
  bottom: 6px;
  right: 6px;
}

/* ==========================================================================
   Responsive Mobile & Tablet Adjustments (Single Column Layout)
   ========================================================================== */

@media (max-width: 992px) {

  /* Flatten parent grid layout */
  .video-story-inner {
    grid-template-columns: 1fr;
    min-height: unset;
    gap: 1.5rem;
  }

  /* Reset sticky positioning for mobile flow */
  .video-story-sticky {
    position: static;
    height: auto;
    padding: 0;
    top: auto;
  }

  /* Constrain video display height for smaller screens */
  .story-video-display {
    max-height: 320px;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  /* Mobile panels wrapper padding */
  .video-story-panels {
    padding: 0;
    gap: 1rem;
  }

  /* Keep all panels fully visible and interactive on touch devices */
  .video-story-panel {
    opacity: 1;
    transform: none;
    min-height: auto;
  }

  .video-story-panel:hover {
    transform: none;
  }
}

/* ==========================================================================
   10. SCROLL PROGRESS BAR ANIMATION
   Width is updated via JS â€” the transition is defined in style.css.
   ========================================================================== */

/* ==========================================================================
   11. LOADING SKELETON (for lazy-loaded content placeholder)
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg,
      var(--clr-surface) 0%,
      var(--clr-surface-2) 50%,
      var(--clr-surface) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   12. REDUCED MOTION â€” Override everything
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {

  /* Disable all animations and transitions for accessibility */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Hero: show immediately without animation */
  .hero-eyebrow,
  .hero-title,
  .hero-desc,
  .hero-actions,
  .hero-floating-cards {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  /* Reveal elements: show without animation */
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-down {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Floating elements and badge: no floating */
  .hero-badge,
  .float-slow,
  .float-medium,
  .float-fast,
  .float-delayed {
    animation: none !important;
    transform: none !important;
  }

  /* Loader animations: static */
  .loader-orbit,
  .loader-arc,
  .loader-dot,
  .loader-center-g {
    animation: none !important;
  }

  /* No scroll progress animation */
  .scroll-progress {
    transition: none !important;
  }
}