/* ==========================================================================
   SOS Informatique 06 — Futuristic Animations
   Premium showroom aesthetic | Accent #4AC1E0
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
  --anim-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-duration: 0.8s;
  --anim-accent: #4AC1E0;
  --anim-glow: rgba(74, 193, 224, 0.45);
}

/* ==========================================================================
   1. SCROLL REVEAL SYSTEM — [data-animate]
   ========================================================================== */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity, filter;
  transition:
    opacity var(--anim-duration) var(--anim-ease),
    transform var(--anim-duration) var(--anim-ease),
    filter var(--anim-duration) var(--anim-ease);
}

[data-animate="fade-up"]   { transform: translateY(48px); }
[data-animate="fade-down"] { transform: translateY(-48px); }
[data-animate="fade-left"] { transform: translateX(-60px); }
[data-animate="fade-right"]{ transform: translateX(60px); }
[data-animate="scale"]     { transform: scale(0.9); }
[data-animate="blur"]      { filter: blur(12px); }

/* Triggered state */
[data-animate].animated {
  opacity: 1;
  transform: translate(0) scale(1);
  filter: blur(0);
}

/* Stagger delay via data-delay attribute */
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }
[data-delay="5"] { transition-delay: 0.5s; }
[data-delay="6"] { transition-delay: 0.6s; }
[data-delay="7"] { transition-delay: 0.7s; }
[data-delay="8"] { transition-delay: 0.8s; }

/* ==========================================================================
   2. COUNTER ANIMATION
   ========================================================================== */
.counter {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--anim-ease);
}

.counter.animated {
  color: var(--anim-accent);
  animation: counter-pop 0.4s var(--anim-ease);
}

@keyframes counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   3. HOVER MICRO-INTERACTIONS
   ========================================================================== */

/* --- Cards: subtle 3D tilt --- */
.card-3d {
  perspective: 800px;
  transform-style: preserve-3d;
}

.card-3d__inner {
  transition: transform 0.45s var(--anim-ease), box-shadow 0.45s var(--anim-ease);
}

/* --- Buttons: scale + glow pulse --- */
.btn,
button[class*="btn"] {
  transition: transform 0.3s var(--anim-ease), box-shadow 0.3s var(--anim-ease);
}

.btn:hover,
button[class*="btn"]:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 3px var(--anim-glow), 0 8px 24px rgba(74, 193, 224, 0.25);
  animation: glow-pulse 1.6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--anim-glow), 0 8px 24px rgba(74, 193, 224, 0.25); }
  50%      { box-shadow: 0 0 0 6px var(--anim-glow), 0 12px 32px rgba(74, 193, 224, 0.35); }
}

/* --- Links: underline slide-in from left --- */
a:not(.btn):not([class*="btn"]) {
  position: relative;
}

a:not(.btn):not([class*="btn"])::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--anim-accent);
  transition: width 0.35s var(--anim-ease);
}

a:not(.btn):not([class*="btn"]):hover::after {
  width: 100%;
}

/* --- Icons: rotate + scale on parent hover --- */
.icon,
[class*="__icon"] {
  transition: transform 0.4s var(--anim-ease);
}

*:hover > .icon,
*:hover > [class*="__icon"] {
  transform: rotate(8deg) scale(1.15);
}

/* ==========================================================================
   4. HERO ANIMATIONS
   ========================================================================== */

/* --- Staggered entrance for hero children --- */
.hero-entrance > * {
  opacity: 0;
  transform: translateY(36px);
  animation: hero-child-in var(--anim-duration) var(--anim-ease) forwards;
}

.hero-entrance > *:nth-child(1) { animation-delay: 0.1s; }
.hero-entrance > *:nth-child(2) { animation-delay: 0.25s; }
.hero-entrance > *:nth-child(3) { animation-delay: 0.4s; }
.hero-entrance > *:nth-child(4) { animation-delay: 0.55s; }
.hero-entrance > *:nth-child(5) { animation-delay: 0.7s; }

@keyframes hero-child-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Gradient text shimmer --- */
.hero-entrance h1,
.text-shimmer {
  background: linear-gradient(
    105deg,
    currentColor 40%,
    var(--anim-accent) 50%,
    currentColor 60%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite;
}

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

/* --- Floating decorative elements --- */
.animate-float,
.hero-float {
  animation: float 4s var(--anim-ease) infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-12px) rotate(1deg); }
  66%      { transform: translateY(-6px) rotate(-1deg); }
}

/* ==========================================================================
   5. PAGE TRANSITIONS — Voile + zoom (Option B)
   ========================================================================== */

/* Entrée : fondu simple — pas de transform sur body (casserait position:fixed) */
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body {
  animation: page-enter 0.25s ease-out both;
}

/* Overlay noir — invisible par défaut */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: #07090F;
  opacity: 0;
  transition: opacity 0.18s ease-in;
  will-change: opacity;
}

/* Panel interne inutilisé */
.page-transition__panel { display: none; }

/* EXIT : fondu vers le noir */
.page-transition--exiting {
  opacity: 1;
  pointer-events: all;
}

/* ==========================================================================
   6. SCROLL INDICATOR
   ========================================================================== */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

.scroll-indicator__arrow {
  width: 24px;
  height: 24px;
  animation: scroll-bounce 2s var(--anim-ease) infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(10px); opacity: 1; }
}

/* ==========================================================================
   7. LOADING / SKELETON STATES
   ========================================================================== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(74, 193, 224, 0.06);
  border-radius: 8px;
  color: transparent !important;
}

.skeleton * {
  visibility: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 193, 224, 0.08) 40%,
    rgba(74, 193, 224, 0.14) 50%,
    rgba(74, 193, 224, 0.08) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: skeleton-sweep 1.6s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(74, 193, 224, 0.15);
  border-top-color: var(--anim-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ==========================================================================
   8. MARQUEE — .clients-marquee__track
   ========================================================================== */
.clients-marquee__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}

.clients-marquee__track:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   9. STAGGER SYSTEM — [data-stagger]
   ========================================================================== */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s var(--anim-ease),
    transform 0.6s var(--anim-ease);
}

[data-stagger].animated > *:nth-child(1)  { transition-delay: 0.05s; }
[data-stagger].animated > *:nth-child(2)  { transition-delay: 0.1s; }
[data-stagger].animated > *:nth-child(3)  { transition-delay: 0.15s; }
[data-stagger].animated > *:nth-child(4)  { transition-delay: 0.2s; }
[data-stagger].animated > *:nth-child(5)  { transition-delay: 0.25s; }
[data-stagger].animated > *:nth-child(6)  { transition-delay: 0.3s; }
[data-stagger].animated > *:nth-child(7)  { transition-delay: 0.35s; }
[data-stagger].animated > *:nth-child(8)  { transition-delay: 0.4s; }
[data-stagger].animated > *:nth-child(9)  { transition-delay: 0.45s; }
[data-stagger].animated > *:nth-child(10) { transition-delay: 0.5s; }
[data-stagger].animated > *:nth-child(11) { transition-delay: 0.55s; }
[data-stagger].animated > *:nth-child(12) { transition-delay: 0.6s; }

[data-stagger].animated > * {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   10. UTILITY ANIMATIONS
   ========================================================================== */
.animate-pulse {
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

.animate-spin-slow {
  animation: spin 20s linear infinite;
}

/* ==========================================================================
   11. REDUCED MOTION — accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-entrance > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .clients-marquee__track {
    animation: none !important;
  }

  .skeleton::after {
    animation: none !important;
  }
}
