/* =========================================================
   Ternier Électricité : site d'exemple (entreprise fictive)
   Idée visuelle : le schéma électrique. Filets fins, repères
   numérotés en police à chasse fixe, plaque signalétique,
   prestations présentées comme les modules d'un tableau.
   Mobile d'abord.
   ========================================================= */

/* Polices auto-hébergées : IBM Plex Sans (variable) et IBM Plex Mono */
@font-face {
  font-family: "Plex Sans";
  src: url("fonts/plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 85% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Couleurs : 1 fond, 1 texte, 1 accent, plus des neutres */
  --fond: #f6f5f0;        /* papier de plan */
  --texte: #1c1e21;       /* anthracite */
  --jaune: #f6b800;       /* jaune signal : aplats et repères, jamais pour du texte sur fond clair */
  --gris: #5a5d61;        /* texte secondaire (6:1 sur le fond) */
  --trait: #c9c7bf;       /* filets */
  --fond-alt: #e8e6df;    /* fond gris des sections alternées */
  --blanc: #ffffff;
  --sombre: #24272b;      /* pied de page */

  --sans: "Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", Consolas, "Courier New", monospace;

  --gouttiere: 1.25rem;
  --section: 4.5rem;
  --largeur: 74rem;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--pp-bandeau) + 4.5rem); }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  padding-bottom: 3.75rem; /* place pour le bouton d'appel fixe sur mobile */
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--texte); outline-offset: 3px; box-shadow: 0 0 0 5px var(--jaune); }

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

/* Repère : petite étiquette en police à chasse fixe, comme sur un plan */
.repere {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gris);
}

/* Boutons et liens */
.bouton {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  background: var(--texte);
  color: var(--blanc);
  font-weight: 600;
  text-decoration: none;
  border-left: 6px solid var(--jaune);
  transition: background-color 0.15s;
}
.bouton:hover { background: #000; }

.lien-fleche { font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.lien-fleche::after { content: " →"; }
.lien-fleche:hover { text-decoration-thickness: 2px; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky;
  top: var(--pp-bandeau);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--gouttiere);
  background: var(--fond);
  border-bottom: 1px solid var(--texte);
}
.marque { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
/* Symbole : un éclair stylisé dans un carré, dessiné en CSS */
.marque-symbole {
  width: 1.9rem;
  height: 1.9rem;
  background: var(--jaune);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  position: relative;
}
.marque-symbole::after {
  content: "";
  position: absolute;
  inset: 0.3rem 0.55rem;
  background: var(--texte);
  clip-path: polygon(55% 0, 10% 58%, 45% 58%, 35% 100%, 90% 38%, 55% 38%, 70% 0);
}
.marque-nom { font-weight: 650; font-size: 1.15rem; letter-spacing: -0.01em; line-height: 1; }
.marque-nom span { font-weight: 400; color: var(--gris); }

.menu { display: none; }

.entete-appel {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--texte);
  white-space: nowrap;
}
.entete-appel:hover { background: var(--jaune); }
@media (max-width: 25rem) { .entete-appel { display: none; } }

/* ---------- Accroche ---------- */
.accroche { max-width: var(--largeur); margin: 0 auto; padding: 2.5rem var(--gouttiere) 0; }
.accroche h1 {
  margin-top: 1rem;
  font-size: clamp(2.2rem, 8.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 16ch;
}
.accroche-colonne { margin-top: 1.5rem; max-width: 34rem; }
.accroche-colonne > p { font-size: 1.12rem; }
.accroche-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; }

.accroche-photo { position: relative; margin: 2.5rem 0 0; }
/* Photos encadrées comme un tirage de plan : liseré blanc et filet fin */
.accroche-photo img, .galerie img { padding: 5px; background: var(--blanc); border: 1px solid var(--texte); border-radius: 4px; }
.accroche-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
/* Repères numérotés posés sur la photo */
.photo-repere {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  background: var(--jaune);
  border: 2px solid var(--texte);
  border-radius: 50%;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
}
.accroche-photo figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--texte);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--gris);
}
.accroche-photo figcaption b {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--jaune);
  color: var(--texte);
  font-weight: 500;
  font-size: 0.75rem;
}

/* ---------- Plaque signalétique ---------- */
.plaque-zone { max-width: var(--largeur); margin: 0 auto; padding: 3rem var(--gouttiere) 0; }
.plaque {
  position: relative;
  background: var(--blanc);
  border: 1.5px solid var(--texte);
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.88rem;
}
/* Quatre « vis » aux coins */
.plaque::before {
  content: "";
  position: absolute;
  inset: 0.45rem;
  pointer-events: none;
  background:
    radial-gradient(circle, var(--trait) 0 3px, transparent 3.5px) top left / 10px 10px no-repeat,
    radial-gradient(circle, var(--trait) 0 3px, transparent 3.5px) top right / 10px 10px no-repeat,
    radial-gradient(circle, var(--trait) 0 3px, transparent 3.5px) bottom left / 10px 10px no-repeat,
    radial-gradient(circle, var(--trait) 0 3px, transparent 3.5px) bottom right / 10px 10px no-repeat;
}
.plaque-titre {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--texte);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.plaque-titre span { font-family: var(--mono); font-weight: 400; font-size: 0.8rem; color: var(--gris); letter-spacing: 0; align-self: center; }
.plaque dl { margin: 0; }
.plaque dl div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--trait); }
.plaque dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.plaque dt { color: var(--gris); text-transform: uppercase; font-size: 0.78rem; padding-top: 0.1rem; }
.plaque dd { margin: 0; }

/* ---------- Sections ---------- */
.section { max-width: var(--largeur); margin: 0 auto; padding: var(--section) var(--gouttiere); }
/* Fonds pleine largeur qui alternent, pour bien séparer les sections
   (l'ombre étendue colore toute la largeur, le clip-path la limite en hauteur) */
.prestations, .chantiers { background: var(--fond-alt); box-shadow: 0 0 0 100vmax var(--fond-alt); clip-path: inset(0 -100vmax); }
.methode { background: var(--blanc); box-shadow: 0 0 0 100vmax var(--blanc); clip-path: inset(0 -100vmax); }
.prestations { margin-top: 3rem; }
.section h2 { margin-top: 0.75rem; font-size: clamp(1.8rem, 6vw, 2.9rem); letter-spacing: -0.025em; max-width: 22ch; }
.section-chapo { margin-top: 0.75rem; color: var(--gris); max-width: 36rem; }
.note { margin-top: 1rem; font-size: 0.88rem; color: var(--gris); }

/* ---------- Tableau électrique (onglets) ---------- */
.tableau { margin-top: 2rem; }

.tableau-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0.9rem;
  background: #d8d5cc;
  border: 1.5px solid var(--texte);
  border-bottom: 0;
  /* le rail DIN qui traverse le tableau */
  background-image: linear-gradient(transparent calc(50% - 6px), #c4c1b7 calc(50% - 6px), #c4c1b7 calc(50% + 6px), transparent calc(50% + 6px));
}
.tableau-rail[hidden] { display: none; }

.module {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-height: 9rem;
  padding: 0.6rem 0.35rem 0.75rem;
  background: var(--blanc);
  border: 1px solid #9c9a93;
  margin: -0.5px;
  font: inherit;
  color: var(--texte);
  cursor: pointer;
}
.module-num { font-family: var(--mono); font-size: 0.72rem; color: var(--gris); }
/* Le levier : en bas (O) au repos, en haut et jaune (I) quand le module est enclenché */
.module-levier {
  position: relative;
  width: 1.5rem;
  height: 3rem;
  background: #2f3236;
  border-radius: 3px;
}
.module-levier i {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 45%;
  background: #8d9096;
  border-radius: 2px;
  transition: transform 0.18s ease, background-color 0.18s;
}
.module-nom { font-size: 0.82rem; font-weight: 600; line-height: 1.15; text-align: center; }
.module:hover .module-levier i { background: #b4b7bc; }
.module[aria-selected="true"] { background: #fffbea; }
.module[aria-selected="true"] .module-levier i { transform: translateY(-104%); background: var(--jaune); }
.module:focus-visible { position: relative; z-index: 1; }

.tableau-details { border: 1.5px solid var(--texte); background: var(--blanc); }
.detail { padding: 1.5rem; }
.detail + .detail { border-top: 1px solid var(--trait); }
.tableau-rail:not([hidden]) + .tableau-details .detail + .detail { border-top: 0; }
.detail h3 { font-size: 1.5rem; display: flex; align-items: baseline; gap: 0.75rem; }
.detail p { margin-top: 0.75rem; max-width: 40rem; }
.detail-prix {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1.25rem !important;
  padding: 0.45rem 0.75rem;
  background: var(--fond);
  border-left: 4px solid var(--jaune);
  font-weight: 650;
  font-size: 1.15rem;
}
.detail-prix span { font-family: var(--mono); font-size: 0.75rem; font-weight: 400; text-transform: uppercase; color: var(--gris); }

/* ---------- Liste de contrôle ---------- */
.verifier { display: grid; gap: 2rem; }
.liste-controle { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--texte); }
.liste-controle label {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--trait);
  cursor: pointer;
}
.liste-controle input {
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0.1rem 0 0;
  border: 1.5px solid var(--texte);
  background: var(--blanc);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.liste-controle input:checked { background: var(--jaune); }
.liste-controle input:checked::after {
  content: "";
  width: 0.45rem;
  height: 0.8rem;
  border: solid var(--texte);
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.controle-resultat {
  margin-top: 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--blanc);
  border: 1px dashed var(--gris);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.controle-resultat.alerte { border: 1.5px solid var(--texte); border-left: 6px solid var(--jaune); }
.controle-resultat a { font-weight: 500; }

/* ---------- Méthode : étapes reliées par un fil ---------- */
.fil { list-style: none; counter-reset: etape; margin: 2rem 0 0; padding: 0; }
.fil li {
  counter-increment: etape;
  position: relative;
  padding: 0 0 2rem 3.25rem;
}
/* le fil vertical */
.fil li::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--texte);
}
.fil li:last-child::after { display: none; }
/* le repère numéroté */
.fil li::before {
  content: counter(etape, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--texte);
  border-radius: 50%;
  background: var(--fond);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}
.fil li:last-child::before { background: var(--jaune); }
.fil h3 { font-size: 1.25rem; padding-top: 0.2rem; }
.fil p { margin-top: 0.35rem; color: var(--gris); }

/* ---------- Chantiers ---------- */
.galerie { display: grid; gap: 1.75rem; margin-top: 2rem; }
.galerie figure { margin: 0; }
.galerie img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--texte); }
.galerie figcaption { margin-top: 0.6rem; font-size: 0.95rem; }
.galerie figcaption .repere { display: block; margin-bottom: 0.15rem; }

/* ---------- Contact : grand aplat jaune ---------- */
.contact { background: var(--jaune); color: var(--texte); }
.contact-inner { max-width: var(--largeur); margin: 0 auto; padding: 3.5rem var(--gouttiere); }
.contact .repere { color: var(--texte); }
.contact h2 { margin-top: 0.75rem; font-size: clamp(1.8rem, 6vw, 2.9rem); letter-spacing: -0.025em; max-width: 18ch; }
.contact-grille { display: grid; gap: 2rem; margin-top: 2rem; }
.contact-numero {
  display: block;
  font-size: clamp(2.2rem, 10vw, 3.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.contact-numero:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.contact-mail { display: inline-block; margin-top: 1rem; font-weight: 600; text-underline-offset: 4px; }
.contact-infos { margin: 2rem 0 0; border-top: 1.5px solid var(--texte); font-family: var(--mono); font-size: 0.9rem; }

/* Faux formulaire : une fiche blanche posée sur l'aplat jaune */
.formulaire { display: grid; gap: 0.9rem; padding: 1.5rem; background: var(--blanc); border: 1.5px solid var(--texte); }
.formulaire-titre { display: flex; align-items: baseline; gap: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1.5px solid var(--texte); font-weight: 650; font-size: 1.2rem; }
.champ { display: grid; gap: 0.3rem; }
.champ label { font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; color: var(--gris); }
.champ input, .champ select, .champ textarea {
  width: 100%;
  padding: 0.65rem 0.7rem;
  font: inherit;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid #8f8d86;
  border-radius: 0;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid var(--texte); outline-offset: 0; box-shadow: 0 0 0 5px var(--jaune); }
.formulaire-bouton {
  justify-self: start;
  padding: 0.8rem 1.2rem;
  background: var(--texte);
  color: var(--blanc);
  border: 0;
  border-left: 6px solid var(--jaune);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.formulaire-bouton:hover { background: #000; }
.formulaire-note { font-family: var(--mono); font-size: 0.78rem; color: var(--gris); }
.contact-infos div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid rgba(28, 30, 33, 0.35); }
.contact-infos dt { text-transform: uppercase; font-size: 0.78rem; padding-top: 0.1rem; }
.contact-infos dd { margin: 0; text-align: right; font-weight: 500; }
.contact :focus-visible { box-shadow: 0 0 0 5px var(--blanc); }

/* ---------- Pied de page ---------- */
.pied {
  display: grid;
  gap: 2.5rem;
  padding: 3rem var(--gouttiere);
  background: var(--sombre);
  color: #c8cacc;
  font-size: 0.95rem;
}
.pied .marque-nom { display: block; color: var(--blanc); font-size: 1.5rem; margin-bottom: 0.75rem; }
.pied .marque-nom span { color: #a9acaf; }
.pied-ternier p + p { margin-top: 0.5rem; }
.pied-ternier a { color: var(--blanc); }

/* Encadré Pearce'pective Web */
.pied-pp { padding: 1.5rem; background: var(--fond); color: var(--texte); border-top: 6px solid var(--jaune); }
.pied-pp h2 { margin-top: 0.5rem; font-size: 1.4rem; }
.pied-pp > p:not(.repere) { margin-top: 0.6rem; }
.pied-pp ul { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin: 1.25rem 0 0; padding: 0; }

/* ---------- Bouton d'appel fixe (mobile) ---------- */
.appel-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0.95rem;
  background: var(--texte);
  color: var(--blanc);
  border-top: 4px solid var(--jaune);
  text-align: center;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 500;
}

/* =========================================================
   Tablette : 768 px et plus
   ========================================================= */
@media (min-width: 48rem) {
  :root { --gouttiere: 2rem; --section: 6rem; }
  body { padding-bottom: 0; }
  .appel-mobile { display: none; }

  .accroche { padding-top: 3.5rem; }
  .accroche-texte { display: grid; grid-template-columns: 1fr; }
  .accroche-colonne { margin-left: auto; margin-top: 2rem; }

  .tableau-rail { grid-template-columns: repeat(6, 1fr); padding: 1.1rem; }
  .detail { padding: 2rem; }

  .verifier { grid-template-columns: 0.9fr 1.1fr; gap: 3rem; align-items: start; }

  .fil { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .fil li { padding: 3rem 0 0; }
  .fil li::after { left: 2rem; right: -1.5rem; top: 0.95rem; bottom: auto; width: auto; height: 2px; }

  .galerie { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .galerie-large { grid-column: span 2; }
  .galerie-large img { aspect-ratio: 21 / 9; }

  .contact-grille { grid-template-columns: 1fr 1fr; column-gap: 3rem; align-items: start; }

  .pied { grid-template-columns: 1fr 1.2fr; padding: 3.5rem var(--gouttiere); }
  .pied-pp { padding: 2rem; }
}

/* =========================================================
   Ordinateur : 1024 px et plus
   ========================================================= */
@media (min-width: 64rem) {
  .menu { display: block; margin-left: auto; }
  .menu ul { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
  .menu a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
  .menu a span { font-family: var(--mono); font-size: 0.72rem; color: var(--gris); margin-right: 0.2rem; }
  .menu a:hover { text-decoration: underline; text-underline-offset: 5px; }

  .entete, .pied { padding-left: max(var(--gouttiere), calc((100% - var(--largeur)) / 2 + var(--gouttiere))); padding-right: max(var(--gouttiere), calc((100% - var(--largeur)) / 2 + var(--gouttiere))); }

  .accroche-texte { grid-template-columns: 1.5fr 1fr; column-gap: 3rem; align-items: end; }
  .accroche-texte .repere { grid-column: 1 / -1; }
  .accroche-colonne { margin: 0; }
  .accroche-photo img { aspect-ratio: 21 / 9; }

  /* La plaque à cheval sur le bas de la photo, décalée à droite */
  .plaque-zone { padding-top: 0; }
  .plaque { width: 32rem; margin: -6rem 2.5rem 0 auto; }
  /* les légendes de la photo s'arrêtent avant la plaque */
  .accroche-photo figcaption { flex-direction: column; padding-right: 36rem; border-bottom: 0; }
}

/* Mouvements réduits */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
