/* ==========================================================
   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; }
