/* ==========================================================
   CRM ENTREPRISE 3D
   Le recit de la page : ce que vos equipes ouvrent aujourd'hui,
   ce que ca leur coute, et ce que ca peut etre.

   1. HERO       fenetre Windows 98 -> dissolution -> CRM moderne
   2. VOLET      comparatif avant / apres, a faire glisser
   3. EDGE       ce n'est pas une maquette, c'est branche
   4. METIERS    quatre vignettes, quatre niches

   Zero librairie. La fenetre 98 est entierement en CSS.

   ATTENTION : le hero utilise position:sticky.
   Ne jamais remettre overflow:hidden sur un parent de #hero.
   ========================================================== */

.cx { position: relative; --hot: #E0607A; }

.cx__track { position: relative; height: 420vh; }
.cx__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden; display: grid; align-content: start; justify-items: center;
  padding-top: clamp(100px, 16vh, 156px);
}
.cx:not(.is-js) .cx__track { height: auto; }
.cx:not(.is-js) .cx__sticky { position: static; height: auto; overflow: visible; display: block; }
.cx:not(.is-js) .cx__caps { display: none; }

/* ---------- le hero ---------- */
.cx__hero {
  position: absolute; inset: 0; z-index: 8;
  padding-bottom: clamp(100px, 16vh, 156px);
  display: flex; align-items: center; justify-content: center;
  will-change: transform, opacity;
}
.cx__hero .hero__in { text-align: center; }
/* .h1--page est aligne a gauche partout ailleurs : ici il est centre */
.cx__hero .h1--page { text-align: center; max-width: 19ch; margin-inline: auto; }
.cx__hero .lead { margin-inline: auto; }

/* ---------- les legendes des trois temps ---------- */
.cx__caps {
  position: absolute; left: 50%; top: clamp(52px, 8.5vh, 88px);
  transform: translateX(-50%);
  width: min(660px, calc(100% - 32px)); z-index: 9;
  text-align: center; pointer-events: none;
}
.cx-cap { position: absolute; left: 0; right: 0; top: 0; opacity: 0; margin: 0; will-change: transform, opacity; }
.cx-cap span {
  display: block; font-weight: 800; letter-spacing: -.02em;
  font-size: clamp(20px, 3vw, 31px); line-height: 1.14; color: var(--ink);
}
.cx-cap small { display: block; margin-top: 7px; color: var(--grey); font-size: clamp(13px, 1.4vw, 15px); line-height: 1.5; }

/* ---------- la scene : les deux ecrans se superposent ---------- */
.cx-scene {
  position: relative; z-index: 4;
  width: min(1000px, calc(100vw - 48px));
  height: min(580px, calc(100svh - 220px));
}
.cx-screen { position: absolute; inset: 0; will-change: transform, opacity, filter; }

/* ==========================================================
   1 · LA VIEILLE FENETRE
   Tout est en CSS : biseaux, barre de titre, menu, grille.
   ========================================================== */
.w98 {
  display: flex; flex-direction: column; height: 100%;
  font-family: Tahoma, Verdana, "DejaVu Sans", sans-serif;
  font-size: 11px; color: #000; background: #c0c0c0;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080,
              inset 2px 2px 0 #dfdfdf, inset -2px -2px 0 #000,
              0 40px 90px -40px rgba(0, 0, 0, .8);
  padding: 3px; overflow: hidden;
}
.w98__bar {
  flex: none; display: flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 2px 0 4px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff; font-weight: 700;
}
.w98__bar b { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.w98__bar i {
  flex: none; width: 13px; height: 12px; margin-left: auto;
  background: #c0c0c0; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000;
  display: grid; place-items: center; font-style: normal; font-size: 9px; color: #000;
}
.w98__bar i + i { margin-left: 2px; }
.w98__menu {
  flex: none; display: flex; gap: 12px; padding: 3px 6px;
  background: #c0c0c0; border-bottom: 1px solid #808080;
}
.w98__menu s { text-decoration: none; }
.w98__menu s u { text-decoration: underline; }
.w98__tabs { flex: none; display: flex; gap: 2px; padding: 5px 6px 0; background: #c0c0c0; }
.w98__tabs s {
  text-decoration: none; padding: 3px 9px; background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  position: relative; white-space: nowrap;
}
.w98__tabs s.is-on { background: #dfdfdf; font-weight: 700; }
.w98__body {
  flex: 1 1 auto; min-height: 0; margin: 0 3px 3px; padding: 2px;
  background: #fff; box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  overflow: hidden; position: relative;
}
.w98__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.w98__grid th {
  background: #c0c0c0; font-weight: 700; text-align: left;
  padding: 3px 5px; font-size: 11px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080;
  white-space: nowrap; overflow: hidden;
}
.w98__grid td {
  padding: 3px 5px; font-size: 11px; border-bottom: 1px solid #e0e0e0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.w98__grid tr:nth-child(even) td { background: #f3f3f3; }
.w98__grid tr.is-sel td { background: #000080; color: #fff; }
.w98__foot {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 3px 6px; background: #c0c0c0; font-size: 10px; color: #000;
}
.w98__foot s { text-decoration: none; box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff; padding: 2px 8px; }
.w98__foot em { font-style: normal; margin-left: auto; color: #404040; }

/* le curseur qui cherche, et le compteur de temps perdu */
.w98__cur {
  position: absolute; left: 0; top: 0; width: 15px; height: 22px;
  pointer-events: none; opacity: 0; z-index: 5; will-change: transform, opacity;
}
.w98__cur svg { width: 100%; height: 100%; display: block; filter: drop-shadow(1px 1px 0 #fff); }
.w98__clock {
  position: absolute; right: 14px; bottom: 44px; z-index: 6; opacity: 0;
  padding: 7px 13px; border-radius: 999px;
  background: var(--hot); color: #fff;
  font-family: "Manrope", sans-serif; font-size: 13px; font-weight: 800;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .8); white-space: nowrap;
  will-change: transform, opacity;
}

/* ==========================================================
   2 · LE NOUVEL ECRAN
   Une vraie capture d'un des huit logiciels. Si les videos sont
   activees dans js/config.js, la video prend le relais quand le
   troisieme temps de la scene arrive. Les logiciels eux-memes ne
   sont jamais servis en ligne.
   ========================================================== */
.cx-new {
  height: 100%; border-radius: 16px; overflow: hidden; position: relative;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 50px 110px -44px rgba(0, 0, 0, .8);
}
.cx-new video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block; opacity: 0; z-index: 2; pointer-events: none;
  transition: opacity .6s ease;
}
.cx-new.is-live video { opacity: 1; }
.cx-new.is-live img { opacity: 0; transition: opacity .6s ease; }
.cx-new img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.cx-new__go {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 3; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .9);
  transition: transform .25s var(--ease);
}
.cx-new__go:hover { transform: translateX(-50%) translateY(-3px); }
.cx-new__go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================
   3 · LE VOLET COMPARATIF
   ========================================================== */
.cmp {
  position: relative; margin-top: clamp(28px, 4vw, 44px);
  border-radius: 18px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); background: var(--bg-alt);
  aspect-ratio: 16 / 9; touch-action: pan-y; cursor: ew-resize;
  --sx: 50%;
}
.cmp__pane { position: absolute; inset: 0; }
.cmp__pane--new img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.cmp__pane--old { clip-path: inset(0 calc(100% - var(--sx)) 0 0); z-index: 2; }
.cmp__pane--old .w98 { border-radius: 0; box-shadow: none; }
.cmp__tag {
  position: absolute; bottom: 14px; z-index: 4;
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  pointer-events: none;
}
.cmp__tag--old { left: 14px; }
.cmp__tag--new { right: 14px; }
.cmp__h {
  position: absolute; top: 0; bottom: 0; left: var(--sx); z-index: 5;
  width: 2px; margin-left: -1px; background: var(--card);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}
.cmp__h i {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .7);
  display: grid; place-items: center;
}
.cmp__h i::before, .cmp__h i::after {
  content: ""; width: 0; height: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  position: absolute;
}
.cmp__h i::before { border-right: 7px solid var(--ink); left: 11px; }
.cmp__h i::after { border-left: 7px solid var(--ink); right: 11px; }
.cmp:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* ==========================================================
   4 · LES HUIT DEMONSTRATIONS
   Chaque vignette ouvre un vrai logiciel, pas une video.
   ========================================================== */
.demos {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.4vw, 18px); margin-top: clamp(28px, 4vw, 44px);
}
.demo {
  position: relative; display: block; overflow: hidden; margin: 0;
  border-radius: 14px; border: 1px solid var(--line); background: var(--bg-alt);
  aspect-ratio: 16 / 10; text-decoration: none; color: inherit;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.demo:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--violet) 50%, var(--line));
  box-shadow: 0 28px 54px -30px rgba(0, 0, 0, .85);
}
.demo video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block; opacity: 0; z-index: 1; pointer-events: none;
  transition: opacity .4s ease;
}
.demo.is-live video { opacity: 1; }
.demo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: top center; display: block;
  transition: transform .5s var(--ease);
}
.demo:hover img { transform: scale(1.05); }
.demo__ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--violet) 18%, var(--bg-alt)), var(--bg-alt));
  color: var(--grey-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.demo__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 26px 12px 11px; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  color: #fff; font-size: 13px; font-weight: 800;
}
.demo__cap em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; opacity: .85; }
.demo__cap svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.demo:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.demos-note { margin: clamp(16px, 2vw, 22px) 0 0; text-align: center; font-size: 12.5px; color: var(--grey-2); line-height: 1.6; }

/* ==========================================================
   5 · LA SECTION EDGE
   ========================================================== */
.edge { display: grid; gap: clamp(14px, 1.8vw, 20px); grid-template-columns: repeat(3, 1fr); margin-top: clamp(30px, 4vw, 46px); }
.edge__c { padding: 22px 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.edge__c b { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.edge__c span { display: block; font-size: 14.5px; color: var(--grey); line-height: 1.6; }

/* ==========================================================
   TELEPHONE
   ========================================================== */
@media (max-width: 920px) {
  .cx__track { height: 400vh; }
  .cx-scene { width: calc(100vw - 24px); height: min(480px, calc(100svh - 200px)); }
  .w98 { font-size: 10px; }
  .w98__menu, .w98__grid th:nth-child(n+4), .w98__grid td:nth-child(n+4) { display: none; }
  .w98__clock { right: 10px; bottom: 36px; font-size: 12px; padding: 6px 11px; }
  .cx-mock__kpi { grid-template-columns: repeat(2, 1fr); }
  .cx-mk { border-bottom: 1px solid var(--line); }
  .cx-mk:nth-child(2n) { border-right: 0; }
  .cx-plan { width: 280px; height: 168px; }
  .cmp { aspect-ratio: 4 / 3; }
  .demos { grid-template-columns: repeat(2, 1fr); }
  .cx-new__go { bottom: 14px; padding: 10px 18px; font-size: 13px; }
  .edge { grid-template-columns: 1fr; }
}

/* ==========================================================
   MOUVEMENT REDUIT · un etat lisible, pas de piste de scroll
   ========================================================== */
.cx.is-static .cx__track { height: auto; }
.cx.is-static .cx__sticky { position: static; height: auto; overflow: visible; display: block; padding-top: 0; }
.cx.is-static .cx__hero { position: static; padding: clamp(96px, 15vh, 160px) 0 30px; }
.cx.is-static .cx__caps { display: none; }
.cx.is-static .cx-scene { margin: 0 auto; height: 460px; }
.cx.is-static .cx-screen--old { display: none; }
/* Initial state is applied before deferred scripts: no preview flash. */
.crm-motion .cx-screen{opacity:0;visibility:hidden}
.cx{--hot:#7958df}
.cx-new img,.cmp__pane--new img{object-fit:contain;background:var(--card)}
.cx-new__go{background:#7550d8;color:#fff}
.demo--jarvis{border:2px solid #8965e7;box-shadow:0 0 0 4px #8965e71c,0 12px 35px -20px #7550d8}
.demo--jarvis:hover{border-color:#a788f5;box-shadow:0 0 0 5px #8965e728}
.demo__badge{position:absolute;top:10px;left:10px;z-index:2;padding:5px 9px;border-radius:7px;background:#7550d8;color:white;font-size:11px;font-weight:800}
/* Familiar XP-era desktop chrome, with an agency's project table. */
.wxp{background:#ece9d8;border:1px solid #315dac;border-radius:9px 9px 0 0;padding:3px;box-shadow:0 30px 70px -35px #0008}
.wxp .w98__bar{height:30px;border-radius:6px 6px 0 0;padding:0 8px;background:linear-gradient(#6585b9,#3c609a 12%,#33588e 85%,#284677);text-shadow:0 1px #20334e}
.wxp .w98__bar b{font-size:12px}.wxp .w98__bar i{width:19px;height:19px;border:1px solid #ffffff99;border-radius:3px;color:white;background:#7190bc;box-shadow:inset 1px 1px #ffffff55}
.wxp .w98__menu,.wxp .w98__tabs,.wxp .w98__foot{background:#ece9d8}.wxp .w98__menu{padding:6px 8px;border-color:#d1cebd}.wxp .w98__tabs{padding-top:8px;gap:4px}.wxp .w98__tabs s{background:#e5e3d9;border:1px solid #b4b1a4;border-radius:4px 4px 0 0;box-shadow:none;padding:6px 12px}.wxp .w98__tabs s.is-on{background:#fff;border-top:3px solid #cfa65c;padding-top:4px}
.wxp .w98__grid th{background:linear-gradient(#faf9f4,#e8e6dc);padding:7px 8px;font-weight:400;box-shadow:inset -1px 0 #cbc9c0}.wxp .w98__grid td{padding:8px;font-size:11px}.wxp .w98__grid tr:nth-child(even) td{background:#f6f7fa}.wxp .w98__grid tr.is-sel td{background:#426aab;color:#fff}.wxp .w98__foot{min-height:28px;flex-wrap:wrap}.wxp .w98__foot em{font-size:10px}
/* Six small UI narratives in the established feature-card design. */
#prodWhat .tk__v{position:relative;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;overflow:hidden}
.crm-mini{position:relative;width:85%;height:100px;display:flex;align-items:center;justify-content:center;color:var(--ink);font-family:inherit}
.crm-mini-caption{font-size:10px;font-weight:600;color:var(--grey);text-align:center;padding:0 8px 10px}
.crm-mini i{display:block;height:5px;background:var(--line);border-radius:3px}
.crm-mini b{font-size:9px;letter-spacing:.04em}
.crm-stages{gap:8px;align-items:stretch;padding:10px 0}
.crm-stages>div{flex:1;padding:8px 6px;border:1px solid var(--line);border-radius:9px;background:var(--card)}
.crm-stages i{height:12px;margin-top:8px;background:color-mix(in srgb,#8965e7 12%,var(--card))}
.crm-moving{position:absolute;top:43px;left:4%;width:25%;height:13px;border-radius:4px;background:#8965e7;animation:crm-stage 6s ease-in-out infinite}
.crm-envelope{display:grid;place-items:center;width:46px;height:40px;background:var(--card);border:1px solid var(--line);border-radius:10px;color:#8965e7;font-size:25px;font-weight:700}
.crm-dots{font-size:25px;color:#8965e7;margin:0 12px;animation:crm-glow 3s ease-in-out infinite}
.crm-record{width:95px;background:var(--card);padding:10px;border:1px solid var(--line);border-radius:10px;position:relative;animation:crm-record 4s ease-in-out infinite}.crm-record i{margin-top:7px}.crm-record strong{position:absolute;right:-8px;bottom:-8px;border-radius:50%;background:#8965e7;color:#fff;width:23px;height:23px;text-align:center}
.crm-floor{width:155px;height:80px;border:1px solid #8965e766;background:color-mix(in srgb,#8965e7 8%,var(--card));display:grid;grid-template-columns:repeat(3,1fr);gap:14px;padding:12px;transform:perspective(350px) rotateX(48deg) rotateZ(-25deg);border-radius:9px;box-shadow:0 6px 0 #8965e72b}
.crm-floor i{height:22px;border-radius:3px;background:#8965e7;box-shadow:3px 3px 0 #5d3aa4;animation:crm-desk 5s ease-in-out infinite}.crm-floor i:nth-child(2n){animation-delay:1s;opacity:.5}
.crm-pin{position:absolute;left:51%;top:4px;color:#8965e7;animation:crm-glow 3s infinite}
.crm-alert{background:var(--card);border:1px solid var(--line);border-radius:12px;width:82%;height:78px;padding:15px;gap:12px;box-shadow:0 8px 18px -12px #0004}.crm-alert>div{flex:1}.crm-alert i{margin-top:8px}.crm-alert i:last-child{width:65%}.crm-alert strong{font-size:22px;color:#8965e7}.crm-alert-dot{width:9px;height:9px;background:#8965e7;border-radius:50%;animation:crm-glow 2s infinite}
.crm-phone{width:55px;height:95px;background:var(--card);border:2px solid var(--line);border-radius:11px;padding:8px;transform:rotate(-7deg);box-shadow:7px 7px 0 #8965e711}.crm-phone b{display:block;width:15px;height:3px;background:var(--ink);margin:0 auto 13px;border-radius:3px}.crm-phone i{margin:7px 0}.crm-phone span{display:block;background:#8965e7;color:white;border-radius:5px;font-size:10px;text-align:center}.crm-sync{font-size:32px;color:#8965e7;margin-left:25px;animation:crm-sync 5s ease-in-out infinite}
.crm-connect{gap:5px}.crm-connect span{display:grid;place-items:center;background:var(--card);border:1px solid var(--line);border-radius:10px;width:65px;height:45px;font-size:10px;font-weight:700}.crm-connect span:first-child{background:#8965e7;color:#fff}.crm-connect i{width:18px;height:2px;background:#8965e7;animation:crm-glow 2.5s infinite}.crm-connect i:nth-of-type(2){animation-delay:1.25s}
.crm-mini:not(.is-playing) *{animation-play-state:paused}
@keyframes crm-stage{0%,15%{transform:translateX(0)}45%,60%{transform:translateX(132%)}85%,100%{transform:translateX(0)}}
@keyframes crm-glow{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes crm-record{0%,100%{transform:translateY(3px)}50%{transform:translateY(-3px)}}
@keyframes crm-desk{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
@keyframes crm-sync{0%,25%{transform:rotate(0)}75%,100%{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.crm-mini *{animation:none!important}.crm-motion .cx.is-static .cx-screen--new{opacity:1;visibility:visible}}
@media(max-width:620px){.wxp .w98__grid th,.wxp .w98__grid td{font-size:9px;padding:6px 4px}.wxp .w98__foot em{font-size:8px}.cx-new__go{font-size:12px}.demo__badge{font-size:9px;top:6px;left:6px}.demo--jarvis .demo__cap{flex-wrap:wrap;gap:2px}.demo--jarvis .demo__cap em{font-size:10px}.cx-scene{height:auto;aspect-ratio:1.35}.cx.is-static .cx-scene{height:auto;aspect-ratio:1.35}}
@media(min-width:921px){.cmp{aspect-ratio:1828/803}.cx-scene{height:min(520px,calc(100svh - 220px))}}

/* The Agentic pain-section overlap must not cover the CRM comparison. */
#cmpSec + #prodPain{margin-top:0;padding-top:clamp(40px,5vw,72px)}
