/* ============================================================
   Composants — sections, cartes, timeline, fiches projet
   ============================================================ */

/* ---------- Bouton ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  font-family: var(--f-sans);
  font-size: var(--t-16);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast), transform var(--tr-fast);
  cursor: pointer;
}
.btn--primary {
  background: var(--c-accent);
  color: var(--c-bg);
  border-color: var(--c-accent);
}
.btn--primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  color: var(--c-bg);
  transform: translateY(-1px);
}
.btn__arrow { transition: transform var(--tr-fast); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ---------- Eyebrow (étiquette mono accent) ---------- */
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-signal);
  font-weight: 500;
}

/* ============================================================
   HERO — accueil
   ============================================================ */
.hero {
  padding: clamp(var(--s-12), 10vw, var(--s-24)) 0 clamp(var(--s-12), 8vw, var(--s-16));
  border-bottom: var(--b-1) solid var(--c-border);
}
.hero__eyebrow {
  margin-bottom: var(--s-6);
}
.hero__title {
  font-size: clamp(2.5rem, 6.5vw, 4.5rem);
  line-height: 1.04;
  max-width: 18ch;
  margin-bottom: var(--s-6);
  font-variation-settings: "opsz" 96, "wght" 600;
}
.hero__title em {
  color: var(--c-accent);
  font-style: italic;
  font-variation-settings: "opsz" 96, "wght" 500, "SOFT" 50;
}
.hero__lead {
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  line-height: 1.55;
  max-width: 58ch;
  color: var(--c-text-muted);
  margin-bottom: var(--s-8);
}
.hero__cta { margin-top: var(--s-4); }

/* ============================================================
   PROOF — preuve lab (schéma SVG)
   ============================================================ */
.proof {
  padding: clamp(var(--s-12), 8vw, var(--s-16)) 0;
}
.proof__title {
  margin-bottom: var(--s-6);
}
.proof__lead {
  font-size: var(--t-18);
  color: var(--c-text-muted);
  margin-bottom: var(--s-12);
}
.proof__figure {
  margin: 0;
  background: #FBF8F3;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .proof__figure {
  background: #EFEAE0;
  border-color: var(--c-border-strong);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.proof__figure img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}
.proof__figure figcaption {
  font-family: var(--f-mono);
  font-size: var(--t-14);
  color: #5B6B7A;
  text-align: center;
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--c-border-strong);
  font-style: italic;
}

/* ============================================================
   RECONVERSION — 4 paragraphes + timeline
   ============================================================ */
.reconv {
  padding: clamp(var(--s-12), 8vw, var(--s-16)) 0;
  border-top: var(--b-1) solid var(--c-border);
  background: var(--c-bg-card);
}
.reconv__title { margin-bottom: var(--s-8); max-width: 28ch; }
.reconv__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s-16);
  align-items: start;
}
.reconv__text p {
  margin-bottom: var(--s-4);
  font-size: var(--t-16);
  line-height: 1.75;
}
.reconv__text p:last-child { margin-bottom: 0; }

/* ---------- Timeline verticale ---------- */
.timeline {
  list-style: none;
  position: relative;
  padding: 0 0 0 var(--s-6);
  margin: 0;
  border-left: 2px solid var(--c-border-strong);
}
.timeline__item {
  position: relative;
  padding-bottom: var(--s-8);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(var(--s-6) * -1 - 7px);
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--c-bg-card);
  border: 2px solid var(--c-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--c-bg-card);
}
.timeline__item--current::before {
  background: var(--c-signal);
  border-color: var(--c-signal);
}
.timeline__date {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-signal);
  margin-bottom: var(--s-1);
  font-weight: 500;
}
.timeline__title {
  font-family: var(--f-sans);
  font-size: var(--t-18);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--s-1);
  letter-spacing: 0;
  font-variation-settings: normal;
}
.timeline__detail {
  color: var(--c-text-muted);
  font-size: var(--t-14);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .reconv__grid {
    grid-template-columns: 1fr;
    gap: var(--s-12);
  }
}

/* ============================================================
   PAGE PROJETS — intro, sommaire, fiches
   ============================================================ */
.projects-intro {
  padding: clamp(var(--s-12), 8vw, var(--s-16)) 0 var(--s-8);
}
.projects-intro__title {
  margin-bottom: var(--s-6);
}
.projects-intro__lead {
  font-size: var(--t-20);
  color: var(--c-text-muted);
  max-width: var(--w-narrow);
  line-height: 1.6;
}

/* ---------- Sommaire (TOC) ---------- */
.projects-toc {
  margin-top: var(--s-10, var(--s-8));
  padding: var(--s-6);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.projects-toc__label {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--s-3);
  display: block;
}
.projects-toc__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-2) var(--s-6);
  counter-reset: tocproject;
  padding: 0;
}
.projects-toc__list li {
  counter-increment: tocproject;
  padding: var(--s-1) 0;
}
.projects-toc__list a {
  display: inline-block;
  text-decoration: none;
  color: var(--c-text);
  font-size: var(--t-14);
  line-height: 1.4;
  transition: color var(--tr-fast);
}
.projects-toc__list a::before {
  content: counter(tocproject, decimal-leading-zero);
  font-family: var(--f-mono);
  color: var(--c-signal);
  font-weight: 500;
  margin-right: var(--s-2);
}
.projects-toc__list a:hover {
  color: var(--c-accent);
}

/* ---------- Fiche projet ---------- */
.project {
  padding: clamp(var(--s-12), 8vw, var(--s-16)) 0;
  border-top: 1px solid var(--c-border);
  scroll-margin-top: 80px;
}
.project__header {
  margin-bottom: var(--s-8);
  max-width: var(--w-narrow);
}
.project__eyebrow {
  display: block;
  margin-bottom: var(--s-3);
}
.project__title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  max-width: 26ch;
  line-height: 1.15;
  font-variation-settings: "opsz" 48, "wght" 600;
}
.project__block {
  margin-bottom: var(--s-8);
  max-width: var(--w-narrow);
}
.project__block:last-child {
  margin-bottom: 0;
}
.project__heading {
  font-family: var(--f-serif);
  font-size: var(--t-20);
  font-weight: 600;
  margin-bottom: var(--s-4);
  padding-left: var(--s-4);
  border-left: 3px solid var(--c-signal);
  line-height: 1.3;
  font-variation-settings: "opsz" 24, "wght" 600;
}
.project__block p {
  font-size: var(--t-16);
  line-height: 1.7;
}
.project__block p + p { margin-top: var(--s-3); }

/* Liste à puces "·" verte */
.project__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: 0;
}
.project__list li {
  padding-left: var(--s-5, 1.25rem);
  position: relative;
  line-height: 1.65;
}
.project__list li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--c-signal);
  border-radius: 50%;
}

/* Tableaux des fiches */
.project__table-wrap {
  overflow-x: auto;
  margin-top: var(--s-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-bg-card);
}
.project__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-14);
  line-height: 1.5;
}
.project__table th,
.project__table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}
.project__table thead th {
  background: var(--c-bg-elevated);
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: var(--t-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.project__table tbody tr:last-child td { border-bottom: none; }
.project__table tbody tr:hover { background: var(--c-bg-elevated); }
.project__table code {
  background: transparent;
  padding: 0;
  font-size: 0.95em;
  color: var(--c-accent);
}

/* Bloc outils en pied de fiche */
.project__tools {
  margin-top: var(--s-8);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--c-border-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  max-width: var(--w-narrow);
}
.project__tools-label {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.project__tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  padding: 0;
}
.project__tools-list li {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  background: var(--c-code-bg);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}

/* Mots techniques dans le corps (code inline) */
.project p code,
.project li code {
  background: var(--c-code-bg);
  color: var(--c-accent);
}

@media (max-width: 640px) {
  .project__heading { padding-left: var(--s-3); }
  .project__table { font-size: var(--t-12); }
  .project__table th,
  .project__table td { padding: var(--s-2) var(--s-3); }
}

/* ============================================================
   PAGE PROJETS — grille de tuiles
   ============================================================ */
.projects-grid {
  margin-top: var(--s-12);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-6);
  list-style: none;
  padding: 0;
}
.project-tile {
  display: flex;
  flex-direction: column;
  padding: var(--s-6);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: transform var(--tr-fast), border-color var(--tr-fast), box-shadow var(--tr-fast);
  height: 100%;
}
.project-tile:hover {
  transform: translateY(-3px);
  border-color: var(--c-accent);
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  color: inherit;
}
.project-tile:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}
.project-tile__num {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-signal);
  margin-bottom: var(--s-3);
  font-weight: 500;
}
.project-tile__title {
  font-family: var(--f-serif);
  font-size: var(--t-20);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: var(--s-3);
  color: var(--c-text);
  font-variation-settings: "opsz" 24, "wght" 600;
  letter-spacing: -0.01em;
}
.project-tile__summary {
  font-size: var(--t-14);
  color: var(--c-text-muted);
  line-height: 1.55;
  margin: 0 0 var(--s-4);
  flex: 1;
}
.project-tile__arrow {
  font-family: var(--f-mono);
  font-size: var(--t-14);
  color: var(--c-accent);
  transition: transform var(--tr-fast);
  margin-top: auto;
}
.project-tile:hover .project-tile__arrow { transform: translateX(4px); }

/* ============================================================
   PAGE PROJET INDIVIDUELLE — bouton retour, schéma, note
   ============================================================ */
/* Page projet individuelle : pas de double bordure avec le header */
.project:only-of-type { border-top: 0; padding-top: var(--s-8); }

.project-back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-sans);
  font-size: var(--t-14);
  color: var(--c-text-muted);
  text-decoration: none;
  margin-bottom: var(--s-8);
  transition: color var(--tr-fast), transform var(--tr-fast);
}
.project-back:hover { color: var(--c-accent); transform: translateX(-3px); }
.project-back__arrow { font-family: var(--f-mono); }

.project-end {
  margin-top: var(--s-16);
  padding-top: var(--s-6);
  border-top: 1px dashed var(--c-border);
  max-width: var(--w-narrow);
}

/* Schéma intégré dans une fiche projet */
.project__schema {
  margin: var(--s-8) 0;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-6);
  max-width: var(--w-narrow);
}
[data-theme="dark"] .project__schema {
  background: #EFEAE0;
  border-color: var(--c-border-strong);
}
.project__schema img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.project__schema figcaption {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  color: #5B6B7A;
  text-align: center;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--c-border-strong);
  font-style: italic;
}

/* Note d'architecture (encadré accentué) */
.project__note {
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-6);
  background: var(--c-code-bg);
  border-left: 3px solid var(--c-accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--t-14);
  line-height: 1.65;
  max-width: var(--w-narrow);
}
.project__note strong { color: var(--c-accent); }

/* ---------- Captures d'écran (preuves UI) ---------- */
.project__capture {
  margin: var(--s-8) 0;
  max-width: var(--w-narrow);
}
.project__capture img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
}
.project__capture figcaption {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  color: var(--c-text-muted);
  text-align: center;
  margin-top: var(--s-3);
  font-style: italic;
  line-height: 1.5;
}

/* Paire de captures (HA Master / Backup) — empilées verticalement pour rester lisibles à largeur prose */
.project__captures-pair {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  margin: var(--s-8) 0;
  max-width: var(--w-narrow);
}
.project__captures-pair figure { margin: 0; }
.project__captures-pair img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.project__captures-pair figcaption {
  font-family: var(--f-mono);
  font-size: var(--t-12);
  color: var(--c-text-muted);
  text-align: center;
  margin-top: var(--s-3);
  font-style: italic;
}
@media (max-width: 768px) {
  .project__captures-pair { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* Sous-titres de zones (Projet 2 — zone par zone) */
.project__zone-title {
  font-family: var(--f-sans);
  font-size: var(--t-16);
  font-weight: 600;
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
  color: var(--c-text);
  letter-spacing: 0;
}
.project__zone-title code {
  font-family: var(--f-mono);
  background: var(--c-code-bg);
  color: var(--c-accent);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 0.9em;
  margin-right: var(--s-2);
}
