/* ==========================================================================
   PITCHLY — Motion (2026-10) — adapté du kit CHOSTE
   Chargé APRÈS le CSS du site. Ne change ni les sections ni la DA :
   ajoute des reflets verts animés en fond + des animations.
   Tout est activé par motion.js (classe .mx sur <html>) ; sans JS, rien ne change.
   ========================================================================== */

/* ---------- 1. Reflets de couleur (aurora) — palette verte Pitchly ---------- */
.mx-host { position: relative; }
.mx-aurora {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
  top: -12vh; bottom: -12vh;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12vh, #000 calc(100% - 12vh), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 12vh, #000 calc(100% - 12vh), transparent 100%);
  transform: translate3d(var(--mx-px, 0px), calc(var(--mx-py, 0px) + var(--mx-sy, 0px)), 0);
  transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.mx-lift { position: relative; z-index: 1; }
.mx-above { z-index: 2; }
.mx-orb {
  position: absolute; display: block; border-radius: 50%;
  width: var(--s, 50vw); height: var(--s, 50vw); max-width: 760px; max-height: 760px;
  opacity: var(--a, .5); will-change: transform, opacity;
  animation: mx-drift-1 var(--t, 14s) ease-in-out infinite alternate, mx-breathe var(--tb, 7s) ease-in-out infinite alternate;
  animation-play-state: paused;
}
.mx-on .mx-orb { animation-play-state: running; }
/* couleurs = palette Pitchly (vert menthe, émeraude, teal, lime) */
.mx-g { background: radial-gradient(closest-side, rgba(34,197,94,.55), rgba(34,197,94,.18) 55%, transparent); }
.mx-m { background: radial-gradient(closest-side, rgba(134,239,172,.62), rgba(134,239,172,.22) 55%, transparent); }
.mx-t { background: radial-gradient(closest-side, rgba(20,184,166,.50), rgba(20,184,166,.16) 55%, transparent); }
.mx-l { background: radial-gradient(closest-side, rgba(163,230,53,.42), rgba(163,230,53,.14) 55%, transparent); }
.mx-e { background: radial-gradient(closest-side, rgba(16,185,129,.55), rgba(16,185,129,.18) 55%, transparent); }

.mx-o1 { top: -24%; left: -14%; --t: 13s; --tb: 6s; }
.mx-o2 { bottom: -32%; right: -12%; --t: 16s; --tb: 8s; animation-name: mx-drift-2, mx-breathe; animation-delay: -6s, -3s; }
.mx-o3 { top: 14%; left: 38%; --s: 36vw; --t: 18s; --tb: 9s; animation-name: mx-drift-3, mx-breathe; animation-delay: -11s, -5s; }
.mx-o4 { bottom: -22%; left: 6%; --s: 32vw; --t: 15s; --tb: 7s; animation-name: mx-drift-4, mx-breathe; animation-delay: -4s, -2s; }
.mx-flip .mx-o1 { left: auto; right: -14%; }
.mx-flip .mx-o2 { right: auto; left: -12%; }
.mx-flip .mx-o4 { left: auto; right: 6%; }
@keyframes mx-drift-1 { 0%{transform:translate3d(0,0,0) scale(1)} 35%{transform:translate3d(20vw,10vh,0) scale(1.18)} 70%{transform:translate3d(8vw,24vh,0) scale(.9)} 100%{transform:translate3d(26vw,4vh,0) scale(1.08)} }
@keyframes mx-drift-2 { 0%{transform:translate3d(0,0,0) scale(1.05)} 35%{transform:translate3d(-18vw,-12vh,0) scale(.88)} 70%{transform:translate3d(-6vw,-26vh,0) scale(1.15)} 100%{transform:translate3d(-24vw,-6vh,0) scale(.95)} }
@keyframes mx-drift-3 { 0%{transform:translate3d(0,0,0) scale(.9)} 35%{transform:translate3d(-22vw,12vh,0) scale(1.15)} 70%{transform:translate3d(14vw,-10vh,0) scale(.95)} 100%{transform:translate3d(-8vw,-16vh,0) scale(1.1)} }
@keyframes mx-drift-4 { 0%{transform:translate3d(0,0,0) scale(1)} 35%{transform:translate3d(16vw,-14vh,0) scale(1.12)} 70%{transform:translate3d(30vw,4vh,0) scale(.9)} 100%{transform:translate3d(10vw,-20vh,0) scale(1.05)} }
@keyframes mx-breathe { 0%{opacity:calc(var(--a,.5)*.55)} 100%{opacity:var(--a,.5)} }

.mx-aurora-hero  .mx-orb { --a: .7; }
.mx-aurora-plain .mx-orb { --a: .3; --s: 44vw; }
.mx-aurora-dark  .mx-orb { --a: .8; --s: 42vw; mix-blend-mode: screen; }
/* blocs sombres (bandeau stats, bandeau final, haut du tableau de bord) : reflets internes, pas de débordement */
.mx-aurora-dark { top: 0; bottom: 0; -webkit-mask-image: none; mask-image: none; }

/* le bandeau final force ses enfants en position:relative : on garde les reflets en absolu derrière */
#pg-landing .cta-band > .mx-aurora, #pg-landing .stats-section > .mx-aurora { position: absolute; z-index: 0; }


/* ---------- 1 bis. Page d'accueil : un seul fond de couleurs qui se baladent ----------
   Fixe derrière toute la page : mêmes couleurs, même mouvement, aucune coupure entre sections. */
.mx-page-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.mx-page-bg .mx-orb { --a: .42; --s: 52vw; }
.mx-page-bg .mx-o5 { top: 40%; right: 18%; --s: 34vw; --t: 17s; --tb: 8s; animation-name: mx-drift-2, mx-breathe; animation-delay: -9s, -4s; }
.mx-page-bg.mx-on .mx-orb { animation-play-state: running; }
/* le contenu et le pied de page passent au-dessus du fond */
.mx #pg-landing > section, .mx #footer-landing { position: relative; z-index: 1; }

/* les anciens blobs fixes sont remplacés par les reflets animés */
.mx #pg-landing .landing-bg, .mx #pg-landing .hero-blobs { display: none; }
/* le motif fixe du haut du tableau de bord reste, les reflets passent dessous */
.mx .db-hero.mx-host > .db-hero-bg { z-index: 1; }
.mx .db-hero.mx-host > .db-hero-inner { z-index: 2; }

/* ---------- 3. Titres qui montent mot par mot ---------- */
.mx-w { display: inline-block; overflow: hidden; vertical-align: top; padding: .2em .06em .32em; margin: -.2em -.06em -.32em; }
.mx-w > .mx-wi { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform .9s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 55ms); }
.mx-split.mx-in .mx-w > .mx-wi { transform: none; }

/* ---------- 4. Lumière qui suit la souris sur les cartes (ordinateur) ---------- */
.mx-spot { position: relative; isolation: isolate; }
.mx-spot::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(380px circle at var(--sx, -999px) var(--sy, -999px), rgba(34,197,94,.10), rgba(20,184,166,.05) 38%, transparent 62%);
}
.mx-spot::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(240px circle at var(--sx, -999px) var(--sy, -999px), rgba(22,163,74,.7), rgba(20,184,166,.35) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
}
.mx-spot:hover::after { opacity: 1; }

/* ---------- 4 bis. Blocs qui apparaissent au défilement ---------- */
.mx-rise { opacity: 0; transform: translate3d(0, 24px, 0); transition: opacity .7s ease, transform .85s cubic-bezier(.2,.8,.2,1); transition-delay: var(--mx-d, 0ms); }
.mx-rise.mx-up { opacity: 1; transform: none; }

/* ---------- 5. Tableau de bord : compteurs ---------- */
.mx-count { font-variant-numeric: tabular-nums; }


/* ==========================================================================
   6. « COMMENT ÇA MARCHE » : LA CARTE QUI SE TRANSFORME
   Une seule carte reste collée à l'écran pendant que les 4 étapes défilent à côté.
   À chaque étape, la carte change de forme, ses 6 blocs glissent, le texte se remplace.
   ========================================================================== */
.mx { --grad: linear-gradient(90deg, #16a34a, #22c55e, #14b8a6, #16a34a); }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes mxPop { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: none; } }
@keyframes mxDraw { to { stroke-dashoffset: 0; } }
@keyframes mxLine { to { stroke-dashoffset: 0; } }

.mx-story { --e: cubic-bezier(.2,.8,.2,1);
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 64px; max-width: 1140px; margin: 2.5rem auto 0; }
.mx-stage-col { position: relative; }
.mx-stage {
  position: sticky; top: calc(76px + 4vh); height: min(68vh, 540px);
  border-radius: 28px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 35%, #134e2c 0%, #052e16 72%);
  box-shadow: 0 40px 80px -40px rgba(5,46,22,.65);
}
.mx-glow { position: absolute; inset: -20%; z-index: -1; transition: background .8s ease;
  background: radial-gradient(circle at 30% 30%, rgba(34,197,94,.45), transparent 45%), radial-gradient(circle at 75% 75%, rgba(20,184,166,.35), transparent 45%);
  animation: mxGlow 14s ease-in-out infinite alternate; }
.mx-stage[data-scene="1"] .mx-glow { background: radial-gradient(circle at 70% 30%, rgba(163,230,53,.32), transparent 45%), radial-gradient(circle at 25% 75%, rgba(34,197,94,.45), transparent 45%); }
.mx-stage[data-scene="2"] .mx-glow { background: radial-gradient(circle at 30% 70%, rgba(20,184,166,.4), transparent 45%), radial-gradient(circle at 75% 25%, rgba(74,222,128,.35), transparent 45%); }
.mx-stage[data-scene="3"] .mx-glow { background: radial-gradient(circle at 60% 40%, rgba(16,185,129,.42), transparent 45%), radial-gradient(circle at 20% 80%, rgba(163,230,53,.28), transparent 45%); }
@keyframes mxGlow { to { transform: translate3d(4%, -3%, 0) scale(1.08); } }

/* la carte */
.mm-fit { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: scale(var(--k, 1)); }
.mm-shell { --spring: cubic-bezier(.3, 1.18, .42, 1); position: absolute; left: 0; top: 0;
  width: var(--w, 380px); height: var(--h, 290px); border-radius: var(--r, 18px); background: var(--bg, #fff);
  transform: translate(-50%, -50%);
  box-shadow: 0 40px 70px -28px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.06);
  transition: width .8s var(--spring), height .8s var(--spring), border-radius .8s var(--spring), background-color .6s ease; }
.mm-atoms { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.mm-atom { position: absolute; left: 0; top: 0; display: block;
  transform: translate(var(--x, 0), var(--y, 0)); width: var(--aw, 0); height: var(--ah, 0); border-radius: var(--ar, 0);
  background: var(--ab, transparent); opacity: var(--ao, 1);
  transition: transform .8s var(--spring), width .8s var(--spring), height .8s var(--spring), border-radius .8s var(--spring), background .6s ease, opacity .5s ease; }
.mm-atom.is-grad { background: var(--grad); background-size: 200% 100%; animation: gradient-shift 6s ease infinite; }
.mm-atom:nth-child(2) { transition-delay: .04s; } .mm-atom:nth-child(3) { transition-delay: .08s; } .mm-atom:nth-child(4) { transition-delay: .12s; }
.mm-layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; filter: blur(6px); transition: opacity .25s ease, filter .25s ease; }
.mm-layer.on { opacity: 1; filter: none; transition: opacity .45s ease .38s, filter .45s ease .38s; }
.mm-t { position: absolute; white-space: nowrap; color: #111827; font-size: 14px; line-height: 1.3; font-family: var(--font); }
.mm-shell.is-dark .mm-t { color: #fff; }
.mm-c { text-align: center; } .mm-b { font-weight: 800; letter-spacing: -.01em; }
.mm-xs { font-size: 11.5px; } .mm-sm { font-size: 13px; }
.mm-t.mm-white, .mm-shell .mm-t.mm-white { color: #fff; }
.mm-mut { color: #6b7280; }
.mm-kick { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #15803d; }
.mm-pdf { display: inline-block; padding: 3px 6px; margin-right: 6px; border-radius: 6px; background: #ef4444; font-size: 10px; line-height: 1.2; }
/* décors Pitchly : terrain, joueurs, passes, outils */
.mm-field { border: 1.5px dashed rgba(255,255,255,.75); border-radius: 4px; }
.mm-mid { width: 0; border-left: 1.5px solid rgba(255,255,255,.4); }
.mm-pl { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.mm-cone { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #f59e0b; }
.mm-tool { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #64748b; }
.mm-pass { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mm-pass path { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.mm-layer.on .mm-pass path { animation: mxLine 1.1s cubic-bezier(.2,.8,.2,1) .9s forwards; }
.mm-layer.on .mm-pass path + path { animation-delay: 1.6s; }
.mm-shell:not(.is-dark) .mm-pass path { stroke: #fff; }
/* pions au premier plan : les traits passent dessous, la lettre est sur le pion */
.mm-pion { border-radius: 50%; color: #fff !important; font-size: 11px; font-weight: 800; text-align: center;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,.3); }
.mm-cursor { width: 22px; height: 22px; opacity: 0; }
.mm-cursor::before { content: ''; position: absolute; inset: 0; background: #fff; clip-path: polygon(0 0, 0 80%, 25% 60%, 42% 100%, 55% 94%, 38% 56%, 70% 56%); filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.mm-layer.on .mm-cursor { animation: mmCursor 1.3s cubic-bezier(.2,.8,.2,1) 1.1s both; }
@keyframes mmCursor { 0% { opacity: 0; transform: translate(70px, 60px); } 25% { opacity: 1; } 80% { opacity: 1; transform: translate(-12px, -6px); } 100% { opacity: 1; transform: translate(-12px, -6px) scale(.85); } }
.mm-layer.on .mm-pl { animation: mxPop .4s cubic-bezier(.34,1.56,.64,1) both; animation-delay: .7s; }

/* les étapes à côté, reliées par une ligne qui se remplit */
.mx-ssteps { list-style: none; margin: 0; padding: 0; position: relative; --fill: 0; }
.mx-ssteps::before, .mx-ssteps::after { content: ''; position: absolute; left: 25px; top: 28vh; width: 3px; border-radius: 3px; }
.mx-ssteps::before { bottom: 28vh; background: #dcfce7; }
.mx-ssteps::after { height: calc((100% - 56vh) * var(--fill)); background: var(--grad); background-size: 100% 300%; box-shadow: 0 0 14px rgba(34,197,94,.45); }
.mx-sstep { min-height: 62vh; display: grid; grid-template-columns: 54px 1fr; gap: 22px; align-content: center; position: relative; z-index: 1; cursor: pointer; }
.mx .mx-sstep { opacity: .32; transition: opacity .5s ease; }
.mx .mx-sstep.is-on { opacity: 1; }
.mx-sbadge { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  background: #fff; color: #15803d; border: 2px solid #bbf7d0; transform: scale(.85); transition: transform .5s cubic-bezier(.34,1.56,.64,1), color .4s, border-color .4s, box-shadow .4s; position: relative; overflow: hidden; }
.mx-sbadge::before { content: ''; position: absolute; inset: 0; background: var(--grad); background-size: 200% 100%; animation: gradient-shift 6s ease infinite; opacity: 0; transition: opacity .4s; }
.mx-sbadge b { position: relative; }
.mx-sstep.is-on .mx-sbadge, .mx-sstep.is-done .mx-sbadge { transform: scale(1); color: #fff; border-color: transparent; box-shadow: 0 12px 26px -10px rgba(34,197,94,.6); }
.mx-sstep.is-on .mx-sbadge::before, .mx-sstep.is-done .mx-sbadge::before { opacity: 1; }
.mx-sstep h3 { font-size: clamp(1.45rem, 2.3vw, 1.95rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 10px; color: var(--text); }
.mx-sstep p { font-size: 1.02rem; line-height: 1.65; color: var(--muted); max-width: 460px; margin: 0 0 1rem; }
.mx-sstep .mx-skick { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #15803d; margin-bottom: 8px; }
.mx-sstep .how2-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: .75rem; font-size: 14.5px; font-weight: 600; color: #16a34a; }
.mx-sstep .how2-cta i { transition: transform .2s ease; }
.mx-sstep:hover .how2-cta i { transform: translateX(4px); }

@media (max-width: 860px) {
  .mx-story { display: block; margin-top: 1.5rem; }
  .mx-stage-col { position: sticky; top: 64px; z-index: 3; }
  .mx-stage { position: relative; top: auto; height: 40vh; min-height: 250px; max-height: 340px; border-radius: 22px; }
  .mx-ssteps { padding-top: 24px; }
  .mx-ssteps::before, .mx-ssteps::after { top: 20vh; left: 21px; } .mx-ssteps::before { bottom: 20vh; } .mx-ssteps::after { height: calc((100% - 40vh) * var(--fill)); }
  .mx-sstep { min-height: 52vh; grid-template-columns: 46px 1fr; gap: 16px; align-content: start; padding-top: 6vh; }
  .mx-sbadge { width: 46px; height: 46px; font-size: .95rem; }
  .mx-sstep h3 { font-size: 1.35rem; } .mx-sstep p { font-size: .96rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-shell, .mm-atom, .mm-layer, .mm-layer.on { transition: none !important; }
  .mm-layer.on *, .mx-glow, .mm-atom.is-grad, .mx-sbadge::before { animation: none !important; }
  .mm-pass path { stroke-dashoffset: 0; } .mm-cursor { opacity: 1; }
  .mx .mx-sstep { opacity: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .mx-orb { --s: 85vw; }
  .mx-aurora-plain .mx-orb { --a: .24; --s: 75vw; }
  .mx-page-bg .mx-orb { --s: 90vw; --a: .36; }
}

/* ---------- Mouvement réduit : tout figé, rien de caché ---------- */
@media (prefers-reduced-motion: reduce) {
  .mx-orb { animation: none !important; }
  .mx-aurora { transform: none !important; transition: none; }
  .mx-w > .mx-wi { transform: none !important; transition: none; }
  .mx-rise { opacity: 1 !important; transform: none !important; transition: none; }
}
