/* ========================================
   ACCES IA — Animations & micro-interactions
   Vanilla CSS, ~3 Ko, prefers-reduced-motion safe
   ======================================== */

/* ----- Reveal au scroll : état initial ----- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Variantes */
.reveal-left { transform: translateX(-32px); }
.reveal-left.is-visible { transform: translateX(0); }

.reveal-right { transform: translateX(32px); }
.reveal-right.is-visible { transform: translateX(0); }

.reveal-fade { transform: none; }

/* Stagger : enfants directs d'un conteneur .reveal-stagger
   apparaissent en cascade (60 ms entre chaque) */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1),
              transform .6s cubic-bezier(.22,.61,.36,1);
}

.reveal-stagger.is-visible > *        { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 270ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 360ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 450ms; }

/* ----- Hero highlight : gradient animé subtil ----- */
.hero-highlight {
  background: linear-gradient(
    90deg,
    var(--orange) 0%,
    #FF7A4D 50%,
    var(--orange) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite;
  position: relative;
  padding-bottom: 4px;
}

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

/* ----- Hero entrance : eyebrow + titre + actions ----- */
.hero .eyebrow,
.hero-title,
.hero .targets,
.hero-actions {
  opacity: 0;
  animation: hero-in .8s cubic-bezier(.22,.61,.36,1) forwards;
}

.hero .eyebrow   { animation-delay: .05s; }
.hero-title      { animation-delay: .15s; }
.hero .targets   { animation-delay: .35s; }
.hero-actions    { animation-delay: .50s; }

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

/* ----- Cards : raffinage hover (par-dessus l'existant) ----- */
.card-outil {
  transition: transform .35s cubic-bezier(.22,.61,.36,1),
              box-shadow .35s cubic-bezier(.22,.61,.36,1),
              border-color .35s ease;
}

.card-outil:hover {
  transform: translateY(-6px);
}

/* ----- Boutons : lift plus présent ----- */
.btn-primary {
  transition: transform .2s cubic-bezier(.22,.61,.36,1),
              background .25s ease,
              color .25s ease,
              box-shadow .25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(232, 70, 31, 0.28);
}

/* ----- Targets (chips bâtiment) : entrée en cascade ----- */
.hero .targets li {
  opacity: 0;
  transform: translateY(8px);
  animation: chip-in .5s cubic-bezier(.22,.61,.36,1) forwards;
}

.hero .targets li:nth-child(1) { animation-delay: .55s; }
.hero .targets li:nth-child(2) { animation-delay: .65s; }
.hero .targets li:nth-child(3) { animation-delay: .75s; }
.hero .targets li:nth-child(4) { animation-delay: .85s; }
.hero .targets li:nth-child(5) { animation-delay: .95s; }

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

/* ----- Méthode : step-num pulse léger au reveal ----- */
.methode-steps li.is-visible .step-num {
  animation: pulse-num .8s cubic-bezier(.22,.61,.36,1);
}

@keyframes pulse-num {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ----- Accessibilité : respect prefers-reduced-motion ----- */
@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;
  }

  .reveal,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-highlight {
    background: none;
    -webkit-text-fill-color: var(--orange);
    color: var(--orange);
  }

  .hero-highlight::after { display: none; }
}
