/*
  Savoiesite v4 : carte topographique de nuit. Grille stricte, filets fins, angles droits partout.
  Un seul accent (braise), une seule inversion claire (le prix).
*/
:root {
  --nuit: #0b1018;
  --encre: #111824;
  --trait: rgba(232, 237, 242, 0.13);
  --glacier: #e8edf2;
  --brume: #8d9bad;
  --braise: #ff7a2e;
  --titre: "Archivo", "Arial Black", system-ui, sans-serif;
  --texte: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --g: max(20px, env(safe-area-inset-left, 0px));
  --d: max(20px, env(safe-area-inset-right, 0px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html { background: var(--nuit); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nuit); color: var(--glacier); font: 400 17px/1.6 var(--texte); overflow-x: clip; }
h1, h2, h3 { margin: 0; font-family: var(--titre); font-weight: 800; font-stretch: 125%; letter-spacing: -0.025em; line-height: 0.95; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--braise); outline-offset: 3px; }
::selection { background: var(--braise); color: var(--nuit); }

.cadre { width: 100%; max-width: 1320px; margin: 0 auto; padding-left: var(--g); padding-right: var(--d); }
.mono { font: 500 12px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brume); }
.mono b { color: var(--braise); font-weight: 500; }

.btn { display: inline-flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 24px; font: 700 15px/1 var(--texte); font-stretch: 112%; letter-spacing: 0.01em; text-decoration: none; border: 1px solid var(--glacier); background: transparent; color: var(--glacier); cursor: pointer; transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease); }
.btn .fl { display: inline-block; transition: transform 0.35s var(--ease); }
.btn:hover .fl { transform: translateX(5px); }
.btn.plein { background: var(--braise); border-color: var(--braise); color: var(--nuit); }
.btn.plein:hover { background: var(--glacier); border-color: var(--glacier); }
.btn:not(.plein):hover { background: var(--glacier); color: var(--nuit); }

/* ---------- Barre ---------- */
.barre { position: fixed; inset: 0 0 auto; z-index: 60; padding-top: env(safe-area-inset-top, 0px); transition: background 0.4s var(--ease), border-color 0.4s var(--ease); border-bottom: 1px solid transparent; }
.barre.pleine { background: rgba(11, 16, 24, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-color: var(--trait); }
.barre .cadre { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font: 800 18px/1 var(--titre); font-stretch: 125%; letter-spacing: -0.01em; text-decoration: none; text-transform: uppercase; }
.logo svg { width: 22px; height: 22px; flex: none; }
.barre nav { display: flex; gap: 28px; }
.barre nav a { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--brume); transition: color 0.25s; }
.barre nav a:hover { color: var(--glacier); }
.barre .btn { min-height: 42px; padding: 0 18px; font-size: 13px; white-space: nowrap; }

/* ---------- Altimètre ---------- */
.alti { position: fixed; z-index: 55; right: var(--d); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); display: flex; align-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brume); pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity .5s var(--ease); }
.alti .jauge { width: 54px; height: 1px; background: rgba(232, 237, 242, 0.3); position: relative; }
.alti .jauge i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--braise); }
.alti strong { color: var(--glacier); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Ouverture ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-bottom: 1px solid var(--trait); }
#topo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: var(--nuit); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(11, 16, 24, 0.55) 0%, rgba(11, 16, 24, 0) 30%, rgba(11, 16, 24, 0) 55%, rgba(11, 16, 24, 0.85) 100%); }
.hero .cadre { position: relative; z-index: 2; padding-top: 120px; padding-bottom: clamp(28px, 5vw, 56px); }
.hero .meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-bottom: 22px; margin-bottom: clamp(20px, 3vw, 34px); border-bottom: 1px solid var(--trait); }
.hero h1 { font-size: clamp(2.7rem, 8.6vw, 9.2rem); max-width: 11.5ch; }
.hero h1 .feu { color: var(--braise); }
.hero .bas { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px 48px; margin-top: clamp(26px, 4vw, 48px); }
.hero .bas p { max-width: 34em; color: #b9c4d1; font-size: clamp(1rem, 1.6vw, 1.2rem); }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Avant / après ---------- */
.avap { position: relative; height: 320svh; }
.avap .scene { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 68px; overflow: hidden; }
.avap .tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 30px; margin-bottom: clamp(14px, 2.5vh, 26px); }
.avap h2 { font-size: clamp(1.9rem, 4.6vw, 4.4rem); max-width: 16ch; }
.compare { position: relative; width: 100%; max-width: min(1320px, calc((100svh - 300px) * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--trait); overflow: hidden; touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none; }
.compare video, .compare .apres-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.avant { position: absolute; inset: 0; clip-path: inset(0 0 0 0); will-change: clip-path; }
.poignee { position: absolute; top: 0; bottom: 0; left: 100%; width: 0; z-index: 3; pointer-events: none; }
.poignee::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--braise); box-shadow: 0 0 24px rgba(255, 122, 46, 0.6); }
.poignee span { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; background: var(--braise); color: var(--nuit); font: 700 22px/1 var(--texte); }
.etiq { position: absolute; top: 14px; z-index: 2; padding: 7px 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; background: var(--nuit); color: var(--glacier); border: 1px solid var(--trait); }
.etiq.g { left: 14px; }
.etiq.d { right: 14px; color: var(--braise); }
.preuves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; max-width: min(1320px, calc((100svh - 300px) * 16 / 9)); margin: clamp(14px, 2.5vh, 24px) auto 0; border-top: 1px solid var(--trait); }
.preuves div { padding: 14px 18px 0 0; opacity: 0.55; transition: opacity 0.6s var(--ease); }
.preuves div + div { padding-left: 18px; border-left: 1px solid var(--trait); }
.preuves div.on { opacity: 1; }
.preuves strong { display: block; font: 700 15px/1.25 var(--texte); font-stretch: 112%; }
.preuves div.on strong { color: var(--glacier); }
.preuves p { margin-top: 4px; font-size: 14px; color: var(--brume); }
.note-demo { margin-top: 12px; text-align: center; }

/* Le vieux site (maquette « avant »), dessiné à 1280 × 720 puis mis à l'échelle */
.vieux { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; background: #c9c9c9 repeating-linear-gradient(45deg, #c4c4c4 0 2px, #cdcdcd 2px 6px); font-family: "Times New Roman", Times, serif; color: #000; overflow: hidden; }
.vieux .page { width: 980px; margin: 0 auto; height: 100%; background: #fffdf2; border-left: 3px ridge #999; border-right: 3px ridge #999; }
.vieux .ban { height: 120px; display: flex; align-items: center; justify-content: center; flex-direction: column; background: linear-gradient(180deg, #3b5ea8, #1c2f6b); color: #ffe66b; border-bottom: 4px double #ffe66b; }
.vieux .ban b { font: italic 700 54px/1 "Times New Roman", serif; text-shadow: 3px 3px 0 #000; letter-spacing: 2px; }
.vieux .ban small { margin-top: 6px; font: 18px "Comic Sans MS", "Comic Sans", cursive; color: #fff; }
.vieux .defil { height: 30px; overflow: hidden; white-space: nowrap; background: #ffff00; color: #c00; font: 700 18px/30px Arial, sans-serif; border-bottom: 1px solid #999; }
.vieux .defil span { display: inline-block; padding-left: 100%; animation: defil 16s linear infinite; }
@keyframes defil { to { transform: translateX(-100%); } }
.vieux .corps { display: grid; grid-template-columns: 190px 1fr; height: calc(100% - 150px); }
.vieux .menu { background: #e3e8f5; border-right: 2px solid #9aa6c8; padding: 18px 12px; font: 17px Verdana, sans-serif; }
.vieux .menu a { display: block; color: #00e; text-decoration: underline; margin-bottom: 14px; }
.vieux .menu a:nth-child(3) { color: #551a8b; }
.vieux .menu .compteur { margin-top: 30px; padding: 6px; font: 13px Verdana; background: #000; color: #0f0; text-align: center; }
.vieux .milieu { padding: 22px 34px; text-align: center; font-size: 19px; line-height: 1.35; }
.vieux .milieu h4 { margin: 0 0 10px; font: 700 34px "Comic Sans MS", "Comic Sans", cursive; color: #d40000; text-decoration: underline; }
.vieux .milieu .photo { width: 300px; height: 168px; margin: 12px auto; border: 4px outset #ccc; background: url("media/braise-petit.jpg") center / cover; image-rendering: pixelated; filter: saturate(0.55) contrast(0.9) brightness(1.05); }
.vieux .milieu .clignote { color: #f00; font: 700 20px Arial; animation: cligne 1s steps(2) infinite; }
@keyframes cligne { 50% { opacity: 0; } }
.vieux .milieu .pied { margin-top: 16px; font: 13px Arial; color: #555; }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 13vw, 180px) 0; border-bottom: 1px solid var(--trait); }
.section .tete { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 20px 40px; align-items: start; }
.section h2 { font-size: clamp(2.3rem, 6.4vw, 6.6rem); }
.chapo { max-width: 34em; color: #b9c4d1; font-size: clamp(1.02rem, 1.5vw, 1.18rem); margin-top: 26px; }

.offre { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: clamp(50px, 7vw, 90px); border-top: 1px solid var(--trait); }
.offre article { padding: 26px 26px 10px 0; position: relative; }
.offre article + article { padding-left: 26px; border-left: 1px solid var(--trait); }
.offre article::before { content: ""; position: absolute; top: -1px; left: 0; width: 0; height: 2px; background: var(--braise); transition: width 0.7s var(--ease); }
.offre article:hover::before { width: 100%; }
.offre h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); margin-top: 34px; font-stretch: 112%; letter-spacing: -0.015em; }
.offre p { margin-top: 12px; color: var(--brume); font-size: 16px; }

.prix { background: var(--glacier); color: var(--nuit); border-bottom: 0; }
.prix .mono { color: #5b6878; }
.prix .ligne { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 30px 60px; }
.prix .chiffre { font: 800 clamp(6rem, 25vw, 22rem)/0.8 var(--titre); font-stretch: 125%; letter-spacing: -0.05em; margin-top: 30px; }
.prix .chiffre sup { font-size: 0.32em; vertical-align: top; margin-left: 0.06em; letter-spacing: 0; position: relative; top: 0.12em; }
.prix .apartir { font: 500 13px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; display: block; color: #5b6878; }
.prix p { max-width: 24em; font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: #2d3846; }
.prix .btn { margin-top: 24px; border-color: var(--nuit); color: var(--nuit); }
.prix .btn:hover { background: var(--nuit); color: var(--glacier); }

.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(50px, 7vw, 90px); counter-reset: e; }
.etapes li { list-style: none; padding: 0 28px 0 0; border-top: 1px solid var(--trait); padding-top: 22px; }
.etapes li + li { padding-left: 28px; }
.etapes ol { margin: 0; padding: 0; }
.etapes .num { font: 800 clamp(3.6rem, 7vw, 6rem)/0.85 var(--titre); font-stretch: 125%; color: transparent; -webkit-text-stroke: 1px var(--brume); }
.etapes li:hover .num { color: var(--braise); -webkit-text-stroke-color: var(--braise); }
.etapes h3 { margin-top: 22px; font-size: 1.5rem; font-stretch: 112%; }
.etapes p { margin-top: 10px; color: var(--brume); }
.etapes .num { transition: color 0.4s var(--ease), -webkit-text-stroke-color 0.4s var(--ease); }

.equipe { margin-top: clamp(40px, 6vw, 70px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--trait); }
.equipe div { padding: 26px 20px 0 0; }
.equipe div + div { padding-left: 20px; border-left: 1px solid var(--trait); }
.equipe strong { display: block; font: 800 clamp(2.2rem, 5.6vw, 5rem)/0.9 var(--titre); font-stretch: 125%; letter-spacing: -0.03em; }
.equipe span { display: block; margin-top: 12px; }

/* ---------- Formulaire ---------- */
.contact h2 { font-size: clamp(2.2rem, 4.8vw, 5.2rem); }
.contact .grille { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 40px 70px; align-items: start; }
form { display: grid; gap: 26px; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.champ { display: grid; gap: 10px; }
.champ label, legend { font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--brume); }
input[type="text"], textarea { width: 100%; padding: 14px 0; background: transparent; color: var(--glacier); border: 0; border-bottom: 1px solid rgba(232, 237, 242, 0.3); font: 400 19px/1.4 var(--texte); transition: border-color 0.3s; }
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #566476; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--braise); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
legend { padding: 0; margin-bottom: 12px; }
.choix { position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choix span { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border: 1px solid rgba(232, 237, 242, 0.3); font-weight: 600; transition: border-color 0.25s, background 0.25s, color 0.25s; }
.choix span::before { content: ""; width: 9px; height: 9px; border: 1px solid currentColor; }
.choix input:checked + span { border-color: var(--braise); color: var(--braise); }
.choix input:checked + span::before { background: var(--braise); border-color: var(--braise); }
.choix input:focus-visible + span { outline: 2px solid var(--braise); outline-offset: 3px; }
.etat { min-height: 1.4em; color: var(--braise); font-size: 15px; }
.petit { font-size: 14px; color: var(--brume); }
.coord { margin-top: 34px; display: grid; gap: 18px; }
.coord div { border-top: 1px solid var(--trait); padding-top: 14px; }
.coord p { margin-top: 6px; font-size: 18px; }

footer { padding: 70px 0 calc(env(safe-area-inset-bottom, 0px) + 80px); }
footer .grand { font: 800 clamp(3rem, 12.5vw, 13rem)/0.8 var(--titre); font-stretch: 125%; letter-spacing: -0.05em; text-transform: uppercase; color: transparent; -webkit-text-stroke: 1px rgba(232, 237, 242, 0.28); white-space: nowrap; }
footer .lignes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 40px; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--trait); color: var(--brume); font-size: 15px; }

/* ---------- Apparitions (seulement si JS) ---------- */
.js .rv { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--dl, 0s); }
.js .rv.vu { opacity: 1; transform: none; }
.js .ligne-titre { display: block; overflow: hidden; }
.js .ligne-titre > span { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: var(--dl, 0s); }
.js .vu .ligne-titre > span, .js .ligne-titre.vu > span { transform: none; }

@media (max-width: 900px) {
  .barre nav { display: none; }
  .section .tete { grid-template-columns: 1fr; }
  .offre { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offre article:nth-child(3) { padding-left: 0; border-left: 0; }
  .offre article:nth-child(n + 3) { border-top: 1px solid var(--trait); }
  .contact .grille { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero .bas { grid-template-columns: 1fr; }
  .avap { height: 260svh; }
  .avap .scene { justify-content: flex-start; padding-top: 92px; }
  .compare { max-width: 100%; aspect-ratio: 4 / 3.4; }
  .etiq { top: 8px; padding: 5px 7px; font-size: 10px; }
  .etiq.g { left: 8px; } .etiq.d { right: 8px; }
  .poignee span { width: 34px; height: 34px; font-size: 13px; }
  .preuves { grid-template-columns: 1fr; max-width: 100%; }
  .preuves div, .preuves div + div { padding: 12px 0 0; border-left: 0; }
  .preuves div + div { border-top: 1px solid var(--trait); margin-top: 12px; }
  .offre { grid-template-columns: 1fr; }
  .offre article, .offre article + article { padding: 24px 0 8px; border-left: 0; }
  .offre article + article { border-top: 1px solid var(--trait); }
  .etapes { grid-template-columns: 1fr; }
  .etapes li, .etapes li + li { padding: 22px 0 26px; }
  .equipe { grid-template-columns: 1fr; }
  .equipe div, .equipe div + div { padding: 22px 0; border-left: 0; }
  .equipe div + div { border-top: 1px solid var(--trait); }
  .prix .ligne { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  footer .lignes { grid-template-columns: 1fr; }
  .alti { display: none; }
}
