/* ============================================================
   MDJLABS — Socle partagé : Nav + Footer multi-pages
   Ce fichier n'ajoute QUE ce qui manque au DS existant :
   sous-menu Produits, état actif, feuille mobile, chrome de planche.
   Tout le reste (tokens, .nav, .btn, .wm, .foot-v3…) vient du site.
   ============================================================ */

/* =========================================================
   0 — CHROME DE LA PLANCHE (hors maquette)
   ========================================================= */
.board {
  max-width: 1320px;
  margin: 0 auto;
  padding: 64px 32px 120px;
}
.board-head { margin-bottom: 56px; max-width: 760px; }
.board-kicker {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--acc);
  display: inline-flex; align-items: center; gap: 9px;
}
.board-kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px;
  background: var(--acc); box-shadow: 0 0 10px var(--acc-glow);
}
.board-head h1 {
  font-size: clamp(30px, 4vw, 46px); font-weight: 600; letter-spacing: -0.02em;
  margin: 18px 0 14px; line-height: 1.04; text-wrap: balance;
}
.board-head p { color: var(--fg-1); font-size: 15px; line-height: 1.6; margin: 0; text-wrap: pretty; }
.board-head .meta {
  margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 10px;
  font-family: var(--ff-mono); font-size: 11px; color: var(--fg-2); letter-spacing: 0.04em;
}
.board-head .meta span {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 10px;
}

.board-grid { display: flex; flex-direction: column; gap: 40px; }

/* --- une fiche écran --- */
.frame { display: flex; flex-direction: column; gap: 0; }
.frame-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.frame-fig {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--acc); font-weight: 600;
}
.frame-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.frame-note {
  font-family: var(--ff-mono); font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.03em; margin-left: auto; text-align: right;
  max-width: 46ch; line-height: 1.5;
}

/* --- la scène (le viewport de la maquette) --- */
.stage {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background:
    radial-gradient(900px 380px at 15% -10%, rgba(84,232,138,0.04), transparent 60%),
    var(--bg-0);
}
/* filet ambiance blueprint léger, comme le hero */
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line-weak) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-weak) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 220px);
          mask-image: linear-gradient(to bottom, #000, transparent 220px);
}

/* la nav est fixée dans le vrai site : on l'ancre à la scène ici */
.stage .nav { position: absolute; }

/* scène desktop : la nav tient en haut, contenu dessous.
   La nav garde sa vraie largeur de composition (min-width) ; si la
   colonne de la planche est plus étroite, la scène défile horizontalement
   au lieu de rogner le CTA — rien n'est jamais coupé/inatteignable. */
.stage-desktop { min-height: 240px; overflow-x: auto; overflow-y: hidden; }
.stage-desktop.tall { min-height: 720px; }
.stage-desktop .nav { position: relative; min-width: 1100px; }
.stage-desktop .tpl-body { padding-top: 44px; }
/* dans une scène desktop on force l'affichage des liens indexés */
.stage-desktop .nav-links { display: flex; }

/* déclencheur mobile : visible seulement à viewport étroit (iframe 390px) */
@media (max-width: 760px) {
  .nav .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
}

/* coquille téléphone (mobile-first, 390 px) — contient une iframe rendue
   à un vrai viewport étroit pour que les media queries mobile s'appliquent */
.phones { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.phone {
  position: relative; overflow: hidden; flex: none;
  width: 390px; height: 748px;
  border: 1px solid var(--line-strong); border-radius: 30px;
  background: var(--bg-0);
  box-shadow: 0 40px 90px -50px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(255,255,255,0.02);
}
.phone iframe { width: 100%; height: 100%; border: 0; display: block; border-radius: inherit; background: var(--bg-0); }
.stage-desktop iframe { width: 100%; border: 0; display: block; background: transparent; }

/* =========================================================
   1 — LIENS DE NAV : index + état actif
   ========================================================= */
/* espace pour les liens à gauche des outils */
.nav .nav-links { margin-right: auto; }

/* l'item actif : nettement distinct du simple survol */
.nav-links a.is-active {
  color: var(--fg-0); background: var(--bg-2);
}
.nav-links a.is-active i { color: var(--acc); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  background: var(--acc); border-radius: 999px; box-shadow: 0 0 8px var(--acc-glow);
}
.nav-links a { position: relative; }

/* Les index "01"/"03"-"06" (dans un <a>) ET "02" (dans le <button> du
   sous-menu Produits) doivent recevoir EXACTEMENT le même habillage.
   site.css ne stylise que `.nav-links a i` : le <i> du <button> retombait
   donc sur le style navigateur par défaut (italique, police non-mono, 15px,
   couleur héritée du bouton). Bug constaté en revue le 2026-07-11, corrigé
   dans le port React (components/site-nav.css), reporté ici le 2026-07-15
   pour que les maquettes cessent de le réémettre. */
.nav-links a i,
.nav-trigger i {
  font-style: normal;
  color: var(--fg-3);
  font-size: 10px;
  margin-right: 6px;
}
.nav-item.is-open > .nav-trigger i,
.nav-trigger[aria-current="page"] i {
  color: var(--acc);
}

/* =========================================================
   2 — SOUS-MENU PRODUITS (desktop : survol + clic)
   ========================================================= */
.nav-item { position: relative; display: inline-flex; }
.nav-trigger { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; background: none; border: 0; }
.nav-trigger .caret {
  width: 8px; height: 8px; margin-left: 1px; color: var(--fg-3);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-item.is-open > .nav-trigger { color: var(--fg-0); background: var(--bg-2); }
.nav-item.is-open > .nav-trigger .caret { transform: rotate(180deg); color: var(--acc); }

.nav-sub {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 300px; padding: 8px;
  background:
    radial-gradient(360px 120px at 0% 0%, var(--acc-soft), transparent 70%),
    var(--bg-1);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 22px 54px -26px rgba(0,0,0,0.78);
  display: grid; gap: 2px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}
.nav-sub::before {
  content: "SOUS-MENU"; grid-column: 1 / -1;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--fg-3);
  padding: 4px 10px 6px;
}
.nav-item.is-open .nav-sub {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s;
}
.nav-sub a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  transition: background var(--dur-fast) var(--ease);
}
.nav-sub a:hover { background: var(--bg-2); }
.nav-sub a .s-idx { font-family: var(--ff-mono); font-size: 10px; color: var(--fg-3); width: 18px; }
.nav-sub a .wm { font-size: 13.5px; letter-spacing: 0.06em; }
.nav-sub a .s-cap {
  margin-left: auto; font-family: var(--ff-mono); font-size: 9.5px;
  color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-sub a:hover .s-cap { color: var(--fg-2); }

/* =========================================================
   3 — DÉCLENCHEUR MOBILE + FEUILLE (geste du compagnon-bot)
   ========================================================= */
.nav-burger {
  display: none; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-1); color: var(--fg-1);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.08em;
  cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.nav-burger:hover { color: var(--fg-0); border-color: var(--line-strong); }
.nav-burger .bars { display: inline-flex; flex-direction: column; gap: 3px; }
.nav-burger .bars i { display: block; width: 15px; height: 1.5px; background: currentColor; border-radius: 999px; }

/* ⚠️ RAPPEL POUR TOUTE MAQUETTE DE PAGE RÉELLE (pas une planche) :
   la media query ci-dessus MASQUE .nav-links sous 760px et compte sur un
   .nav-burger + .nav-sheet présents dans le HTML. Une page qui n'inclut que
   la nav desktop se retrouve SANS AUCUNE navigation sur mobile (constaté sur
   la maquette Preuves v2 le 2026-07-15 : seuls le logo et FR/EN restaient
   atteignables à 390px). Toujours inclure le burger + la feuille. */

/* feuille : glisse du bas, même grammaire que .nt-sheet du compagnon */
.nav-sheet { position: absolute; inset: 0; z-index: 120; pointer-events: none; }
.nav-sheet-bd {
  position: absolute; inset: 0; background: rgba(4,4,6,0.5);
  opacity: 0; transition: opacity var(--dur) var(--ease); pointer-events: none;
}
.nav-sheet.is-open .nav-sheet-bd { opacity: 1; pointer-events: auto; }
.nav-sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; pointer-events: auto;
  max-height: 88%; display: flex; flex-direction: column;
  border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background:
    radial-gradient(560px 200px at 0% 0%, var(--acc-soft), transparent 70%),
    var(--bg-1);
  box-shadow: 0 -26px 60px -26px rgba(0,0,0,0.7);
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(102%); opacity: 0; visibility: hidden;
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur-slow);
}
.nav-sheet.is-open .nav-sheet-card {
  transform: none; opacity: 1; visibility: visible;
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur) var(--ease), visibility 0s;
}
.nav-sheet-grab { width: 40px; height: 4px; border-radius: 999px; background: var(--bg-4); margin: 2px auto 12px; }
.nav-sheet-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--fg-2);
}
.nav-sheet-x {
  margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--fg-2); font-size: 13px; background: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.nav-sheet-x:hover { color: var(--fg-0); border-color: var(--line-strong); }
.nav-sheet-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

.msheet-links { display: flex; flex-direction: column; }
.msheet-links > a,
.msheet-links > .m-sub-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 6px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--fg-0); cursor: pointer; text-align: left;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
}
.msheet-links > a:first-child { border-top: 0; }
.msheet-links a i.m-idx,
.msheet-links .m-sub-trigger i.m-idx {
  font-style: normal; font-family: var(--ff-mono); font-size: 11px; color: var(--fg-3);
  width: 22px; flex: none;
}
.msheet-links a.is-active { color: var(--acc); }
.msheet-links a.is-active i.m-idx { color: var(--acc); }
.msheet-links a.is-active::after {
  content: ""; width: 6px; height: 6px; border-radius: 999px; margin-left: auto;
  background: var(--acc); box-shadow: 0 0 8px var(--acc-glow);
}
.m-sub-trigger .m-caret {
  margin-left: auto; width: 12px; height: 12px; color: var(--fg-3);
  transition: transform var(--dur) var(--ease);
}
.m-sub-trigger[aria-expanded="true"] .m-caret { transform: rotate(180deg); color: var(--acc); }

.m-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease); }
.m-sub > div { overflow: hidden; min-height: 0; }
.m-sub-trigger[aria-expanded="true"] + .m-sub { grid-template-rows: 1fr; }
.m-sub-inner { padding: 4px 0 10px 34px; display: flex; flex-direction: column; gap: 2px; }
.m-sub-inner a {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px;
  border-radius: var(--r-sm); border-left: 1px solid var(--line);
}
.m-sub-inner a:hover { background: var(--bg-2); }
.m-sub-inner a .s-idx { font-family: var(--ff-mono); font-size: 10px; color: var(--fg-3); }
.m-sub-inner a .wm { font-size: 14px; letter-spacing: 0.06em; }

.msheet-foot { display: flex; align-items: center; gap: 12px; padding-top: 18px; }
.msheet-foot .lang-btn { height: 38px; }
.msheet-foot .btn { flex: 1; justify-content: center; }

/* =========================================================
   4 — ENTRÉE EN CASCADE (sobre, coupée si reduced-motion)
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
  .nav-item.is-open .nav-sub a {
    animation: casc var(--dur-slow) var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 55ms);
  }
  .nav-sheet.is-open .msheet-links > a,
  .nav-sheet.is-open .msheet-links > .m-sub-trigger,
  .nav-sheet.is-open .msheet-foot {
    animation: casc var(--dur-slow) var(--ease) backwards;
    animation-delay: calc(120ms + var(--i, 0) * 45ms);
  }
}
@keyframes casc {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-sheet-card,
  .nav-sheet.is-open .nav-sheet-card {
    transition: opacity var(--dur) var(--ease), visibility 0s;
  }
}

/* =========================================================
   5 — GABARIT DE PAGE : contenu factice + emplacements réservés
   ========================================================= */
.tpl-body { padding: 96px 0 64px; }
.phone .tpl-body { padding: 30px 0 40px; }
.tpl-eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-2);
}
.tpl-h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.02em; margin: 14px 0 0; line-height: 1.06; }
.phone .tpl-h1 { font-size: 26px; }
.tpl-lede { color: var(--fg-1); font-size: 15px; line-height: 1.6; margin: 16px 0 0; max-width: 54ch; }
.tpl-blocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.phone .tpl-blocks { grid-template-columns: 1fr; gap: 12px; margin-top: 26px; }
.tpl-block {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-1); padding: 20px; min-height: 128px;
  display: flex; flex-direction: column; gap: 10px;
}
.tpl-block .b-num { font-family: var(--ff-mono); font-size: 11px; color: var(--acc); letter-spacing: 0.1em; }
.tpl-block .b-bar { height: 8px; border-radius: 999px; background: var(--bg-3); }
.tpl-block .b-bar.s { width: 60%; }
.tpl-block .b-bar.m { width: 82%; }

/* emplacement réservé : widget flottant (compagnon-bot) — NE PAS redessiner */
.slot-widget {
  position: absolute; right: 20px; bottom: 20px; z-index: 40;
  width: 168px; height: 52px; border-radius: 999px;
  border: 1px dashed var(--line-strong); background: rgba(12,12,14,0.7);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--fg-3); text-transform: uppercase;
}
.slot-widget .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--acc); box-shadow: 0 0 8px var(--acc-glow); flex: none; }

/* emplacement réservé : bande CTA sticky mobile — NE PAS redessiner */
.slot-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 60px;
  border-top: 1px dashed var(--line-strong); background: rgba(12,12,14,0.86);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--fg-3); text-transform: uppercase;
}
.slot-sticky .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--acc); box-shadow: 0 0 8px var(--acc-glow); flex: none; }
.phone .phone-scroll.has-sticky { bottom: 60px; }

/* le footer dans une scène : pas de fixed, marge haute */
.stage footer.foot-v3,
.phone footer.foot-v3 { margin-top: 40px; }
.phone .nl { padding: 30px 0; }

/* =========================================================
   6 — BARRES DE DONNÉES : garde-fou display
   ========================================================= */
/* Une barre de progression écrite en <span class="track"><span class="fill">
   ne se remplit JAMAIS si .fill reste en display:inline (largeur et hauteur
   ne s'appliquent pas aux éléments inline) — la piste se blockifie parce
   qu'elle est un grid item, mais pas son enfant. Bug constaté sur la maquette
   Preuves v2 le 2026-07-15 : width:58.03% posée, largeur rendue 0px. */
.track > .fill { display: block; }
