/* Couche motion — Home V5 · Impulsion
   Principe : chaque mouvement sert le message de sa section (voir js/motion.js).
   html.motion-on n'est posé que si le mouvement est autorisé (prefers-reduced-motion respecté)
   et retiré si les librairies ne se chargent pas : sans JS, tout reste visible. */

/* ---------- Lenis (défilement fluide) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- États initiaux (avant révélation) ---------- */
html.motion-on [data-m="fade"],
html.motion-on [data-m="split"],
html.motion-on [data-m="card"],
html.motion-on [data-m="stagger"] > *,
html.motion-on .hero__eyebrow,
html.motion-on .hero__title-a,
html.motion-on .hero__title-b,
html.motion-on .hero__ctas > *,
html.motion-on .hero__proof,
html.motion-on .nav__bar { opacity: 0; }
html.motion-on .hero__bg { opacity: 0; }
/* Le chapeau du hero reste visible dès le premier affichage (c'est l'élément LCP mesuré par Lighthouse) :
   seul son glissement est animé, jamais son opacité. */
html.motion-on .hero__lead { transform: translateY(22px); }

[data-count] { font-variant-numeric: tabular-nums; }
.m-line { padding-bottom: .06em; margin-bottom: -.06em; } /* évite de rogner les jambages dans le masque */

/* ---------- Navigation : se retire en descendant, revient en remontant ---------- */
.nav { transition: background-color .3s ease, border-color .3s ease, transform .5s cubic-bezier(.7, 0, .2, 1); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__item.is-open .nav__rows li,
.nav__item.is-open .nav__menu--list > li,
.nav__item.is-open .nav__feature { animation: m-drop .45s cubic-bezier(.2, .7, .2, 1) both; }
.nav__item.is-open .nav__rows li:nth-child(2), .nav__item.is-open .nav__menu--list > li:nth-child(2) { animation-delay: .04s; }
.nav__item.is-open .nav__rows li:nth-child(3), .nav__item.is-open .nav__menu--list > li:nth-child(3) { animation-delay: .08s; }
.nav__item.is-open .nav__rows li:nth-child(4) { animation-delay: .12s; }
.nav__item.is-open .nav__rows li:nth-child(5) { animation-delay: .16s; }
@keyframes m-drop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Boutons : la flèche glisse de 2 px, légère pression ---------- */
.btn::after { display: inline-block; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
@media (hover: hover) {
  .btn:hover::after { transform: translate(2px, -2px); }
}
.btn:active { scale: .985; }
.btn { transition: background-color .25s ease, border-color .25s ease, scale .15s ease; }

/* ---------- Hero : balayage de lumière sur « La puissance de l’IA. » ---------- */
.hero__title-b.is-shine {
  background: linear-gradient(100deg, #fff 0%, #fff 42%, #ffd9a0 50%, #fff 58%, #fff 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: m-shine 2.2s cubic-bezier(.45, 0, .2, 1) forwards;
}
@keyframes m-shine { to { background-position: 0 0; } }

/* ---------- Bandeau logos : défilement continu ---------- */
.m-marquee {
  flex: 1; min-width: 0; width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.m-marquee .logos__list.is-marquee {
  display: flex; width: max-content; justify-content: flex-start; gap: 72px;
  animation: m-marquee 38s linear infinite;
}
.m-marquee:hover .logos__list.is-marquee { animation-play-state: paused; }
.m-marquee .logos__item { flex: none; width: 120px; transition: opacity .3s ease; }
.m-marquee .logos__item:hover { opacity: 1; }
@keyframes m-marquee { to { transform: translateX(calc(-50% - 36px)); } }
@media (max-width: 640px) {
  .m-marquee .logos__list.is-marquee { gap: 48px; animation-duration: 28s; }
  .m-marquee .logos__item { width: 100px; }
  @keyframes m-marquee { to { transform: translateX(calc(-50% - 24px)); } }
}

/* ---------- Courbes qui se dessinent + point « en direct » ---------- */
.m-curve { display: block; position: relative; }
.m-curve svg { display: block; width: 100%; height: 100%; overflow: visible; }
.methode__chart .m-curve { width: 276px; height: 88px; }
.expertises__courbe.m-curve { height: auto; }
.expertises__courbe.m-curve svg { height: auto; aspect-ratio: 270.25 / 86.17; }
html.motion-on .m-curve__line { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.motion-on .m-curve__area,
html.motion-on .m-curve__dot { opacity: 0; }
.m-curve__dot {
  position: absolute; left: 100%; top: 7.95%;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: #fff;
}
.m-curve__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid #fff; animation: m-ping 2s ease-out infinite;
}
@keyframes m-ping { from { transform: scale(1); opacity: .8; } to { transform: scale(3.4); opacity: 0; } }

/* ---------- Méthode : rail de progression + anneau de lecture automatique ---------- */
.methode__tab { z-index: 1; }
.methode__rail {
  position: absolute; z-index: 0; height: 2px; margin-top: -1px;
  background: var(--ink); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}
.methode__node { position: relative; }
.methode__node::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%;
  background: conic-gradient(var(--ink) calc(var(--p, 0) * 1turn), rgba(12, 12, 13, .08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: 0; transition: opacity .4s ease;
}
.methode__stepper.is-autoplay .methode__tab[aria-selected="true"] .methode__node::before { opacity: 1; }
@media (max-width: 1024px) {
  .methode__node::before { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
}
.methode__phase::after { transition: background-color .5s ease; }

/* ---------- Augment : lecture qui respire, signaux vers le cœur ---------- */
.augment__play::before, .augment__play::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  animation: m-ring 2.8s cubic-bezier(.2, .6, .3, 1) infinite;
  pointer-events: none;
}
.augment__play::after { animation-delay: 1.4s; }
@keyframes m-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(2); opacity: 0; } }
.augment__signal {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #ffe2b8; box-shadow: 0 0 12px 3px rgba(255, 200, 130, .75);
  opacity: 0; pointer-events: none;
}
.augment__core { z-index: 1; }
.augment__pulse {
  position: absolute; inset: 0; border-radius: inherit;
  border: 1px solid rgba(255, 226, 184, .9); opacity: 0; pointer-events: none;
}

/* ---------- Expertises : interfaces vivantes + lumière qui suit le curseur ---------- */
.expertises__card { position: relative; }
.expertises__card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 200, 140, .10), transparent 65%);
  opacity: 0; transition: opacity .4s ease;
}
@media (hover: hover) { .expertises__card:hover::after { opacity: 1; } }
.expertises__outils .expertises__ico { transition: background-color .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease; }
.expertises__outils .expertises__ico img { transition: filter .3s ease; }
.expertises__outils li.is-lit .expertises__ico {
  background: #f8f8f8; transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.expertises__outils li.is-lit .expertises__ico img { filter: invert(1); }
.expertises__outils li span.t-small { transition: color .45s ease, opacity .45s ease; opacity: .7; }
.expertises__outils li.is-lit span.t-small { opacity: 1; }
.expertises__etape { transition: background-color .4s ease, color .4s ease, box-shadow .4s ease; }
.expertises__etape.is-lit { background: #f8f8f8; color: #0f0f0f; box-shadow: 0 0 0 4px rgba(248, 248, 248, .12); }
.expertises__etape-fleche { transition: opacity .3s ease, transform .3s ease; opacity: .45; }
.expertises__etape-fleche.is-lit { opacity: 1; transform: translateX(2px); }

/* ---------- CTA final : lumière qui suit le curseur ---------- */
.cta__inner { position: relative; z-index: 1; }
.cta__glow {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 236, 200, .55), rgba(255, 236, 200, 0));
  mix-blend-mode: soft-light; pointer-events: none;
}

/* ---------- FAQ : ouverture fluide ---------- */
html.motion-on .faq__item[open] .faq__a { animation: none; }
.faq__a.is-animating { overflow: hidden; }
.faq__icon { transition: background-color .2s ease, color .2s ease, transform .35s cubic-bezier(.2, .7, .2, 1); }
.faq__item[open] .faq__icon { transform: rotate(180deg); }

/* ---------- Changement de page : fondu enchaîné (30.09.2026) ----------
   View Transitions entre documents (Chrome, Edge, Safari 18.2+ ; ignoré ailleurs, sans effet de bord).
   L'ancienne page s'efface en montant légèrement, la nouvelle arrive. La navigation reste fixe (pas de clignotement). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: m-vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: m-vt-in .42s cubic-bezier(0, 0, .2, 1) both; }
@keyframes m-vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes m-vt-in { from { opacity: 0; transform: translateY(14px); } }
.nav { view-transition-name: site-nav; }
.m-sticky { view-transition-name: sticky-cta; }
::view-transition-group(site-nav), ::view-transition-group(sticky-cta) { animation-duration: 0s; }

/* ---------- Navigation : revient plus vite qu'elle ne part (en remontant, on la veut tout de suite) ---------- */
.nav:not(.is-hidden) { transition-duration: .3s, .3s, .38s; transition-timing-function: ease, ease, cubic-bezier(.2, .8, .2, 1); }

/* ---------- Mouvement réduit : rien ne bouge, tout est visible ---------- */
@media (prefers-reduced-motion: reduce) {
  .m-marquee .logos__list.is-marquee { animation: none; }
  .m-curve__dot::after, .augment__play::before, .augment__play::after { animation: none; }
  .hero__title-b.is-shine { animation: none; background: none; color: #fff; }
  .nav { transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- Pas de transition CSS sur transform pendant qu'une animation GSAP pilote l'élément ---------- */
.m-anim, .m-anim img { transition: none !important; }
.hero__ctas .btn { transition: background-color .25s ease, border-color .25s ease, scale .15s ease !important; }
