/* =============================================================================
   TOPORAHMA — système de design de la plateforme web
   Les couleurs, la typographie, les rayons et les icônes sont ceux du LOGICIEL
   (ui/design_system/tokens.py : DARK_PALETTE / LIGHT_PALETTE, Typography,
   Radii ; icônes Lucide de resources/icons/lucide). Deux thèmes, sombre et
   clair, comme dans le logiciel. Voir docs/DIRECTION_ARTISTIQUE.md.
   ========================================================================== */
@layer reset, jetons, base, mise-en-page, composants, pages, utilitaires;

/* --- Polices auto-hébergées : celles de l'interface du logiciel -------------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var.4b73e2ff3024.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-italique.59036e902b79.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Cascadia Code";
  src: url("../fonts/cascadia-400.a27e51a98ffe.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Cascadia Code";
  src: url("../fonts/cascadia-600.7bc9239c89ae.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  img, video { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  table { border-collapse: collapse; }
}

@layer jetons {
  /* ---- Thème clair : LIGHT_PALETTE du logiciel ---------------------------- */
  :root, [data-theme="clair"] {
    --fond: #f4f6f9;          /* canvas_bg */
    --fond-2: #e7ecf3;        /* bg_dark (page) */
    --fond-3: #dfe6ef;        /* view3d_bg */
    --surface: #ffffff;       /* bg_primary / bg_card */
    --surface-2: #e2e8f0;     /* bg_tertiary */
    --survol: #d5deea;        /* bg_hover */
    --texte: #0f1117;         /* text_primary */
    --texte-2: #334155;       /* icon */
    --texte-3: #475569;       /* text_secondary */
    --texte-4: #94a3b8;       /* text_muted */
    --trait: #d3dbe6;         /* divider */
    --trait-fort: #9aa7ba;    /* border_strong */
    --bordure: #bcc7d6;       /* border_default */
    --accent: #2563eb;        /* accent_blue */
    --accent-fonce: #1d4ed8;
    --accent-pale: #dbeafe;
    --sur-accent: #ffffff;    /* text_on_accent */
    --succes: #059669;        /* accent_green */
    --avert: #d97706;         /* accent_orange */
    --erreur: #dc2626;        /* accent_red */
    --info: #0891b2;          /* accent_cyan */
    --ombre: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 32px -16px rgba(15, 23, 42, .22);
    /* Scène 3D (vue 3D du logiciel en clair) */
    --scene-fond: #dfe6ef; --scene-terrain: #f4f6f9; --scene-trait: #0f1117;
    --scene-voie: #ffffff; --scene-lot: #ffffff; --scene-bord: #0f1117;
    --scene-accent: #2563eb; --scene-equipement: #d97706;
    color-scheme: light;
  }

  /* ---- Thème sombre : DARK_PALETTE, identité historique du logiciel -------- */
  [data-theme="sombre"] {
    --fond: #0f1117;          /* bg_dark */
    --fond-2: #1a1d24;        /* bg_primary */
    --fond-3: #22262f;        /* bg_secondary */
    --surface: #1a1d24;       /* bg_primary */
    --surface-2: #2a2f3a;     /* bg_tertiary */
    --survol: #333a47;        /* bg_hover */
    --texte: #ffffff;
    --texte-2: #d8dee9;       /* icon */
    --texte-3: #a1a7b3;       /* text_secondary */
    --texte-4: #6b7280;       /* text_muted */
    --trait: #2a2f3a;         /* divider */
    --trait-fort: #4b5563;    /* border_strong */
    --bordure: #374151;       /* border_default */
    --accent: #3b82f6;
    --accent-fonce: #2563eb;
    --accent-pale: rgba(59, 130, 246, .16);
    --sur-accent: #ffffff;
    --succes: #10b981;
    --avert: #f59e0b;
    --erreur: #ef4444;
    --info: #06b6d4;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -18px rgba(0, 0, 0, .7);
    --scene-fond: #0b0e14; --scene-terrain: #3a414e; --scene-trait: #e5e9f0;
    --scene-voie: #4b5563; --scene-lot: #f1ead8; --scene-bord: #0f1117;
    --scene-accent: #3b82f6; --scene-equipement: #f59e0b;
    color-scheme: dark;
  }
  /* La bande sombre reste sombre dans les deux thèmes (panneau du logiciel). */
  .section--bande, .appel {
    --fond: #0f1117; --fond-2: #1a1d24; --fond-3: #22262f;
    --surface: #1a1d24; --surface-2: #2a2f3a; --survol: #333a47;
    --texte: #ffffff; --texte-2: #d8dee9; --texte-3: #a1a7b3; --texte-4: #6b7280;
    --trait: #2a2f3a; --trait-fort: #4b5563; --bordure: #374151;
    --accent: #3b82f6; --accent-fonce: #2563eb; --succes: #10b981;
    color-scheme: dark;
  }
  [data-theme="sombre"] .section--bande, [data-theme="sombre"] .appel {
    --fond: #1a1d24; --surface: #22262f; --trait: #333a47;
  }

  :root {
    /* Typographie : Typography du logiciel */
    --f-titre: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
    --f-texte: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
    --f-mono: "Cascadia Code", Consolas, Menlo, ui-monospace, monospace;

    --t-hero: clamp(2.5rem, 1.7rem + 3.4vw, 4.25rem);
    --t-1: clamp(2rem, 1.5rem + 2.2vw, 3rem);
    --t-2: clamp(1.625rem, 1.3rem + 1.3vw, 2.125rem);
    --t-3: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
    --t-chapeau: clamp(1.0625rem, 1rem + .35vw, 1.25rem);
    --t-corps: 1rem;
    --t-petit: .875rem;
    --t-legende: .75rem;

    /* Rayons : Radii du logiciel */
    --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px;

    /* Espacement (base 4 du logiciel) */
    --e-1: .25rem; --e-2: .5rem; --e-3: .75rem; --e-4: 1rem; --e-5: 1.5rem;
    --e-6: 2rem; --e-7: 3rem; --e-8: 4rem; --e-9: 6rem; --e-10: 9rem;
    --section: clamp(4rem, 2.5rem + 6vw, 8rem);

    /* Grille */
    --contenu: 82.5rem;
    --marge: clamp(1rem, .4rem + 2.6vw, 2.5rem);
    --gouttiere: 1.5rem;

    /* Mouvement : Motion du logiciel (120 / 200 / 320 ms, OutCubic) */
    --courbe: cubic-bezier(.33, 1, .68, 1);
    --d-1: 120ms; --d-2: 200ms; --d-3: 320ms;

    --en-tete: 4rem;
  }
  @media (prefers-reduced-motion: reduce) {
    :root { --d-1: 0ms; --d-2: 0ms; --d-3: 0ms; }
  }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--en-tete) + 1rem); }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  html, body { overflow-x: clip; }
  body {
    background: var(--fond);
    color: var(--texte);
    font-family: var(--f-texte);
    font-size: var(--t-corps);
    line-height: 1.6;
    font-kerning: normal;
    font-variant-ligatures: common-ligatures;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, h4 {
    font-family: var(--f-titre);
    font-weight: 620;
    letter-spacing: -.012em;
    line-height: 1.06;
    text-wrap: balance;
  }
  h1 { font-size: var(--t-1); }
  h2 { font-size: var(--t-2); }
  h3 { font-size: var(--t-3); line-height: 1.2; letter-spacing: -.005em; }
  p { text-wrap: pretty; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
  a:hover { text-decoration-color: var(--accent); }
  strong { font-weight: 640; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  ::selection { background: var(--accent); color: var(--sur-accent); }
  hr { border: 0; border-top: 1px solid var(--trait); margin: 0; }
  .ic {
    width: 1.5rem; height: 1.5rem; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
  }
}

/* =============================================================================
   Mise en page
   ========================================================================== */
@layer mise-en-page {
  .conteneur {
    width: 100%;
    max-width: calc(var(--contenu) + 2 * var(--marge));
    margin-inline: auto;
    padding-inline: var(--marge);
  }
  .grille {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gouttiere);
    row-gap: var(--e-6);
  }
  .grille > * { grid-column: 1 / -1; }
  @media (min-width: 60rem) {
    .c-1-5 { grid-column: 1 / span 5; }
    .c-1-4 { grid-column: 1 / span 4; }
    .c-1-6 { grid-column: 1 / span 6; }
    .c-1-7 { grid-column: 1 / span 7; }
    .c-1-8 { grid-column: 1 / span 8; }
    .c-5-8 { grid-column: 5 / span 8; }
    .c-6-7 { grid-column: 6 / span 7; }
    .c-7-6 { grid-column: 7 / span 6; }
    .c-8-5 { grid-column: 8 / span 5; }
    .c-9-4 { grid-column: 9 / span 4; }
    .c-2-10 { grid-column: 2 / span 10; }
  }
  .section { padding-block: var(--section); position: relative; }
  .section--serree { padding-block: calc(var(--section) * .6); }
  .section--alt { background: var(--fond-2); }
  .section--bande { background: var(--fond); color: var(--texte); }
  .pile > * + * { margin-top: var(--e-5); }
  .pile-s > * + * { margin-top: var(--e-3); }
  .pile-l > * + * { margin-top: var(--e-7); }
  .mesure { max-width: 38rem; }
  .mesure-l { max-width: 46rem; }
}

/* =============================================================================
   Composants
   ========================================================================== */
@layer composants {

  /* --- Lien d'évitement --- */
  .evitement {
    position: absolute; left: var(--e-4); top: -4rem; z-index: 100;
    background: var(--texte); color: var(--fond); padding: var(--e-3) var(--e-4);
  }
  .evitement:focus { top: var(--e-4); }

  /* --- Typographie fonctionnelle --- */
  .surtitre {
    font-family: var(--f-titre);
    font-weight: 560;
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--texte-3);
  }
  .chapeau {
    font-family: var(--f-texte);
    font-size: var(--t-chapeau);
    line-height: 1.45;
    font-weight: 380;
    color: var(--texte-2);
  }
  .mono { font-family: var(--f-mono); font-size: .8125rem; letter-spacing: 0; }
  .legende {
    font-family: var(--f-mono);
    font-size: var(--t-legende);
    line-height: 1.5;
    color: var(--texte-3);
  }
  .graphite { color: var(--texte-3); }
  .titre-hero {
    font-size: var(--t-hero);
    font-weight: 640;
    line-height: .98;
    letter-spacing: -.022em;
  }
  /* Seconde moitié d'un titre : en retrait, comme les libellés secondaires du logiciel. */
  .titre-hero em, h1 em, h2 em { font-style: normal; color: var(--texte-3); }

  /* --- Boutons --- */
  .bouton {
    --b-fond: transparent; --b-texte: var(--texte); --b-bord: var(--bordure);
    display: inline-flex; align-items: center; gap: var(--e-3);
    min-height: 3rem; padding: 0 var(--e-5);
    background: var(--b-fond); color: var(--b-texte);
    border: 1px solid var(--b-bord); border-radius: var(--r-sm);
    font-family: var(--f-titre); font-weight: 600; font-size: .9375rem;
    letter-spacing: .005em; text-decoration: none; white-space: nowrap;
    transition: background var(--d-1) var(--courbe), color var(--d-1) var(--courbe),
                border-color var(--d-1) var(--courbe);
  }
  .bouton .ic { width: 1.125rem; height: 1.125rem; transition: transform var(--d-2) var(--courbe); }
  .bouton:hover .ic { transform: translateX(3px); }
  /* Bouton principal : le dégradé « gradient_primary » du logiciel (#3b82f6 → #2563eb). */
  .bouton--principal {
    --b-texte: var(--sur-accent); --b-bord: #2563eb;
    background: linear-gradient(#3b82f6, #2563eb); box-shadow: 0 1px 2px rgba(15, 23, 42, .2);
  }
  .bouton--principal:hover { background: linear-gradient(#2563eb, #1d4ed8); --b-bord: #1d4ed8; }
  .bouton--secondaire { --b-fond: var(--surface-2); }
  .bouton--secondaire:hover { --b-fond: var(--survol); --b-bord: var(--trait-fort); }
  .bouton--petit { min-height: 2.5rem; padding: 0 var(--e-4); font-size: .875rem; }
  .lien-action {
    display: inline-flex; align-items: center; gap: var(--e-2);
    font-family: var(--f-titre); font-weight: 600; font-size: .9375rem;
    text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px;
  }
  .lien-action .ic { width: 1rem; height: 1rem; transition: transform var(--d-2) var(--courbe); }
  .lien-action:hover { color: var(--accent); }
  .lien-action:hover .ic { transform: translateX(3px); }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-4) var(--e-5); }

  /* --- En-tête --- */
  .en-tete {
    position: sticky; top: 0; z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--trait);
  }
  .en-tete__barre {
    display: flex; align-items: center; gap: var(--e-6);
    height: var(--en-tete);
  }
  .marque {
    display: inline-flex; align-items: center; gap: .6rem;
    text-decoration: none; color: var(--texte);
    font-family: var(--f-titre); font-weight: 700;
    font-size: 1rem; letter-spacing: .08em;
  }
  .marque__icone { width: 1.75rem; height: auto; }
  [data-theme="sombre"] .marque__icone--clair, :root:not([data-theme="sombre"]) .marque__icone--sombre { display: none; }
  .nav { display: none; margin-left: auto; }
  .nav__liste { display: flex; align-items: center; gap: var(--e-1); list-style: none; margin: 0; padding: 0; }
  .nav__lien, .nav__bouton {
    display: inline-flex; align-items: center; gap: .35rem;
    height: var(--en-tete); padding: 0 var(--e-3);
    background: none; border: 0; text-decoration: none;
    font-family: var(--f-titre); font-weight: 520; font-size: .9375rem;
    color: var(--texte); position: relative;
  }
  .nav__lien::after, .nav__bouton::after {
    content: ""; position: absolute; left: var(--e-3); right: var(--e-3); bottom: 0;
    height: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform var(--d-2) var(--courbe);
  }
  .nav__lien:hover::after, .nav__bouton:hover::after,
  .nav__bouton[aria-expanded="true"]::after, .nav__lien[aria-current="page"]::after { transform: scaleX(1); }
  .nav__bouton .ic { width: .875rem; height: .875rem; transition: transform var(--d-2) var(--courbe); }
  .nav__bouton[aria-expanded="true"] .ic { transform: rotate(180deg); }
  .en-tete__actions { display: flex; align-items: center; gap: var(--e-3); margin-left: auto; }
  .bouton-menu {
    display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem;
    background: var(--surface-2); border: 1px solid var(--bordure); border-radius: var(--r-sm);
    color: var(--texte-2);
  }
  .bouton-menu:hover { background: var(--survol); }
  .bouton-menu .ic { width: 1.25rem; height: 1.25rem; }
  .bouton-theme .ic--soleil, [data-theme="sombre"] .bouton-theme .ic--lune { display: none; }
  [data-theme="sombre"] .bouton-theme .ic--soleil { display: block; }
  .bouton-theme { display: inline-grid; }
  .en-tete__demo { display: none; }
  @media (min-width: 64rem) {
    .nav { display: block; }
    .en-tete__actions { margin-left: var(--e-4); }
    .bouton-menu:not(.bouton-theme) { display: none; }
    .en-tete__demo { display: inline-flex; }
  }
  /* ⚠ Sept entrées de navigation, deux boutons et le prix ne tiennent PAS dans
     la barre aux espacements larges : à 1024 px elle débordait de 345 px, et
     même au plus large (contenu de 82,5rem) il manquait 35 px — le bouton
     « Acheter » sortait de l'écran. On resserre, puis on rend la place par
     paliers. */
  @media (min-width: 64rem) {
    .en-tete__barre { gap: var(--e-4); }
    .nav__lien, .nav__bouton { padding: 0 var(--e-2); font-size: .875rem; }
    .nav__lien::after, .nav__bouton::after { left: var(--e-2); right: var(--e-2); }
    .en-tete__actions { margin-left: var(--e-2); }
    .en-tete__prix { display: none; }
  }
  @media (min-width: 64rem) and (max-width: 74.99rem) { .en-tete__demo { display: none; } }
  @media (min-width: 90rem) {
    .nav__lien, .nav__bouton { padding: 0 var(--e-3); font-size: .9375rem; }
    .nav__lien::after, .nav__bouton::after { left: var(--e-3); right: var(--e-3); }
    .en-tete__prix { display: inline; }
  }

  /* Méga-menu « Logiciel » */
  .mega {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--trait);
    box-shadow: var(--ombre);
  }
  .mega[hidden] { display: none; }
  .mega__grille {
    display: grid; grid-template-columns: repeat(4, 1fr) 1.15fr; gap: 0;
    padding-block: var(--e-6) var(--e-7);
  }
  .mega__groupe { padding-right: var(--e-5); border-right: 1px solid var(--trait); padding-left: var(--e-5); }
  .mega__groupe:first-child { padding-left: 0; }
  .mega__groupe h2 { font-size: .75rem; margin-bottom: var(--e-4); }
  .mega__lien { display: flex; gap: var(--e-3); padding: var(--e-3) 0; text-decoration: none; }
  .mega__lien .ic { color: var(--texte-3); margin-top: 2px; }
  .mega__lien:hover .ic { color: var(--accent); }
  .mega__lien strong { display: block; font-family: var(--f-titre); font-weight: 600; font-size: .9375rem; line-height: 1.25; }
  .mega__lien span { display: block; font-size: .8125rem; line-height: 1.4; color: var(--texte-3); margin-top: 2px; }
  .mega__lien:hover strong { color: var(--accent); }
  .mega__profils { padding-left: var(--e-6); }
  .mega__profils ul { list-style: none; padding: 0; margin: 0; }
  .mega__profils a { display: block; padding: var(--e-2) 0; border-bottom: 1px solid var(--trait); text-decoration: none; font-weight: 520; }
  .mega__profils a:hover { color: var(--accent); }

  /* Menu mobile */
  .tiroir {
    position: fixed; inset: 0; z-index: 60; background: var(--fond);
    display: flex; flex-direction: column; overflow-y: auto;
  }
  .tiroir[hidden] { display: none; }
  .tiroir__tete { display: flex; align-items: center; justify-content: space-between; height: var(--en-tete); border-bottom: 1px solid var(--trait); }
  .tiroir__corps { padding-block: var(--e-5) var(--e-8); }
  .tiroir__corps h2 { margin: var(--e-5) 0 var(--e-2); }
  .tiroir__corps a { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) 0; border-bottom: 1px solid var(--trait); text-decoration: none; font-weight: 540; }
  .tiroir__corps .bouton { border-bottom: 1px solid var(--accent); margin-top: var(--e-6); width: 100%; justify-content: center; }

  /* --- Cartouche de section (le titre de planche) --- */
  .cartouche {
    display: grid; grid-template-columns: auto 1fr; align-items: end;
    gap: var(--e-3) var(--e-5);
    padding-bottom: var(--e-4); margin-bottom: var(--e-7);
    border-bottom: 1px solid var(--trait);
  }
  .cartouche__num {
    font-family: var(--f-mono); font-size: .75rem; line-height: 1;
    padding: .375rem .5rem; border: 1px solid var(--bordure); border-radius: 4px;
    color: var(--accent); background: var(--accent-pale);
  }
  .cartouche__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--e-2) var(--e-5); }

  /* --- Figure : une carte du logiciel (bg_card, bordure, rayon 8, ombre légère) --- */
  .planche {
    position: relative; padding: var(--e-3);
    border: 1px solid var(--bordure); border-radius: var(--r-md);
    background: var(--surface); box-shadow: var(--ombre);
  }
  .planche img { width: 100%; border-radius: var(--r-sm); }
  .planche { container-type: inline-size; }
  .planche figcaption {
    display: flex; flex-direction: column; gap: var(--e-1);
    padding-top: var(--e-3); margin-top: var(--e-3); border-top: 1px solid var(--trait);
  }
  .planche figcaption .legende:last-child { color: var(--texte-4); }
  @container (min-width: 36rem) {
    .planche figcaption { flex-direction: row; justify-content: space-between; gap: var(--e-5); }
    .planche figcaption .legende:last-child { text-align: right; flex: 0 1 40%; }
  }
  .planche--zoom { cursor: zoom-in; }
  .planche--sans-fond { background: transparent; }

  /* --- État : existant plein / projeté tireté --- */
  .etat {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--f-titre); font-weight: 560;
    font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  }
  .etat::before { content: ""; width: 1.5rem; border-top: 2px solid var(--succes); }
  .etat--ops { color: var(--succes); }
  .etat--dev { color: var(--texte-3); }
  .etat--dev::before { border-top: 2px dashed var(--texte-3); }

  /* --- Nomenclature : tableau à filets --- */
  .nomenclature { width: 100%; font-size: var(--t-petit); }
  .nomenclature th {
    text-align: left; font-family: var(--f-titre); font-weight: 560;
    font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-3);
    padding: var(--e-2) var(--e-4) var(--e-2) 0; border-bottom: 1px solid var(--trait-fort);
  }
  .nomenclature td { padding: var(--e-4) var(--e-4) var(--e-4) 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
  .nomenclature td:last-child, .nomenclature th:last-child { padding-right: 0; }
  .nomenclature .num { font-family: var(--f-mono); white-space: nowrap; }
  .nomenclature .droite { text-align: right; }
  .nomenclature tr.dev td { color: var(--texte-3); }
  .nomenclature tr.dev td:first-child { border-left: 0; }
  .nomenclature caption { caption-side: bottom; text-align: left; padding-top: var(--e-3); }
  .table-defilante { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* --- Fiche module (ligne de catalogue) --- */
  .fiches { border-top: 1px solid var(--trait-fort); }
  .fiche {
    display: grid; grid-template-columns: 2.75rem 1fr auto; gap: var(--e-2) var(--e-4);
    align-items: start; padding: var(--e-5) 0; border-bottom: 1px solid var(--trait);
    text-decoration: none; position: relative;
  }
  .fiche::before {
    content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 100%;
    background: var(--accent); transform: scaleX(0); transform-origin: left;
    transition: transform var(--d-3) var(--courbe);
  }
  .fiche:hover::before, .fiche:focus-visible::before, .fiche.est-actif::before { transform: scaleX(1); }
  .fiche__num { font-family: var(--f-mono); font-size: .75rem; color: var(--texte-3); padding-top: .35rem; }
  .fiche__nom { font-family: var(--f-titre); font-weight: 600; font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); line-height: 1.2; }
  .fiche__accroche { color: var(--texte-3); font-size: .9375rem; margin-top: .25rem; }
  .fiche__etats { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; padding-top: .35rem; }
  .fiche .ic { color: var(--texte-3); transition: color var(--d-1); }
  .fiche:hover .ic, .fiche.est-actif .ic { color: var(--accent); }
  .fiche:hover .fiche__nom { color: var(--accent); }
  @media (max-width: 40rem) {
    .fiche { grid-template-columns: 2rem 1fr; }
    .fiche__etats { grid-column: 2; align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: var(--e-4); padding-top: 0; }
  }

  /* --- Calque avant / après --- */
  .calque {
    position: relative; overflow: hidden; user-select: none; touch-action: pan-y;
    background: var(--fond-3); --pos: 50%;
  }
  .calque img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .calque__apres { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
  .calque__trait {
    position: absolute; top: 0; bottom: 0; left: var(--pos); width: 1px; background: var(--texte);
    transform: translateX(-.5px);
  }
  .calque__poignee {
    position: absolute; top: 50%; left: var(--pos); transform: translate(-50%, -50%);
    width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
    background: var(--accent); color: var(--sur-accent); border: 0; border-radius: 50%; cursor: ew-resize; box-shadow: var(--ombre);
  }
  .calque__poignee .ic { width: 1.25rem; height: 1.25rem; }
  .calque__etiquette {
    position: absolute; top: var(--e-3); padding: .25rem .5rem;
    background: rgba(15, 17, 23, .88); color: #fff; border-radius: 4px;
    font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .04em;
  }
  .calque__etiquette--avant { left: var(--e-3); }
  .calque__etiquette--apres { right: var(--e-3); background: var(--accent); }

  /* --- Questions (accordéons) --- */
  .questions { border-top: 1px solid var(--trait-fort); }
  .question { border-bottom: 1px solid var(--trait); }
  .question summary {
    list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: var(--e-4);
    padding: var(--e-5) 0; font-family: var(--f-titre); font-weight: 580; font-size: 1.0625rem; line-height: 1.35;
  }
  .question summary::-webkit-details-marker { display: none; }
  .question summary .ic { width: 1.25rem; height: 1.25rem; transition: transform var(--d-2) var(--courbe); }
  .question[open] summary .ic { transform: rotate(45deg); color: var(--accent); }
  .question summary:hover { color: var(--accent); }
  .question__reponse { padding: 0 var(--e-7) var(--e-5) 0; color: var(--texte-2); max-width: 44rem; }

  /* --- Onglets (profils) --- */
  .onglets__liste { display: flex; gap: 0; border-bottom: 1px solid var(--trait-fort); overflow-x: auto; scrollbar-width: none; }
  .onglets__liste::-webkit-scrollbar { display: none; }
  .onglet {
    background: none; border: 0; padding: var(--e-4) var(--e-5) var(--e-4) 0; margin-right: var(--e-4);
    font-family: var(--f-titre); font-weight: 560; font-size: 1rem; color: var(--texte-3);
    position: relative; white-space: nowrap;
  }
  .onglet::after { content: ""; position: absolute; left: 0; right: var(--e-5); bottom: -1px; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--d-2) var(--courbe); }
  .onglet[aria-selected="true"] { color: var(--texte); }
  .onglet[aria-selected="true"]::after { transform: scaleX(1); }
  .onglet__num { font-family: var(--f-mono); font-size: .6875rem; margin-right: .5rem; }
  .panneau { padding-top: var(--e-7); }
  .panneau[hidden] { display: none; }

  /* Couples situation → réponse */
  .couples { border-top: 1px solid var(--trait-fort); }
  .couple { display: grid; grid-template-columns: 1fr; gap: var(--e-2); padding: var(--e-4) 0; border-bottom: 1px solid var(--trait); }
  .couple__avant { color: var(--texte-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-decoration-thickness: 1px; }
  .couple__apres { font-weight: 560; display: flex; gap: var(--e-3); }
  .couple__apres .ic { color: var(--succes); width: 1.25rem; height: 1.25rem; margin-top: .15rem; }
  @media (min-width: 48rem) {
    .couple { grid-template-columns: 1fr 1fr; gap: var(--e-6); }
  }
  .couples__tete { display: none; }
  @media (min-width: 48rem) {
    .couples__tete { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-6); padding-bottom: var(--e-2); }
  }

  /* --- Cotes (indicateurs mesurés) --- */
  .cotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); border-top: 1px solid currentColor; }
  .cote { padding: var(--e-5) var(--e-5) var(--e-5) 0; border-bottom: 1px solid var(--trait); }
  .cote__valeur { font-family: var(--f-titre); font-weight: 600; font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem); line-height: 1; letter-spacing: -.02em; display: flex; align-items: baseline; gap: .5rem; }
  .cote__valeur::before { content: ""; width: .5rem; height: .5rem; background: var(--accent); align-self: center; flex: none; }
  .cote__libelle { margin-top: var(--e-3); font-weight: 540; font-size: .9375rem; line-height: 1.35; }
  .cote__source { margin-top: var(--e-2); }

  /* --- Bordereau des prix --- */
  .bordereau { width: 100%; border-top: 2px solid var(--trait-fort); }
  .bordereau th { text-align: left; font-family: var(--f-titre); font-weight: 560; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-3); padding: var(--e-3) var(--e-4) var(--e-3) 0; border-bottom: 1px solid var(--trait-fort); }
  .bordereau td { padding: var(--e-5) var(--e-4) var(--e-5) 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
  .bordereau .designation strong { display: block; font-family: var(--f-titre); font-size: 1.25rem; font-weight: 620; }
  .bordereau .designation p { color: var(--texte-3); font-size: .9375rem; margin-top: .25rem; max-width: 26rem; }
  .bordereau ul { margin: 0; padding: 0; list-style: none; font-size: .9375rem; }
  .bordereau li { padding-left: 1.25rem; position: relative; }
  .bordereau li + li { margin-top: .3rem; }
  .bordereau li::before { content: ""; position: absolute; left: 0; top: .7em; width: .625rem; border-top: 1px solid var(--trait-fort); }
  .bordereau .prix { font-family: var(--f-titre); font-weight: 640; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); line-height: 1; white-space: nowrap; letter-spacing: -.02em; }
  .bordereau .prix small { font-family: var(--f-mono); font-size: .75rem; font-weight: 400; letter-spacing: 0; color: var(--texte-3); display: block; margin-top: .4rem; }
  .bordereau tr.en-avant { background: color-mix(in srgb, var(--accent) 5%, transparent); }
  .bordereau tr.en-avant td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: var(--e-4); }
  .bordereau td:first-child, .bordereau th:first-child { padding-left: var(--e-2); }
  .bordereau .unite { font-family: var(--f-mono); font-size: .8125rem; white-space: nowrap; }
  @media (max-width: 52rem) {
    .bordereau, .bordereau tbody { display: block; width: 100%; }
    .bordereau thead { display: none; }
    .bordereau tr { display: grid; grid-template-columns: 1fr auto; padding: var(--e-5) 0; border-bottom: 1px solid var(--trait); gap: var(--e-3) var(--e-4); }
    .bordereau td { display: block; padding: 0; border: 0; }
    .bordereau .designation { grid-column: 1 / -1; }
    .bordereau .contenu { grid-column: 1 / -1; }
    .bordereau tr.en-avant { box-shadow: inset 3px 0 0 var(--accent); padding-left: var(--e-4); }
    .bordereau tr.en-avant td:first-child { box-shadow: none; padding-left: 0; }
  }

  /* --- Formulaires --- */
  .formulaire { display: grid; gap: var(--e-5); }
  .champ { display: grid; gap: var(--e-2); }
  .champ label, .champ legend { font-weight: 560; font-size: .9375rem; }
  .champ .aide { font-size: .8125rem; color: var(--texte-3); }
  .champ input[type="text"], .champ input[type="email"], .champ input[type="number"],
  .champ input[type="tel"], .champ select, .champ textarea {
    width: 100%; min-height: 3rem; padding: .7rem .875rem;
    background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--r-sm);
    font-size: 1rem; line-height: 1.4;
    transition: border-color var(--d-1), box-shadow var(--d-1);
  }
  .champ textarea { resize: vertical; min-height: 6rem; }
  .champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); }
  .champ--erreur input, .champ--erreur select, .champ--erreur textarea { border-color: var(--erreur); }
  .champ__erreur { color: var(--erreur); font-size: .875rem; font-weight: 520; display: flex; gap: .4rem; }
  .champ fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--e-2); }
  .champ fieldset > div, .champ ul { display: grid; gap: var(--e-2); list-style: none; padding: 0; margin: 0; }
  .choix { display: flex; gap: var(--e-3); align-items: flex-start; font-weight: 420; font-size: .9375rem; line-height: 1.45; cursor: pointer; }
  .choix input { width: 1.125rem; height: 1.125rem; margin-top: .15rem; accent-color: var(--accent); flex: none; }
  .formulaire__duo { display: grid; gap: var(--e-5); }
  @media (min-width: 40rem) { .formulaire__duo { grid-template-columns: 1fr 1fr; } }
  .formulaire__piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .alerte { padding: var(--e-4); border: 1px solid var(--erreur); border-left-width: 4px; color: var(--erreur); background: color-mix(in srgb, var(--erreur) 6%, var(--surface)); }
  .note { padding: var(--e-4) var(--e-5); border-left: 3px solid var(--texte); background: var(--surface); font-size: .9375rem; }
  .note--projete { border-left-style: dashed; border-left-color: var(--texte-3); }
  .mentions { font-size: .8125rem; color: var(--texte-3); line-height: 1.5; }

  /* Procédure numérotée (ce qui se passe ensuite) */
  .procedure { list-style: none; padding: 0; margin: 0; counter-reset: etape; border-left: 1px solid var(--trait-fort); }
  .procedure li { counter-increment: etape; position: relative; padding: 0 0 var(--e-5) var(--e-6); }
  .procedure li:last-child { padding-bottom: 0; }
  .procedure li::before {
    content: counter(etape, decimal-leading-zero); position: absolute; left: -.9rem; top: 0;
    width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
    background: var(--fond); border: 1px solid var(--trait-fort);
    font-family: var(--f-mono); font-size: .6875rem;
  }
  .section--alt .procedure li::before { background: var(--fond-2); }
  .procedure strong { display: block; font-family: var(--f-titre); font-weight: 600; }

  /* --- Bande de bas de page (appel final) --- */
  .appel { padding-block: var(--section); background: var(--fond); color: var(--texte); position: relative; overflow: hidden; }
  .appel__contenu { position: relative; }
  .appel__titre { font-size: var(--t-1); }
  .appel__actions { align-self: end; }
  .appel__courbes { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--trait-fort); opacity: .55; pointer-events: none; }

  /* --- Pied de page : un cartouche de plan --- */
  .pied { background: var(--surface); border-top: 1px solid var(--trait); padding-top: var(--e-7); font-size: .875rem; }
  .pied__grille { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--trait); border-left: 1px solid var(--trait); }
  .pied__case { border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); padding: var(--e-4); }
  .pied__case h2 { font-size: .6875rem; margin-bottom: var(--e-3); }
  .pied__case ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
  .pied__case a { text-decoration: none; }
  .pied__case a:hover { text-decoration: underline; }
  .pied__marque { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--e-3); }
  .pied__bas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--e-3); padding-block: var(--e-4) var(--e-6); }
  @media (min-width: 48rem) { .pied__grille { grid-template-columns: 1.6fr repeat(4, 1fr); } .pied__marque { grid-column: auto; } }
  .lettre { display: flex; gap: 0; margin-top: var(--e-2); }
  .lettre input { flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 .75rem; border: 1px solid var(--bordure); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--fond); }
  .lettre button { min-height: 2.75rem; padding: 0 1rem; border: 1px solid #2563eb; background: linear-gradient(#3b82f6, #2563eb); color: #fff; font-weight: 600; border-radius: 0 var(--r-sm) var(--r-sm) 0; }

  /* --- Bandeau de consentement (discret, jamais bloquant) --- */
  .consentement {
    position: fixed; left: var(--e-4); right: var(--e-4); bottom: var(--e-4); z-index: 40;
    max-width: 34rem; margin-left: auto;
    background: #1a1d24; color: #fff; padding: var(--e-4) var(--e-5); border: 1px solid #374151; border-radius: var(--r-md); box-shadow: var(--ombre);
    display: grid; gap: var(--e-3); font-size: .875rem; line-height: 1.5;
  }
  .consentement[hidden] { display: none; }
  .consentement .actions { gap: var(--e-3); }
  .consentement button { min-height: 2.5rem; padding: 0 1rem; border: 1px solid #4b5563; background: #2a2f3a; color: #fff; font-weight: 600; border-radius: var(--r-sm); }
  .consentement button[value="accepter"] { background: linear-gradient(#3b82f6, #2563eb); border-color: #2563eb; }

  /* --- Visionneuse --- */
  .visionneuse { border: 0; padding: 0; max-width: min(96vw, 110rem); max-height: 94vh; background: #0f1117; color: #fff; border-radius: var(--r-md); }
  .visionneuse::backdrop { background: rgba(21, 25, 29, .88); }
  .visionneuse img { max-height: calc(94vh - 4rem); width: auto; margin-inline: auto; }
  .visionneuse__barre { display: flex; justify-content: space-between; align-items: center; gap: var(--e-4); padding: var(--e-2) var(--e-2) var(--e-2) var(--e-4); }
  .visionneuse__fermer { background: none; border: 0; color: inherit; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; }

  /* --- Révélation au défilement (uniquement si le JS est actif) --- */
  .js .revele { opacity: 0; transform: translateY(14px); transition: opacity var(--d-3) var(--courbe), transform var(--d-3) var(--courbe); }
  .js .revele.est-visible { opacity: 1; transform: none; }
  .js .trace path, .js .trace line, .js .trace polyline { stroke-dasharray: var(--longueur, 1200); stroke-dashoffset: var(--longueur, 1200); transition: stroke-dashoffset 1.6s var(--courbe); }
  .js .trace.est-visible path, .js .trace.est-visible line, .js .trace.est-visible polyline { stroke-dashoffset: 0; }
  @media (prefers-reduced-motion: reduce) {
    .js .revele { opacity: 1; transform: none; }
    .js .trace path, .js .trace line, .js .trace polyline { stroke-dashoffset: 0; transition: none; }
  }
}

/* =============================================================================
   Pages
   ========================================================================== */
@layer pages {

  /* --- Accueil : la scène 3D en arrière-plan, le texte et l'achat par-dessus --- */
  .ouverture {
    position: relative; isolation: isolate; overflow: hidden;
    background: var(--scene-fond);
  }
  .scene--fond { position: relative; min-height: clamp(38rem, calc(100svh - var(--en-tete)), 58rem); display: flex; }
  .scene--fond .scene__cadre {
    position: absolute; inset: 0; z-index: 0; aspect-ratio: auto; height: auto;
    border: 0; border-radius: 0; background: var(--scene-fond);
  }
  .scene--fond .scene__sonde { left: auto; right: var(--marge); top: var(--e-4); bottom: auto; }
  .ouverture__voile {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
      linear-gradient(90deg, var(--fond) 0%, color-mix(in srgb, var(--fond) 88%, transparent) 26%,
                      color-mix(in srgb, var(--fond) 35%, transparent) 50%, transparent 66%),
      linear-gradient(0deg, color-mix(in srgb, var(--fond) 92%, transparent) 0%, transparent 34%);
  }
  .ouverture__grille {
    position: relative; z-index: 2; width: 100%;
    display: grid; grid-template-rows: 1fr auto; gap: var(--e-7);
    padding-block: var(--e-8) var(--e-5); pointer-events: none;
  }
  .ouverture__grille > * { pointer-events: auto; }
  .ouverture__texte { align-self: center; max-width: 36rem; }
  .ouverture__texte .chapeau { max-width: 33rem; margin-top: var(--e-5); color: var(--texte-2); }
  .ouverture__pilotage { max-width: 46rem; justify-self: end; width: 100%; }
  @media (min-width: 64rem) {
    .ouverture__grille { grid-template-columns: minmax(0, 36rem) 1fr minmax(0, 28rem); grid-template-rows: 1fr; }
    .ouverture__texte { grid-column: 1; }
    .ouverture__pilotage {
      grid-column: 3; align-self: end; padding: var(--e-4) var(--e-5);
      background: color-mix(in srgb, var(--surface) 86%, transparent);
      border: 1px solid var(--bordure); border-radius: var(--r-lg);
      backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    }
    .ouverture__pilotage .echelle { margin-right: 0; margin-top: 0; }
    .ouverture__pilotage .echelle__nom { display: none; }
    .ouverture__pilotage .scene__texte { margin-right: 0; min-height: 0; }
  }
  .ouverture__pilotage .legende { margin-top: var(--e-2); }
  .ouverture__garanties { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-5); margin-top: var(--e-5); font-size: .875rem; color: var(--texte-3); }
  .ouverture__garanties li { display: inline-flex; align-items: center; gap: .4rem; }
  .ouverture__garanties .ic { width: 1rem; height: 1rem; color: var(--succes); }
  @media (max-width: 63.99rem) {
    .ouverture__voile {
      background: linear-gradient(180deg, color-mix(in srgb, var(--fond) 94%, transparent) 0%,
                                  color-mix(in srgb, var(--fond) 80%, transparent) 55%,
                                  color-mix(in srgb, var(--fond) 94%, transparent) 100%);
    }
    .ouverture__pilotage { justify-self: stretch; }
    .scene--fond .scene__sonde { display: none; }
  }

  /* Achat en un geste, dans le héros */
  .achat-eclair {
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--e-3) var(--e-5);
    margin-top: var(--e-6); padding: var(--e-4) var(--e-4) var(--e-4) var(--e-5);
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-lg);
    box-shadow: var(--ombre);
  }
  .achat-eclair__prix { display: contents; }
  .achat-eclair__prix > .legende:first-child { grid-column: 1 / -1; }
  .achat-eclair__prix > strong { grid-column: 1; grid-row: 2; }
  .achat-eclair > .bouton { grid-column: 2; grid-row: 2 / span 2; }
  .achat-eclair__prix > .legende:last-child { grid-column: 1; grid-row: 3; }
  @media (max-width: 30rem) {
    .achat-eclair { grid-template-columns: 1fr; }
    .achat-eclair > .bouton { grid-column: 1; grid-row: auto; justify-content: center; }
  }
  .achat-eclair__prix strong { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
  .achat-eclair__prix small { font-size: .875rem; font-weight: 600; color: var(--texte-3); }
  .bouton--grand { min-height: 3.5rem; padding: 0 var(--e-6); font-size: 1.0625rem; }

  /* Scène 3D et son cadre gradué */
  .scene { position: relative; }
  .scene__cadre {
    position: relative; aspect-ratio: 4 / 3.15; background: var(--fond-2);
    border: 1px solid var(--bordure); border-radius: var(--r-md); overflow: hidden;
  }
  @media (min-width: 64rem) { .scene__cadre { aspect-ratio: auto; height: min(72svh, 46rem); border-right: 0; } }
  @media (min-width: 64rem) {
    .scene__cadre--encadre { border-right-width: 1px; height: min(64svh, 38rem); }
    .echelle--libre, .scene__texte--libre { margin-right: 0; }
  }
  .scene__cadre canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
  .scene__affiche { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity var(--d-3) var(--courbe); }
  .scene.est-prete .scene__affiche { opacity: 0; pointer-events: none; }
  .scene__graduations { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
  .scene__graduations span { position: absolute; font-family: var(--f-mono); font-size: .625rem; color: var(--texte-2); background: color-mix(in srgb, var(--fond) 80%, transparent); padding: 0 .25rem; }
  .scene__coin--no { right: var(--e-3); bottom: 2.75rem; }
  .scene__coin--se { right: var(--e-3); bottom: var(--e-3); }
  .scene__sonde {
    position: absolute; left: var(--e-3); bottom: var(--e-3); z-index: 3;
    display: flex; gap: var(--e-4); padding: .4rem .6rem;
    background: rgba(15, 17, 23, .9); color: #fff; font-family: var(--f-mono); font-size: .6875rem; border-radius: var(--r-sm);
    font-variant-numeric: tabular-nums;
  }
  .scene__sonde b { font-weight: 500; color: var(--texte-4); margin-right: .3rem; }
  .scene__nord { position: absolute; right: var(--e-4); top: var(--e-4); z-index: 3; width: 2.25rem; color: var(--texte); }
  .scene__etat { position: absolute; left: var(--e-3); top: var(--e-3); z-index: 3; font-family: var(--f-mono); font-size: .6875rem; background: var(--fond); padding: .2rem .45rem; border: 1px solid var(--trait-fort); }
  .scene__etat[hidden] { display: none; }

  /* Barre d'étapes : une échelle graphique */
  .echelle { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: var(--e-4); }
  @media (min-width: 64rem) { .echelle { margin-right: var(--marge); } }
  .echelle button {
    background: none; border: 0; padding: 0; text-align: left; position: relative; color: var(--texte);
  }
  .echelle__progression { display: block; height: 100%; width: var(--progression, 0%); background: var(--accent); }
  .echelle__segment { display: block; height: .5rem; overflow: hidden; border-radius: 1px; border: 1px solid var(--trait-fort); border-right-width: 0; background: var(--fond); transition: background var(--d-2); }
  .echelle button:nth-child(even) .echelle__segment { background: var(--texte-4); }
  .echelle button:last-child .echelle__segment { border-right-width: 1px; }
  .echelle button[aria-pressed="true"] .echelle__segment { border-color: var(--accent); background: var(--fond-3); }
  .echelle button[aria-pressed="true"] .echelle__progression { width: 100%; }
  /* Défilement automatique : l'étape en cours se remplit pendant sa durée. */
  .est-auto .echelle button[aria-pressed="true"] .echelle__progression {
    animation: progression-etape var(--duree-etape, 5s) linear forwards;
  }
  @keyframes progression-etape { from { width: 0; } to { width: 100%; } }
  @media (prefers-reduced-motion: reduce) { .est-auto .echelle button[aria-pressed="true"] .echelle__progression { animation: none; width: 100%; } }
  .echelle__graduation { display: block; font-family: var(--f-mono); font-size: .625rem; color: var(--texte-3); margin-top: .35rem; }
  .echelle__nom { display: block; font-family: var(--f-titre); font-weight: 560; font-size: .8125rem; line-height: 1.2; margin-top: .1rem; }
  .echelle button[aria-pressed="true"] .echelle__nom { color: var(--accent); }
  .echelle button:hover .echelle__nom { color: var(--accent); }
  @media (max-width: 40rem) { .echelle__nom { display: none; } }
  @media (max-width: 48rem) { .scene__coin { display: none; } }
  .scene__texte strong { font-weight: 640; }
  .scene__texte { display: grid; grid-template-columns: 1fr; gap: var(--e-2); margin-top: var(--e-4); min-height: 4.5rem; }
  @media (min-width: 64rem) { .scene__texte { grid-template-columns: 1fr auto; margin-right: var(--marge); align-items: start; } }
  .scene__texte p { font-size: .9375rem; color: var(--texte-2); max-width: 36rem; }
  .scene__controle { display: flex; gap: var(--e-2); }
  .scene__controle button { background: none; border: 1px solid var(--trait-fort); width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: var(--r-sm); }
  .scene__controle .ic { width: 1rem; height: 1rem; }

  /* --- En-tête : l'achat toujours à portée --- */
  .en-tete__acheter { white-space: nowrap; }
  .en-tete__prix { font-weight: 500; opacity: .85; }
  @media (max-width: 40rem) { .en-tete__prix { display: none; } .en-tete__actions { gap: var(--e-2); } }

  /* --- Barre d'achat collante (après le premier écran) --- */
  .barre-achat {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--surface); border-top: 1px solid var(--bordure); box-shadow: var(--ombre);
    transform: translateY(110%); transition: transform var(--d-3) var(--courbe);
  }
  .barre-achat.est-visible { transform: none; }
  .barre-achat__contenu { display: flex; align-items: center; gap: var(--e-5); min-height: 4rem; }
  .barre-achat__texte { flex: 1; min-width: 0; font-size: .9375rem; }
  .barre-achat__texte span { color: var(--texte-3); margin-left: .5rem; }
  .barre-achat__prix { font-size: 1.375rem; font-weight: 700; white-space: nowrap; }
  .barre-achat__prix small { font-size: .8125rem; color: var(--texte-3); font-weight: 600; }
  .barre-achat__actions { display: flex; align-items: center; gap: var(--e-4); }
  @media (max-width: 48rem) {
    .barre-achat__texte span, .barre-achat__offres { display: none; }
    .barre-achat__contenu { gap: var(--e-3); min-height: 3.5rem; }
  }
  .pied { padding-bottom: 4.5rem; }

  /* --- Bon de commande et suivi --- */
  .commande { padding-block: var(--e-6) var(--section); }
  .commande__tete { margin-bottom: var(--e-6); }
  .commande__tete h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); margin-top: var(--e-3); }
  .commande__etapes { display: flex; flex-wrap: wrap; gap: var(--e-3) var(--e-6); margin-top: var(--e-5); font-size: .9375rem; color: var(--texte-3); }
  .commande__etapes li { display: inline-flex; align-items: center; gap: .6rem; }
  .commande__etapes li > span {
    width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--bordure); font-size: .8125rem; font-weight: 600; background: var(--surface);
  }
  .commande__etapes li > span .ic { width: .9rem; height: .9rem; }
  .commande__etapes .est-active { color: var(--texte); font-weight: 600; }
  .commande__etapes .est-active > span { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
  .commande__etapes .est-faite > span { background: var(--succes); border-color: var(--succes); color: #fff; }
  .commande__grille { display: grid; gap: var(--e-6); align-items: start; }
  @media (min-width: 60rem) { .commande__grille { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); } }
  .commande__formulaire { display: grid; gap: var(--e-5); }
  .commande__bloc {
    display: grid; gap: var(--e-5); margin: 0; min-width: 0;
    padding: clamp(1.25rem, .9rem + 1.5vw, 2rem);
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-lg);
  }
  .commande__bloc legend, .commande__bloc > h2 {
    display: flex; align-items: center; gap: .75rem; float: left; width: 100%;
    font-size: 1.125rem; font-weight: 650; margin-bottom: var(--e-2);
  }
  .commande__bloc legend + * { clear: both; }
  .commande__num {
    width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-pale); color: var(--accent); font-size: .875rem; font-weight: 700;
  }
  .offres-choix { display: grid; gap: var(--e-3); }
  .offre-choix {
    display: grid; grid-template-columns: auto 1fr auto; gap: var(--e-4); align-items: center;
    padding: var(--e-4) var(--e-5); border: 1px solid var(--bordure); border-radius: var(--r-md);
    background: var(--fond); cursor: pointer; transition: border-color var(--d-1), box-shadow var(--d-1);
  }
  .offre-choix:hover { border-color: var(--trait-fort); }
  .offre-choix:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-pale); background: var(--surface); }
  .offre-choix input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); }
  .offre-choix__nom { display: block; font-weight: 650; }
  .offre-choix__nom em { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--accent-pale); padding: .1rem .45rem; border-radius: 4px; margin-left: .35rem; }
  .offre-choix__resume { display: block; font-size: .875rem; color: var(--texte-3); margin-top: .15rem; }
  .offre-choix__prix { font-size: 1.25rem; font-weight: 700; white-space: nowrap; text-align: right; }
  .offre-choix__prix small { display: block; font-size: .75rem; font-weight: 500; color: var(--texte-3); }
  @media (max-width: 40rem) { .offre-choix { grid-template-columns: auto 1fr; } .offre-choix__prix { grid-column: 2; text-align: left; } }
  [data-si-offre][hidden] { display: none; }
  .commande__recap { position: sticky; top: calc(var(--en-tete) + var(--e-5)); }
  .recap {
    display: grid; gap: var(--e-3); padding: var(--e-6);
    background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-lg); box-shadow: var(--ombre);
  }
  .recap__offre { font-size: 1.125rem; font-weight: 650; }
  .recap__total { font-size: 2.5rem; font-weight: 750; letter-spacing: -.025em; line-height: 1; margin-top: var(--e-2); }
  .recap__total small { font-size: 1rem; font-weight: 600; color: var(--texte-3); letter-spacing: 0; }
  .recap__bouton { width: 100%; justify-content: center; min-height: 3.5rem; font-size: 1.0625rem; margin-top: var(--e-3); }
  .recap__garanties { display: grid; gap: .5rem; margin-top: var(--e-3); font-size: .875rem; color: var(--texte-3); }
  .recap__garanties li { display: flex; gap: .5rem; align-items: flex-start; }
  .recap__garanties .ic { width: 1rem; height: 1rem; color: var(--succes); margin-top: .2rem; }
  .cle__code { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-4); }
  .cle__code code {
    font-family: var(--f-mono); font-size: clamp(1.125rem, .9rem + 1.2vw, 1.625rem); font-weight: 600;
    letter-spacing: .04em; padding: var(--e-3) var(--e-4); border-radius: var(--r-md);
    background: var(--accent-pale); color: var(--texte); border: 1px dashed var(--accent);
    word-break: break-all;
  }

  /* --- Constat : chaîne d'outils --- */
  .chaine { width: 100%; height: auto; color: var(--texte); overflow: visible; }
  .chaine text { font-family: var(--f-titre); font-size: 13px; font-weight: 600; fill: var(--texte); }
  .chaine .chaine__mono { font-family: var(--f-mono); font-size: 10px; fill: var(--texte-3); font-weight: 400; }
  .chaine .chaine__rupture { stroke: var(--erreur); }
  .chaine .chaine__accent { color: var(--accent); }
  .chaine .chaine__boite { fill: var(--fond-3); stroke: var(--bordure); }
  .chaine .chaine__boite--tr { fill: var(--accent); stroke: none; }

  /* --- Avantages : liste éditoriale --- */
  .avantages { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--trait-fort); counter-reset: av; }
  .cartouche + .avantages { border-top: 0; margin-top: calc(-1 * var(--e-5)); }
  .avantage { display: grid; gap: var(--e-2) var(--e-6); padding: var(--e-5) 0; border-bottom: 1px solid var(--trait); counter-increment: av; }
  .avantage h3 { display: flex; gap: var(--e-4); align-items: baseline; }
  .avantage h3::before { content: counter(av, decimal-leading-zero); font-family: var(--f-mono); font-size: .75rem; font-weight: 400; color: var(--accent); }
  .avantage p { color: var(--texte-2); }
  @media (min-width: 48rem) { .avantage { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

  /* --- Catalogue sur l'accueil : liste + aperçu collant --- */
  .catalogue { display: grid; gap: var(--e-7); }
  .catalogue__groupe + .catalogue__groupe { margin-top: var(--e-6); }
  .catalogue__groupe > h3 { font-size: .75rem; margin-bottom: var(--e-3); }
  .catalogue__apercu { display: none; }
  @media (min-width: 64rem) {
    .catalogue { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--e-7); }
    .catalogue__apercu { display: block; position: sticky; top: calc(var(--en-tete) + var(--e-6)); align-self: start; }
    .catalogue__vue { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--fond-2); }
    .catalogue__img { position: absolute; inset: 0; opacity: 0; transition: opacity var(--d-3) var(--courbe); }
    .catalogue__img.est-actif { opacity: 1; }
    .catalogue__img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; border-radius: var(--r-sm); }
  }

  /* --- Documents produits --- */
  .documents { display: grid; gap: var(--e-6); }
  @media (min-width: 48rem) { .documents { grid-template-columns: repeat(3, 1fr); align-items: start; } .documents > :nth-child(2) { margin-top: var(--e-8); } .documents > :nth-child(3) { margin-top: var(--e-6); } }
  .documents .planche img { aspect-ratio: 1 / 1.25; object-fit: cover; object-position: top; }

  /* --- Cas d'utilisation --- */
  .cas { display: grid; gap: var(--e-6); padding-block: var(--e-6); border-bottom: 1px solid var(--trait); }
  .cas:first-of-type { border-top: 1px solid var(--trait-fort); }
  @media (min-width: 60rem) { .cas { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--e-7); } }
  .cas__chiffres { display: grid; grid-template-columns: 1fr auto; font-size: .9375rem; }
  .cas__chiffres dt, .cas__chiffres dd { padding: var(--e-2) 0; border-bottom: 1px dotted var(--texte-4); margin: 0; }
  .cas__chiffres dd { font-family: var(--f-mono); text-align: right; padding-left: var(--e-4); }

  /* --- Module : en-tête de planche --- */
  .module-tete { padding-block: var(--e-7) var(--e-8); }
  .module-tete__titre { font-size: clamp(2.25rem, 1.6rem + 3vw, 4.25rem); line-height: 1; }
  .fil { display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--f-mono); font-size: .75rem; color: var(--texte-3); margin-bottom: var(--e-6); }
  .fil a { text-decoration: none; }
  .fil a:hover { color: var(--accent); }
  .tete-page { padding-block: var(--e-7) var(--e-7); border-bottom: 1px solid var(--trait-fort); }
  .tete-page h1 { font-size: clamp(2.25rem, 1.6rem + 2.8vw, 4rem); line-height: 1.02; max-width: 52rem; }
  .tete-page .chapeau { margin-top: var(--e-5); max-width: 42rem; }
  .navigation-planches { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--trait-fort); border-bottom: 1px solid var(--trait-fort); }
  .navigation-planches a { display: block; padding: var(--e-5) 0; text-decoration: none; }
  .navigation-planches a + a, .navigation-planches span + a { text-align: right; border-left: 1px solid var(--trait); padding-left: var(--e-4); }
  .navigation-planches strong { display: block; font-family: var(--f-titre); font-size: 1.125rem; font-weight: 600; }
  .navigation-planches a:hover strong { color: var(--accent); }

  /* --- Galerie --- */
  .galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: var(--e-7) var(--e-6); align-items: start; }
  .filtres { display: flex; flex-wrap: wrap; gap: var(--e-2); margin-bottom: var(--e-7); }
  .filtres a { padding: .45rem .8rem; border: 1px solid var(--trait); text-decoration: none; font-size: .875rem; border-radius: var(--r-sm); }
  .filtres a[aria-current="true"] { border-color: var(--accent); background: var(--accent); color: var(--sur-accent); }
  .filtres a:hover { border-color: var(--texte); }

  /* --- Page de formulaire --- */
  .page-formulaire { display: grid; gap: var(--e-8); padding-block: var(--e-7) var(--section); }
  @media (min-width: 60rem) { .page-formulaire { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--e-9); } }
  .page-formulaire__carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-lg); box-shadow: var(--ombre); padding: clamp(1.25rem, .8rem + 2vw, 2.5rem); }

  /* --- Page légale --- */
  .texte-long h2 { font-size: var(--t-3); margin: var(--e-7) 0 var(--e-3); }
  .texte-long p, .texte-long ul { margin-bottom: var(--e-4); max-width: 44rem; }
  .texte-long ul { padding-left: 1.25rem; }
  .texte-long li + li { margin-top: .4rem; }
}

@layer utilitaires {
  /* Captures du logiciel dans le thème du visiteur */
  [data-theme="sombre"] .si-clair, :root:not([data-theme="sombre"]) .si-sombre { display: none !important; }
  .visuellement-cache { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .centre { text-align: center; }
  .mt-4 { margin-top: var(--e-4); } .mt-5 { margin-top: var(--e-5); } .mt-6 { margin-top: var(--e-6); } .mt-7 { margin-top: var(--e-7); } .mt-8 { margin-top: var(--e-8); }
  .mb-6 { margin-bottom: var(--e-6); }
  .minium { color: var(--accent); }
  @media (max-width: 63.99rem) { .bureau-seulement { display: none !important; } }
  @media (min-width: 64rem) { .mobile-seulement { display: none !important; } }
}

@media print {
  .en-tete, .pied, .consentement, .appel, .scene { display: none !important; }
  body { background: #fff; }
}
