/* Motion design — chargé après site.css.
   Règles : seuls transform et opacity sont animés, 200 à 600 ms, une seule boucle (l'onde du hero).
   Les états masqués ne s'appliquent que sous .js : sans JavaScript, tout est affiché. */

/* ---------- a) Signature : l'onde du logo parle (unique boucle du site) ---------- */
.voix { display: flex; align-items: center; justify-content: center; gap: 4px; height: 56px; margin-bottom: 1.2rem; }
.voix i { flex: 0 1 6px; height: var(--h); min-height: 6px; border-radius: 3px; background: var(--bleu); animation: voix var(--d) ease-in-out var(--dl) infinite alternate; }
.voix i.n { background: var(--anthracite); }
@keyframes voix { from { transform: scaleY(0.4); } to { transform: scaleY(1); } }

/* ---------- b) Entrée du hero : fondu-glissement décalé.
   Le h1 et le chapô glissent sans fondu : ils sont lisibles dès le premier rendu (LCP, SEO). ---------- */
@keyframes entre { from { opacity: 0; transform: translateY(12px); } }
@keyframes glisse { from { transform: translateY(12px); } }
.hero .badge, .svc-hero .crumbs, .svc-hero .tag { animation: entre 0.5s var(--t) both; }
.hero h1, .svc-hero h1 { animation: glisse 0.5s var(--t) 0.06s both; }
.hero .sub, .svc-hero .lead { animation: glisse 0.5s var(--t) 0.12s both; }
.hero-actions, .svc-actions { animation: entre 0.5s var(--t) 0.2s both; }
.hero-edito { animation: entre 0.5s var(--t) 0.28s both; }
.hero-proof, .proof-note { animation: entre 0.5s var(--t) 0.34s both; }

/* ---------- c) Schémas Sans / Avec : étapes une par une dans l'ordre du flux, point de perte en dernier ---------- */
.js .agent-dia .dia-step, .js .agent-dia .dia-loss { opacity: 0; transition: opacity 0.3s ease-out; transition-delay: calc(var(--i) * 90ms); }
.js .agent-dia.in .dia-step, .js .agent-dia.in .dia-loss { opacity: 1; }

/* ---------- d) Apparition au défilement : fondu + 16 px, une seule fois ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--t), transform 0.5s var(--t); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; }

/* ---------- e) Micro-interactions ---------- */
/* Barre de navigation : le fond apparaît en fondu (pas de changement de taille) */
nav.top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--blanc) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); opacity: 0; transition: opacity 0.3s var(--t); }
nav.top.scrolled::before { opacity: 1; }

/* Boutons et cartes : l'ombre est portée par un pseudo-élément dont seule l'opacité change */
.btn, .agent, .svc-others li a, .social { position: relative; transition: transform 0.2s var(--t); }
.agent, .svc-others li a { transition-duration: 0.3s; }
.btn::after, .agent::after, .svc-others li a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.2s var(--t); }
.btn::after { box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--anthracite) 55%, transparent); }
.agent::after, .svc-others li a::after { box-shadow: 0 22px 44px -28px color-mix(in srgb, var(--anthracite) 45%, transparent); transition-duration: 0.3s; }
@media (hover: hover) {
  .btn:hover, .social:hover, .svc-others li a:hover { transform: translateY(-2px); }
  .agent:hover { transform: translateY(-3px); }
  .btn:hover::after, .agent:hover::after, .svc-others li a:hover::after { opacity: 1; }
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn:active::after { opacity: 0; }

/* Liens : le soulignement se déroule depuis la gauche */
.nav-links > a, .agent-more, .foot-agents a, .foot-legal a { position: relative; text-decoration: none; }
.nav-links > a::after, .agent-more::after, .foot-agents a::after, .foot-legal a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.25s var(--t); }
.nav-links > a:hover::after, .nav-links > a:focus-visible::after, .agent-more:hover::after, .agent-more:focus-visible::after, .foot-agents a:hover::after, .foot-agents a:focus-visible::after, .foot-legal a:hover::after, .foot-legal a:focus-visible::after { transform: scaleX(1); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Fenêtre modale vidéo : entrée en fondu-glissement */
.video-modal[open] { animation: entre 0.3s var(--t); }

/* ---------- Mouvement réduit : aucune animation, contenu affiché directement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .agent-dia .dia-step, .js .agent-dia .dia-loss { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
