/* tarekmokhtari.io — feuille de style unique.
   Mode sobre par défaut ; mode atelier via html[data-mode="atelier"] (la mosaïque des fiches créatives en tête).
   Les variantes de style abandonnées vivent dans atelier/styles/. */

:root {
  /* Blanc chaud (fond, surfaces, traits) ; les gris de texte gardent un contraste d'au moins 7:1 sur le fond. */
  --fond: #FAF8F3;
  --surface: #FFFEFB;
  --texte: #15181E;
  --corps: #2A3140;
  --sourdine: #4A5260;
  --bord: #E6E1D6;
  --filet: #F0ECE3;
  --accent: #1F4FD8;
  --accent-fonce: #0F2F8C;
  --puce: #EEF2FB;
  --trait: #15181E;
  --police: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(21, 24, 30, 0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--police);
  background: var(--fond);
  color: var(--texte);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-fonce); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 32px 64px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ───────── En-tête ───────── */
.entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bord);
}
.entete .nom {
  font-weight: 700; font-size: 18px; color: var(--texte); text-decoration: none; letter-spacing: -0.01em;
  margin-right: auto;
}
.entete nav { display: flex; flex-wrap: wrap; gap: 22px; font-size: 15px; font-weight: 500; }
.entete nav a { color: var(--texte); text-decoration: none; }
.entete nav a:hover { color: var(--accent); }
.commandes { display: flex; align-items: center; gap: 10px; }

.bascule { display: inline-flex; border: 1px solid var(--bord); border-radius: 999px; background: var(--surface); padding: 2px; }
.bascule button {
  border: 0; background: transparent; color: var(--sourdine); font-weight: 600; font-size: 12px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer; line-height: 1;
}
.bascule button.actif { background: var(--texte); color: var(--fond); }
.langue {
  font: 600 12px var(--police); padding: 6px 10px; border-radius: 999px; cursor: pointer; line-height: 1;
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte);
}
.langue:hover { border-color: var(--accent); }

/* ───────── Héros ───────── */
.heros { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.heros .photo {
  flex: 0 0 auto; width: 168px; height: 210px; border-radius: 14px; overflow: hidden; display: block;
  border: 1px solid var(--bord); background: var(--surface); box-shadow: var(--ombre);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.heros .photo:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(21, 24, 30, 0.12); }
.heros .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.heros .texte { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.heros h1 { font-size: 42px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
.heros .sous { font-size: 18px; color: var(--sourdine); max-width: 640px; }
.heros .liens { display: flex; flex-wrap: wrap; gap: 20px; font-size: 16px; font-weight: 600; }

/* ───────── Sections ───────── */
.section { display: flex; flex-direction: column; gap: 20px; }
.section-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.section h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sourdine); }

/* ───────── Filtres : cinq mots, un seul actif ───────── */
.filtres { display: flex; flex-wrap: wrap; gap: 4px; }
.filtre {
  font: 600 13.5px var(--police); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--sourdine);
}
.filtre:hover { color: var(--texte); border-color: var(--bord); }
.filtre.actif { background: var(--texte); color: var(--fond); }

/* ───────── La sélection ───────── */
.grille-sel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.grille-sel .rang-1 { grid-column: span 6; }
.grille-sel .rang-2 { grid-column: span 3; }
.grille-sel .vide { grid-column: 1 / -1; color: var(--sourdine); font-size: 15px; }
.grille-plus { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }

.carte {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  transition: border-color 120ms, box-shadow 160ms;
}
.carte:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--bord)); box-shadow: 0 8px 22px rgba(21, 24, 30, 0.07); }
.carte .illu { display: block; border-bottom: 1px solid var(--bord); background: var(--filet); }
.carte .illu img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }
.carte .corps { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 16px; flex: 1; min-width: 0; }
.carte h3 { font-size: 21px; line-height: 1.2; }
.carte h3 a { color: inherit; text-decoration: none; }
.carte h3 a:hover { color: var(--accent); }
.carte h3 .plus { color: var(--sourdine); font-weight: 500; margin: 0 2px; }
.carte .resume { font-size: 15px; line-height: 1.5; color: var(--corps); }
.carte .pied {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--filet); margin-top: auto; font-size: 12.5px; color: var(--sourdine);
}
.carte .pied .lien { font-weight: 600; font-size: 14px; white-space: nowrap; }
/* Deux boutons par tuile : « Voir » (la page projet) et « Ouvrir le lab ↗ » (accès direct). */
.carte .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; min-width: 0; }
.bouton {
  display: inline-flex; align-items: center; min-height: 32px; padding: 5px 12px; border-radius: 999px;
  font: 600 13.5px/1.2 var(--police); white-space: nowrap; text-decoration: none;
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte);
}
.bouton:hover { border-color: var(--accent); color: var(--accent); }
.bouton-acces { background: var(--puce); border-color: color-mix(in srgb, var(--accent) 28%, var(--bord)); color: var(--accent-fonce); }
.bouton-acces:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.carte .jauges { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rang-2 .corps { padding: 16px 16px 14px; }
.rang-2 h3 { font-size: 18px; }
.rang-2 .resume { font-size: 14px; }
.grille-plus .carte .corps { padding: 16px 18px 14px; gap: 8px; }
.grille-plus .carte h3 { font-size: 17px; }
.grille-plus .carte .resume {
  font-size: 14px; color: var(--sourdine);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.bouton-plus {
  align-self: center; font: 600 14px var(--police); padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte);
}
.bouton-plus:hover { border-color: var(--accent); color: var(--accent); }

/* « Et aussi » : le rang 3 en index toujours visible, une ligne par projet (numéro, titre, accroche, thèmes, ↗) */
.et-aussi { display: flex; flex-direction: column; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--bord); min-width: 0; }
.et-aussi-titre { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sourdine); margin-bottom: 6px; }
.index-aussi { list-style: none; margin: 0; padding: 0; min-width: 0; }
.ligne { display: flex; align-items: center; min-width: 0; border-bottom: 1px solid var(--bord); }
.ligne-lien {
  flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 3rem 14rem minmax(0, 1fr) auto;
  column-gap: 16px; align-items: baseline; padding: 13px 8px 13px 0; color: inherit; text-decoration: none;
  border-radius: 6px; transition: background 120ms;
}
.ligne-lien:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); color: inherit; }
.ligne-num { font: 12px var(--mono); color: var(--sourdine); padding-left: 4px; }
.ligne-titre { font-size: 17px; font-weight: 600; color: var(--texte); line-height: 1.3; min-width: 0; }
.ligne-titre .plus { color: var(--sourdine); font-weight: 500; }
.ligne-lien:hover .ligne-titre { color: var(--accent); }
.ligne-accroche { font-size: 15px; color: var(--sourdine); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-themes { font-size: 13px; color: var(--sourdine); white-space: nowrap; text-align: right; }
.ligne-labs { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 2px; min-width: 2.75rem; }
.ligne-acces {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0 6px;
  border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; color: var(--accent);
}
.ligne-acces:hover { background: var(--puce); color: var(--accent-fonce); }
/* L'image du projet, près du pointeur (ordinateur seulement ; app.js) */
.survol-apercu {
  position: fixed; left: 0; top: 0; width: 288px; z-index: 40; pointer-events: none; opacity: 0; transition: opacity 150ms;
  border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; background: var(--filet);
  box-shadow: 0 14px 36px rgba(21, 24, 30, 0.18);
}
.survol-apercu.vu { opacity: 1; }
.survol-apercu img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }

/* ───────── Jauge à deux côtés ───────── */
.jauge-bloc { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; font: inherit; }
.jauge-bloc .etiq { font-size: 12px; color: var(--sourdine); }
.jauge {
  position: relative; width: 104px; height: 12px; border-radius: 3px;
  background: var(--filet); border: 1px solid var(--bord); overflow: hidden; flex: 0 0 auto;
}
.jauge .g, .jauge .d { position: absolute; top: 0; bottom: 0; }
.jauge .g { right: 50%; background: var(--accent); border-radius: 2px 0 0 2px; }
.jauge .d {
  left: 50%; border-radius: 0 2px 2px 0;
  background: repeating-linear-gradient(135deg, var(--accent) 0 3px, transparent 3px 6px);
  background-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.jauge .trait { position: absolute; left: calc(50% - 1px); top: -1px; bottom: -1px; width: 2px; background: var(--trait); }
.jauge-bloc:hover .jauge { border-color: var(--accent); }
.duo .jauge { width: 72px; }

/* Surcouche jauge */
.voile {
  position: fixed; inset: 0; background: rgba(21, 24, 30, 0.55); display: none; z-index: 50;
  align-items: flex-start; justify-content: center; padding: 48px 16px; overflow: auto;
}
.voile.ouvert { display: flex; }
.panneau {
  width: min(840px, 100%); background: var(--surface); border: 1px solid var(--bord); border-radius: 14px;
  padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.panneau .tete { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.panneau h2 { font-size: 22px; letter-spacing: -0.01em; text-transform: none; color: var(--texte); }
.panneau p { font-size: 15px; color: var(--corps); max-width: 70ch; }
.panneau .fermer { border: 1px solid var(--bord); background: var(--fond); color: var(--texte); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
.legende-jauge { display: grid; grid-template-columns: 200px 1fr; gap: 12px; font-size: 12px; color: var(--sourdine); }
.legende-jauge .axes { display: flex; justify-content: space-between; }
.rangees { display: flex; flex-direction: column; gap: 6px; }
.rangee { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: center; text-decoration: none; color: inherit; padding: 4px 6px; border-radius: 6px; }
.rangee:hover, .rangee.cible { background: var(--puce); }
.rangee .n { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rangee .jauge { width: 100%; height: 14px; }

/* ───────── Comment je travaille ───────── */
.grille-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pilier { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-left: 2px solid var(--accent); }
.pilier strong { font-size: 16px; }
.pilier p { font-size: 14px; line-height: 1.5; color: var(--sourdine); }

/* Bandeau d'images, en haut de « Comment je travaille » : défilement à la main, aimanté (pas d'automatique) */
.bandeau { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bandeau-piste {
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 2px 2px 10px; border-radius: var(--rayon);
}
.bandeau-item { flex: 0 0 auto; width: min-content; margin: 0; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; }
.bandeau-image { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--rayon); }
.bandeau-image img {
  display: block; height: 280px; width: auto; max-width: none; border-radius: var(--rayon);
  border: 1px solid var(--bord); background: var(--filet); transition: box-shadow 160ms;
}
.bandeau-image:hover img { box-shadow: 0 8px 22px rgba(21, 24, 30, 0.12); }
.bandeau-item figcaption { font-size: 14px; line-height: 1.45; color: var(--sourdine); }
.bandeau-item figcaption a { font-weight: 600; white-space: nowrap; }
.bandeau-commandes { display: flex; justify-content: flex-end; gap: 8px; }
.bandeau-fleche {
  font: 600 15px var(--police); width: 38px; height: 34px; border-radius: 999px; cursor: pointer; line-height: 1;
  border: 1px solid var(--bord); background: var(--surface); color: var(--texte);
}
.bandeau-fleche:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.bandeau-fleche:disabled { opacity: 0.4; cursor: default; }
/* L'image en grand, dans la surcouche de la jauge */
.panneau-image { width: auto; max-width: min(1040px, 100%); align-items: center; }
.panneau-image .tete { align-self: stretch; }
.panneau-image img { display: block; max-width: 100%; max-height: min(560px, calc(100vh - 220px)); width: auto; height: auto; border-radius: 8px; }
.panneau-image p { font-size: 15px; color: var(--corps); max-width: 70ch; align-self: flex-start; }

/* Page « Sept axes, sept choix » (methode/variantes.html) */
.article.article-large { max-width: 1040px; }
.article.article-large > p { max-width: 760px; }
.defile-tableau { overflow-x: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.tableau-axes { border-collapse: collapse; width: 100%; min-width: 900px; font-size: 13.5px; color: var(--corps); }
.tableau-axes th, .tableau-axes td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--filet); }
.tableau-axes thead th { font-size: 13px; color: var(--texte); border-bottom: 1px solid var(--bord); }
.tableau-axes tbody tr:last-child > * { border-bottom: 0; }
.tableau-axes .echelle { display: block; font-weight: 400; font-size: 12px; color: var(--sourdine); }
.tableau-axes tbody th b { font-size: 18px; color: var(--texte); }
.tableau-axes code { font: 600 12px var(--mono); color: var(--accent-fonce); }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.vignettes figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.vignettes img { display: block; width: 100%; height: auto; border: 1px solid var(--bord); border-radius: var(--rayon); }
.vignettes figcaption { font-size: 14px; color: var(--sourdine); }

/* ───────── Pied ───────── */
.pied-page {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 16px;
  border-top: 1px solid var(--bord); font-size: 13px; color: var(--sourdine);
}
.pied-page .contact { margin: 0; font-size: 15px; color: var(--corps); }
.pied-page .contact a { color: var(--texte); font-weight: 600; }
.pied-page .contact a:hover { color: var(--accent); }
.avert-en { display: none; font-size: 12px; color: var(--sourdine); }
html[lang="en"] .avert-en { display: block; }

/* ───────── Pages intérieures (projet, qui, manifeste, méthode) ───────── */
.article { max-width: 760px; display: flex; flex-direction: column; gap: 22px; }
.article .retour { font-size: 14px; font-weight: 600; }
.article h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; }
.article .sous { font-size: 18px; color: var(--sourdine); }
.article h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sourdine); margin-top: 8px; }
.article p { font-size: 17px; line-height: 1.6; color: var(--corps); }
.article .encart { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; font-size: 13px; color: var(--sourdine); padding: 14px 16px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.article .encart .chiffres { font-family: var(--mono); font-size: 12.5px; }
.article .chantier { font-size: 14px; color: var(--sourdine); padding: 12px 16px; border-left: 2px solid var(--bord); }
.article ul { margin: 0; padding-left: 20px; font-size: 16px; color: var(--corps); line-height: 1.6; }
.article .capture { width: 100%; border: 1px solid var(--bord); border-radius: var(--rayon); display: block; }
.qui-photo { width: 220px; height: auto; border-radius: 14px; border: 1px solid var(--bord); display: block; }
.citation { font-size: 20px; line-height: 1.45; color: var(--texte); border-left: 3px solid var(--accent); padding-left: 18px; font-style: italic; }
.citation small { display: block; font-style: normal; font-size: 13px; color: var(--sourdine); margin-top: 6px; }

/* Page projet */
.projet .illu-page { margin: 0; border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; background: var(--filet); }
.projet .illu-page img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }
.note-perso { margin: 0; font-size: 20px; line-height: 1.45; font-style: italic; color: var(--texte); border-left: 3px solid var(--accent); padding: 2px 0 2px 18px; }
.bouton-lab {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--police);
  padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none;
}
.bouton-lab:hover { background: var(--accent-fonce); color: #fff; }
.projet .avec { font-size: 15px; color: var(--sourdine); }
.projet .fig { margin: 4px 0; display: flex; flex-direction: column; gap: 8px; }
.projet .fig img { display: block; width: 100%; height: auto; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); }
.projet .fig figcaption { font-size: 14px; line-height: 1.5; color: var(--sourdine); }
.projet .avec a { font-weight: 600; }

/* Sommaire de la page projet (construire.js) : une ligne de liens sous le titre ;
   à partir de 1100 px, une colonne étroite et collante à gauche, la section en cours soulignée. */
.projet [id] { scroll-margin-top: 24px; }
.sommaire { font-size: 14px; min-width: 0; }
.sommaire-liste { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; min-width: 0; }
.sommaire-titre { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sourdine); }
.projet .sommaire ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; min-width: 0; font-size: 14px; line-height: 1.4; }
.sommaire li { min-width: 0; }
.sommaire a { color: var(--sourdine); text-decoration: none; font-weight: 500; overflow-wrap: anywhere; }
.sommaire a:hover { color: var(--accent); }
.sommaire a[aria-current] { color: var(--texte); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
@media (min-width: 1100px) {
  .projet.a-sommaire { position: relative; margin-left: 228px; }
  .projet.a-sommaire .sommaire { position: absolute; top: 0; bottom: 0; left: -228px; width: 180px; }
  .projet.a-sommaire .sommaire-liste {
    position: sticky; top: 24px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px;
    padding-left: 14px; border-left: 1px solid var(--bord);
  }
  .projet.a-sommaire .sommaire ul { flex-direction: column; flex-wrap: nowrap; gap: 8px; }
}

/* Sections de page écrites en HTML (listes, sous-titres) */
.article h3 { font-size: 15px; font-weight: 700; color: var(--texte); margin: 12px 0 0; }
.article .article-liste { margin: 6px 0 0; padding-left: 20px; font-size: 16px; color: var(--corps); line-height: 1.6; }
.article .article-liste li { margin-bottom: 4px; }
.article .chiffres-page { display: flex; flex-wrap: wrap; gap: 10px 22px; font-family: var(--mono); font-size: 13px; color: var(--sourdine); }
.article .chiffres-page b { display: block; font: 700 22px var(--police); color: var(--texte); letter-spacing: -0.01em; }
.article p + p, .article ul + p, .article .chiffres-page + p { margin-top: 10px; }
.article .nw { white-space: nowrap; }

/* Lisière : la figure de la boucle et l'encart « Où se place Lisière » (écrits dans projets.js) */
.projet .fig-boucle img { max-width: 640px; }
.projet .place { margin: 10px 0 4px; padding: 18px 18px 14px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.projet .place > h3 { margin: 0 0 12px; font-size: 17px; }
.projet .place-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.projet .place-grille > div { min-width: 0; }
.projet .place-these, .projet .place-biblio { grid-column: 1 / -1; }
.projet .place-biblio { border-top: 1px solid var(--filet); padding-top: 12px; }
.projet .place h4 { margin: 0 0 5px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.projet .place p { font-size: 15px; line-height: 1.55; }
.projet .place .place-these p { font-size: 16.5px; }
.projet .place .place-note { font-size: 13px; color: var(--sourdine); margin: 0 0 8px; }
.projet .place ol { margin: 0; padding-left: 1.4em; font-size: 13.5px; line-height: 1.5; color: var(--sourdine); columns: 2; column-gap: 26px; }
.projet .place li { break-inside: avoid; margin-bottom: 6px; }
.projet .place li i { color: var(--texte); }
/* Lisière : « Trois échelles », une vignette et un lien par mini-lab */
.projet .echelles-cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 6px 0 4px; }
.projet .echelle-carte { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); color: var(--texte); text-decoration: none; }
.projet .echelle-carte:hover { border-color: var(--accent); }
.projet .echelle-carte img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--filet); }
.projet .echelle-n { font-weight: 700; font-size: 15px; margin-top: 4px; }
.projet .echelle-p { font-size: 14px; line-height: 1.5; color: var(--corps); }
.projet .echelle-l { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 600; color: var(--accent); }
.projet .carte-chantiers { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .projet .echelles-cartes { grid-template-columns: 1fr; }
  .projet .place { padding: 14px; }
  .projet .place-grille { grid-template-columns: 1fr; }
  .projet .place ol { columns: 1; }
}

/* Boutons du manifeste (tirage) */
.chip {
  font: 600 13px var(--police); padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bord); background: var(--fond); color: var(--texte);
}
.chip:hover { border-color: var(--accent); }
.chip.actif { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ───────── Contenus bilingues (pages générées) ───────── */
html[lang="en"] [data-lang="fr"] { display: none; }
html:not([lang="en"]) [data-lang="en"] { display: none; }

/* ───────── Page 404 : la fin du manifeste, phrase inachevée ───────── */
.page-404 { padding: 40px 0 80px; }
.page-404 .fin-404 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--texte); margin-top: 28px; }
.curseur-404 { display: inline-block; width: 0.5em; height: 1em; background: currentColor; vertical-align: -0.12em; margin-left: 3px; animation: clignote 1.1s steps(1) infinite; }
@keyframes clignote { 50% { opacity: 0; } }

/* ───────── Mode atelier : la mosaïque des fiches créatives, qui débordent de leur case ───────── */
.grille-mosaique { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; padding-top: 30px; gap: 22px 20px; }
.grille-mosaique .scene-azetta { grid-column: span 4; }
.grille-mosaique .scene-piano { grid-column: span 2; grid-row: span 2; }
.grille-mosaique .scene-chemin { grid-column: span 2; }
.grille-mosaique .scene-seance { grid-column: span 2; }

.carte.scene { position: relative; overflow: visible; border: 0; padding: 0; background: transparent; box-shadow: none; min-height: 300px; justify-content: flex-end; }
.carte.scene:hover { border: 0; box-shadow: none; }
.carte.scene .decor { position: absolute; inset: 0; z-index: 0; border-radius: var(--rayon); pointer-events: none; }
.carte.scene .decor > * { position: absolute; }
.carte.scene .corps {
  position: relative; z-index: 1; flex: 0 0 auto; margin: 150px 14px 14px; padding: 14px 16px 12px;
  background: color-mix(in srgb, var(--surface) 93%, transparent); border-radius: 10px; backdrop-filter: blur(3px);
  border: 1px solid color-mix(in srgb, var(--bord) 60%, transparent);
}
.carte.scene .titre-scene {
  position: absolute; z-index: 2; top: -30px; left: 12px; margin: 0;
  font-size: 44px; line-height: 0.95; letter-spacing: -0.03em; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  max-width: calc(100% - 24px);
}
.carte.scene .titre-scene a { color: inherit; text-decoration: none; }
.carte.scene .titre-scene a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.carte.scene .resume { font-size: 14.5px; }
.grille-mosaique .scene-piano .corps { margin-top: 240px; }

/* Azeṭṭa : un tissage qui se noue, une frange qui dépasse à droite */
.scene-azetta .tissage {
  inset: 0; border-radius: var(--rayon); background-color: #F1E6D0;
  background-image:
    repeating-linear-gradient(45deg, rgba(184, 66, 42, 0.82) 0 9px, transparent 9px 26px),
    repeating-linear-gradient(-45deg, rgba(30, 42, 90, 0.78) 0 9px, transparent 9px 26px),
    repeating-linear-gradient(90deg, rgba(224, 178, 74, 0.55) 0 2px, transparent 2px 11px);
  background-size: 52px 52px, 52px 52px, 11px 11px;
  animation: nouer 2.2s cubic-bezier(.2,.7,.2,1) 1;
}
@keyframes nouer { from { background-position: 0 -260px, 0 260px, 0 0; } to { background-position: 0 0, 0 0, 0 0; } }
.scene-azetta .frange { right: -18px; top: 22px; bottom: 22px; width: 26px; background: repeating-linear-gradient(90deg, #B8422A 0 3px, transparent 3px 7px); }
.carte.scene-azetta .titre-scene { color: #1E2A5A; left: -6px; }

/* Le ciel : le vrai ciel déborde par le haut ; la montagne d'un trait ; l'eau */
.scene-chemin .ciel {
  left: 0; right: 0; top: -28px; height: 206px; border-radius: 14px 14px 0 0;
  background:
    radial-gradient(1.2px 1.2px at 18% 32%, #fff 70%, transparent 71%),
    radial-gradient(1.6px 1.6px at 66% 18%, #fff 70%, transparent 71%),
    radial-gradient(1px 1px at 82% 44%, #fff 70%, transparent 71%),
    radial-gradient(1.4px 1.4px at 40% 12%, #fff 70%, transparent 71%),
    radial-gradient(1px 1px at 55% 50%, #fff 70%, transparent 71%),
    radial-gradient(1.1px 1.1px at 8% 60%, #fff 70%, transparent 71%),
    radial-gradient(1.3px 1.3px at 90% 10%, #fff 70%, transparent 71%),
    radial-gradient(1px 1px at 30% 70%, #fff 70%, transparent 71%),
    linear-gradient(180deg, #0B1530 0%, #1E2A4A 55%, #6E8AA8 100%);
}
.scene-chemin .montagne { left: 0; right: 0; width: 100%; height: 64px; top: 120px; color: #2E3A4A; }
.scene-chemin .eau { left: 0; right: 0; top: 178px; bottom: 0; border-radius: 0 0 var(--rayon) var(--rayon); background: linear-gradient(180deg, #9CB7C9, #EFE3D3); }
.carte.scene-chemin .titre-scene { color: #FFFFFF; top: 2px; left: 16px; font-size: 38px; }
.scene-chemin .corps { margin-top: 196px; }

/* Le Cœur du piano : laque noire, deux ondes qui battent, les touches qui sortent par le bas */
.scene-piano .decor { background: #101214; border-radius: var(--rayon); }
.scene-piano .battement { left: 0; right: 0; width: 100%; height: 80px; top: 120px; color: #D8B45A; }
.scene-piano .touches {
  left: 10px; right: 10px; bottom: -16px; height: 64px; border-radius: 0 0 4px 4px;
  background-image:
    linear-gradient(90deg, transparent 0 14px, #15171A 14px 24px, transparent 24px 38px, #15171A 38px 48px, transparent 48px 72px, #15171A 72px 82px, transparent 82px 96px, #15171A 96px 106px, transparent 106px 120px, #15171A 120px 130px, transparent 130px 168px),
    repeating-linear-gradient(90deg, #F5F0E6 0 23px, #CFC9BB 23px 24px);
  background-size: 168px 60%, 24px 100%; background-repeat: repeat-x, repeat;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.carte.scene-piano .titre-scene { color: #F5F0E6; top: 18px; left: 18px; }
.scene-piano .corps { margin-bottom: 78px; }

/* Séance piano : papier à musique, l'arbre au crayon qui dépasse à droite */
.scene-seance .decor { background: #FBF8EF; border-radius: var(--rayon); border: 1px solid #E6E0D0; }
.scene-seance .portee {
  left: 0; right: 0; top: 20px; height: 120px; opacity: 0.55;
  background: repeating-linear-gradient(180deg, #9A9385 0 1px, transparent 1px 9px);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.scene-seance .arbre { right: -16px; top: 18px; width: 52%; height: auto; color: #3A3A3A; }
.carte.scene-seance .titre-scene { color: #3A3A3A; left: -6px; }

/* ───────── Réactif ───────── */
@media (max-width: 960px) {
  .grille-sel .rang-1 { grid-column: span 12; }
  .grille-sel .rang-2 { grid-column: span 6; }
  .grille-plus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-how { grid-template-columns: 1fr; }
  .grille-mosaique { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-mosaique .scene-azetta { grid-column: span 2; }
  .grille-mosaique .scene-piano, .grille-mosaique .scene-chemin, .grille-mosaique .scene-seance { grid-column: span 1; grid-row: auto; }
}
@media (max-width: 720px) {
  .page { padding: 16px 16px 48px; gap: 40px; }
  .grille-sel .rang-1, .grille-sel .rang-2 { grid-column: span 12; }
  .grille-plus { grid-template-columns: minmax(0, 1fr); }
  .heros h1 { font-size: 30px; }
  .heros .sous { font-size: 16px; }
  .entete nav { gap: 14px; font-size: 14px; }
  .rangee, .legende-jauge { grid-template-columns: 120px 1fr; }
  .panneau { padding: 20px 16px; }
  .article h1 { font-size: 30px; }
  .bouton-lab { margin-left: 0; }
  .grille-mosaique { grid-template-columns: minmax(0, 1fr); }
  .grille-mosaique .carte.scene { grid-column: span 1; grid-row: auto; }
  .grille-mosaique .scene-piano .corps { margin-top: 170px; }
  .bandeau-image img { height: 200px; }
  .bandeau-piste { gap: 14px; }
  /* Tuiles : des boutons d'au moins 40 px de haut au doigt */
  .bouton { min-height: 40px; padding: 8px 14px; }
  /* « Et aussi » : l'accroche passe sous le titre, les thèmes dessous ; pas d'image */
  .ligne-lien { grid-template-columns: 2.25rem minmax(0, 1fr); row-gap: 3px; padding: 12px 4px 12px 0; }
  .ligne-num { grid-row: 1 / 4; }
  .ligne-titre { grid-column: 2; }
  .ligne-accroche { grid-column: 2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }
  .ligne-themes { grid-column: 2; text-align: left; font-size: 12.5px; }
  .ligne-acces { min-width: 40px; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .survol-apercu, .ligne-lien { transition: none; }
  .scene-azetta .tissage, .curseur-404 { animation: none; }
}

/* Portraits : noir et blanc sur l'accueil (cadre arrondi), couleur sur « Qui je suis ». */
.qui-portrait { width: 300px; max-width: 100%; height: auto; }
