/* Galerie blanche : noir, blanc, deux gris. Polices système, angles droits, aucune ombre. */
:root {
  --ink: #000000;
  --charcoal: #404040;
  --ash: #74747c; /* contraste 4,6:1 sur blanc (minimum WCAG AA : 4,5) */
  --plaster: #ffffff;

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --body: 16px;
  --caption: 12px;
  --lh: 1.2;

  --radius: 0;
  --gap: 20px;
  --pad: 40px;
  --section: 100px;
  --max: 1200px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font: 500 var(--body) / var(--lh) var(--font);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, figure, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* ── Deux zones : 30 % texte, 70 % images, même bord supérieur ── */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: var(--pad);
  align-items: start;
}
.side {
  position: sticky;
  top: var(--pad);
  max-height: calc(100vh - 2 * var(--pad));
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.main { min-width: 0; outline: none; }

/* ── Colonne de gauche ── */
.name { font-size: var(--body); font-weight: 500; }
.role { color: var(--charcoal); }
.intro { color: var(--ink); }
.intro cite { display: block; margin-top: 8px; font-style: normal; font-size: var(--caption); font-weight: 400; color: var(--ash); }
.row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--caption); font-weight: 400; }
.row a[aria-current] { text-decoration: underline; text-underline-offset: 2px; }
.row.muted { color: var(--ash); }
.back { font-size: var(--caption); font-weight: 400; }

/* ── Grille (masonry répartie en JS pour garder l'ordre de lecture) ── */
.grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.col { display: flex; flex-direction: column; gap: var(--gap); }
.tile { display: block; }
.tile:hover { text-decoration: none; }
.frame { border-radius: var(--radius); overflow: hidden; background: var(--plaster); }
.frame img { width: 100%; height: auto; }
.tile figcaption { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: var(--caption); font-weight: 400; }
.tile figcaption span:last-child { color: var(--ash); flex: none; }
.tile:hover figcaption span:first-child { text-decoration: underline; text-underline-offset: 2px; }
.shot { cursor: zoom-in; border: 0; padding: 0; background: none; width: 100%; display: block; }
.shot + figcaption { margin-top: 8px; font-size: var(--caption); font-weight: 400; color: var(--ash); }

/* ── Projet ── */
.project-head { display: flex; flex-direction: column; gap: 4px; }
.subtitle, .credits { color: var(--charcoal); }
.credits { font-size: var(--caption); font-weight: 400; }
.prose { display: flex; flex-direction: column; gap: 1.2em; font-weight: 400; color: var(--charcoal); }
.prose h2 { font-size: var(--body); font-weight: 500; color: var(--ink); margin-top: var(--gap); }
.prose h2:first-child { margin-top: 0; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose a { color: var(--ink); border-bottom: 1px solid var(--ash); }
.prose a:hover { text-decoration: none; border-color: var(--ink); }
.prose ul { display: flex; flex-direction: column; gap: 4px; }
.prose li::before { content: '– '; color: var(--ash); }
/* Boutons d'action (jouer, télécharger) et étapes numérotées */
.actions { display: flex; flex-direction: column; gap: 8px; }
.prose a.action { display: block; padding: 12px 16px; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); font-weight: 500; text-align: center; }
.prose a.action:hover { background: var(--ink); color: var(--plaster); }
.prose a.action.primary { background: var(--ink); color: var(--plaster); }
.prose a.action.primary:hover { background: var(--charcoal); border-color: var(--charcoal); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.prose .steps li::before { content: counter(step); display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--ink); color: var(--ink); font-size: var(--caption); font-weight: 500; }
.prose .ico { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.media { display: flex; flex-direction: column; gap: var(--gap); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--plaster); }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
video.clip { width: 100%; border-radius: var(--radius); }
.scene3d { aspect-ratio: 1; background: var(--plaster); }
.scene3d iframe { display: block; width: 100%; height: 100%; border: 0; }
.pager { display: flex; justify-content: space-between; gap: var(--gap); margin-top: var(--section); font-size: var(--caption); font-weight: 400; }
.pager span { color: var(--ash); }

/* ── Pages texte (bio, CV, presse…) ── */
.page-text { max-width: 640px; display: flex; flex-direction: column; gap: var(--pad); }
.page-text > h1 { font-size: var(--body); font-weight: 500; }
/* Titre au-dessus de la grille (catégorie, page introuvable) */
.grid-title { margin-bottom: var(--pad); }
h1.grid-title { font-size: var(--body); font-weight: 500; }
.page-text.grid-title { gap: var(--gap); }

/* ── Visionneuse ── */
.lightbox {
  position: fixed; inset: 0; z-index: 10;
  background: var(--plaster);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: var(--gap);
  gap: var(--gap);
}
.lightbox[hidden] { display: none; }
.lightbox .bar { display: flex; justify-content: space-between; gap: var(--gap); font-size: var(--caption); font-weight: 400; }
.lightbox .bar span { color: var(--ash); }
.lightbox button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.lightbox button:hover { text-decoration: underline; text-underline-offset: 2px; }
.lightbox .stage { min-height: 0; display: flex; align-items: center; justify-content: center; }
.lightbox .stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--radius); object-fit: contain; cursor: zoom-out; }
body.locked { overflow: hidden; }

.fade { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } }

/* ── Mobile : une seule colonne, grille à deux ── */
@media (max-width: 800px) {
  :root { --pad: 16px; --gap: 16px; --section: 64px; }
  .page { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 24px; }
  .side { position: static; max-height: none; overflow: visible; }
}
/* Une colonne : les vignettes reprennent l'ordre chronologique (style="order") quelle que soit
   la colonne où le pré-rendu les a placées, sans attendre que le script refasse la grille */
@media (max-width: 520px) {
  .grid { display: flex; flex-direction: column; align-items: stretch; gap: var(--gap); }
  .col { display: contents; }
}
