/* ==========================================================================
   Ma Conciergerie en Ligne — « Le plan annoté »
   Feuille unique, sans dépendance. Polices auto-hébergées (sous-ensemble latin).
   ========================================================================== */

/* 1. Polices ------------------------------------------------------------- */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens -------------------------------------------------------------- */

:root {
  /* Couleur — l'ambre et le vert sont sémantiques (incident / résolu) */
  --papier: #f4f5f2;
  --craie: #ffffff;
  --encre: #121c26;
  --encre-doux: #414e5c;
  --bleu-plan: #1b4b73;
  --ambre: #b4691a;
  --ambre-texte: #8a4f12;
  --vert: #2c6a4a;

  --trait: rgba(18, 28, 38, 0.16);
  --trait-fort: rgba(18, 28, 38, 0.42);
  --trait-plan: rgba(27, 75, 115, 0.55);

  /* Typographie */
  --titre: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --texte: "Newsreader", Georgia, "Times New Roman", serif;

  /* Structure */
  --r: 2px;
  --wrap: 1200px;
  --gouttiere: 24px;
  --entete-h: 68px;
  --rythme: clamp(56px, 7.5vw, 104px);
}

/* 3. Base ---------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--titre);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--bleu-plan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--encre);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
output {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--bleu-plan);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background: var(--bleu-plan);
  color: var(--craie);
}

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

.evitement {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--encre);
  color: var(--craie);
  font-family: var(--titre);
  font-size: 15px;
  padding: 10px 16px;
  border-radius: var(--r);
  text-decoration: none;
  transition: top 140ms ease;
}

.evitement:focus {
  top: 12px;
  color: var(--craie);
}

/* 4. Primitives de mise en page ------------------------------------------ */

.wrap {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

.bande {
  padding-block: var(--rythme);
  scroll-margin-top: calc(var(--entete-h) + 16px);
}

.bande + .bande {
  border-top: 1px solid var(--trait);
}

.bande-titre {
  max-width: 62ch;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

.bande-titre h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 700;
}

.bande-titre p {
  margin-top: 14px;
  color: var(--encre-doux);
  max-width: 60ch;
}

.mesure {
  max-width: 66ch;
}

/* 5. Boutons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--titre);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 15px 22px;
  min-height: 48px;
  background: var(--encre);
  color: var(--craie);
  border: 1px solid var(--encre);
  border-radius: var(--r);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.btn:hover {
  background: var(--bleu-plan);
  border-color: var(--bleu-plan);
  color: var(--craie);
}

.btn svg {
  flex: none;
  width: 19px;
  height: 19px;
}

.btn-ligne {
  background: transparent;
  color: var(--encre);
  border-color: var(--trait-fort);
}

.btn-ligne:hover {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--craie);
}

.btn-clair {
  background: var(--craie);
  color: var(--encre);
  border-color: var(--craie);
}

.btn-clair:hover {
  background: var(--papier);
  border-color: var(--papier);
  color: var(--encre);
}

/* 6. En-tête ------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
}

.entete-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--entete-h);
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--titre);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--encre);
  text-decoration: none;
  margin-right: auto;
}

.marque:hover {
  color: var(--bleu-plan);
}

.marque svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 500;
  color: var(--encre-doux);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--r);
  position: relative;
}

.nav a:hover {
  color: var(--encre);
  background: rgba(18, 28, 38, 0.05);
}

/* Le bouton dans la nav doit garder son contraste : .nav a ne doit pas le gagner. */
.nav a.btn,
.nav a.btn:hover {
  color: var(--craie);
}

.nav a.btn:hover {
  background: var(--bleu-plan);
  border-color: var(--bleu-plan);
}

.nav a[aria-current="true"] {
  color: var(--encre);
}

.nav a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  background: var(--bleu-plan);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--encre);
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.5px;
  background: var(--encre);
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.entete .btn {
  padding: 11px 16px;
  min-height: 42px;
  font-size: 15px;
}

/* 7. Hero ---------------------------------------------------------------- */

.hero {
  padding-block: clamp(36px, 4.5vw, 64px) var(--rythme);
}

.hero-titre {
  font-size: clamp(34px, 6.4vw, 76px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  margin-bottom: clamp(28px, 3.4vw, 48px);
}

.hero-titre span {
  display: block;
}

.hero-grille {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

.hero-sous {
  margin-top: 0;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--encre-doux);
  max-width: 46ch;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-preuve {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--trait);
  font-size: 16px;
  line-height: 1.55;
  color: var(--encre-doux);
  max-width: 48ch;
}

.hero-preuve strong {
  font-family: var(--titre);
  font-weight: 600;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
}

/* 8. Planche (plan annoté) ----------------------------------------------- */

.planche {
  background: var(--craie);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
  padding: 18px 18px 0;
}

.planche svg {
  width: 100%;
  height: auto;
}

/* Traits du plan */
.plan .mur {
  fill: none;
  stroke: var(--encre);
  stroke-width: 2.4;
  stroke-linecap: square;
}

.plan .cloison {
  fill: none;
  stroke: var(--encre);
  stroke-width: 1.6;
}

.plan .detail {
  fill: none;
  stroke: var(--trait-plan);
  stroke-width: 1.1;
}

.plan .fenetre {
  stroke: var(--bleu-plan);
  stroke-width: 1.4;
  fill: none;
}

.plan .porte {
  fill: none;
  stroke: var(--trait-plan);
  stroke-width: 1;
}

.plan .cote {
  stroke: var(--trait-plan);
  stroke-width: 1;
  fill: none;
}

.plan .piece {
  font-family: var(--titre);
  font-size: 14px;
  font-weight: 500;
  fill: var(--encre-doux);
  text-anchor: middle;
  letter-spacing: -0.01em;
}

.plan .cote-txt {
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 500;
  fill: var(--bleu-plan);
  text-anchor: middle;
  font-variant-numeric: tabular-nums;
}

/* Repères A–E : liens vers la légende */
.repere {
  cursor: pointer;
  text-decoration: none;
}

.repere circle {
  fill: var(--craie);
  stroke: var(--encre);
  stroke-width: 1.6;
  transition: fill 130ms ease, stroke 130ms ease;
}

.repere text {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 700;
  fill: var(--encre);
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  transition: fill 130ms ease;
}

.repere:hover circle,
.repere:focus-visible circle {
  fill: var(--bleu-plan);
  stroke: var(--bleu-plan);
}

.repere:hover text,
.repere:focus-visible text {
  fill: var(--craie);
}

.repere:focus-visible {
  outline: none;
}

.repere:focus-visible circle {
  stroke-width: 3;
}

/* Cartouche : bloc de titre de la planche */
.cartouche {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--trait-fort);
  margin-top: 14px;
}

.cartouche-cell {
  padding: 12px 14px 14px;
  border-left: 1px solid var(--trait);
}

.cartouche-cell:first-child {
  border-left: 0;
  padding-left: 0;
}

.cartouche-cle {
  display: block;
  font-family: var(--titre);
  font-size: 12px;
  font-weight: 500;
  color: var(--encre-doux);
  line-height: 1.3;
}

.cartouche-val {
  display: block;
  margin-top: 4px;
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--encre);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.cartouche-note {
  grid-column: 1 / -1;
  border-top: 1px solid var(--trait);
  padding: 10px 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--encre-doux);
}

/* 9. Légende ------------------------------------------------------------- */

.legende {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
}

.entree {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  background: var(--craie);
  border: 1px solid var(--trait);
  border-radius: var(--r);
  padding: 26px 26px 24px;
  scroll-margin-top: calc(var(--entete-h) + 24px);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.entree > p:not(.entree-ligne) {
  margin-bottom: 18px;
}

.entree--d {
  grid-column: span 4;
}

.entree:target {
  border-color: var(--bleu-plan);
  box-shadow: inset 3px 0 0 var(--bleu-plan);
}

.entree-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.repere-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1.6px solid var(--encre);
  border-radius: 50%;
  font-family: var(--titre);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--encre);
  background: var(--craie);
}

.entree h3 {
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.entree p {
  color: var(--encre-doux);
  font-size: 17px;
  line-height: 1.6;
}

.entree-ligne {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--trait);
  font-family: var(--titre);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--encre-doux);
  letter-spacing: -0.005em;
}

.point {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bleu-plan);
}

.point--vert {
  background: var(--vert);
}

.point--ambre {
  background: var(--ambre);
}

.entree--d .entree-colonnes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 18px;
}

/* 10. Périmètre ---------------------------------------------------------- */

.perimetre {
  background: var(--craie);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.perimetre-col {
  padding: clamp(24px, 3vw, 36px);
}

.perimetre-col + .perimetre-col {
  border-left: 1px solid var(--trait-fort);
}

.perimetre-col h3 {
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 600;
  margin-bottom: 20px;
}

.perimetre-liste li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding-block: 9px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--encre-doux);
  border-top: 1px solid var(--trait);
}

.perimetre-liste li:first-child {
  border-top: 0;
  padding-top: 0;
}

.perimetre-liste svg {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

.perimetre-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--trait-fort);
  font-size: 16px;
  line-height: 1.55;
  color: var(--encre-doux);
}

/* 11. Méthode ------------------------------------------------------------ */

.methode {
  position: relative;
  display: grid;
  gap: 0;
  max-width: 78ch;
}

.methode::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 20px;
  bottom: 28px;
  width: 1px;
  background: var(--trait-fort);
}

.etape {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 22px;
  padding-bottom: 34px;
  position: relative;
}

.etape:last-child {
  padding-bottom: 0;
}

.etape-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.6px solid var(--encre);
  border-radius: 50%;
  background: var(--papier);
  font-family: var(--titre);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.etape h3 {
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 600;
  margin-bottom: 8px;
  padding-top: 6px;
}

.etape p {
  color: var(--encre-doux);
  font-size: 17px;
  line-height: 1.6;
  max-width: 58ch;
}

/* 12. Tarif + simulateur ------------------------------------------------- */

.tarif-grille {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 3.5vw, 52px);
  align-items: start;
}

.tarif-chiffre {
  font-family: var(--titre);
  font-size: clamp(72px, 10vw, 124px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--encre);
}

.tarif-chiffre small {
  display: block;
  font-size: clamp(18px, 1.8vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 14px;
  color: var(--encre-doux);
}

.tarif-inclus {
  margin-top: 28px;
  border-top: 1px solid var(--trait-fort);
}

.tarif-inclus li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  padding-block: 10px;
  border-bottom: 1px solid var(--trait);
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--encre-doux);
}

.tarif-inclus svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
}

.tarif-note {
  margin-top: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--encre-doux);
}

.sim {
  background: var(--craie);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
  padding: clamp(22px, 2.6vw, 32px);
}

.sim h3 {
  font-size: clamp(19px, 1.8vw, 23px);
  font-weight: 600;
}

.sim-intro {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre-doux);
}

.sim-champ {
  margin-top: 24px;
}

.sim-champ-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.sim-champ label {
  font-family: var(--titre);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--encre-doux);
}

.sim-nombre {
  width: 104px;
  padding: 7px 10px;
  text-align: right;
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--papier);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
}

.sim-nombre:focus-visible {
  outline: 2px solid var(--bleu-plan);
  outline-offset: 1px;
}

/* Curseurs */
.sim input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.sim input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--trait-fort);
}

.sim input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--trait-fort);
}

.sim input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--craie);
  border: 2px solid var(--encre);
}

.sim input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--craie);
  border: 2px solid var(--encre);
}

.sim input[type="range"]:focus-visible {
  outline: 2px solid var(--bleu-plan);
  outline-offset: 4px;
}

.sim-resultats {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--trait-fort);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sim-resultat-cle {
  display: block;
  font-family: var(--titre);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--encre-doux);
  line-height: 1.3;
}

.sim-resultat-val {
  display: block;
  margin-top: 6px;
  font-family: var(--titre);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.sim-resultat--net .sim-resultat-val {
  color: var(--vert);
}

.sim-resultat--commission .sim-resultat-val {
  color: var(--ambre-texte);
}

.sim-mention {
  margin-top: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--encre-doux);
}

/* 13. Cartouche de preuve ------------------------------------------------ */

.preuve {
  background: var(--craie);
  border: 1px solid var(--trait-fort);
  border-radius: var(--r);
}

.preuve-grille {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.preuve-cell {
  padding: clamp(20px, 2.4vw, 28px);
  border-left: 1px solid var(--trait);
}

.preuve-cell:first-child {
  border-left: 0;
}

.preuve-cle {
  display: block;
  font-family: var(--titre);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--encre-doux);
}

.preuve-val {
  display: block;
  margin-top: 8px;
  font-family: var(--titre);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.preuve-val small {
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--encre-doux);
}

.preuve-texte {
  border-top: 1px solid var(--trait-fort);
  padding: clamp(20px, 2.4vw, 28px);
}

.preuve-texte p {
  color: var(--encre-doux);
  font-size: 17px;
  line-height: 1.6;
  max-width: 78ch;
}

/* 14. Questions ---------------------------------------------------------- */

.questions {
  max-width: 80ch;
  border-top: 1px solid var(--trait-fort);
}

.question {
  border-bottom: 1px solid var(--trait);
}

.question summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  cursor: pointer;
  font-family: var(--titre);
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.35;
  list-style: none;
}

.question summary::-webkit-details-marker {
  display: none;
}

.question summary:hover {
  color: var(--bleu-plan);
}

.question summary:focus-visible {
  outline: 2px solid var(--bleu-plan);
  outline-offset: 2px;
}

.question-icone {
  flex: none;
  position: relative;
  width: 16px;
  height: 16px;
  margin-left: auto;
}

.question-icone::before,
.question-icone::after {
  content: "";
  position: absolute;
  background: var(--encre);
  transition: transform 160ms ease, opacity 160ms ease;
}

.question-icone::before {
  left: 0;
  top: 7.5px;
  width: 16px;
  height: 1.5px;
}

.question-icone::after {
  left: 7.5px;
  top: 0;
  width: 1.5px;
  height: 16px;
}

.question[open] .question-icone::after {
  transform: rotate(90deg);
  opacity: 0;
}

.question-corps {
  padding: 0 40px 24px 0;
  color: var(--encre-doux);
  font-size: 17px;
  line-height: 1.65;
  max-width: 68ch;
}

.question-corps p + p {
  margin-top: 12px;
}

/* 15. CTA final ---------------------------------------------------------- */

.appel {
  background: var(--encre);
  color: var(--papier);
  border-top: 0;
}

.appel-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 3vw, 48px);
  align-items: center;
}

.appel h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700;
  color: var(--craie);
  max-width: 22ch;
}

.appel p {
  margin-top: 16px;
  color: rgba(244, 245, 242, 0.78);
  font-size: 17.5px;
  line-height: 1.6;
  max-width: 52ch;
}

.appel-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.appel-tel {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 500;
  color: rgba(244, 245, 242, 0.78);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.appel-tel:hover {
  color: var(--craie);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 16. Pied de page ------------------------------------------------------- */

.pied {
  border-top: 1px solid var(--trait);
  padding-block: 40px 48px;
}

.pied-grille {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
}

.pied h2 {
  font-family: var(--titre);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pied p {
  margin-top: 10px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--encre-doux);
  max-width: 40ch;
}

.pied-titre {
  font-family: var(--titre);
  font-size: 13px;
  font-weight: 600;
  color: var(--encre-doux);
  margin-bottom: 12px;
}

.pied-liens li + li {
  margin-top: 8px;
}

.pied-liens a {
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 500;
  color: var(--encre-doux);
  text-decoration: none;
}

.pied-liens a:hover {
  color: var(--encre);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pied-bas {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--trait);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--encre-doux);
}

/* 17. Pages annexes ------------------------------------------------------ */

.page-tete {
  padding-block: clamp(36px, 5vw, 64px) 28px;
  border-bottom: 1px solid var(--trait);
}

.page-tete h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-tete p {
  margin-top: 14px;
  color: var(--encre-doux);
  max-width: 62ch;
}

.retour {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--titre);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--encre-doux);
  text-decoration: none;
  margin-bottom: 22px;
}

.retour:hover {
  color: var(--encre);
}

.prose {
  max-width: 72ch;
  padding-block: clamp(32px, 4vw, 56px) var(--rythme);
}

.prose h2 {
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 14px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--encre-doux);
  margin-bottom: 14px;
}

.prose ul {
  margin-bottom: 16px;
}

.prose li {
  position: relative;
  padding-left: 20px;
  color: var(--encre-doux);
  margin-bottom: 8px;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 1px;
  background: var(--trait-fort);
}

.prose strong {
  color: var(--encre);
  font-weight: 600;
}

.a-completer {
  display: inline-block;
  font-family: var(--titre);
  font-size: 13px;
  font-weight: 600;
  color: var(--ambre-texte);
  background: rgba(180, 105, 26, 0.1);
  border: 1px solid rgba(180, 105, 26, 0.35);
  border-radius: var(--r);
  padding: 2px 8px;
}

.encadre {
  background: var(--craie);
  border: 1px solid var(--trait-fort);
  border-left: 3px solid var(--ambre);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.encadre p {
  margin: 0;
  font-size: 16px;
}

/* 18. 404 ---------------------------------------------------------------- */

.perdu {
  padding-block: clamp(64px, 10vw, 140px);
}

.perdu-code {
  font-family: var(--titre);
  font-size: clamp(64px, 12vw, 140px);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--trait-fort);
  font-variant-numeric: tabular-nums;
}

.perdu h1 {
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  margin-top: 24px;
  max-width: 24ch;
}

.perdu p {
  margin-top: 16px;
  color: var(--encre-doux);
  max-width: 52ch;
}

.perdu-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 19. Animation : une seule séquence, au chargement ---------------------- */

@keyframes trace {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes apparait {
  to {
    opacity: 1;
  }
}

.plan .mur,
.plan .cloison {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: trace 900ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.plan .cloison {
  animation-delay: 220ms;
}

.plan .repere,
.plan .piece,
.plan .detail,
.plan .cote,
.plan .cote-txt,
.plan .fenetre,
.plan .porte {
  opacity: 0;
  animation: apparait 420ms ease-out 720ms forwards;
}

/* 20. Responsive --------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero-grille {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-texte {
    max-width: 62ch;
  }

  .planche {
    max-width: 680px;
  }

  .tarif-grille {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .preuve-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preuve-cell:nth-child(3) {
    border-left: 0;
  }

  .preuve-cell:nth-child(n + 3) {
    border-top: 1px solid var(--trait);
  }
}

@media (max-width: 900px) {
  .legende {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entree,
  .entree--d {
    grid-column: span 1;
  }

  .entree--d {
    grid-column: span 2;
  }

  .appel-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .pied-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --entete-h: 62px;
  }

  body {
    font-size: 17px;
  }

  .wrap {
    width: min(var(--wrap), 100% - 32px);
  }

  /* Navigation repliée */
  .nav-toggle {
    display: flex;
  }

  .entete .btn {
    display: none;
  }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--entete-h);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--papier);
    border-bottom: 1px solid var(--trait-fort);
    padding: 8px 16px 16px;
    display: none;
  }

  .entete.nav-ouverte .nav {
    display: flex;
  }

  .nav a {
    padding: 14px 8px;
    font-size: 17px;
    border-bottom: 1px solid var(--trait);
  }

  .nav a[aria-current="true"]::after {
    display: none;
  }

  .nav .btn-nav {
    display: inline-flex;
    margin-top: 14px;
    justify-content: center;
    background: var(--encre);
    border-color: var(--encre);
    color: var(--craie);
  }

  .nav .btn-nav:hover {
    background: var(--bleu-plan);
    border-color: var(--bleu-plan);
    color: var(--craie);
  }

  /* Plan : on garde les repères, on retire le détail illisible */
  .plan .detail,
  .plan .porte,
  .plan .cote,
  .plan .cote-txt {
    display: none;
  }

  .plan .piece {
    font-size: 19px;
  }

  .plan .repere text {
    font-size: 19px;
  }

  .planche {
    padding: 12px 12px 0;
  }

  .cartouche {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cartouche-cell:nth-child(3) {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--trait);
    padding-left: 0;
  }

  .legende {
    grid-template-columns: minmax(0, 1fr);
  }

  .entree,
  .entree--d {
    grid-column: span 1;
  }

  .entree--d .entree-colonnes {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .perimetre {
    grid-template-columns: minmax(0, 1fr);
  }

  .perimetre-col + .perimetre-col {
    border-left: 0;
    border-top: 1px solid var(--trait-fort);
  }

  .sim-resultats {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .sim-resultat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
  }

  .sim-resultat-val {
    margin-top: 0;
  }

  .preuve-grille {
    grid-template-columns: minmax(0, 1fr);
  }

  .preuve-cell {
    border-left: 0;
    border-top: 1px solid var(--trait);
  }

  .preuve-cell:first-child {
    border-top: 0;
  }

  .question-corps {
    padding-right: 0;
  }

  .pied-grille {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 400px) {
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .methode::before {
    left: 16px;
  }

  .etape {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 16px;
  }

  .etape-num {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
}

/* 21. Mouvement réduit --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .plan .mur,
  .plan .cloison {
    stroke-dashoffset: 0;
  }

  .plan .repere,
  .plan .piece,
  .plan .detail,
  .plan .cote,
  .plan .cote-txt,
  .plan .fenetre,
  .plan .porte {
    opacity: 1;
  }
}

/* 22. Impression --------------------------------------------------------- */

@media print {
  .entete,
  .appel,
  .sim,
  .hero-actions,
  .nav-toggle {
    display: none;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .bande {
    padding-block: 18px;
    break-inside: avoid;
  }
}
