/* ==========================================================================
   NeuralBIM : tokens et classes de base de la landing (neuralbim.fr)
   DA : « Le repère ». Voir DA.md. HTML/CSS statique, sans framework.
   Préfixe nb- partout. Thème clair uniquement (lisible au soleil).
   ========================================================================== */

/* --- Polices auto-hébergées (pas d'appel à Google : RGPD, et ça marche hors ligne).
       Fichiers dans fonts/, chemins relatifs à ce fichier CSS. --- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrainsmono-var-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* --- Couleurs (contrastes WCAG mesurés, voir DA.md § 3) --- */
  --nb-paper:        #F3F2EE;  /* fond de page : papier de plan */
  --nb-white:        #FFFFFF;  /* surfaces : champs, fiches */
  --nb-paper-2:      #ECEAE4;  /* fond de section alterné, bouton désactivé */
  --nb-ink:          #15191E;  /* texte, traits, repères (15,8:1 sur papier) */
  --nb-ink-2:        #454D57;  /* texte secondaire (7,6:1) */
  --nb-muted:        #5A626C;  /* légendes, notes ; minimum autorisé (5,5:1) */
  --nb-line:         #D6D3CB;  /* filets décoratifs uniquement */
  --nb-line-strong:  #7A8089;  /* bordure de champ (3,6:1, > 3:1 requis) */
  --nb-grid:         rgba(21, 25, 30, .055); /* quadrillage fin du plan */
  --nb-grid-major:   rgba(21, 25, 30, .09);  /* quadrillage tous les 5 carreaux */

  --nb-orange:       #FF7A1A;  /* LE TAG. Aplats seulement, jamais du texte sur clair */
  --nb-orange-hover: #FF9445;
  --nb-orange-press: #E8650A;
  --nb-orange-text:  #B8460A;  /* si un mot doit être orange sur clair (4,8:1) */
  --nb-orange-tint:  #FFE9D9;  /* surligneur, fond d'encart */

  --nb-plate:        #0E1216;  /* plaque sombre qui porte les rendus 3D */
  --nb-plate-top:    #030405;  /* haut du dégradé, = fond des rendus Blender */
  --nb-plate-bottom: #161C22;
  --nb-plate-2:      #1C2229;  /* étiquettes sur plaque */
  --nb-plate-text:   #F3F2EE;  /* 14,3:1 sur plate-2 */
  --nb-plate-muted:  #A9B2BC;  /* 7,5:1 sur plate-2 */

  --nb-ok:           #1D7A4B;  /* « lien validé », « en garantie » (4,8:1) */

  /* --- Typographie --- */
  --nb-font:  "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nb-mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --nb-fs-display: clamp(2.5rem, 1.35rem + 4.6vw, 4.5rem);   /* h1 : 40 → 72 px */
  --nb-fs-h2:      clamp(1.875rem, 1.3rem + 2.3vw, 3rem);    /* 30 → 48 px */
  --nb-fs-h3:      clamp(1.25rem, 1.1rem + .5vw, 1.5rem);    /* 20 → 24 px */
  --nb-fs-lead:    clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);/* 19 → 22 px */
  --nb-fs-body:    1.125rem;  /* 18 px, mobile compris : soleil, gants, terrain */
  --nb-fs-small:   .9375rem;  /* 15 px, plancher pour du texte courant */
  --nb-fs-label:   .8125rem;  /* 13 px, mono capitales uniquement */

  --nb-lh-tight: 1.04;
  --nb-lh-head:  1.15;
  --nb-lh-body:  1.55;

  /* --- Espacements : base 8, le carreau du plan fait 24 (= --nb-s-5) --- */
  --nb-s-1: 4px;
  --nb-s-2: 8px;
  --nb-s-3: 12px;
  --nb-s-4: 16px;
  --nb-s-5: 24px;
  --nb-s-6: 32px;
  --nb-s-7: 48px;
  --nb-s-8: 64px;
  --nb-s-9: 96px;
  --nb-s-10: 144px;
  --nb-section: clamp(56px, 4vw + 40px, 120px);  /* respiration verticale des sections */
  --nb-gutter: clamp(16px, 2.5vw, 32px);
  --nb-max: 1200px;

  /* --- Rayons : une étiquette industrielle, pas une bulle --- */
  --nb-r-s: 4px;   /* boutons, champs, repères, étiquettes */
  --nb-r-m: 8px;   /* fiches, encarts */
  --nb-r-l: 12px;  /* plaques d'image */
  --nb-r-round: 999px; /* pastilles seulement */

  --nb-border: 2px solid var(--nb-ink);
  --nb-focus: 3px solid var(--nb-ink);

  --nb-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nb-paper);
  color: var(--nb-ink);
  font-family: var(--nb-font);
  font-size: var(--nb-fs-body);
  line-height: var(--nb-lh-body);
  font-weight: 400;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 var(--nb-s-4); }

h1, h2, h3 { margin: 0; font-weight: 750; color: var(--nb-ink); text-wrap: balance; }
h1, .nb-display {
  font-size: var(--nb-fs-display);
  line-height: var(--nb-lh-tight);
  font-stretch: 112%;           /* semi-élargi : le ton signalétique */
  letter-spacing: -.025em;
  font-weight: 780;
}
h2 {
  font-size: var(--nb-fs-h2);
  line-height: var(--nb-lh-head);
  font-stretch: 108%;
  letter-spacing: -.02em;
  margin-bottom: var(--nb-s-6);
}
h3 { font-size: var(--nb-fs-h3); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
strong, b { font-weight: 650; }

.nb-lead { font-size: var(--nb-fs-lead); line-height: 1.45; color: var(--nb-ink-2); max-width: 36em; }
.nb-small { font-size: var(--nb-fs-small); color: var(--nb-muted); }
.nb-mono  { font-family: var(--nb-mono); font-weight: 500; }

a { color: var(--nb-ink); text-decoration: underline; text-decoration-color: var(--nb-orange);
    text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--nb-ink); }

:focus-visible { outline: var(--nb-focus); outline-offset: 3px; border-radius: var(--nb-r-s); }
.nb-plate :focus-visible, .nb-on-dark :focus-visible { outline-color: var(--nb-plate-text); }

::selection { background: var(--nb-orange-tint); color: var(--nb-ink); }

/* ==========================================================================
   Mise en page
   ========================================================================== */
.nb-wrap { width: 100%; max-width: calc(var(--nb-max) + 2 * var(--nb-gutter)); margin-inline: auto; padding-inline: var(--nb-gutter); }
.nb-section { padding-block: var(--nb-section); border-top: 1px solid var(--nb-line); }
.nb-section--alt { background: var(--nb-paper-2); }
.nb-grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--nb-s-5) var(--nb-gutter); }

/* Le papier de plan : carreau de 24 px, trait renforcé tous les 5 carreaux.
   Seulement derrière le hero et le process. */
.nb-plan {
  background-color: var(--nb-paper);
  background-image:
    linear-gradient(var(--nb-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--nb-grid-major) 1px, transparent 1px),
    linear-gradient(var(--nb-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--nb-grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* Repère de section : mono, précédé d'un trait de rappel. Pas de pastille, pas de fond.
   Maximum 4 sur la page. Ex. : <p class="nb-kicker">02 · Mise en place</p> */
.nb-kicker {
  display: flex; align-items: center; gap: var(--nb-s-3);
  margin: 0 0 var(--nb-s-4);
  font: 500 var(--nb-fs-label)/1.2 var(--nb-mono);
  text-transform: uppercase; letter-spacing: .08em; color: var(--nb-ink-2);
}
.nb-kicker::before { content: ""; width: 24px; height: 2px; background: var(--nb-ink); flex: none; }

/* ==========================================================================
   Boutons : un seul principal par écran
   ========================================================================== */
.nb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--nb-s-2);
  min-height: 52px; padding: 12px 22px;
  font: 700 1.0625rem/1.2 var(--nb-font); font-stretch: 104%;
  color: var(--nb-ink); text-decoration: none;
  background: transparent; border: var(--nb-border); border-radius: var(--nb-r-s);
  cursor: pointer; transition: background-color .15s var(--nb-ease), color .15s var(--nb-ease), box-shadow .15s var(--nb-ease);
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.nb-btn--s { min-height: 44px; padding: 8px 16px; font-size: 1rem; }
/* Principal : la couleur du tag, texte encre (6,8:1), filet encre (repérable même en plein soleil) */
.nb-btn--primary { background: var(--nb-orange); }
.nb-btn--primary:hover { background: var(--nb-orange-hover); box-shadow: 3px 3px 0 var(--nb-ink); }
.nb-btn--primary:active { background: var(--nb-orange-press); box-shadow: none; }
/* Secondaire : filet encre, fond transparent */
.nb-btn--secondary:hover { background: var(--nb-ink); color: var(--nb-paper); }
.nb-btn--secondary:active { background: var(--nb-ink-2); color: var(--nb-paper); }
/* Désactivé (formulaire incomplet) : 5,1:1, lisible mais éteint */
.nb-btn:disabled, .nb-btn[aria-disabled="true"] {
  background: var(--nb-paper-2); color: var(--nb-muted); border-color: #B9B6AE; box-shadow: none; cursor: not-allowed;
}
/* Sur plaque sombre */
.nb-on-dark .nb-btn--secondary { color: var(--nb-plate-text); border-color: var(--nb-plate-text); }
.nb-on-dark .nb-btn--secondary:hover { background: var(--nb-plate-text); color: var(--nb-ink); }
.nb-btn .nb-picto { width: 20px; height: 20px; }

@media (max-width: 639px) {
  .nb-btn--block-mobile { width: 100%; }
}

/* ==========================================================================
   Pastille, repère, picto : le vocabulaire de l'étiquette d'équipement
   ========================================================================== */
.nb-pastille {               /* le tag NFC, vu de face */
  display: inline-block; flex: none; width: 1em; height: 1em; border-radius: var(--nb-r-round);
  background: radial-gradient(circle, var(--nb-ink) 0 13%, transparent 14% 33%, var(--nb-ink) 34% 44%, transparent 45%) , var(--nb-orange);
}
.nb-repere {                 /* VMC-01, PAC-01… */
  display: inline-flex; align-items: center; gap: .5em;
  padding: .3em .6em .3em .5em; border-radius: var(--nb-r-s);
  background: var(--nb-ink); color: var(--nb-paper);
  font: 700 var(--nb-fs-label)/1 var(--nb-mono); letter-spacing: .04em; white-space: nowrap;
}
.nb-repere::before { content: ""; width: .75em; height: .75em; border-radius: 50%; background: var(--nb-orange); }

.nb-picto { width: 32px; height: 32px; color: var(--nb-ink); --picto-accent: var(--nb-orange); flex: none; }
.nb-picto--l { width: 48px; height: 48px; }

/* ==========================================================================
   Plaque sombre + rendus 3D + légendes en trait de rappel (hero)
   <figure class="nb-figure">
     <div class="nb-plate">
       <img src="images/hero-maquette-1500.webp" alt="…">
       <span class="nb-callout" style="--x:60.2%;--y:31.8%;--xm:71.1%;--ym:28.2%">
         <span class="nb-repere">PAC-01</span><span class="nb-callout__txt">Contrôle d'étanchéité</span>
       </span>
     </div>
     <figcaption class="nb-caption">Maquette de démonstration au 1/20, rendu 3D</figcaption>
   </figure>
   <ul class="nb-legend">…</ul>   (même contenu que les callouts, affichée sous 1280 px)
   ========================================================================== */
.nb-plate {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--nb-r-l);
  background: linear-gradient(180deg, var(--nb-plate-top) 0%, var(--nb-plate-bottom) 100%);
  color: var(--nb-plate-text);
}
.nb-plate > img, .nb-plate > picture img { width: 100%; height: 100%; object-fit: cover; }

.nb-callout {
  position: absolute; left: var(--x); top: var(--y);
  display: flex; align-items: center; gap: 0;
  transform: translate(-9px, -50%);
  pointer-events: none;
}
/* le point visé : anneau clair sur la pastille du rendu */
.nb-callout::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid var(--nb-plate-text); box-shadow: 0 0 0 2px rgba(3, 4, 5, .55);
}
/* le trait de rappel */
.nb-callout > .nb-repere { margin-left: 28px; position: relative; }
.nb-callout > .nb-repere::after {
  content: ""; position: absolute; right: 100%; top: 50%; width: 28px; height: 2px; background: var(--nb-plate-text);
}
.nb-callout__txt {
  margin-left: 6px; padding: .35em .6em; border-radius: var(--nb-r-s);
  background: var(--nb-plate-2); color: var(--nb-plate-text);
  font: 500 .875rem/1.2 var(--nb-font); max-width: 13em;
}
.nb-callout .nb-repere { background: var(--nb-plate-2); outline: 1px solid rgba(243, 242, 238, .18); }
/* étiquette à gauche du point */
.nb-callout--left { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), -50%); }
.nb-callout--left > .nb-repere { margin-left: 6px; margin-right: 28px; }
.nb-callout--left > .nb-repere::after { right: auto; left: 100%; }
.nb-callout--left .nb-callout__txt { margin-left: 0; }

.nb-figure { margin: 0; }
/* Légende de l'image : sous la plaque, sur le papier (jamais sur le rendu) */
.nb-caption {
  margin-top: var(--nb-s-2);
  font: 500 .75rem/1.4 var(--nb-mono); letter-spacing: .04em; color: var(--nb-muted);
}

/* Légende des repères : liste sous l'image tant que la plaque est trop étroite pour les textes */
.nb-legend { list-style: none; margin: var(--nb-s-4) 0 0; padding: 0; display: grid; gap: var(--nb-s-2); }
.nb-legend li { display: flex; align-items: center; gap: var(--nb-s-3); font-size: var(--nb-fs-small); color: var(--nb-ink-2); }

/* < 1280 px : repère seul sur l'image, texte dans la légende */
@media (max-width: 1279px) {
  .nb-callout__txt { display: none; }
}
/* ≥ 1280 px : la liste est masquée à l'écran mais reste lue par les lecteurs d'écran */
@media (min-width: 1280px) {
  .nb-legend { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* < 768 px : autre cadrage (carré), coordonnées --xm / --ym, repère posé au-dessus du point */
@media (max-width: 767px) {
  .nb-callout, .nb-callout--left {
    left: var(--xm, var(--x)); top: var(--ym, var(--y));
    flex-direction: column-reverse; transform: translate(-50%, calc(-100% + 9px));
  }
  .nb-callout > .nb-repere, .nb-callout--left > .nb-repere { margin: 0 0 12px; }
  .nb-callout > .nb-repere::after, .nb-callout--left > .nb-repere::after {
    left: 50%; right: auto; top: 100%; width: 2px; height: 12px; margin-left: -1px;
  }
  .nb-ping::after, .nb-callout--left.nb-ping::after { left: 50%; right: auto; top: auto; bottom: 0; margin: 0 0 0 -9px; }
}

/* ==========================================================================
   L'onde du scan : la seule animation de la page.
   Sur UN repère du hero : <span class="nb-callout nb-ping" …>. 3 ondes au chargement, puis repos.
   ========================================================================== */
.nb-ping::after {
  content: ""; position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 50%; border: 2px solid var(--nb-orange); opacity: 0;
  animation: nb-ping 1.8s var(--nb-ease) .8s 3;
}
.nb-callout--left.nb-ping::after { left: auto; right: 0; }
@keyframes nb-ping {
  0%   { transform: scale(1);   opacity: .95; }
  100% { transform: scale(3.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nb-ping::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   Le process de mise en place : un parcours de stations numérotées
   <ol class="nb-steps" style="--n:5">
     <li class="nb-step">
       <span class="nb-step__num">01</span>
       <svg class="nb-picto" aria-hidden="true"><use href="#p-doe"/></svg>
       <h3 class="nb-step__title">Vous nous transmettez le DOE</h3>
       <p class="nb-step__text">…</p>
       <p class="nb-step__out"><span>Livrable</span><span>Liste des équipements</span></p>
     </li>
     <li class="nb-step nb-step--scan">… (l'étape du scan : plaque orange)</li>
   </ol>
   ========================================================================== */
.nb-steps {
  --n: 5; --num: 52px;
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; gap: var(--nb-s-7);
}
.nb-step { position: relative; padding-left: calc(var(--num) + var(--nb-s-5)); }
.nb-step__num {
  position: absolute; left: 0; top: 0; z-index: 1;
  display: grid; place-items: center; width: var(--num); height: var(--num);
  border-radius: var(--nb-r-s); background: var(--nb-ink); color: var(--nb-paper);
  font: 700 1.25rem/1 var(--nb-mono); letter-spacing: .02em;
}
.nb-step--scan .nb-step__num { background: var(--nb-orange); color: var(--nb-ink); box-shadow: inset 0 0 0 2px var(--nb-ink); }
/* le rail vertical (mobile d'abord) : trait de rappel qui relie les stations */
.nb-step:not(:last-child)::before {
  content: ""; position: absolute; left: calc(var(--num) / 2 - 1px); top: var(--num);
  width: 2px; height: calc(100% + var(--nb-s-7) - var(--num)); background: var(--nb-ink);
}
.nb-step .nb-picto { margin: 10px 0 var(--nb-s-3); }
.nb-step__title { font-size: var(--nb-fs-h3); margin: 0 0 var(--nb-s-2); }
.nb-step__text { color: var(--nb-ink-2); margin: 0 0 var(--nb-s-3); max-width: 32em; }
/* le livrable de l'étape : une étiquette « LIVRABLE | PV de pose » */
.nb-step__out {
  display: inline-flex; align-items: stretch; margin: 0; max-width: 100%;
  border: 1.5px solid var(--nb-ink); border-radius: var(--nb-r-s); overflow: hidden;
  font-size: var(--nb-fs-small); font-weight: 600; line-height: 1.3; background: var(--nb-white);
}
.nb-step__out > span { padding: .45em .7em; }
.nb-step__out > span:first-child {
  display: flex; align-items: center; flex: none; background: var(--nb-ink); color: var(--nb-paper);
  font: 500 .6875rem/1 var(--nb-mono); text-transform: uppercase; letter-spacing: .08em;
}

@media (min-width: 1024px) {
  /* bureau : les stations en ligne, le rail devient horizontal */
  .nb-steps { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--nb-s-6); }
  .nb-step { padding-left: 0; padding-top: calc(var(--num) + var(--nb-s-4)); }
  .nb-step:not(:last-child)::before {
    left: var(--num); top: calc(var(--num) / 2 - 1px);
    width: calc(100% + var(--nb-s-6) - var(--num)); height: 2px;
  }
}

/* ==========================================================================
   Fiche de chiffres mesurés : valeurs en mono, pas de compteur animé
   ========================================================================== */
.nb-spec { display: grid; gap: 0; border-top: var(--nb-border); margin: 0; }
.nb-spec > div { padding: var(--nb-s-5) 0; border-bottom: 1px solid var(--nb-line-strong); }
.nb-spec dt { font: 700 clamp(2rem, 1.5rem + 2vw, 3rem)/1 var(--nb-mono); letter-spacing: -.05em; word-spacing: -.3em; margin-bottom: var(--nb-s-2); }
.nb-spec dd { margin: 0; color: var(--nb-ink-2); }
@media (min-width: 768px) {
  .nb-spec { grid-template-columns: repeat(3, 1fr); }
  .nb-spec > div { padding: var(--nb-s-5) var(--nb-s-5) var(--nb-s-5) 0; border-bottom: 0; }
  .nb-spec > div + div { border-left: 1px solid var(--nb-line-strong); padding-left: var(--nb-s-5); }
}

/* ==========================================================================
   Le cartouche : le bloc d'appel à l'action final, dessiné comme le cartouche d'un plan
   ========================================================================== */
.nb-cartouche { background: var(--nb-white); border: var(--nb-border); border-radius: var(--nb-r-s); }
.nb-cartouche__head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--nb-s-2) var(--nb-s-5);
  padding: var(--nb-s-3) var(--nb-s-5); border-bottom: var(--nb-border);
  font: 500 var(--nb-fs-label)/1.4 var(--nb-mono); text-transform: uppercase; letter-spacing: .08em;
}
.nb-cartouche__body { padding: var(--nb-s-6) var(--nb-s-5); }
.nb-field { display: grid; gap: var(--nb-s-2); margin-bottom: var(--nb-s-5); }
.nb-field label { font: 500 var(--nb-fs-label)/1.2 var(--nb-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--nb-ink-2); }
.nb-field input, .nb-field select, .nb-field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: 400 var(--nb-fs-body)/1.3 var(--nb-font); color: var(--nb-ink);
  background: var(--nb-white); border: 1.5px solid var(--nb-line-strong); border-radius: var(--nb-r-s);
}
.nb-field input:hover, .nb-field select:hover { border-color: var(--nb-ink); }
.nb-field input:focus-visible, .nb-field select:focus-visible { outline: var(--nb-focus); outline-offset: 0; border-color: var(--nb-ink); }

/* Utilitaire */
.nb-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
