/* =============================================================================
   CONSOMEDIX GROUP — animations.css
   Keyframes + scroll-reveal utility classes.
   All motion is gated behind prefers-reduced-motion at the bottom.
   ============================================================================= */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

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

@keyframes floatSlow {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-22px) rotate(6deg);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  70% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes drawLine {
  from {
    stroke-dashoffset: var(--dash, 1000);
  }
  to {
    stroke-dashoffset: 0;
  }
}

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

/* ---- Floating decorative elements ------------------------------------------ */
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-float-slow {
  animation: floatSlow 9s ease-in-out infinite;
}
.hero__float--tl {
  animation: float 6s ease-in-out infinite;
}
.hero__float--br {
  animation: float 7s ease-in-out infinite 0.6s;
}
.shape--ring {
  animation: floatSlow 12s ease-in-out infinite;
}
.shape--dot {
  animation: float 5s ease-in-out infinite;
}
.shape--square {
  animation: floatSlow 10s ease-in-out infinite 0.5s;
}

/* Pulsing map markers */
.map-marker {
  transform-box: fill-box;
  transform-origin: center;
}
.map-pulse {
  transform-origin: center;
  animation: pulseRing 3s ease-out infinite;
}

/* Loading skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f6f9fc 37%, #eef2f7 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-md);
}

/* ---- Scroll reveal --------------------------------------------------------
   Elements get [data-reveal]; JS adds .is-visible via IntersectionObserver.
   --------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal='fade'] {
  transform: none;
}
[data-reveal='left'] {
  transform: translateX(-36px);
}
[data-reveal='right'] {
  transform: translateX(36px);
}
[data-reveal='scale'] {
  transform: scale(0.94);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger children via inline --delay set by JS */
[data-reveal] {
  transition-delay: var(--reveal-delay, 0s);
}

/* Image reveal (clip wipe) */
.img-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.9s var(--ease-out);
}
.img-reveal.is-visible {
  clip-path: inset(0 0 0 0);
}

/* Count-up numbers start hidden until observed (fallback shows them) */
.counting {
  font-variant-numeric: tabular-nums;
}

/* Nav entrance on load */
.site-header {
  animation: fadeIn 0.6s var(--ease) both;
}
.hero__eyebrow,
.hero__title,
.hero__sub,
.hero__actions,
.hero__trust {
  animation: fadeUp 0.8s var(--ease) both;
}
.hero__title {
  animation-delay: 0.08s;
}
.hero__sub {
  animation-delay: 0.16s;
}
.hero__actions {
  animation-delay: 0.24s;
}
.hero__trust {
  animation-delay: 0.32s;
}
.hero__visual {
  animation: scaleIn 0.9s var(--ease-out) both 0.2s;
}

/* Button ripple/press micro-interaction handled by transform in style.css */

/* ---- Reduced motion -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .img-reveal {
    clip-path: none !important;
  }
  .animate-float,
  .animate-float-slow,
  .hero__float--tl,
  .hero__float--br,
  .shape,
  .map-pulse {
    animation: none !important;
  }
}
