/* Autan — site vitrine 3D.
   Tout ce qui se règle (palette, polices, espacements) est dans les variables ci-dessous. */

:root {
  /* Palette (jetons du logo Autan) */
  --marine: #0d2843;
  --nuit: #07182a;
  --bleu: #53a5d7;
  --sarcelle: #37747c;
  --accent: #f7763c;          /* orange : actions, repères */
  --soleil: #fdca55;          /* jaune : mots forts, tracés */
  --creme: #f6f1e8;

  /* Texte posé directement sur la scène 3D (toujours clair, la scène est le fond) */
  --sur-scene: #f6f1e8;
  --sur-scene-doux: rgba(246, 241, 232, 0.8);

  /* Panneaux en surimpression : thème sombre par défaut, clair selon le système (plus bas) */
  --panneau: rgba(8, 22, 38, 0.68);
  --panneau-plein: #0b2038;
  --panneau-texte: #f3efe6;
  --panneau-doux: rgba(243, 239, 230, 0.74);
  --panneau-bord: rgba(255, 255, 255, 0.16);
  --champ-fond: rgba(255, 255, 255, 0.07);
  --accent-texte: #fdca55;    /* accent lisible sur le panneau */

  /* Lumière de la scène (mise à jour par le script : la 3D colore l'interface) */
  --lumiere: 253 202 85;
  --voile: 0.2;
  --vignette-l: clamp(46px, 5.6vw, 80px);   /* largeur d'une vignette du menu du bas */

  /* Page sous le cadre : sombre par défaut, claire selon le système (plus bas) */
  --cadre-plein: clamp(280px, 55svh, 760px);   /* hauteur du cadre fixe en haut, en haut de page */
  --cadre-min: clamp(190px, 27svh, 260px);     /* hauteur du cadre une fois la page défilée */
  --k: 0;                                      /* 0 en haut de page, 1 cadre réduit (mis à jour par main.js) */
  --cadre: calc(var(--cadre-plein) - (var(--cadre-plein) - var(--cadre-min)) * var(--k));
  --page: #0b2038;
  --page-alt: #08192c;
  --page-texte: #f3efe6;
  --page-doux: rgba(243, 239, 230, 0.78);
  --page-trait: rgba(255, 255, 255, 0.18);
  --carte: rgba(255, 255, 255, 0.05);

  /* Polices */
  --titres: 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --corps: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Espacements et échelle */
  --marge: clamp(1.1rem, 4vw, 4.5rem);
  --rayon: 2px;
  --t-geant: clamp(3.6rem, 17.5vw, 20rem);
  --t-grand: clamp(2.3rem, 6.2vw, 6.4rem);
  --t-intro: clamp(1.55rem, 3.7vw, 3.9rem);
  --t-texte: clamp(1rem, 1.15vw, 1.2rem);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --panneau: rgba(250, 247, 240, 0.86);
    --panneau-plein: #f6f1e8;
    --panneau-texte: #0d2843;
    --panneau-doux: rgba(13, 40, 67, 0.8);
    --panneau-bord: rgba(13, 40, 67, 0.16);
    --champ-fond: rgba(13, 40, 67, 0.05);
    --accent-texte: #a8400f;
    --page: #f6f1e8;
    --page-alt: #ece5d8;
    --page-texte: #0d2843;
    --page-doux: rgba(13, 40, 67, 0.82);
    --page-trait: rgba(13, 40, 67, 0.2);
    --carte: rgba(255, 255, 255, 0.6);
    --champ-fond: rgba(13, 40, 67, 0.05);
  }
}
:root[data-theme="light"] {
  --panneau: rgba(250, 247, 240, 0.86);
  --panneau-plein: #f6f1e8;
  --panneau-texte: #0d2843;
  --panneau-doux: rgba(13, 40, 67, 0.8);
  --panneau-bord: rgba(13, 40, 67, 0.16);
  --champ-fond: rgba(13, 40, 67, 0.05);
  --accent-texte: #a8400f;
  --page: #f6f1e8;
  --page-alt: #ece5d8;
  --page-texte: #0d2843;
  --page-doux: rgba(13, 40, 67, 0.82);
  --page-trait: rgba(13, 40, 67, 0.2);
  --carte: rgba(255, 255, 255, 0.6);
  --champ-fond: rgba(13, 40, 67, 0.05);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--cadre-min); }
body {
  margin: 0; background: var(--page); color: var(--page-texte);
  font-family: var(--corps); font-size: var(--t-texte); line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--soleil); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: #1a0e06; }

.evitement { position: fixed; left: 1rem; top: -4rem; z-index: 100; background: var(--soleil); color: #1a0e06; padding: 0.6rem 1rem; border-radius: 8px; font-weight: 600; }
.evitement:focus { top: 1rem; }

/* ---------- Typographie ---------- */
.titre-geant {
  font-family: var(--titres); font-stretch: 62%; font-weight: 800; font-size: var(--t-geant);
  line-height: 0.84; letter-spacing: -0.012em; text-transform: uppercase;
  text-shadow: 0 2px 40px rgba(7, 24, 42, 0.35);
}
.titre-geant .ligne { display: block; overflow: hidden; padding: 0.06em 0 0.04em; margin-bottom: -0.06em; }
.titre-grand {
  font-family: var(--titres); font-stretch: 68%; font-weight: 800; font-size: var(--t-grand);
  line-height: 0.92; letter-spacing: -0.008em; text-transform: uppercase; text-wrap: balance;
  text-shadow: 0 2px 30px rgba(7, 24, 42, 0.4);
}
.accent { color: var(--soleil); }
.surtitre {
  font-family: var(--mono); font-size: clamp(0.72rem, 0.85vw, 0.9rem); letter-spacing: 0.14em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.8em;
}
.surtitre::before { content: ''; width: 2.2em; height: 2px; background: var(--accent); }
.texte { max-width: 34em; text-wrap: pretty; text-shadow: 0 1px 14px rgba(7, 24, 42, 0.75); }
.mention { font-size: 0.8em; color: var(--sur-scene-doux); font-family: var(--mono); letter-spacing: 0.02em; text-shadow: 0 1px 10px rgba(7, 24, 42, 0.8); }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  font-family: var(--titres); font-stretch: 78%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.95rem; padding: 0.8em 1.25em; border-radius: 0; text-decoration: none; white-space: nowrap;
  border: 2px solid currentColor;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s, color 0.18s;
}
/* À plat, angles droits ; au survol le bouton se « soulève » sur une ombre dure (pas de halo). */
.bouton:hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 currentColor; }
.bouton:active { transform: none; box-shadow: none; }
.bouton-plein { background: var(--accent); color: #1a0e06; border-color: #1a0e06; }
.bouton-plein:hover { background: var(--soleil); color: #1a0e06; box-shadow: 4px 4px 0 #1a0e06; }
.nav .bouton-plein { border-color: var(--creme); }
.nav .bouton-plein:hover { box-shadow: 4px 4px 0 var(--creme); }
.bouton-grand { font-size: clamp(1rem, 1.4vw, 1.35rem); padding: 0.95em 1.6em; }
.bouton::after { content: '→'; transition: transform 0.35s var(--ease); }
.bouton:hover::after { transform: translateX(0.3em); }

/* ---------- Préchargeur ---------- */
.prechargeur { display: none; }
.js .prechargeur {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  background: radial-gradient(90% 70% at 50% 110%, #5a2c1a 0%, #1a2238 38%, var(--nuit) 70%); color: var(--creme);
  transition: opacity 1.1s ease 0.15s, visibility 0s linear 1.3s;
}
.pret .prechargeur, .statique .prechargeur { opacity: 0; visibility: hidden; pointer-events: none; }
.pre-texte { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.pre-pct { color: var(--soleil); display: inline-block; min-width: 4ch; text-align: right; }
.pre-barre { width: min(240px, 60vw); height: 2px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.pre-barre span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--soleil)); transform: scaleX(0); transform-origin: left; transition: transform 0.25s linear; }
.prechargeur img { animation: pouls 2.4s ease-in-out infinite; }
@keyframes pouls { 50% { transform: scale(1.06); filter: drop-shadow(0 0 22px rgba(253, 202, 85, 0.5)); } }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.7rem, 1.6vw, 1.4rem) var(--marge); pointer-events: none; color: var(--sur-scene);   /* posée sur la scène : toujours claire */
}
.nav > * { pointer-events: auto; }
.nav-logo img { height: clamp(34px, 3.4vw, 46px); width: auto; filter: drop-shadow(0 1px 10px rgba(7, 24, 42, 0.6)); }
.nav-actions { display: flex; align-items: center; gap: clamp(0.5rem, 1.2vw, 1.1rem); }
.langue { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.08em; display: inline-flex; gap: 0.35em; padding: 0.7em 0.5em; min-height: 44px; align-items: center; text-shadow: 0 1px 10px rgba(7, 24, 42, 0.8); }
.nav-compte { font-size: 0.9rem; font-weight: 500; padding: 0.7em 0.5em; min-height: 44px; display: inline-flex; align-items: center; text-shadow: 0 1px 10px rgba(7, 24, 42, 0.8); }
.nav-compte:hover { color: var(--soleil); }
.langue [data-langue-code] { opacity: 0.62; transition: opacity 0.2s, color 0.2s; }
.langue [data-langue-code].actif { opacity: 1; color: var(--soleil); }
.menu-bouton {
  display: inline-flex; align-items: center; gap: 0.7em; min-height: 44px; padding: 0.55em 1em; border-radius: 0;
  background: rgba(7, 24, 42, 0.7); border: 2px solid rgba(255, 255, 255, 0.5);
  font-family: var(--titres); font-stretch: 78%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; color: var(--creme);
}
html:not(.js) .menu-bouton { display: none; }
.menu-bouton-traits { width: 20px; height: 10px; position: relative; display: block; }
.menu-bouton-traits i { position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform 0.45s var(--ease), top 0.45s var(--ease); }
.menu-bouton-traits i:first-child { top: 0; } .menu-bouton-traits i:last-child { top: 8px; }
.menu-ouvert .menu-bouton-traits i:first-child { top: 4px; transform: rotate(45deg); }
.menu-ouvert .menu-bouton-traits i:last-child { top: 4px; transform: rotate(-45deg); }

/* ---------- Menu plein écran (clip-path) ---------- */
.menu { display: none; }
.js .menu {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(5.5rem, 12vh, 9rem) var(--marge) clamp(1.5rem, 4vh, 3rem);
  background: var(--panneau-plein); color: var(--panneau-texte);
  clip-path: circle(0% at calc(100% - 4.5rem) 2.6rem); visibility: hidden;
  transition: clip-path 0.85s cubic-bezier(0.7, 0, 0.2, 1), visibility 0s linear 0.85s;
}
.js.menu-ouvert .menu { clip-path: circle(150% at calc(100% - 4.5rem) 2.6rem); visibility: visible; transition-delay: 0s; }
.menu-ouvert .nav-logo img { filter: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]).menu-ouvert .nav-logo img { content: url('../assets/logo-autan-complet.png'); }
  :root:not([data-theme="dark"]).menu-ouvert .nav .langue { color: var(--marine); text-shadow: none; }
  :root:not([data-theme="dark"]).menu-ouvert .nav .langue .actif { color: var(--accent-texte); }
}
:root[data-theme="light"].menu-ouvert .nav-logo img { content: url('../assets/logo-autan-complet.png'); }
:root[data-theme="light"].menu-ouvert .nav .langue { color: var(--marine); text-shadow: none; }
:root[data-theme="light"].menu-ouvert .nav .langue .actif { color: var(--accent-texte); }
.menu-liens { display: flex; flex-direction: column; }
.menu-liens a {
  display: flex; align-items: baseline; gap: 0.35em; text-decoration: none; overflow: hidden;
  font-family: var(--titres); font-stretch: 62%; font-weight: 800; text-transform: uppercase; line-height: 0.98;
  font-size: clamp(2.4rem, min(9.5vw, 12.5vh), 8.5rem);
}
.menu-liens a > span:last-child { display: inline-block; transform: translateY(105%); transition: transform 0.8s var(--ease), color 0.25s; }
.menu-ouvert .menu-liens a > span:last-child { transform: none; }
.menu-liens a:nth-child(1) > span:last-child { transition-delay: 0.18s; } .menu-liens a:nth-child(2) > span:last-child { transition-delay: 0.24s; }
.menu-liens a:nth-child(3) > span:last-child { transition-delay: 0.30s; } .menu-liens a:nth-child(4) > span:last-child { transition-delay: 0.36s; }
.menu-liens a:nth-child(5) > span:last-child { transition-delay: 0.42s; }
.menu-liens a:hover > span:last-child, .menu-liens a:focus-visible > span:last-child { color: var(--accent-texte); transform: translateX(0.12em); transition-delay: 0s; }
.menu-num { font-family: var(--mono); font-size: 0.8rem; font-weight: 400; letter-spacing: 0.1em; color: var(--panneau-doux); width: 2.6em; flex: none; }
.menu-pied { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; color: var(--panneau-doux); font-size: 0.95rem; }
.menu-pied .langue { text-shadow: none; color: var(--panneau-texte); }
.menu-pied .langue .actif { color: var(--accent-texte); }

/* ---------- Cadre fixe en haut : scène 3D + vues qui défilent sur le côté ---------- */
.cadre {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--cadre); min-height: var(--cadre-min); overflow: hidden; color: var(--sur-scene);   /* la scène est sombre : texte clair même en thème clair */
  background: var(--nuit); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
/* La scène garde sa pleine hauteur et reste centrée : en réduisant, le cadre la rogne sans la déformer ni la recalculer. */
#scene { position: absolute; left: 0; width: 100%; height: var(--cadre-plein); top: calc((var(--cadre) - var(--cadre-plein)) / 2); display: block; background: var(--nuit); }
.voile {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 24, 42, 0.5), rgba(7, 24, 42, 0) 26%), linear-gradient(90deg, rgba(7, 24, 42, 0.62), rgba(7, 24, 42, 0.18) 55%, rgba(7, 24, 42, 0) 80%), linear-gradient(0deg, rgba(7, 24, 42, 0.5), rgba(7, 24, 42, 0) 40%);
}

/* La bande des vues : défilement horizontal natif avec accroche (scroll-snap). */
.glisse {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; -webkit-overflow-scrolling: touch;
}
.glisse::-webkit-scrollbar { display: none; }
.glisse:focus-visible { outline-offset: -6px; }
.glisse.glisse-drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.diapo {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; position: relative;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem;
  padding: clamp(4.6rem, 11svh, 6rem) var(--marge) clamp(5.6rem, 13svh, 6.6rem);
}
.diapo-texte { display: flex; flex-direction: column; gap: clamp(0.5rem, 1.6svh, 1rem); max-width: min(44rem, 100%); align-items: flex-start; }
.diapo .texte { font-size: clamp(0.9rem, min(1.2vw, 2.6svh), 1.2rem); line-height: 1.4; max-width: 30em; }
.diapo .titre-geant { font-size: clamp(2.3rem, min(9.5vw, 12svh), 9rem); white-space: nowrap; }
.diapo .titre-grand { font-size: clamp(1.9rem, min(5.6vw, 9svh), 5.4rem); }

/* Typographie sur la scène */
.titre-geant .ligne { display: block; padding: 0.04em 0 0.02em; margin-bottom: -0.04em; }
.legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.84rem; text-shadow: 0 1px 10px rgba(7, 24, 42, 0.85); }
.legende li { display: flex; align-items: center; gap: 0.5em; }
.lg { width: 22px; height: 12px; border-radius: 2px; flex: none; }
.lg-zip { border: 2px solid #ff9a2e; box-shadow: 0 0 10px #ff9a2e; }
.lg-excl { background: repeating-linear-gradient(135deg, #8d9499 0 3px, #4b5258 3px 6px); }
.lg-parc { border: 2px dashed currentColor; }
.fiche { display: flex; gap: clamp(1rem, 2.4vw, 2.4rem); }
.fiche dt, .hud dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sur-scene-doux); }
.fiche dd { font-family: var(--titres); font-stretch: 70%; font-weight: 800; font-size: clamp(1.3rem, 2.2vw, 2.2rem); line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 14px rgba(7, 24, 42, 0.7); }

/* Affichage de la vue « productible » : courbe de la journée et productible */
.hud {
  flex: none; align-self: flex-end; width: min(22rem, 40vw); padding: clamp(0.8rem, 1.4vw, 1.3rem); display: flex; flex-direction: column; gap: 0.55rem;
  background: var(--panneau); color: var(--panneau-texte); border: 1px solid var(--panneau-bord); border-radius: var(--rayon);
  
}
.hud dt, .hud-tete { color: var(--panneau-doux); }
.hud-tete { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.hud-heure { color: var(--accent-texte); font-variant-numeric: tabular-nums; }
.hud-courbe { width: 100%; height: clamp(44px, 9svh, 96px); overflow: visible; }
.hud-axe { stroke: var(--panneau-bord); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hud-fond { fill: none; stroke: var(--panneau-bord); stroke-width: 1.5; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.hud-trace { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgb(var(--lumiere) / 0.9)); }
.hud-point { fill: var(--soleil); filter: drop-shadow(0 0 6px var(--soleil)); }
.hud-valeurs { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1.2rem; align-items: end; }
.hud-valeurs dd { font-family: var(--titres); font-stretch: 70%; font-weight: 800; font-size: clamp(1.1rem, 1.5vw, 1.5rem); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-fort dd { font-size: clamp(1.4rem, 2.2vw, 2.2rem); color: var(--accent-texte); }
.hud .mention { color: var(--panneau-doux); text-shadow: none; font-size: 0.7rem; }

/* Tableau de suivi des parcelles : dans le cadre (vue 4, il avance avec la vue) et dans la carte « Suivi et équipe ». */
.suivi { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.suivi li { display: grid; grid-template-columns: 4.6em 3.8em minmax(0, 1fr); align-items: center; gap: 0.6rem; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.suivi-ref { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; }
.suivi-ha { color: var(--panneau-doux); }
.suivi-etat { justify-self: end; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; padding: 0.3em 0.7em; border: 1px solid currentColor; color: var(--panneau-doux); transition: color 0.4s, background-color 0.4s; }
.suivi-etat[data-e="1"] { color: #ffd166; }
.suivi-etat[data-e="2"] { color: #7cc4ff; }
.suivi-etat[data-e="3"] { color: #62d68f; background: rgb(98 214 143 / 0.12); }
.suivi-etat[data-e="4"] { color: #ff9a8a; }
.maquette { display: grid; place-items: center; padding: clamp(0.9rem, 2vw, 1.4rem); background: var(--panneau); color: var(--panneau-texte); }
.maquette .suivi-ha { color: var(--panneau-doux); }
.carte:hover .maquette { transform: none; }

/* Commandes du cadre : une seule, la pause du défilement automatique, discrète. */
.commandes { position: absolute; right: var(--marge); bottom: 0.7rem; z-index: 3; display: flex; }
.cmd {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 0; line-height: 1; color: var(--creme); opacity: 0.6;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.28);
  transition: opacity 0.25s, background-color 0.25s, color 0.25s;
}
.cmd:hover, .cmd:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.14); }
.cmd-pause-icone { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.cmd-pause[aria-pressed="true"] .cmd-pause-icone { width: 0; height: 0; border-inline: 0; border-block: 6px solid transparent; border-left: 10px solid currentColor; }
/* Menu des vues : une vignette photo par vue, avec sa barre d'avancement. */
.progres { position: absolute; left: var(--marge); right: calc(var(--marge) + 3.4rem); bottom: 0.9rem; z-index: 3; display: flex; gap: clamp(0.35rem, 0.8vw, 0.7rem); }
.progres button { flex: 0 1 var(--vignette-l); width: var(--vignette-l); display: flex; flex-direction: column; gap: 5px; text-align: left; opacity: 0.55; transition: opacity 0.35s; }
.progres button:hover, .progres button.actif { opacity: 1; }
.vignette { position: relative; display: block; aspect-ratio: 8 / 5; border-radius: 4px; overflow: hidden; background: var(--nuit); }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.progres i { display: block; width: 100%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.28); position: relative; overflow: hidden; }
.progres i::after { content: ''; position: absolute; inset: 0; background: var(--soleil); transform-origin: left; transform: scaleX(0); }
.progres button.fait i::after { transform: scaleX(1); }
.progres button.actif i::after { transform: scaleX(var(--avance, 1)); }
.progres button:hover i { background: rgba(255, 255, 255, 0.5); }
html:not(.js) :is(.commandes, .progres) { display: none; }

/* Cadre réduit : les textes s'effacent, la scène et le menu de vignettes restent. */
.js .diapo-texte, .js .hud { opacity: calc(var(--vis, 1) * max(0, calc(1 - var(--k) * 2.6))); }
.js:not(.statique) .diapo-texte { transform: translateX(calc(var(--dec, 0) * -56px)); }
.js.cadre-reduit .diapo-texte, .js.cadre-reduit .hud { visibility: hidden; }

/* Apparition des textes du cadre à l'ouverture */
.js:not(.statique) .diapo-texte > * { opacity: 0; transform: translateY(16px); transition: opacity 0.9s ease, transform 1s var(--ease); }
.js:not(.statique).pret .diapo-texte > * { opacity: 1; transform: none; }
.js:not(.statique).pret .diapo-texte > :nth-child(2) { transition-delay: 0.15s; } .js:not(.statique).pret .diapo-texte > :nth-child(3) { transition-delay: 0.3s; } .js:not(.statique).pret .diapo-texte > :nth-child(4) { transition-delay: 0.45s; }

/* ---------- Contenu qui défile sous le cadre ---------- */
main { padding-top: var(--cadre-plein); }   /* hauteur pleine : le cadre se réduit au même rythme que la page défile, sans saut */
.bloc { position: relative; padding: clamp(3rem, 8vh, 6rem) var(--marge); background: var(--page); color: var(--page-texte); }
.bloc-alt { background: var(--page-alt); }
.bloc :focus-visible { outline-color: var(--accent); }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(1.2rem, 3vh, 2rem); }
.page .surtitre { color: var(--page-doux); }
#autoconso .titre-section { font-size: clamp(2rem, 4vw, 3.5rem); overflow-wrap: anywhere; }   /* « autoconsommation » est un mot long, dans une colonne étroite */
.titre-section { font-family: var(--titres); font-stretch: 68%; font-weight: 800; text-transform: uppercase; line-height: 0.95; letter-spacing: -0.006em; font-size: clamp(2.2rem, 5.2vw, 4.6rem); text-wrap: balance; max-width: 18em; }
.titre-moyen { font-family: var(--titres); font-stretch: 72%; font-weight: 800; text-transform: uppercase; line-height: 1; font-size: clamp(1.5rem, 2.8vw, 2.4rem); text-wrap: balance; margin: 0.5rem 0 0.9rem; }
.chapeau { max-width: 40em; font-size: clamp(1.05rem, 1.5vw, 1.4rem); line-height: 1.45; color: var(--page-texte); text-wrap: pretty; }
.bloc .texte { text-shadow: none; color: var(--page-doux); max-width: 36em; }
.bloc .mention { color: var(--page-doux); text-shadow: none; }

.etapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.8rem, 2vw, 1.6rem); margin-top: 0.6rem; }
.carte { padding: clamp(1.1rem, 2vw, 1.7rem); background: var(--carte); border: 1px solid var(--page-trait); border-radius: var(--rayon); display: flex; flex-direction: column; gap: 0.6rem; }
.carte h3 { font-family: var(--titres); font-stretch: 72%; font-weight: 800; text-transform: uppercase; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1; }
.carte p:last-child { color: var(--page-doux); }
.carte-num { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em; color: var(--accent-texte); }
/* Photos de la scène 3D qui accompagnent les textes de la page. */
.photo { margin: 0; position: relative; aspect-ratio: 8 / 5; border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--page-trait); background: var(--nuit); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.js:not(.statique) .revele:not(.vu) .photo img { transform: scale(1.08); }   /* léger zoom arrière à l'apparition */
.carte .photo { margin: calc(-1 * clamp(1.1rem, 2vw, 1.7rem)) calc(-1 * clamp(1.1rem, 2vw, 1.7rem)) 0.4rem; border: 0; border-radius: 0; border-bottom: 1px solid var(--page-trait); aspect-ratio: 16 / 9; }
.carte:hover .photo img, .photo:hover img { transform: scale(1.04); }
.carte { overflow: hidden; }
.deux .photo { margin-bottom: 1.1rem; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 5rem); margin-top: 0.8rem; }
.pastilles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pastilles li { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.55em 1em; border: 1px solid var(--page-trait); border-radius: 0; }
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 2.6rem); margin-top: 1rem; }
.chiffres li { border-top: 2px solid var(--accent); padding-top: 0.8rem; }
.chiffre { font-family: var(--titres); font-stretch: 62%; font-weight: 800; font-size: clamp(2.6rem, 6vw, 5.6rem); line-height: 0.9; white-space: nowrap; }
.chiffre-prefixe { font-size: 0.5em; vertical-align: 0.42em; color: var(--accent-texte); }
.chiffre-unite { font-size: 0.32em; letter-spacing: 0.02em; color: var(--accent-texte); }
.chiffre-legende { margin-top: 0.5rem; max-width: 15em; font-size: 0.95em; color: var(--page-doux); }

/* Tarifs */
.formules { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(0.8rem, 1.6vw, 1.4rem); align-items: stretch; margin-top: 0.6rem; }
.formule { position: relative; padding: clamp(1.1rem, 1.8vw, 1.6rem); display: flex; flex-direction: column; gap: 0.8rem; background: var(--carte); border: 1px solid var(--page-trait); border-radius: var(--rayon); }
.formule h3 { font-family: var(--mono); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-texte); }
.formule-forte { border: 2px solid var(--accent); box-shadow: 6px 6px 0 var(--accent); }
.formule-badge { position: absolute; top: -0.8rem; left: 1.2rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; background: var(--accent); color: #1a0e06; padding: 0.35em 0.9em; border-radius: 0; }
.prix { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3em; font-size: 0.9rem; color: var(--page-doux); }
.prix b { font-family: var(--titres); font-stretch: 66%; font-weight: 800; font-size: clamp(2.2rem, 3.4vw, 3.2rem); line-height: 1; color: var(--page-texte); white-space: nowrap; }
.prix-unite { flex-basis: 100%; }
.formule-desc { color: var(--page-doux); font-size: 0.95rem; min-height: 4.2em; }
.inclus { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.92rem; margin-bottom: 0.6rem; flex: 1; }
.inclus li { display: flex; gap: 0.6em; }
.inclus li::before { content: '✓'; color: var(--accent-texte); font-weight: 700; flex: none; }
.formule .bouton { align-self: flex-start; color: var(--page-texte); }
.formule .bouton:hover { background: var(--accent); color: #1a0e06; box-shadow: 4px 4px 0 var(--page-texte); }
.formule .bouton-plein { color: #1a0e06; border-color: #1a0e06; }

/* Essai et contact */
.page-formulaire { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 36rem); gap: clamp(1.5rem, 5vw, 5rem); align-items: start; }
.page-formulaire > div { display: flex; flex-direction: column; gap: clamp(1rem, 2.4vh, 1.6rem); }
.contact-mail { font-family: var(--mono); font-size: clamp(0.95rem, 1.4vw, 1.2rem); }
.contact-mail a { text-decoration-color: var(--accent); text-underline-offset: 0.3em; }
.formulaire { padding: clamp(1.1rem, 2.2vw, 2rem); display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; background: var(--carte); border: 1px solid var(--page-trait); border-radius: var(--rayon); }
.champ { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.champ-large, .formulaire .bouton, .formulaire-etat { grid-column: 1 / -1; }
.champ label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--page-doux); }
.champ :is(input, textarea, select) {
  font: inherit; color: var(--page-texte); background: var(--champ-fond); border: 1px solid var(--page-trait); border-radius: 0; padding: 0.75em 0.9em; width: 100%; min-height: 46px; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.champ select option { color: #0d2843; background: #f6f1e8; }
.champ :is(input, textarea, select):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.champ [aria-invalid="true"] { border-color: #e5484d; }
.formulaire .bouton { justify-self: start; }
.formulaire-etat { min-height: 1.4em; font-size: 0.92rem; }
.formulaire-etat.erreur { color: #e5484d; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .formulaire-etat.erreur { color: #ff9a8f; } }
:root[data-theme="dark"] .formulaire-etat.erreur { color: #ff9a8f; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Révélations au défilement */
.js:not(.statique) .revele { opacity: 0; transform: translateY(34px); transition: opacity 0.9s ease, transform 1.1s var(--ease); transition-delay: var(--delai, 0s); }
.js:not(.statique) .revele.vu { opacity: 1; transform: none; }
.etapes > :nth-child(2), .chiffres > :nth-child(2), .formules > :nth-child(2) { --delai: 0.08s; } .etapes > :nth-child(3), .chiffres > :nth-child(3), .formules > :nth-child(3) { --delai: 0.16s; } .chiffres > :nth-child(4), .formules > :nth-child(4) { --delai: 0.24s; }

/* Pied de page */
.pied { position: relative; padding: 2.2rem var(--marge) 2.4rem; display: grid; grid-template-columns: auto 1fr; gap: 1.2rem 3rem; align-items: center; background: #05101c; border-top: 1px solid rgba(255, 255, 255, 0.14); color: var(--creme); }
.pied nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.8rem; justify-content: flex-end; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.pied nav a { text-decoration: none; padding: 0.7em 0; position: relative; }
.pied nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0.45em; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform 0.45s var(--ease); }
.pied nav a:hover::after, .pied nav a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.pied-cta { color: var(--soleil); }
.pied-legal { grid-column: 1 / -1; font-size: 0.8rem; color: rgba(246, 241, 232, 0.78); max-width: 62em; }

/* Réglage de qualité du rendu (dans le pied de page) */
.qualite { display: none; }
.js:not(.statique) .qualite {
  grid-column: 1 / -1; justify-self: start; display: flex; align-items: center; gap: 0.15rem; padding: 0.2rem 0.3rem 0.2rem 0.8rem; flex-wrap: wrap;
  border-radius: 0; border: 1px solid rgba(255, 255, 255, 0.22); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--creme);
}
.qualite-titre { margin-right: 0.3rem; color: rgba(246, 241, 232, 0.8); }
.qualite button { padding: 0.5em 0.8em; border-radius: 0; min-height: 36px; letter-spacing: inherit; text-transform: inherit; }
.qualite button[aria-pressed="true"] { background: var(--soleil); color: #1a0e06; }
.qualite-stats { margin-left: 0.4rem; padding-right: 0.6rem; color: var(--soleil); white-space: nowrap; }

/* ---------- Version statique : sans JavaScript, sans WebGL ou avec « réduire les animations » ---------- */
:is(html:not(.js), html.statique) #scene, :is(html:not(.js), html.statique) .voile { display: none; }
:is(html:not(.js), html.statique) .diapo[data-fond] { background: linear-gradient(180deg, rgba(7, 24, 42, 0.5), rgba(7, 24, 42, 0.35)), var(--fond) center / cover no-repeat var(--nuit); }
[data-fond="hero"] { --fond: url('../assets/fonds/fond-hero.jpg'); }
[data-fond="site"] { --fond: url('../assets/fonds/fond-site.jpg'); }
[data-fond="methode"] { --fond: url('../assets/fonds/fond-methode.jpg'); }
[data-fond="ciel"] { --fond: url('../assets/fonds/fond-ciel.jpg'); }
[data-fond="contact"] { --fond: url('../assets/fonds/fond-contact.jpg'); }
html.statique .cmd-pause { display: none; }
html.statique .prechargeur img { animation: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* ---------- Écrans étroits ---------- */
@media (max-width: 900px) {
  .etapes, .deux { grid-template-columns: 1fr; }
  .formules { grid-template-columns: repeat(2, 1fr); }
  .chiffres { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; }
  .page-formulaire { grid-template-columns: 1fr; }
  .pied { grid-template-columns: 1fr; }
  .pied nav { justify-content: flex-start; }
  .formule-desc { min-height: 0; }
  .hud { width: min(15rem, 44vw); }
  .hud .mention { display: none; }
}
@media (max-width: 700px) {
  /* Cadre étroit : la vue « productible » ne garde que le chiffre. */
  .diapo { flex-direction: column; justify-content: flex-end; align-items: flex-start; }
  .hud { position: absolute; top: 4.4rem; right: var(--marge); width: auto; padding: 0.5rem 0.8rem; gap: 0.1rem; }
  .hud-tete, .hud-courbe, .hud-puissance, .hud-suivi .mention { display: none; }
  .hud-suivi li:nth-child(n+4) { display: none; }
  .hud-suivi .suivi-ha { display: none; }
  .hud-suivi .suivi li { grid-template-columns: 4.4em minmax(0, 1fr); }
  .hud-valeurs { grid-template-columns: 1fr; }
  .diapo .legende, .diapo .fiche { display: none; }
}
@media (max-width: 560px) {
  .nav-cta { display: none; }
  .menu-bouton-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .menu-bouton { padding: 0.55em 0.9em; }
  .formulaire { grid-template-columns: 1fr; }
  .formules { grid-template-columns: 1fr; }
  .qualite-titre { display: none; }
  .commandes { bottom: 0.8rem; }
}
@media (max-height: 480px) {
  .diapo .texte { display: none; }
}

/* ---------- Utilitaires ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* ?nu : scène seule, plein écran, sans interface (captures des visuels). */
.nu { --cadre-plein: 100svh; --cadre-min: 100svh; --k: 0 !important; }
.nu body > *:not(.cadre) { opacity: 0 !important; }
.nu .cadre > *:not(#scene) { display: none !important; }
.nu main { display: none; }
/* ?capture : pas de rideau ni de transitions (captures automatiques). */
.capture .prechargeur { display: none !important; }
.capture *, .capture *::before, .capture *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }

/* ---------- Bouton de thème (clair / nuit) ---------- */
.theme-bouton { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--creme); border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(7, 24, 42, 0.7); border-radius: 0; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.theme-bouton:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--creme); }
.theme-bouton svg { width: 20px; height: 20px; }
.theme-bouton .i-soleil { display: none; }
html[data-theme-effectif="dark"] .theme-bouton .i-soleil { display: block; }
html[data-theme-effectif="dark"] .theme-bouton .i-lune { display: none; }
