:root {
  --craie: #FFFFFF;
  --graphite: #18161A;
  --vert: #A84E00;
  --vert-fonce: #7A3900;
  --traceur: #FF8200;
  --gris: #625C57;
  --trait: #CFC9C4;
  --titre: "Rosario", "Gill Sans", "Trebuchet MS", sans-serif;
  --texte: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--craie);
  color: var(--graphite);
  font-family: var(--texte);
  font-size: 1.125rem;
  line-height: 1.65;
}

a { color: var(--vert); text-underline-offset: 0.18em; }
a:hover { color: var(--vert-fonce); }

:focus-visible {
  outline: 3px solid var(--traceur);
  outline-offset: 3px;
}

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* En-tête */
.entete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--trait);
}

.marque {
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--graphite);
  text-decoration: none;
}

.langue { font-family: var(--titre); font-size: 0.95rem; }

/* Ouverture */
.ouverture {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 4.5rem 0 4rem;
}

h1 {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  max-width: 14ch;
}

.chapeau {
  font-size: 1.25rem;
  line-height: 1.55;
  max-width: 34rem;
  margin: 0 0 2rem;
}

.bouton {
  display: inline-block;
  font-family: var(--titre);
  font-weight: 500;
  font-size: 1.05rem;
  background: var(--graphite);
  color: #fff;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 4px;
  box-shadow: 6px 6px 0 var(--traceur);
}
.bouton:hover { background: #000; color: #fff; box-shadow: 3px 3px 0 var(--traceur); }

.precision {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.95rem;
  color: var(--gris);
}

/* Le gabarit */
.gabarit { width: 100%; height: auto; }
.gabarit .piece { fill: #fff; stroke: var(--graphite); stroke-width: 2; }
.gabarit .grille { stroke: var(--trait); stroke-width: 1.5; }
.gabarit .plein { fill: var(--traceur); }
.gabarit .cote { stroke: var(--graphite); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.gabarit .cote-texte {
  fill: var(--graphite);
  font-family: var(--titre);
  font-size: 15px;
  font-weight: 500;
}
.gabarit .repere { stroke: var(--graphite); stroke-width: 1.5; }



/* Sections */
section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--trait);
}

.colonne { max-width: 42rem; }

h2 {
  font-family: var(--titre);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

h3 {
  font-family: var(--titre);
  font-weight: 500;
  font-size: 1.2rem;
  margin: 0 0 0.3rem;
}

p { margin: 0 0 1rem; }

/* Modèles */
.modeles { list-style: none; margin: 1.5rem 0 0; padding: 0; max-width: 46rem; }
.modeles li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--trait);
}
.modeles p { margin: 0; color: var(--gris); }
.etat {
  font-family: var(--titre);
  font-size: 0.9rem;
  color: var(--gris);
  white-space: nowrap;
  align-self: start;
  padding-top: 0.2rem;
}

/* Étapes : une vraie séquence */
.etapes { counter-reset: etape; list-style: none; margin: 1.5rem 0 0; padding: 0; max-width: 46rem; }
.etapes li {
  counter-increment: etape;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  padding: 0.9rem 0;
}
.etapes li::before {
  content: counter(etape);
  font-family: var(--titre);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--graphite);
}
.etapes p { margin: 0; }

/* Questions */
details {
  max-width: 46rem;
  border-bottom: 1px solid var(--trait);
  padding: 1rem 0;
}
summary {
  font-family: var(--titre);
  font-weight: 500;
  font-size: 1.15rem;
  cursor: pointer;
}
details p { margin: 0.8rem 0 0; }

/* Pied */
.pied {
  border-top: 1px solid var(--trait);
  padding: 2.5rem 0 3rem;
  font-size: 0.95rem;
  color: var(--gris);
}
.pied p { margin: 0 0 0.4rem; }

@media (max-width: 760px) {
  .ouverture { grid-template-columns: 1fr; padding: 3rem 0 2.5rem; gap: 2rem; }
  .gabarit { max-width: 26rem; }
  .modeles li { grid-template-columns: 1fr; }
  body { font-size: 1.0625rem; }
}

/* Guides */
.fil { font-family: var(--titre); font-size: 0.95rem; color: var(--gris); padding: 1.5rem 0 0; }
.fil a { color: var(--gris); }
.article { padding: 2rem 0 4rem; }
.article h1 { max-width: 20ch; font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin-bottom: 1rem; }
.article h2 { margin-top: 3.5rem; max-width: 30ch; scroll-margin-top: 1rem; }
.article h3 { margin-top: 2rem; }
.article > p, .article > ul, .article > ol, .article > h2, .article > h3, .article > details { max-width: 42rem; }
.article li { margin-bottom: 0.45rem; }
.maj { font-family: var(--titre); font-size: 0.95rem; color: var(--gris); margin: 0 0 2rem; }
.reponse {
  max-width: 44rem;
  font-size: 1.25rem;
  line-height: 1.55;
  border-left: 6px solid var(--traceur);
  padding: 0.2rem 0 0.2rem 1.25rem;
  margin: 0 0 2.5rem;
}
.reponse p:last-child { margin-bottom: 0; }

/* Le réglet : les dates, à l'échelle d'une règle d'atelier */
.reglet {
  list-style: none;
  margin: 2.5rem 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 3px solid var(--graphite);
  background-image: repeating-linear-gradient(to right, var(--graphite) 0 1px, transparent 1px 12px);
  background-size: 100% 9px;
  background-repeat: no-repeat;
}
.reglet li { padding: 1.4rem 1rem 0 0; position: relative; font-size: 0.98rem; line-height: 1.4; }
.reglet li::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 3px; height: 1.1rem;
  background: var(--graphite);
}
.reglet .jour { display: block; font-family: var(--titre); font-weight: 700; font-size: 1.3rem; }
.reglet .repere-fort::before { background: var(--traceur); width: 9px; height: 1.4rem; }
.reglet .repere-fort .jour { font-size: 1.7rem; }

.tableau { overflow-x: auto; margin: 1.5rem 0 2rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; line-height: 1.45; }
caption { text-align: left; font-family: var(--titre); color: var(--gris); padding-bottom: 0.6rem; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem 0.7rem 0; border-bottom: 1px solid var(--trait); }
thead th { font-family: var(--titre); font-weight: 700; border-bottom: 2px solid var(--graphite); }
tbody th { font-family: var(--titre); font-weight: 700; min-width: 9rem; }
.large table { min-width: 58rem; }

.encadre {
  max-width: 44rem;
  background: var(--graphite);
  color: #fff;
  padding: 1.6rem 1.75rem;
  margin: 2.5rem 0;
  box-shadow: 8px 8px 0 var(--traceur);
}
.encadre h2, .encadre h3 { margin-top: 0; color: #fff; }
.encadre a { color: #FFB45C; }
.encadre p:last-child { margin-bottom: 0; }

.sources { font-size: 0.98rem; }
.sources li { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .reglet { grid-template-columns: 1fr; border-top: 0; border-left: 3px solid var(--graphite); background-image: none; }
  .reglet li { padding: 0 0 1.2rem 1.2rem; }
  .reglet li::before { width: 1.1rem; height: 3px; top: 0.8rem; }
  .reglet .repere-fort::before { width: 1.4rem; height: 9px; top: 0.7rem; }
}

/* Menu */
.entete { flex-wrap: wrap; gap: 0.6rem 2rem; }
.menu { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-family: var(--titre); font-size: 1rem; }
.menu a { color: var(--graphite); text-decoration: none; }
.menu a:hover { text-decoration: underline; text-decoration-color: var(--traceur); text-decoration-thickness: 3px; }
.ouverture h1 { max-width: 16ch; font-size: clamp(2.2rem, 4.6vw, 3.7rem); }

/* La ligne de faits, sous le premier écran */
.faits {
  list-style: none; margin: 0; padding: 1.4rem 0 3rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem;
  font-size: 1rem; color: var(--gris);
}
.faits strong { display: block; font-family: var(--titre); font-weight: 700; font-size: 1.7rem; color: var(--graphite); line-height: 1.2; }

/* Trois façons de s'y prendre */
.voies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin: 2rem 0 2.5rem; }
.voies > div { border-top: 3px solid var(--graphite); padding-top: 1rem; }
.voies .voie-forte { border-top: 9px solid var(--traceur); padding-top: calc(1rem - 6px); }
.voies h3 { font-weight: 700; font-size: 1.35rem; }
.prix { font-family: var(--titre); font-weight: 500; margin: 0.2rem 0 0.8rem; }
.voie-forte .prix { font-weight: 700; font-size: 1.3rem; }

/* Métiers du collectif */
.metiers { list-style: none; padding: 0; margin: 2rem 0; max-width: 46rem; }
.metiers li { border-top: 1px solid var(--trait); padding: 1.3rem 0 0.6rem 1.25rem; border-left: 6px solid var(--traceur); margin-bottom: 1.2rem; }
.metiers h3 { margin-top: 0; font-weight: 700; font-size: 1.3rem; }
.metiers p { margin-bottom: 0.5rem; }
.quand { font-size: 0.98rem; color: var(--gris); }
.quand span { font-family: var(--titre); font-weight: 700; color: var(--graphite); }

@media (max-width: 760px) {
  .faits, .voies { grid-template-columns: 1fr; }
}

/* La scène du gabarit. Sans script ni mouvement, tout est dessiné et lisible. */
.gabarit .assise { fill: var(--traceur); }
.gestes { list-style: none; counter-reset: geste; margin: 1.2rem 0 0; padding: 0; font-size: 1rem; line-height: 1.45; }
.gestes li { counter-increment: geste; padding: 0.45rem 0 0.45rem 2rem; position: relative; color: var(--gris); }
.gestes li::before { content: counter(geste); position: absolute; left: 0; font-family: var(--titre); font-weight: 700; color: var(--graphite); }
.gestes strong { font-family: var(--titre); color: var(--graphite); }
.scene-active .gestes li { opacity: 0.35; transition: opacity 0.3s; }
.scene-active .gestes li.en-cours { opacity: 1; }

/* Micro-interactions, sans bibliothèque */
@media (prefers-reduced-motion: no-preference) {
  .bouton { transition: box-shadow 0.15s ease-out, transform 0.15s ease-out; }
  .bouton:hover { transform: translate(3px, 3px); }
  .bouton:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--traceur); }
  details { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.25s ease-out, content-visibility 0.25s allow-discrete; }
  details[open]::details-content { block-size: auto; }
}
