/* Accueil : héros 3D piloté au défilement, puis sections Array, Mod-DC, services et groupe. */

/* 1. Héros. Par défaut (sans JS ou animations réduites) : panneaux affichés à la suite, sans canvas. */
.heros canvas, .heros__jauge, .heros__invite { display: none; }
.heros__panneau { padding: clamp(48px, 8vw, 110px) var(--marge); max-width: var(--largeur); margin: 0 auto; }
.heros__panneau + .heros__panneau { border-top: 1px solid var(--gris); }
.heros h1 { font-size: clamp(2.2rem, 1rem + 5.4vw, 5.6rem); max-width: 11em; }
.heros h2 { font-size: clamp(2rem, 1rem + 4.4vw, 4.6rem); line-height: 1.04; }
.heros__panneau p { margin-top: 22px; font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem); line-height: 1.5; max-width: 30em; color: var(--doux); }
.heros__mention { color: var(--orange) !important; font: 500 0.95rem var(--titre) !important; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 14px !important; }

/* Mode animé : scène plein écran épinglée, un panneau à la fois */
.heros-actif .heros { height: 560vh; position: relative; }
.heros-actif .heros--court { height: 300vh; }
.heros-actif .heros--moyen { height: 400vh; }
/* Héros court (page Mod-DC) : titre plus petit pour laisser voir le bâtiment */
.heros--court h1 { font-size: clamp(1.8rem, 1rem + 3vw, 3.4rem); max-width: 15em; }
.heros--court h2 { font-size: clamp(1.7rem, 1rem + 2.6vw, 3rem); }
.heros-actif .heros__scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.heros-actif .heros canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.heros-actif .heros__panneau {
  position: absolute; left: 0; right: 0; bottom: clamp(56px, 9vh, 110px); margin: 0 auto; padding: 0 var(--marge); border: 0;
  opacity: 0; transform: translateY(26px); pointer-events: none; visibility: hidden;
  transition: opacity 0.5s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s 0.5s;
}
.heros-actif .heros__panneau.actif { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0.1s, 0.1s, 0s; }
/* Voile sous le texte pour garder le contraste devant la scène */
.heros-actif .heros__scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0) 100%); }
.heros-actif .heros__panneau, .heros-actif .heros__jauge, .heros-actif .heros__invite { z-index: 2; }
.heros-actif .heros__jauge { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gris); }
.heros__jauge i { display: block; height: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); }
.heros-actif .heros__invite { display: block; position: absolute; right: var(--marge); bottom: 22px; font: 500 0.8rem var(--titre); letter-spacing: 0.14em; text-transform: uppercase; color: var(--doux); }
.heros-actif .entete { background: rgba(0, 0, 0, 0.55); }

/* 2. Bandeau d'identité sous le héros */
.identite { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--gris); border-bottom: 1px solid var(--gris); }
.identite div { padding: 26px var(--marge) 28px; border-left: 1px solid var(--gris); }
.identite div:first-child { border-left: 0; }
.identite dt { font: 500 0.8rem var(--titre); letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); margin-bottom: 8px; }
.identite dd { margin: 0; font-size: 1.05rem; line-height: 1.4; }
@media (max-width: 900px) {
  .identite { grid-template-columns: 1fr 1fr; }
  .identite div:nth-child(3) { border-left: 0; }
  .identite div:nth-child(n+3) { border-top: 1px solid var(--gris); }
}
@media (max-width: 480px) {
  .identite { grid-template-columns: 1fr; }
  .identite div { border-left: 0; }
  .identite div + div { border-top: 1px solid var(--gris); }
}

/* 3. Gamme Array : grandes lignes, la référence en orange */
/* (les règles de .gamme sont dans site.css) */

/* Tracés pilotés par scenes.js : pathLength="1", progression --p */
.trace { stroke-dasharray: 1; stroke-dashoffset: calc(1 - clamp(0, (var(--p, 1) - var(--a, 0)) / var(--l, 0.2), 1)); }
svg text { font-family: var(--texte); }
svg .mono { font-family: var(--titre); font-weight: 500; letter-spacing: 0.04em; }

/* 4. Mod-DC : plan coté épinglé qui s'allonge du modèle S au modèle XL */
.scene__fixe { padding: clamp(48px, 7vw, 104px) 0; }
.scene__grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; align-items: center; }
.scene__texte > * + * { margin-top: 20px; }
.scene__dessin svg { display: block; width: 100%; height: auto; }
@media (min-width: 1000px) and (min-height: 640px) {
  .scenes .scene--epingle { height: 320vh; }
  .scenes .scene--epingle .scene__fixe { position: sticky; top: 0; height: 100vh; display: grid; align-content: center; padding: 68px 0 0; }
}
@media (max-width: 999px) { .scene__grille { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
  .scene__dessin { overflow-x: auto; }
  .scene__dessin svg { min-width: 560px; }
}
.plan { border-top: 1px solid var(--gris); }
.plan thead th { white-space: normal; vertical-align: bottom; }
.plan table { font-size: 0.92rem; }
.plan th, .plan td { padding-right: 14px; }
.plan tbody tr > :first-child { border-left: 3px solid transparent; padding-left: 12px; }
.plan tbody .ref { display: inline-block; min-width: 2em; font-size: 1.1rem; }
.scenes .plan tbody tr > * { transition: opacity 0.25s, border-color 0.25s; }
.scenes .plan tbody tr:not(.actif) > * { opacity: 0.4; }
.scenes .plan tr.actif > :first-child { border-left-color: var(--orange); }
.plan svg .mur { fill: none; stroke: var(--blanc); stroke-width: 2; }
.plan svg .mur2 { fill: none; stroke: var(--blanc); stroke-width: 0.75; }
.plan svg .baie { fill: var(--blanc); stroke: none; }
.plan svg .baie-reseau { fill: none; stroke: var(--blanc); stroke-width: 1.25; }
.plan svg .axe { fill: none; stroke: var(--gris); stroke-width: 1; stroke-dasharray: 10 4 2 4; }
.plan svg .cote { fill: none; stroke: var(--orange); stroke-width: 1.5; }
.plan svg .cote-texte { fill: var(--orange); font-size: 20px; }
.plan svg .legende { fill: var(--blanc); font-size: 13px; }
.plan svg .titre-plan { fill: var(--blanc); font-size: 24px; text-transform: uppercase; }
.plan svg .sous-titre-plan { fill: var(--blanc); font-size: 14px; opacity: 0.75; }
.plan svg .module .mur, .plan svg .module .mur2 { stroke-dasharray: 1; stroke-dashoffset: 0; }
.plan svg .etat { display: none; }
.plan svg .etat[data-pas="3"] { display: block; }
.scenes .plan svg .etat { display: block; opacity: 0; transition: opacity 0.3s; }
.scenes .plan svg .etat.actif { opacity: 1; }
.scenes .plan svg .module .mur, .scenes .plan svg .module .mur2 { stroke-dashoffset: 1; transition: stroke-dashoffset 0.7s cubic-bezier(0.6, 0, 0.2, 1); }
.scenes .plan svg .module.fait .mur, .scenes .plan svg .module.fait .mur2 { stroke-dashoffset: 0; }
.scenes .plan svg .module .baie, .scenes .plan svg .module .baie-reseau { opacity: 0; transition: opacity 0.3s 0.45s; }
.scenes .plan svg .module.fait .baie, .scenes .plan svg .module.fait .baie-reseau { opacity: 1; }
.plan__sites { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 24px; font: 500 0.95rem var(--titre); letter-spacing: 0.08em; text-transform: uppercase; }
.plan__sites li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--orange); margin-right: 10px; }

/* 5. Services : section claire, nomenclature */
.nomenclature { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--noir); }
.nomenclature li { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 4px 56px; padding: 22px 0; border-bottom: 1px solid var(--noir); align-items: baseline; }
.nomenclature h3 { font-size: clamp(1.2rem, 1rem + 0.9vw, 1.7rem); text-transform: uppercase; letter-spacing: 0.04em; }
@media (max-width: 700px) { .nomenclature li { grid-template-columns: minmax(0, 1fr); } }
.section--claire a { text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.section--claire a:hover { color: var(--noir); background: var(--orange); }

.accueil-photo { min-height: clamp(200px, 30vw, 420px); }
