/* ==========================================================================
   Cadran — motion.css — DESIGN_BRIEF §3.9 (révélations), §4.6 (porte motion,
   rideau), §7.1. Seul fichier autorisé à utiliser !important (reduced-motion).
   Règle d'or : RIEN n'est masqué sans html.gsap (posée par core.js quand GSAP
   et ScrollTrigger sont chargés). Sans JS, sans CDN : tout est visible.
   Contrat avec core.js : variable --line (0→1) sur [data-reveal="line"],
   classe d'état .is-active posée à la fin de chaque révélation (§8.2).
   ========================================================================== */

/* ---- 3.9 États initiaux (uniquement sous html.gsap, texte du brief) ----
   Le parent stagger et l'en-tête line restent eux-mêmes visibles : seuls leurs enfants sont masqués. */
html.gsap [data-reveal="fade"],
html.gsap [data-reveal="stagger"] > *,
html.gsap [data-reveal="line"] .eyebrow,
html.gsap [data-reveal="line"] .section-head__lead{opacity:0}
html.gsap [data-reveal="clip"]{clip-path:inset(0 0 100% 0)}
html.gsap [data-reveal="line"] .section-head__title{clip-path:inset(0 100% 0 0)}
/* Trait « mesure » de line : dessiné par components.css (.section-head[data-reveal="line"]::before,
   transform:scaleX(var(--line,1))). Ici seulement l'état initial 0 sous html.gsap ; core.js tween --line → 1. */
html.gsap .section-head[data-reveal="line"]{--line:0}

/* ---- États finaux .is-active (ceinture CSS : core.js écrit déjà les valeurs finales en inline
   et ajoute .is-active à la fin de la timeline ou lors de final()). Aucune transition ici :
   les composants gardent leurs propres transitions de survol. ---- */
html.gsap [data-reveal].is-active,
html.gsap [data-reveal="stagger"].is-active > *,
html.gsap [data-reveal="line"].is-active .eyebrow,
html.gsap [data-reveal="line"].is-active .section-head__lead{opacity:1}
html.gsap [data-reveal="clip"].is-active,
html.gsap [data-reveal="line"].is-active .section-head__title{clip-path:none}
html.gsap .section-head[data-reveal="line"].is-active{--line:1}

/* ---- 4.4 data-split (H1 du hero, réservé) : core.js crée <span aria-hidden><span>mot</span></span>
   (masque overflow:clip + mobile transformable) et pose lui-même les états initiaux par GSAP :
   jamais d'opacity:0 ni de transform initial en CSS sur le H1 (LCP). ---- */
[data-split] > span{display:inline-block;vertical-align:bottom}
[data-split] > span > span{display:inline-block}

/* ---- 4.6 Rideau de transition (créé par core.js : <div class="curtain" aria-hidden="true">).
   Au repos : entièrement replié (clip-path:inset(100% 0 0 0)), invisible, non cliquable.
   pageshow (bfcache) → core.js remet cet état. ---- */
.curtain{
  position:fixed;inset:0;z-index:var(--z-curtain);
  display:grid;place-items:center;
  background:var(--color-surface-1);
  clip-path:inset(100% 0 0 0);
  pointer-events:none;
}
.curtain__label{color:var(--color-text-2);letter-spacing:.18em;text-transform:uppercase}

/* ==========================================================================
   PORTE MOTION — même synthèse que SITE.reduced :
   (préférence système ET pas d'opt-in data-motion="full") OU html.motion-reduced (core.js)
   OU html[data-motion="reduce"] (script inline, avant core.js).
   Tout est à l'état final et lisible ; aucune animation CSS ne tourne ; les bascules
   fonctionnelles gardent leurs transitions, ramenées à 150 ms par tokens.css.
   Les sections écrivent leurs états de base = états finaux : animation:none les y ramène.
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  html:not([data-motion="full"]) [data-reveal],
  html:not([data-motion="full"]) [data-reveal] > *,
  html:not([data-motion="full"]) [data-reveal] .section-head__title,
  html:not([data-motion="full"]) [data-reveal] .eyebrow,
  html:not([data-motion="full"]) [data-reveal] .section-head__lead,
  html:not([data-motion="full"]) [data-split] span{
    opacity:1 !important;clip-path:none !important;transform:none !important;
  }
  html:not([data-motion="full"]) .section-head[data-reveal="line"]{--line:1 !important}
  html:not([data-motion="full"]) [data-magnetic],
  html:not([data-motion="full"]) [data-tilt],
  html:not([data-motion="full"]) [data-parallax]{transform:none !important}
  html:not([data-motion="full"]) *,
  html:not([data-motion="full"]) *::before,
  html:not([data-motion="full"]) *::after{animation:none !important}
  html:not([data-motion="full"]) .curtain,
  html:not([data-motion="full"]) .cursor{display:none !important}
  html:not([data-motion="full"]){scroll-behavior:auto !important}
}
html.motion-reduced [data-reveal],html[data-motion="reduce"] [data-reveal],
html.motion-reduced [data-reveal] > *,html[data-motion="reduce"] [data-reveal] > *,
html.motion-reduced [data-reveal] .section-head__title,html[data-motion="reduce"] [data-reveal] .section-head__title,
html.motion-reduced [data-reveal] .eyebrow,html[data-motion="reduce"] [data-reveal] .eyebrow,
html.motion-reduced [data-reveal] .section-head__lead,html[data-motion="reduce"] [data-reveal] .section-head__lead,
html.motion-reduced [data-split] span,html[data-motion="reduce"] [data-split] span{
  opacity:1 !important;clip-path:none !important;transform:none !important;
}
html.motion-reduced .section-head[data-reveal="line"],html[data-motion="reduce"] .section-head[data-reveal="line"]{--line:1 !important}
html.motion-reduced [data-magnetic],html[data-motion="reduce"] [data-magnetic],
html.motion-reduced [data-tilt],html[data-motion="reduce"] [data-tilt],
html.motion-reduced [data-parallax],html[data-motion="reduce"] [data-parallax]{transform:none !important}
html.motion-reduced *,html[data-motion="reduce"] *,
html.motion-reduced *::before,html[data-motion="reduce"] *::before,
html.motion-reduced *::after,html[data-motion="reduce"] *::after{animation:none !important}
html.motion-reduced .curtain,html[data-motion="reduce"] .curtain,
html.motion-reduced .cursor,html[data-motion="reduce"] .cursor{display:none !important}
html.motion-reduced,html[data-motion="reduce"]{scroll-behavior:auto !important}

/* Avant le démarrage des scripts (0,9 s au plus) : ce qui s’anime à l’entrée reste masqué, pour ne pas
   apparaître, disparaître puis se rejouer. Sans effet sans JavaScript ni quand un CDN est en échec. */
html.pre:not(.cdn-error) [data-reveal], html.pre:not(.cdn-error) [data-split], html.pre:not(.cdn-error) .hero .hero-mock{ visibility:hidden; }
