/* ==========================================================================
   Section immersive « Outil sur mesure / Prise en main immédiate »
   Trois logiciels fictifs superposés (Vendra, Édifia, Clientis) ; GSAP gère le
   mouvement des fenêtres (transform / opacity), Anime.js les détails internes.
   Aucun violet ; fonds et tokens existants du site.
   ========================================================================== */
.imm { position: relative; background: var(--pearl, #FAFAFA); overflow-x: clip; }
.imm-stage { position: relative; min-height: 100vh; display: flex; align-items: center; padding: 110px 0 70px; }
.imm-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 96px); align-items: center; width: 100%; }

/* — Titre (à droite) — */
.imm-title { margin: 0; font-family: "Polysans", Inter, sans-serif; font-weight: 400; font-size: clamp(42px, 5.6vw, 96px); line-height: 1.02; letter-spacing: -0.045em; }
.imm-title span { display: block; }
.imm-t1 { color: var(--ink, #07070A); }
.imm-t2 { color: #71717A; margin-top: .08em; }

/* — Composition (à gauche) — */
.imm-visual {
  position: relative; width: 100%; aspect-ratio: 1.1 / 1; border-radius: 28px;
  background: rgba(7, 7, 10, .045);
}
.imm-win {
  position: absolute; margin: 0; width: 96%; aspect-ratio: 1600 / 1018;
  border-radius: 1.9% / 3%; overflow: hidden; container-type: inline-size;
  box-shadow: 0 0 0 1px rgba(7, 7, 10, .07), 0 40px 70px -28px rgba(7, 7, 10, .35);
  background: #fff; transform-origin: 50% 50%;
}
.imm-win img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.imm-a { left: 2%;  top: 12%; z-index: 1; }
.imm-b { left: 6%;  top: 17%; z-index: 2; width: 100%; }   /* déborde légèrement à droite */
.imm-c { left: 3%;  top: 25%; z-index: 3; }
.imm-win.imm-b { background: #14161a; }
/* état de départ (si le script ne s'exécute pas, seule la fenêtre A reste visible) */
.imm-b, .imm-c { opacity: 0; }

/* — Composants reconstruits en code, posés exactement sur la zone de l'image — */
.imm-ov {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  box-sizing: border-box; overflow: hidden; font-family: Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.imm-ov * { box-sizing: border-box; }
/* A — prévision pondérée */
.imm-a-kpi { background: #fdfefe; border: 1px solid #e6e9ee; border-radius: .9cqw; padding: 1.5cqw 1.9cqw; color: #4d5766; }
.imm-ov-t { display: block; font-size: 1.28cqw; font-weight: 400; line-height: 1.3; }
.imm-ov-v { display: block; margin-top: .6cqw; font-size: 2.35cqw; font-weight: 650; letter-spacing: -.02em; color: #2563eb; white-space: nowrap; }
.imm-ov-v small { font-size: 1.1cqw; font-weight: 500; letter-spacing: 0; }
.imm-spark { position: absolute; right: 2.4%; bottom: 8%; width: 58%; height: 46%; overflow: visible; }
.imm-spark .area { fill: rgba(37, 99, 235, .09); }
.imm-spark .line { fill: none; stroke: #2563eb; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.imm-spark circle { fill: #2563eb; }
/* B — budget consommé */
.imm-b-budget { background: #14181b; border: 1px solid #292d32; border-radius: .9cqw; padding: 1.6cqw 1.9cqw; color: #fff; }
.imm-b-budget h4 { margin: 0; font: 650 1.5cqw/1.3 Inter, sans-serif; letter-spacing: -.01em; }
.imm-donut { position: absolute; left: 4.7%; top: 30%; width: 38%; aspect-ratio: 1; }
.imm-donut svg { display: block; width: 100%; }
.imm-donut circle { fill: none; stroke-width: 13; }
.imm-donut .trk { stroke: #3a3c40; }
.imm-donut .arc { stroke: #e8731a; stroke-linecap: butt; }
.imm-donut strong { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .25em; font-size: 2.3cqw; font-weight: 650; letter-spacing: -.03em; white-space: nowrap; }
.imm-b-txt { position: absolute; left: 48%; top: 38%; right: 2%; }
.imm-b-txt b { display: block; font-size: 1.5cqw; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.imm-b-txt > span { display: block; margin-top: .55cqw; font-size: 1.15cqw; color: #a3a7ad; white-space: nowrap; }
/* C — avancement du projet */
.imm-c-step { background: #fefefe; border: 1px solid #e3e6ea; border-radius: .9cqw; padding: 1.2cqw 2cqw; color: #1b2430; }
.imm-c-step h4 { margin: 0; font: 500 1.5cqw/1.3 Inter, sans-serif; }
.imm-steps { position: absolute; left: 7.9%; right: 11.2%; top: 0; height: 100%; }
.imm-steps .rail, .imm-steps .fill { position: absolute; left: 0; top: calc(52.9% - .14cqw); height: .28cqw; border-radius: 2px; }
.imm-steps .rail { right: 0; }
.imm-steps .rail { background: #d9dde3; }
.imm-steps .fill { background: #2563eb; width: 33.333%; transform: scaleX(0); transform-origin: left center; }
.imm-step { position: absolute; top: calc(52.9% - 1.4cqw); width: 10cqw; margin-left: -5cqw; text-align: center; }
.imm-step i { display: grid; place-items: center; width: 2.8cqw; height: 2.8cqw; margin: 0 auto; border-radius: 50%; background: #fff; border: .18cqw solid #aab1bb; color: #4d5766; font: 600 1.3cqw/1 Inter, sans-serif; font-style: normal; }
.imm-step em { display: block; margin-top: .6cqw; font: 400 1.2cqw/1.2 Inter, sans-serif; font-style: normal; color: #4d5766; white-space: nowrap; }
.imm-step.done i, .imm-step.cur i { background: #2563eb; border-color: #2563eb; color: #fff; }
.imm-step.cur em { color: #2563eb; }
.imm-step svg { width: 1.5cqw; height: 1.5cqw; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* — Tablette — */
@media (max-width: 1024px) {
  .imm-stage { padding: 96px 0 40px; }
  .imm-grid { grid-template-columns: 1fr; gap: 28px; }
  .imm-title { font-size: clamp(38px, 7vw, 64px); }
  .imm-title { order: -1; }
  .imm-visual { max-width: 720px; margin: 0 auto; }
}
/* — Mobile : une interface à la fois, transition verticale ; chaque fenêtre est agrandie et
     cadrée sur sa zone utile pour rester lisible à 375 px (cadrage « Butter ») — */
@media (max-width: 767px) {
  .imm-stage { min-height: 100svh; padding: 84px 0 28px; align-items: flex-start; }
  .imm-grid { gap: 22px; }
  .imm-title { font-size: clamp(34px, 9.4vw, 46px); }
  .imm-visual { aspect-ratio: .74 / 1; border-radius: 22px; overflow: hidden; }
  .imm-win, .imm-win.imm-b { width: 190%; top: 6%; margin-top: 0; }
  .imm-a { left: -55%; }
  .imm-win.imm-b { left: -27%; }
  .imm-c { left: -51%; }
  .imm-ov * { letter-spacing: 0; }
}
/* — Mouvement réduit : trois fenêtres empilées, contenu final, aucune animation — */
.imm.is-static .imm-grid { align-items: start; }
.imm.is-static .imm-title { position: sticky; top: 120px; }
.imm.is-static .imm-stage { min-height: 0; padding: 90px 0; }
.imm.is-static .imm-visual { aspect-ratio: auto; background: none; display: grid; gap: 28px; }
.imm.is-static .imm-win, .imm.is-static .imm-win.imm-b { position: relative; left: auto; top: auto; margin: 0; width: 100%; opacity: 1; transform: none; }

.imm-spark circle { transform-box: fill-box; transform-origin: center; }
.imm-win { will-change: transform, opacity; }
.imm.is-static .imm-win { will-change: auto; }

@media (max-width: 767px) {
  .imm.is-static .imm-visual { overflow: visible; }
  .imm.is-static .imm-win, .imm.is-static .imm-win.imm-b { width: 100%; left: auto; top: auto; }
}
