/*
 * Feuille de style du site (page d'accueil, mentions légales, et socle
 * commun du backoffice).
 *
 * Direction : une planche technique imprimée. Filet fin autour de la
 * page, croix de repérage aux coins, panneau vert nuit avec dessin au
 * trait crème, panneau papier avec un formulaire façon formulaire
 * imprimé. Ni ombre, ni dégradé, ni arrondi, ni icône. La veilleuse
 * orange est la seule touche chaude.
 *
 * Contrastes (WCAG 2.1, calculés) :
 *   encre / papier 15,0:1 ; crème / vert nuit 12,1:1 ;
 *   crème atténué / vert nuit 6,4:1 ; gris texte / papier 5,0:1 ;
 *   erreur / papier 6,7:1 ; filet orange / papier 3,2:1 (élément non
 *   textuel, seuil 3:1). Le gris #737875 (4,0:1) ne sert qu'aux filets.
 *
 * Mikael - chef de projet - 2026-10-27
 */

/* ---- Polices auto-hébergées (licence SIL OFL, fichiers dans polices/) ----
   Mikael - chef de projet - 2026-10-27 */
@font-face {
  font-family: "Libre Caslon Display";
  src: url("../polices/libre-caslon-display-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../polices/work-sans-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../polices/work-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../polices/work-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("../polices/work-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- Jetons de couleur et de rythme ----
   Mikael - chef de projet - 2026-10-27 */
:root {
  --vert-nuit: #1C2622;
  --creme: #E9E2D3;
  --creme-attenue: #A9A69B;
  --trait-axe: #4A5550;
  --papier: #F6F0EA;
  --encre: #1E1C19;
  --gris: #737875;
  --gris-texte: #636865;
  --veilleuse: #E0602A;
  --erreur: #9A2E12;

  --police-titre: "Libre Caslon Display", "Times New Roman", serif;
  --police-texte: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --marge-planche: clamp(16px, 2.6vw, 44px);
  --marge-panneau: clamp(32px, 4.4vw, 76px);
  --capitales: 0.22em;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--papier);
  background-image: url("../grain.svg");
  color: var(--encre);
  font-family: var(--police-texte);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- La planche : filet fin et croix de repérage aux quatre coins ----
   Mikael - chef de projet - 2026-10-27 */
.planche {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  /* Largeur explicite : avec une largeur automatique, les marges
     « auto » valent zéro et la planche toucherait les bords (les croix
     de repérage débordaient alors de 7 px, relevé par les captures).
     Mikael - chef de projet - 2026-10-27 */
  width: min(1760px, 100% - 2 * var(--marge-planche));
  min-height: calc(100vh - 2 * var(--marge-planche));
  margin: var(--marge-planche) auto;
  border: 1px solid var(--gris);
}

.croix {
  position: absolute;
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.croix::before,
.croix::after {
  content: "";
  position: absolute;
  background: var(--gris);
}
.croix::before {
  left: 0;
  top: 7px;
  width: 15px;
  height: 1px;
}
.croix::after {
  left: 7px;
  top: 0;
  width: 1px;
  height: 15px;
}
.croix--hg { top: -8px; left: -8px; }
.croix--hd { top: -8px; right: -8px; }
.croix--bg { bottom: -8px; left: -8px; }
.croix--bd { bottom: -8px; right: -8px; }

/* ---- Panneau gauche : vert nuit, nom, dessin ----
   Mikael - chef de projet - 2026-10-27 */
.panneau-dessin {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--marge-panneau);
  background: var(--vert-nuit);
  color: var(--creme);
}

.croix-panneau {
  position: absolute;
  width: 9px;
  height: 9px;
}
.croix-panneau::before,
.croix-panneau::after {
  content: "";
  position: absolute;
  background: var(--creme-attenue);
}
.croix-panneau::before { left: 0; top: 4px; width: 9px; height: 1px; }
.croix-panneau::after { left: 4px; top: 0; width: 1px; height: 9px; }
.croix-panneau--hg { top: 24px; left: 24px; }
.croix-panneau--hd { top: 24px; right: 24px; }
.croix-panneau--bg { bottom: 24px; left: 24px; }
.croix-panneau--bd { bottom: 24px; right: 24px; }

.raison-sociale {
  margin: 0;
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: clamp(4.2rem, 8.6vw, 9.5rem);
  line-height: 0.88;
  /* Crénage du titre : la Caslon Display a des approches larges en grand
     corps ; on resserre légèrement et on laisse jouer les paires.
     Mikael - chef de projet - 2026-10-27 */
  letter-spacing: -0.012em;
  font-feature-settings: "kern" 1, "liga" 1, "lnum" 1;
  color: var(--creme);
}

.dirigeant {
  margin: 1.15rem 0 0;
  font-size: clamp(0.82rem, 1.05vw, 1rem);
  font-weight: 400;
  text-transform: uppercase;
  /* Petites capitales espacées : l'interlettrage ouvert crée la ligne
     de cartouche ; on compense l'espace ajouté après la dernière lettre.
     Mikael - chef de projet - 2026-10-27 */
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  color: var(--creme);
}

.dessin {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: clamp(28px, 5vh, 64px) 0 0;
}

.dessin-svg {
  display: block;
  width: 100%;
  max-width: calc(60vh * 720 / 640);
  height: auto;
  aspect-ratio: 720 / 640;
  margin: 0 auto;
  overflow: hidden;
}

/* Traits du dessin : deux épaisseurs, fixes quelle que soit l'échelle.
   Mikael - chef de projet - 2026-10-27 */
.dessin-svg * {
  vector-effect: non-scaling-stroke;
}
.trait-fort,
.trait-fin,
.trait-tirets,
.trait-axe,
.trait-rappel {
  fill: none;
  stroke: var(--creme);
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.trait-fort { stroke-width: 1.35; }
.trait-fin { stroke-width: 0.8; }
.trait-fin .trait-rappel,
.trait-rappel { stroke-width: 0.6; stroke: var(--creme-attenue); stroke-dasharray: 1 3; }
.trait-tirets { stroke-width: 0.8; stroke-dasharray: 4 4; stroke: var(--creme-attenue); }
.trait-axe { stroke: var(--trait-axe); stroke-width: 0.7; stroke-dasharray: 12 4 2 4; }
.vanne polygon { fill: var(--vert-nuit); }
.remplissage-creme { fill: var(--creme); stroke: none; }

.texte-cote,
.texte-repere {
  font-family: var(--police-texte);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.16em;
  fill: var(--creme-attenue);
}
.texte-repere {
  fill: var(--creme);
  letter-spacing: 0;
}
.pastille circle {
  fill: var(--vert-nuit);
  stroke: var(--creme);
  stroke-width: 0.8;
}

/* La veilleuse : flamme fixe et lueur qui respire très lentement.
   Mikael - chef de projet - 2026-10-27 */
.veilleuse-flamme { fill: var(--veilleuse); }
.veilleuse-halo {
  fill: var(--veilleuse);
  opacity: 0.22;
  transform-box: fill-box;
  transform-origin: center;
  animation: respiration 5.2s ease-in-out infinite;
}
@keyframes respiration {
  0%, 100% { opacity: 0.1; transform: scale(0.75); }
  50% { opacity: 0.42; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .veilleuse-halo {
    animation: none;
    opacity: 0.25;
    transform: none;
  }
}

.nomenclature ol {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0.5rem 2.2rem;
  margin: clamp(20px, 3vh, 36px) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: repere;
}
.nomenclature li {
  counter-increment: repere;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--creme-attenue);
  white-space: nowrap;
}
.nomenclature li::before {
  content: counter(repere);
  display: inline-block;
  min-width: 1.4em;
  color: var(--creme);
}

/* ---- Panneau droit : papier, coordonnées, formulaire imprimé ----
   Mikael - chef de projet - 2026-10-27 */
.panneau-contact {
  display: flex;
  flex-direction: column;
  padding: var(--marge-panneau);
  min-width: 0;
}

.entete-contact {
  max-width: 34rem;
}

.metier {
  margin: 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--gris);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
}

.adresse {
  margin: 1.5rem 0 0;
  font-style: normal;
  font-size: clamp(1.1rem, 1.35vw, 1.3rem);
  font-weight: 400;
  line-height: 1.45;
}

.contact {
  margin-top: clamp(48px, 13vh, 168px);
  max-width: 34rem;
}

.formulaire {
  display: grid;
  gap: 0.6rem;
}

.champ label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--capitales);
}

.champ input,
.champ textarea,
.champ select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0.55rem 0 0.6rem;
  border: 0;
  border-bottom: 1px solid var(--encre);
  border-radius: 0;
  background: transparent;
  color: var(--encre);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 400;
  -webkit-appearance: none;
  appearance: none;
}
.champ textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.5;
}

/* Focus clavier : le filet du champ devient orange et s'épaissit d'un
   pixel (le texte ne bouge pas : on retire ce pixel du rembourrage).
   Mikael - chef de projet - 2026-10-27 */
.champ input:focus,
.champ textarea:focus,
.champ select:focus {
  outline: none;
  border-bottom: 2px solid var(--veilleuse);
  padding-bottom: calc(0.6rem - 1px);
}

.champ--erreur input,
.champ--erreur textarea,
.champ--erreur select {
  border-bottom-color: var(--erreur);
}

.message-champ {
  min-height: 1.3rem;
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--erreur);
}

.piege {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Bouton : rectangle noir, angles vifs, trois états ----
   Mikael - chef de projet - 2026-10-27 */
.envoi {
  margin-top: 1.4rem;
}

.bouton-envoyer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 0;
  background: var(--encre);
  color: var(--papier);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.bouton-libelle {
  margin-right: -0.32em;
}
.bouton-envoyer:hover {
  background: var(--vert-nuit);
}
.bouton-envoyer:focus-visible {
  outline: 2px solid var(--veilleuse);
  outline-offset: 3px;
}
.bouton-envoyer[aria-busy="true"] {
  background: var(--vert-nuit);
  cursor: progress;
}
/* Pendant l'envoi : un filet orange parcourt le bas du bouton.
   Mikael - chef de projet - 2026-10-27 */
.bouton-envoyer[aria-busy="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--veilleuse);
  transform-origin: left center;
  animation: progression 1.4s ease-in-out infinite;
}
@keyframes progression {
  0% { transform: scaleX(0); }
  60% { transform: scaleX(1); }
  100% { transform: scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bouton-envoyer[aria-busy="true"]::after {
    animation: none;
  }
  .bouton-envoyer {
    transition: none;
  }
}
.bouton-envoyer.est-envoye {
  background: var(--vert-nuit);
  cursor: default;
}

.etat-envoi {
  min-height: 1.5rem;
  margin: 0.9rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
}
.etat-envoi--erreur {
  color: var(--erreur);
}
.etat-envoi--ok {
  color: var(--encre);
}
.etat-envoi--ok::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 2px;
  margin-right: 0.6rem;
  vertical-align: middle;
  background: var(--veilleuse);
}

/* ---- Pied de page légal ----
   Mikael - chef de projet - 2026-10-27 */
.pied-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0 1.5rem;
  max-width: 34rem;
  margin-top: auto;
  padding-top: clamp(40px, 8vh, 96px);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gris-texte);
}
.pied-legal p {
  margin: 0;
}
.pied-legal a,
.retour a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gris-texte);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.pied-legal a:hover,
.retour a:hover {
  color: var(--encre);
}
.pied-legal a:focus-visible,
.retour a:focus-visible,
.feuille a:focus-visible {
  outline: 2px solid var(--veilleuse);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ---- Page « Mentions légales » : une feuille de texte ----
   Mikael - chef de projet - 2026-10-27 */
.planche--texte {
  display: block;
  width: min(880px, 100% - 2 * var(--marge-planche));
  min-height: 0;
}
.feuille {
  padding: var(--marge-panneau);
}
.retour {
  margin: 0 0 2rem;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.titre-mentions {
  margin: 0 0 2.5rem;
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.article-mentions {
  padding: 1.6rem 0;
  border-top: 1px solid var(--gris);
}
.article-mentions h2 {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--capitales);
}
.numero {
  display: inline-block;
  min-width: 2.6em;
  color: var(--gris-texte);
  font-weight: 500;
}
.article-mentions p {
  max-width: 66ch;
  margin: 0 0 0.9rem;
  line-height: 1.65;
}

/* ---- Moins de 900 px : bandeau sombre en haut, formulaire dessous ----
   Mikael - chef de projet - 2026-10-27 */
@media (max-width: 899.98px) {
  :root {
    --marge-planche: 16px;
    --marge-panneau: 24px;
  }
  .planche {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .panneau-dessin {
    padding-bottom: 0;
    overflow: hidden;
  }
  .croix-panneau--bg,
  .croix-panneau--bd {
    display: none;
  }
  .croix-panneau--hg { top: 10px; left: 10px; }
  .croix-panneau--hd { top: 10px; right: 10px; }
  .raison-sociale {
    font-size: clamp(3.6rem, 17vw, 6rem);
  }
  .dirigeant {
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    margin-right: -0.3em;
  }
  /* Dessin réduit et recadré : hauteur fixe, le SVG remplit en
     « slice » et ne garde que le centre (chaudière et radiateur).
     Mikael - chef de projet - 2026-10-27 */
  .dessin {
    margin: 20px calc(-1 * var(--marge-panneau)) 0;
  }
  .dessin-svg {
    max-width: 560px;
    width: 100%;
    height: clamp(180px, 46vw, 300px);
    aspect-ratio: auto;
  }
  .reperes-dessin,
  .nomenclature,
  .texte-cote {
    display: none;
  }
  .contact {
    margin-top: 40px;
  }
  .pied-legal {
    padding-top: 40px;
  }
}
