/* Garage Morel. Style "Atelier".
   La page est une planche technique : filets, cotes, repères numérotés,
   et un sélecteur de panne qui marche sans une ligne de JavaScript. */

@font-face {
  font-family: 'Archivo Variable';
  src: url('../fonts/archivo-latin-standard-normal.woff2') format('woff2-variations');
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono Variable';
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --acier: #D9D9D6;
  --acier-fonce: #C4C4C0;
  --graphite: #1E1F21;
  --graphite-72: rgba(30, 31, 33, .72);
  --graphite-doux: rgba(30, 31, 33, .66);   /* 4.58:1 sur l'acier */
  --graphite-18: rgba(30, 31, 33, .18);
  /* Trois niveaux d'orange, choisis par le contraste qu'ils doivent tenir :
     texte courant 4.5:1, grand titre 3:1, et la teinte d'origine pour les
     aplats et les traits, qui ne portent jamais de petit texte. */
  --signal: #A63A14;        /* petit texte sur acier, 4.59:1 */
  --signal-titre: #C44A14;  /* titres de plus de 24 px, 3.42:1 */
  --signal-vif: #FF5A1F;
  --pas: cubic-bezier(.3, 0, .1, 1);
}

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

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

body {
  margin: 0;
  background: var(--acier);
  color: var(--graphite);
  font-family: 'JetBrains Mono Variable', ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(.875rem, .83rem + .2vw, .95rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--signal-vif); color: #fff; }

.shell { width: min(100% - 2.5rem, 78rem); margin-inline: auto; }

/* Quadrillage de planche, très pâle, sur toute la page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(30,31,33,.05) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(30,31,33,.05) 0 1px, transparent 1px 22px);
}
body > * { position: relative; z-index: 1; }

/* ── Cartouche ────────────────────────────────────────────────────────── */

.cartouche {
  border-bottom: 2px solid var(--graphite);
  padding-block: clamp(2rem, 6vh, 3.5rem) 0;
}
.cartouche-haut {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
}
.marque {
  margin: 0;
  font-family: 'Archivo Variable', system-ui, sans-serif;
  font-size: clamp(2.75rem, 11vw, 9rem);
  font-weight: 900;
  font-variation-settings: 'wdth' 70, 'wght' 900;
  line-height: .84;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.marque i { display: block; font-style: normal; color: var(--signal-titre); }
.repere {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--graphite-doux);
}

/* Le bloc de références, comme le cartouche d'un plan. */
.references {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin-top: 2rem;
  border: 1px solid var(--graphite);
  border-bottom: 0;
}
.reference {
  padding: .8rem 1rem;
  border-right: 1px solid var(--graphite-18);
}
.reference:last-child { border-right: 0; }
.reference dt {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--graphite-doux);
}
.reference dd { margin: .15rem 0 0; font-size: .95rem; font-weight: 600; }

/* ── Sections ─────────────────────────────────────────────────────────── */

section { padding-block: clamp(3.5rem, 9vh, 6rem); }

.section-tete {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--graphite);
  margin-bottom: 2.5rem;
}
.section-num {
  font-family: 'Archivo Variable', sans-serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  font-variation-settings: 'wdth' 64, 'wght' 900;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px var(--graphite);
}
.section-h {
  margin: 0;
  font-family: 'Archivo Variable', sans-serif;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  font-weight: 700;
  font-variation-settings: 'wdth' 82, 'wght' 750;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.section-note { margin-left: auto; color: var(--graphite-doux); font-size: .78rem; }

/* ── Le sélecteur de bruit : radios + CSS, zéro JavaScript ────────────── */

.diagnostic { position: relative; }
.question {
  margin: 0 0 1.4rem;
  font-family: 'Archivo Variable', sans-serif;
  font-size: clamp(1.5rem, 4.6vw, 2.8rem);
  font-weight: 800;
  font-variation-settings: 'wdth' 88, 'wght' 800;
  line-height: 1.04;
  letter-spacing: -.025em;
}
.bruits { display: flex; flex-wrap: wrap; gap: .6rem; }
.bruits input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.bruits label {
  display: inline-block;
  padding: .7rem 1.1rem;
  border: 1.5px solid var(--graphite);
  background: transparent;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background-color .18s var(--pas), color .18s var(--pas);
}
.bruits label:hover { background: rgba(30, 31, 33, .08); }
.bruits input:checked + label { background: var(--graphite); color: var(--acier); }
.bruits input:focus-visible + label { outline: 2px solid var(--signal); outline-offset: 3px; }

.reponses { flex: 0 0 100%; width: 100%; margin-top: 2rem; }
.reponse {
  display: none;
  border: 2px solid var(--graphite);
  background: rgba(255, 255, 255, .34);
}
/* Chaque radio commande sa fiche, par son rang dans le groupe. */
#bruit-1:checked ~ .reponses .reponse-1,
#bruit-2:checked ~ .reponses .reponse-2,
#bruit-3:checked ~ .reponses .reponse-3,
#bruit-4:checked ~ .reponses .reponse-4 { display: block; }
/* Sans JavaScript et sans sélection, on montre tout : rien n'est perdu. */
html:not(.js) .reponse { display: block; margin-bottom: 1rem; }

.reponse-haut {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 1.5rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--graphite);
  background: var(--graphite);
  color: var(--acier);
}
.reponse-titre {
  margin: 0;
  font-family: 'Archivo Variable', sans-serif;
  font-size: clamp(1.1rem, 2.8vw, 1.5rem);
  font-weight: 700;
  font-variation-settings: 'wdth' 86, 'wght' 740;
  text-transform: uppercase;
  letter-spacing: -.01em;
}
.reponse-etiquette {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--signal-vif);
}
.reponse-corps { display: grid; gap: 1.5rem; padding: 1.4rem; }
@media (min-width: 46rem) { .reponse-corps { grid-template-columns: 1.4fr 1fr; } }
.reponse-corps p { margin: 0 0 .9rem; max-width: 52ch; }
.reponse-corps p:last-child { margin-bottom: 0; }

.cotes { margin: 0; display: grid; gap: .55rem; align-content: start; }
.cote {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--graphite-18);
}
.cote dt { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite-doux); }
.cote dd { margin: 0 0 0 auto; font-weight: 700; font-size: 1rem; }
.cote dd.prix { color: var(--signal); }

/* Les cotes dessinées autour de la fiche, comme sur un plan. */
.trait-cote {
  position: absolute;
  display: none;
  align-items: center;
  gap: .4rem;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--graphite-doux);
}
/* La cote ne sort dans la marge que si la marge existe : le contenu est
   plafonné à 78rem, il faut donc 78rem + les deux gouttières avant de l'afficher. */
@media (min-width: 86rem) {
  .trait-cote { display: flex; right: -2.6rem; top: 0; writing-mode: vertical-rl; }
  .trait-cote::before, .trait-cote::after { content: ""; flex: 1; width: 1px; background: var(--graphite-18); }
}

/* ── Prestations ──────────────────────────────────────────────────────── */

.prestations { margin: 0; padding: 0; list-style: none; }
.prestation {
  display: grid;
  gap: .3rem 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--graphite-18);
}
@media (min-width: 52rem) {
  .prestation { grid-template-columns: 5.5rem 1fr 10rem 11rem; align-items: baseline; }
}
.prestation:last-child { border-bottom: 1px solid var(--graphite-18); }
.prestation-num {
  font-family: 'Archivo Variable', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  font-variation-settings: 'wdth' 62, 'wght' 900;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1.6px var(--graphite-doux);
}
.prestation-nom {
  font-family: 'Archivo Variable', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  font-variation-settings: 'wdth' 88, 'wght' 720;
  letter-spacing: -.015em;
  text-transform: uppercase;
}
.prestation-det { color: var(--graphite-72); font-size: .82rem; }
.prestation-duree { color: var(--graphite-doux); font-size: .82rem; }
.prestation-prix { font-weight: 700; color: var(--signal); white-space: nowrap; }
@media (min-width: 52rem) { .prestation-prix { text-align: right; } }

/* ── Atelier ──────────────────────────────────────────────────────────── */

.atelier-grille { display: grid; gap: 2.5rem; }
@media (min-width: 52rem) { .atelier-grille { grid-template-columns: 1fr 1fr; } }
.atelier-grille p { margin: 0 0 1rem; max-width: 50ch; }
.atelier-grille strong { font-weight: 700; }
.atelier-grille a { color: var(--signal); text-underline-offset: .25em; }

.horaires { margin: 0; }
.horaire {
  display: flex;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--graphite-18);
}
.horaire dt { width: 11ch; font-weight: 700; }
.horaire dd { margin: 0 0 0 auto; color: var(--graphite-72); }
.horaire.ferme dd { color: var(--signal); }

.rdv {
  display: inline-block;
  margin-top: 1.2rem;
  padding: .95rem 2rem;
  background: var(--graphite);
  color: var(--acier);
  font-family: 'Archivo Variable', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  font-variation-settings: 'wdth' 88, 'wght' 720;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .18s var(--pas);
}
.rdv:hover, .rdv:focus-visible { background: var(--signal); }
.rdv:focus-visible { outline: 2px solid var(--graphite); outline-offset: 3px; }

.pied {
  padding: 1.6rem 0 9rem;
  border-top: 2px solid var(--graphite);
  color: var(--graphite-doux);
  font-size: .72rem;
  letter-spacing: .06em;
}

/* ── Révélation : mécanique, par paliers, jamais en fondu mou ─────────── */

.js .rv { opacity: 0; transform: translateY(10px); animation: secours .01s linear 2.6s forwards; }
.js .rv.vu {
  opacity: 1;
  transform: none;
  animation: none;
  transition: opacity .01s linear var(--retard, 0ms), transform .34s var(--pas) var(--retard, 0ms);
}
@keyframes secours { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .rv.vu { opacity: 1; transform: none; transition: none; animation: none; }
}

/* ── Bandeau Webot ────────────────────────────────────────────────────────
   Identique sur toutes les démos, volontairement neutre pour rester lisible
   quel que soit le style derrière. Police système : elle ne compte pas dans
   les deux familles de la démo. */

.webot-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 10;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  max-width: calc(100vw - 2rem);
  padding: .6rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(16, 16, 18, .92);
  color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: .8125rem;
  line-height: 1.3;
  letter-spacing: .01em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
@supports (backdrop-filter: blur(8px)) {
  .webot-bar { background: rgba(16, 16, 18, .78); backdrop-filter: blur(10px); }
}
.webot-bar p { margin: 0; color: rgba(255, 255, 255, .78); }
.webot-bar a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  padding-bottom: 1px;
  white-space: nowrap;
}
.webot-bar a:hover { border-bottom-color: #fff; }
.webot-bar a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 2px; }
@media (max-width: 34rem) {
  .webot-bar { top: .75rem; bottom: auto; gap: .75rem; padding: .5rem .9rem; font-size: .75rem; }
}
