/* ─────────────────────────────────────────────
   nasryne ouabi — V6
   Mise en page : nom géant, rangées d'infos en petites capitales,
   index des projets en très grand. Charte : Europa, noir sur blanc.
   ───────────────────────────────────────────── */

:root {
  --paper: #ffffff;
  --ink: #000000;
  --mute: #6b6b6b;
  --line: #000000;
  --wash: #ffffff;                 /* fond derrière les images : blanc, pour les images détourées (fond transparent) */

  --font: "Europa", "Helvetica Neue", Arial, sans-serif;
  --track: 0.03em;                 /* approche 30 : grands titres */
  --track-caps: 0.04em;            /* approche 40 : petites capitales */

  --gutter: clamp(12px, 1.1vw, 20px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }

h1, h2, p, dl, dd, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Texte géant, ajusté à la largeur par le JS ── */

.giant {
  font-weight: 700;
  font-size: 15.4vw;               /* valeur de secours si le JS ne tourne pas */
  line-height: 0.8;
  letter-spacing: var(--track);
  white-space: nowrap;
  margin-inline: -0.035em;         /* les lettres touchent optiquement les marges */
}

.giant .mask { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.giant .mask > span { display: inline-block; }   /* inline-block : sa largeur = celle du texte */

/* ── Rangées d'infos : 4 colonnes, petites capitales ── */

.meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  font-weight: 500;
  font-size: clamp(11px, 0.78vw, 13px);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

.meta .m1 { grid-column: 1 / 3; }
.meta .m3 { grid-column: 3; }
.meta .m4 { grid-column: 4; }
.meta .right { text-align: right; }

.label,
.meta dt {
  font-weight: 400;
  font-size: 0.72em;
  color: var(--mute);
  margin-right: 0.5em;
  vertical-align: 0.1em;
}

.meta dt { display: inline; }
.meta dd { display: inline; }

.meta-bar { padding: 14px 0; }
.meta-bar nav a + a { margin-left: 0.9em; }

/* ── Ouverture ───────────────────────────────── */

/* Nom géant en haut de page */
.top { padding: 0 var(--gutter); }

/* Barre de navigation collée en haut de l'écran, partout */
.site-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 var(--gutter);
  background: transparent;         /* pas de bloc : le contenu passe dessous */
}

/* Collée en haut : un bandeau blanc sur toute la largeur, texte noir.
   Le contenu passe dessous et disparaît proprement, sans se mélanger au texte. */
.site-bar.is-stuck { color: var(--ink); }
.site-bar.is-stuck::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -1);   /* déborde sur les marges : tout l'écran est couvert */
  z-index: -1;
  background: var(--paper);
}

/* Une fois collée en haut, la barre ne garde que la navigation */
.site-bar .m1,
.site-bar .m4 { transition: opacity 0.25s ease; }
.site-bar.is-stuck .m1,
.site-bar.is-stuck .m4 { opacity: 0; visibility: hidden; }

/* Pages projet : pas de nom géant, le nom est en petit à gauche de la barre et reste visible quand elle est collée */
.site-bar .brand { font-weight: 700; text-transform: none; letter-spacing: var(--track); font-size: clamp(22px, 2vw, 32px); line-height: 1; }   /* le nom reste toujours en minuscules ; sa taille se règle ici */
.site-bar:has(.brand) { align-items: center; }
.site-bar.is-stuck .m1.brand { opacity: 1; visibility: visible; }

/* Home : le petit nom partage la case de la ligne info. et ne se montre qu'une fois la barre collée (work, contact) */
.site-bar:has(.brand--stuck) > * { grid-row: 1; }
.site-bar .brand--stuck { opacity: 0; visibility: hidden; transition: opacity 0.25s ease; height: 0; display: flex; align-items: center; }   /* hauteur 0 : la barre de la home garde sa hauteur d'origine */

/* L'ouverture remplit le reste du premier écran (--head-h est calculé par le JS) */
.opening {
  min-height: calc(100vh - var(--head-h, 0px));
  min-height: calc(100svh - var(--head-h, 0px));
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter) calc(var(--gutter) * 2);
}

/* Le nom remonte presque contre le bord : on retire l'espace vide au-dessus des lettres */
.top > .giant { margin-top: -0.045em; }   /* le nom touche presque le bord */

/* La phrase de présentation, avec l'image entre les mots */
.statement {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 1fr auto;
  column-gap: 6px;                 /* espace entre l'image et le texte */
  align-items: end;
  padding-top: 4vh;
  font-weight: 700;                /* EuropaGroNr2SH-Bol */
  font-size: clamp(13px, 1.15vw, 19px);
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

.st-left  { grid-column: 1; grid-row: 1; text-align: right; }
.st-right { grid-column: 3; grid-row: 1; text-align: left; }
.st-image { grid-column: 2; grid-row: 1; }
.st-bottom { grid-column: 1 / -1; grid-row: 2; text-align: center; margin-top: 0; }
.st-left, .st-right { white-space: nowrap; }

/* Version d'un seul tenant : cachée à l'écran sur ordinateur, gardée pour les lecteurs d'écran */
.st-full {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Diaporama */
.slideshow {
  position: relative;
  height: clamp(120px, 17vh, 220px);   /* taille de l'image d'ouverture */
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--wash);
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;                       /* pas de fondu : les images se remplacent net */
}

.slideshow img.is-active { opacity: 1; }

/* Toute l'image est cliquable : elle mène à la partie work */
.slide-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}
.slide-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── Work : filtres, puis grille irrégulière sur 4 colonnes, légende sur l'image au survol ── */

.work { padding: 0 var(--gutter); }
.work + .contact { padding-top: clamp(40px, 7vh, 80px); }   /* espace entre la fin de la grille et le contact (home) */

/* Filtres, au-dessus de la grille */
.work-bar {
  border-top: 1px solid var(--line);
  margin-top: clamp(24px, 4vh, 48px);
  padding: 14px 0 16px;
}

.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 1.4em;
  font-weight: 500;
  font-size: clamp(11px, 0.78vw, 13px);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

.work-filters button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--mute);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
}
.work-filters button:hover { color: var(--ink); }
.work-filters button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
.work-filters button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Disposition irrégulière : 4 colonnes, chaque image à son format d'origine (aucun recadrage).
   Le JS range chaque projet dans la colonne la moins remplie : les hauts de colonnes sont alignés
   et les colonnes s'équilibrent. Sans JS, on retombe sur de simples colonnes CSS. */
.work-grid {
  --cols: 4;
  columns: var(--cols);
  column-gap: var(--gutter);
}
.card { display: inline-block; width: 100%; vertical-align: top; break-inside: avoid; padding-bottom: var(--gutter); }

.work-grid.is-masonry {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: 1px;
  row-gap: 0;
  align-items: start;
}
.work-grid.is-masonry .card { display: block; padding-bottom: 0; }

.card[hidden] { display: none !important; }   /* un projet filtré disparaît vraiment, quelle que soit la disposition */
.card { animation: view-in 0.45s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card figure {
  aspect-ratio: var(--ar, 4 / 3);
  overflow: hidden;
  background: var(--wash);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}

/* Légende sur l'image : titre à gauche (minuscules), disciplines à droite, en blanc, posés en bas de l'image.
   Une ombre légère, seulement sur le bas de l'image, garde le texte lisible (--shade règle sa force).
   Légende et ombre n'apparaissent qu'au survol ; sur écran tactile, sans survol possible, elles restent affichées. */
.card .cell-link { position: relative; }

.card-cap {
  --shade: 0.42;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1em;
  padding: 44px 12px 10px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, var(--shade)), rgba(0, 0, 0, 0));
  pointer-events: none;
  font-weight: 500;
  font-size: clamp(10px, 0.72vw, 12px);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}
.card-cap .cap-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; text-transform: none; letter-spacing: 0.02em; font-size: 1.15em; }   /* titres en minuscules */
.card-cap .cap-disc { flex: none; text-align: right; }

@media (hover: hover) and (pointer: fine) {
  .card-cap { opacity: 0; transition: opacity 0.25s ease; }
  .card .cell-link:hover .card-cap,
  .card .cell-link:focus-visible .card-cap { opacity: 1; }
}

@media (max-width: 1100px) { .work-grid { --cols: 3; } }
@media (max-width: 760px) {
  .work-grid { --cols: 2; }
  .card-cap .cap-disc { display: none; }   /* sur mobile, seulement le titre sur l'image */
}

/* ── Page about ──────────────────────────────── */

.home-link:hover { text-decoration: none; opacity: 0.55; }
.meta a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }

.about { padding: clamp(64px, 14vh, 160px) var(--gutter) 0; }

/* Le texte d'introduction, en grand */
.about-lead {
  max-width: 30ch;
  font-weight: 700;
  font-size: clamp(24px, 2.9vw, 46px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  margin-bottom: clamp(64px, 12vh, 140px);
  text-wrap: pretty;
}

/* Les rangées : intitulé à gauche (petites capitales), contenu à droite */
.about-row {
  padding: 14px 0 28px;
  border-top: 1px solid var(--line);
  align-items: start;
}
.about-row:last-child { border-bottom: 1px solid var(--line); }
.about-row h2 { font: inherit; }
.about-row .label { font-size: 1em; color: var(--ink); font-weight: 500; }   /* intitulés lisibles */

.about-body {
  grid-column: 3 / 5;
  text-transform: none;
  letter-spacing: 0.005em;
  font-weight: 500;
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.4;
  max-width: 52ch;
}

.about-body li + li { margin-top: 2px; }

/* Formation : année en gras, diplôme, école en gris */
.edu li + li { margin-top: 22px; }
.edu-year { font-weight: 700; }
.edu-school { color: var(--mute); font-weight: 400; }

/* Liens vers les pages projet (grille et index) */
.cell-link { display: block; }
.cell-link:hover { text-decoration: none; }

/* ── Page projet ─────────────────────────────── */

/* Emplacements à compléter : soulignés en pointillés gris */
.todo {
  color: var(--mute);
  text-decoration: underline dashed 1px;
  text-underline-offset: 0.2em;
}

   

/* Projet précédent / suivant : une ligne, à gauche et à droite */
.project-pager {
  display: flex;
  justify-content: space-between;
  margin: clamp(80px, 14vh, 180px) var(--gutter) 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  font-size: clamp(11px, 0.78vw, 13px);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

/* ── Contact ─────────────────────────────────── */

.contact {
  padding: 18vh var(--gutter) 0;   /* pas de marge sous le pied de page : il se termine comme la barre du haut commence */
}

.contact .meta-bar:first-child { border-bottom: 1px solid var(--line); margin-bottom: 1.2vw; }
.contact h2 { font: inherit; }

.giant--mail { padding: 0.04em 0 0.02em; }
.giant--mail a:hover { text-decoration: none; opacity: 0.55; }

.meta-foot { border-top: 1px solid var(--line); margin-top: 1.4vw; }
.meta-foot .m3 { text-transform: none; letter-spacing: 0.02em; }
.foot-legal { margin-left: 1.2em; }

/* Page mentions légales : un simple bloc de petit texte */
.legal-min {
  max-width: 62ch;
  padding: clamp(48px, 10vh, 110px) var(--gutter) clamp(48px, 10vh, 110px);
  font-weight: 500;
  font-size: clamp(12px, 0.85vw, 14px);
  line-height: 1.45;
}
.legal-min h1 { font-size: inherit; font-weight: 700; margin-bottom: 1.2em; }
.legal-min p + p { margin-top: 1em; }
.legal-min a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }

/* ── Arrivée : une seule séquence ──
   1. le nom monte de son masque  2. les infos apparaissent  3. l'image s'ouvre, la phrase suit */

.has-motion .top .giant .mask > span {
  transform: translateY(102%);
  transition: transform 1.1s var(--ease-out);
}

.has-motion .site-bar,
.has-motion .st-left,
.has-motion .st-right,
.has-motion .st-bottom {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.has-motion .site-bar { transition-delay: 0.45s; }
.has-motion .st-left, .has-motion .st-right { transition-delay: 0.9s; }
.has-motion .st-bottom { transition-delay: 1s; }
.has-motion .st-full { opacity: 0; transition: opacity 0.7s ease 0.9s; }
.has-motion.is-ready .st-full { opacity: 1; }

.has-motion .st-image {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.1s cubic-bezier(0.77, 0, 0.18, 1) 0.55s;
}

.has-motion.is-ready .top .giant .mask > span { transform: none; }
.has-motion.is-ready .site-bar,
.has-motion.is-ready .st-left,
.has-motion.is-ready .st-right,
.has-motion.is-ready .st-bottom { opacity: 1; }
.has-motion.is-ready .st-image { clip-path: inset(0 0 0 0); }

/* ── Écran d'arrivée ─────────────────────────────
   Invisible par défaut : il n'existe que si le JS a ajouté .js-intro (sans JS, la page s'affiche directement). */

.loader { display: none; }

.js-intro .loader {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  cursor: pointer;                 /* un clic passe l'animation */
}

.js-intro.is-loading { overflow: hidden; }

/* Le trait central */
.ld-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 2px;
  margin: -1px 0 0 -28px;
  background: var(--ink);
  transform: scaleX(0);
}

/* La rangée de vignettes, posée sur un cylindre */
.ld-strip {
  --tw: clamp(34px, 4.4vw, 72px);  /* largeur d'une vignette */
  --gap: clamp(10px, 2.6vw, 44px); /* la rangée occupe presque toute la largeur */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  perspective: 700px;
}

.ld-thumb {
  position: absolute;
  left: calc(var(--tw) / -2);
  top: calc(var(--tw) * -0.625);   /* centrée verticalement */
  width: var(--tw);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--wash);
  opacity: 0;
  will-change: transform, opacity;
}

.ld-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
}

/* Pendant l'arrivée, l'image du diaporama attend que la vignette la rejoigne */
.js-intro.is-loading .st-image { visibility: hidden; }
.js-intro .has-motion .st-image,
.js-intro.has-motion .st-image { clip-path: none; transition: none; }

/* Images détourées (fond transparent) : affichées en entier, plus petites, sur fond noir.
   Pour une autre image détourée : lui donner class="is-cutout" dans le HTML. */
img.is-cutout {
  object-fit: contain !important;
  padding: 12%;
  box-sizing: border-box;
  background: #000;
}
.card figure:has(.is-cutout) { background: #000; }

/* ── Mobile ──────────────────────────────────── */

@media (max-width: 760px) {
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; }
  .meta .m1 { grid-column: 1 / -1; }
  .about-body { grid-column: 1 / -1; margin-top: 8px; }
  
  
  .site-bar.is-stuck .m1 { display: none; }   /* sur mobile, la barre collée ne garde qu'une ligne */
  .site-bar.is-stuck .m1.brand { display: block; }
  .site-bar:has(.brand--stuck) > * { grid-row: auto; }
  .site-bar:not(.is-stuck) .brand--stuck { display: none; }
  .site-bar .brand--stuck { height: auto; }
  /* Barre sur mobile : toujours une seule ligne, collée ou non.
     Le nom (ou la ligne info. sur l'accueil) à gauche, la navigation à droite. */
  /* Une seule ligne tant que tout tient ; si l'écran est trop étroit, la navigation passe sur une deuxième ligne au lieu de chevaucher le nom */
  .site-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 1em; row-gap: 6px; }
  .site-bar .m1.brand { font-size: 18px; }
  .site-bar .m3 { margin-left: auto; text-align: right; white-space: nowrap; }
  .site-bar .m3 .label { display: none; }
  .site-bar .m1:not(.brand) { display: none; }   
  
  .meta .m3 { grid-column: 1; }
  .meta .m4 { grid-column: 2; }

  /* Sur mobile : l'image d'abord, puis la phrase d'un seul tenant */
  .statement {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    margin-top: auto;
    text-align: center;
    text-wrap: balance;
  }
  .st-image  { margin: 0 auto 16px; }
  .st-left, .st-right, .st-bottom { display: none; }
  .st-full {
    position: static; width: auto; height: auto; margin: 0 auto; clip: auto;
    overflow: visible; white-space: normal; max-width: 32ch;
  }
  .slideshow { height: auto; width: min(78vw, 360px); }

}

/* ── Pages projet : rangées d'images supplémentaires ── */

   /* petit espace entre deux blocs de mentions */

/* ── Transitions entre pages ─────────────────────
   Fondu entre deux pages ; la vignette cliquée dans la grille s'agrandit pour devenir
   la première image du projet (et l'inverse au retour). Navigateurs récents uniquement,
   les autres changent de page normalement. Ne joue pas si le mouvement est réduit. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  .page-project .project-hero { view-transition-name: project-hero; }

  ::view-transition-old(root) { animation: vt-out 0.3s ease both; }
  ::view-transition-new(root) { animation: vt-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }

  ::view-transition-group(project-hero) {
    animation-duration: 0.75s;
    animation-timing-function: cubic-bezier(0.77, 0, 0.18, 1);
  }
  ::view-transition-old(project-hero),
  ::view-transition-new(project-hero) {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* ── Mouvement réduit ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* transition: none (et pas une durée minuscule) : sinon chaque changement de taille passe par une micro-transition
     et le texte géant est mesuré à la mauvaise taille, donc il dépasse de l'écran */
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ── Index des projets sur le côté (pages projet) ─────────────
   Ordinateur uniquement : une colonne à gauche, collée sous la barre de navigation,
   avec la liste de tous les projets ; le projet affiché est en noir, les autres en gris.
   Sur tablette et mobile, l'index est masqué (previous / next restent en bas).
*/

.project-index { display: none; }

@media (min-width: 1100px) {
  .project-layout {
    display: grid;
    grid-template-columns: clamp(170px, 13vw, 230px) minmax(0, 1fr);
    align-items: start;
  }
  .project-main { min-width: 0; }

  .project-index {
    display: block;
    position: sticky;
    top: 72px;                                   /* juste sous la barre de navigation collée */
    padding: clamp(56px, 11vh, 130px) 0 0 var(--gutter);   /* aligné sur le haut du titre du projet */
    font-weight: 500;
    font-size: clamp(11px, 0.78vw, 13px);
    line-height: 1.55;
  }
  .project-index .label { display: block; margin-bottom: 0.6em; }
  .project-index a { color: var(--mute); transition: color 0.2s ease; }
  .project-index a:hover,
  .project-index a:focus-visible,
  .project-index a[aria-current="page"] { color: var(--ink); }
  .project-index a[aria-current="page"] { font-weight: 700; }
}

/* ── Pages projet : tout sur un écran, côte à côte ─────────────────
   En arrivant : la grande image à gauche, le texte à droite, sans avoir à défiler.
   Les images sont regroupées dans un diaporama : clic à droite / à gauche de l'image,
   flèches du clavier, vignettes ou previous / next. La page reste courte. */

.pj-screen {
  display: flex;
  gap: calc(var(--gutter) * 2);
  height: calc(100svh - 56px);          /* toute la hauteur sous la barre du haut */
  min-height: 520px;
  padding: clamp(8px, 1.5vh, 16px) var(--gutter) var(--gutter);
}

/* Grande image */
.pj-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  outline: none;
  container-type: size;                  /* pour caler les films sur la taille du cadre */
}
.pj-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: flex-start;               /* calée en haut à gauche : même ligne que le titre et l'index */
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.pj-slide.is-on { opacity: 1; visibility: visible; }
.pj-slide img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left top; }   /* l'image entière, sans recadrage, calée en haut à gauche */
.pj-slide.is-cover img { object-fit: cover; }                                        /* option : remplir tout le cadre */
.pj-slide--video { container-type: size; }   /* le film se cale sur la zone intérieure, marge comprise */
.pj-slide--video iframe {
  display: block;
  width: min(100cqw, 100cqh * 16 / 9);   /* film en 16:9, aussi grand que le cadre le permet */
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

/* Zones cliquables : moitié gauche = image précédente, moitié droite = suivante (pas sur un film) */
.pj-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
  border: 0;
  background: transparent;
}
.pj-hit--prev { left: 0; cursor: w-resize; }
.pj-hit--next { right: 0; cursor: e-resize; }
.pj-stage.on-video .pj-hit { display: none; }

/* Colonne de texte à droite */
.pj-side {
  flex: 0 0 clamp(250px, 22vw, 360px);   /* colonne de texte un peu plus étroite : l'image est plus grande */
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pj-title {
  font-weight: 700;
  font-size: clamp(24px, 2.1vw, 38px);
  line-height: 1;
  letter-spacing: var(--track);
}
.pj-disc,
.pj-ctrl {
  font-weight: 500;
  font-size: clamp(11px, 0.78vw, 13px);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--mute);
}
.pj-disc { margin-top: 10px; }
.pj-desc {
  margin-top: clamp(20px, 3vh, 32px);
  font-weight: 500;
  font-size: clamp(13px, 0.95vw, 16px);
  line-height: 1.4;
  text-wrap: pretty;
}
.pj-credits {
  margin-top: clamp(16px, 2.4vh, 26px);
  font-weight: 500;
  font-size: clamp(11px, 0.72vw, 12px);
  line-height: 1.45;
  color: var(--mute);
  text-wrap: pretty;
}
.pj-credits p + p { margin-top: 0.7em; }
.pj-credits a { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color 0.2s ease; }
.pj-credits a:hover { color: var(--ink); }

/* Vignettes, compteur et previous / next, en bas de la colonne */
.pj-nav { margin-top: auto; padding-top: 20px; }
.pj-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }   /* vignettes de même taille sur tous les projets */
.pj-thumb {
  width: calc((100% - 36px) / 7);       /* toujours 7 places par ligne : même taille de vignette sur tous les projets */
  aspect-ratio: 1;
  flex: none;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.25s ease;
}
.pj-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pj-thumb--video span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}
.pj-thumb:hover,
.pj-thumb.is-on { opacity: 1; }
/* Vignette d'un film hébergé sur le site : l'image d'aperçu, avec « film » par-dessus */
.pj-thumb { position: relative; }
.pj-thumb--video img + span { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }

/* Film hébergé sur le site (balise <video>) : entier, centré dans la zone, avec ses commandes */
.pj-slide--file { container-type: normal; justify-content: center; align-items: center; }
.pj-slide--file video { display: block; max-width: 100%; height: 100%; width: auto; object-fit: contain; background: #000; }
.pj-thumb:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Vignettes des planches sur fond blanc : un filet gris très fin pour les détacher de la page */
.pj-thumb.is-sheet { box-shadow: inset 0 0 0 1px #c9c9c9; }
.pj-thumb.is-sheet img { padding: 1px; }
/* Planches sur fond blanc dans le grand cadre : l'image garde sa taille réelle, entourée du même filet */
.pj-slide.is-sheet img { width: auto; height: auto; max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px #c9c9c9; }

.pj-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding-top: 10px;
}
.pj-now { color: var(--ink); }
.pj-arrows button {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--mute);
  cursor: pointer;
}
.pj-arrows button + button { margin-left: 1.2em; }
.pj-arrows button:hover { color: var(--ink); }

/* L'index sur le côté commence à la hauteur de l'image */
@media (min-width: 1100px) {
  .page-project .project-index { top: 56px; padding-top: clamp(8px, 1.5vh, 16px); }
}

/* Écrans peu larges : l'image en haut, le texte dessous */
@media (max-width: 900px) {
  .pj-screen { flex-direction: column; height: auto; min-height: 0; }
  .pj-stage { flex: none; height: min(78vw, 70svh); }
  .pj-slide { align-items: center; justify-content: center; }      /* sur mobile, l'image est centrée dans son cadre */
  .pj-slide img { object-position: center; }
  .pj-side { flex: none; }
  .pj-nav { margin-top: 0; order: -1; padding: 0 0 22px; }   /* vignettes juste sous l'image */
}

/* ── Cadre de l'image : choisi image par image ─────────────────
   Si le format de l'image est proche de celui du cadre, elle le remplit entièrement (plein cadre,
   très peu recadrée). Sinon, elle est affichée entière, centrée sur un fond (passe-partout).
   Le JS décide tout seul (classe is-fill ou is-fit sur chaque image) et recalcule si la fenêtre change.
   Pour forcer : class="is-cover" (toujours plein cadre) ou class="is-contain" (toujours entière) sur la <figure>. */

.pj-stage { background: var(--paper); }   /* fond blanc autour des images centrées */
.pj-slide { align-items: center; justify-content: center; }
.pj-slide img { object-position: center; }
.pj-slide { padding: clamp(24px, 5%, 64px); }   /* une marge autour de chaque image : les traits de coupe restent visibles partout */
.pj-slide.is-fill img { object-fit: cover; }
.pj-slide.is-fit img { object-fit: contain; }
/* Animation en boucle (vidéo sans son ni commandes, comme un GIF mais nette) : remplit la zone */
.pj-slide--loop video { display: block; width: 100%; height: 100%; object-fit: cover; }
.pj-slide--loop.is-contain video { object-fit: contain; }   /* boucle entière, sans recadrage (formats larges) */

/* Image volontairement plus petite dans son cadre (ex. la pochette de rosé pamp) */
.pj-slide.is-reduced img { width: 72%; height: 72%; object-fit: contain; }
/* Petites animations (GIF de faible résolution) : affichées sans être trop agrandies, pour rester nettes */
.pj-slide.is-small img { width: min(100%, 520px); height: auto; max-height: 100%; object-fit: contain; }

/* Traits de coupe aux coins et au milieu des bords du cadre, comme sur une épreuve d'imprimerie,
   sur toutes les images : la zone de l'image est toujours lisible. */
.pj-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Traits de coupe : de petits traits aux quatre coins, comme sur une épreuve d'imprimerie */
.pj-stage::after {
  --m: 14px;     /* longueur des traits */
  --g: 0px;      /* décalage par rapport au coin */
  --c: #b5b5b5;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--m) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px var(--m) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--m) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px var(--m) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--m) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px var(--m) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--m) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px var(--m) no-repeat;
}
.pj-stage::before {          /* petite croix de repère au centre de chaque bord */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  --c: #b5b5b5;
  background:
    linear-gradient(var(--c), var(--c)) center top / 1px 8px no-repeat,
    linear-gradient(var(--c), var(--c)) center bottom / 1px 8px no-repeat,
    linear-gradient(var(--c), var(--c)) left center / 8px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right center / 8px 1px no-repeat;
}

@media (max-width: 900px) {
  .pj-thumbs { max-width: 420px; }
}

/* ── Page 404 : un grand « 404 », une phrase, un lien vers le travail ── */
.notfound {
  min-height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--gutter) 12vh;
}
.notfound-code {
  font-weight: 700;
  font-size: clamp(120px, 26vw, 420px);
  line-height: 0.8;
  letter-spacing: var(--track);
  margin-left: -0.05em;
}
.notfound-title {
  margin-top: clamp(20px, 3vh, 36px);
  font-weight: 500;
  font-size: clamp(15px, 1.15vw, 19px);
  line-height: 1.4;
}
.notfound-link {
  margin-top: 14px;
  font-weight: 500;
  font-size: clamp(11px, 0.78vw, 13px);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}
.notfound-link a { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }

/* Tablette : toutes les vignettes d'un projet sur une seule ligne, de même largeur */
@media (min-width: 561px) and (max-width: 900px) {
  .pj-thumbs { max-width: none; flex-wrap: nowrap; }
  .pj-thumb { flex: 1 1 0; width: auto; min-width: 0; max-width: 72px; }
}

/* Transition de secours (navigateurs sans transition entre pages, ou site ouvert en fichier local) :
   la page apparaît en fondu, et disparaît en fondu au clic sur un lien du site (voir main.js). */
@media (prefers-reduced-motion: no-preference) {
  .pt-fallback body { animation: vt-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
  .pt-fallback.is-leaving body { animation: vt-out 0.28s ease both; }
}
