/* ============================================================
   CODIA Holding — Animations & optimisations (vanilla, léger)
   Chargé EN DERNIER dans style.css (surcharge les règles existantes)
   Budget : < 4 Ko minifié. Aucune librairie JS.
   ============================================================ */

/* ---------- Réduction de mouvement (accessibilité) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Animations d'apparition au scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s cubic-bezier(.22,.61,.36,1),
              transform .55s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-left  { transform: translateX(-26px); }
.reveal-right { transform: translateX(26px); }
.reveal-scale { transform: scale(.96); }
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible { transform: none; }

/* Décalage en cascade pour les cartes */
[data-reveal-group] > *:nth-child(1) { transition-delay: .05s; }
[data-reveal-group] > *:nth-child(2) { transition-delay: .12s; }
[data-reveal-group] > *:nth-child(3) { transition-delay: .19s; }
[data-reveal-group] > *:nth-child(4) { transition-delay: .26s; }
[data-reveal-group] > *:nth-child(5) { transition-delay: .33s; }
[data-reveal-group] > *:nth-child(6) { transition-delay: .40s; }
[data-reveal-group] > *:nth-child(7) { transition-delay: .47s; }

/* ---------- Hero : entrée douce ---------- */
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
.hero-content > * {
  animation: hero-fade-up .7s cubic-bezier(.22,.61,.36,1) both;
}
.hero-content > *:nth-child(1) { animation-delay: .05s; }
.hero-content > *:nth-child(2) { animation-delay: .15s; }
.hero-content > *:nth-child(3) { animation-delay: .25s; }
.hero-content > *:nth-child(4) { animation-delay: .35s; }

/* ---------- Hero : zoom lent (Ken Burns) ---------- */
@keyframes hero-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}
.hero::before {
  animation: hero-kenburns 18s ease-out both;
  transform-origin: center;
}

/* ---------- Cartes : élévation au survol ---------- */
.activity-card,
.asset-card,
.news-card,
.intro-card,
.contact-panel {
  transition: transform .28s cubic-bezier(.22,.61,.36,1),
              box-shadow .28s cubic-bezier(.22,.61,.36,1),
              border-color .28s ease;
}
.activity-card:hover,
.activity-card:focus-within,
.asset-card:hover,
.asset-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}

/* ---------- Images d'actifs : zoom léger ---------- */
.asset-card img {
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
  transform-origin: center;
}
.asset-card:hover img {
  transform: scale(1.05);
}

/* ---------- Boutons : micro-interaction ---------- */
.btn {
  transition: transform .2s cubic-bezier(.22,.61,.36,1),
              background .2s ease,
              box-shadow .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* ---------- Barre de valeurs : apparition ---------- */
.value {
  opacity: 0;
  transition: opacity .5s ease;
}
.value.is-visible { opacity: 1; }

/* ---------- Skeleton de chargement (shimmer) ---------- */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,.06) 25%,
    rgba(255,255,255,.14) 37%,
    rgba(255,255,255,.06) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

/* ---------- Lien de navigation : souligné animé ---------- */
.menu a {
  position: relative;
}
.menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 1px;
  background: var(--gold, #e6b25a);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.22,.61,.36,1);
}
.menu a:hover::after,
.menu a:focus-visible::after {
  transform: scaleX(1);
}
