/* Direction : le travail d'abord, l'interface s'efface (principes Apple HIG).
   Une seule famille de caractères (celle du système), hiérarchie par la taille et la graisse,
   phrases en casse normale, surfaces grises plutôt que filets.
   Le logo (Gloock, « o » penché, nom en violet) est le seul élément expressif ; ailleurs le violet ne sert qu'aux liens et au focus. */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@700&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");
:root {
  --bg: #ffffff;
  --ink: #1d1d1f;          /* texte principal : 16.8:1 sur blanc */
  --grey: #6e6e73;         /* texte secondaire : 5.1:1 sur blanc, 4.7:1 sur --surface */
  --surface: #f5f5f7;      /* fonds de cartes et de contrôles */
  --surface-2: #e8e8ed;
  --line: rgba(0, 0, 0, 0.1);
  --violet: #ff3dff;       /* magenta : logo, liens et focus */
  --pad: clamp(20px, 5vw, 80px);
  --max: 1440px;
  --radius: 18px;
  --radius-s: 12px;
  /* Texte en chasse fixe (IBM Plex Mono), façon fiche technique ; le logo garde Gloock */
  --font: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-display: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-court: 0.2s;
  --dur-moyen: 0.4s;
  --dur-long: 0.7s;
}

/* Thème sombre, activé par projet (theme: "sombre" dans projects.js) */
body.theme-sombre, .dossier.theme-sombre {
  --bg: #000000;
  --ink: #f5f5f7;          /* 19.3:1 sur noir */
  --grey: #a1a1a6;         /* 8.1:1 sur noir */
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --line: rgba(255, 255, 255, 0.14);
  --violet: #ff3dff;       /* même magenta sur noir */
}
.theme-sombre .brand img, .theme-sombre .footer-brand { filter: invert(1); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
section[id] { scroll-margin-top: 80px; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
code { font: 12px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
::selection { background: var(--ink); color: var(--bg); }

/* Titres : casse normale, grande taille, approche serrée */
.caps { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }

main, .footer { max-width: var(--max); margin-inline: auto; }

/* ---------- Barre du haut + menu ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
@media (prefers-reduced-transparency: reduce) { .topbar { background: var(--bg); backdrop-filter: none; } }
.brand { display: block; margin-right: auto; position: relative; }
.brand.pixelise .brand-loup { opacity: 0; }
.brand img { height: 28px; width: auto; }
.brand-loup { display: block; width: 52px; height: 52px; background: transparent; --poster-color: transparent; pointer-events: none; }
/* Sur l'accueil, le petit loup s'efface tant que le grand est visible */
.brand { transition: opacity var(--dur-moyen, .3s) ease, visibility 0s linear var(--dur-moyen, .3s); }
.loup-hero-visible .brand { opacity: 0; visibility: hidden; transition: opacity var(--dur-moyen, .3s) ease, visibility 0s; }
/* Le grand loup 3D de l'accueil, centré ; on peut le faire tourner au doigt ou à la souris */
.hero-loup-cadre { display: block; position: relative; margin-inline: auto; width: clamp(200px, 30vw, 380px); aspect-ratio: 1; }
.hero-loup { display: block; width: 100%; height: 100%; background: transparent; --poster-color: transparent; }
/* Pendant la dépixelisation, le modèle 3D reste caché sous le canvas, puis apparaît net */
.hero-loup-cadre.pixelise .hero-loup { opacity: 0; }

.menu-btn {
  width: 44px; height: 44px; position: relative;
  background: none; border: 0; cursor: pointer;
}
.menu-btn::before, .menu-btn::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 1.5px; border-radius: 1px; background: var(--ink);
  transition: transform .3s var(--ease-out), top .3s var(--ease-out);
}
.menu-btn::before { top: 17px; }
.menu-btn::after { top: 25px; }
.menu-open .menu-btn::before { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn::after { top: 21px; transform: rotate(-45deg); }

.topnav { display: flex; gap: 4px; }
.topnav a {
  font-size: 14px; color: var(--ink); opacity: .8;
  padding: 10px 12px; border-radius: 980px;
  transition: opacity var(--dur-court), background var(--dur-court);
}
.topnav a:hover { opacity: 1; }
.topnav a[aria-current="page"] { opacity: 1; font-weight: 600; }
@media (min-width: 761px) { .menu-btn { display: none; } }
/* Sur téléphone, les liens restent visibles : ils passent sur une deuxième ligne, sous le logo */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 64px; row-gap: 0; padding-bottom: 6px; }
  .topnav { order: 10; width: 100%; justify-content: space-between; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-top: -4px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { font-size: 13px; padding: 8px 10px; white-space: nowrap; }
  .topnav a.topnav-cta { padding-inline: 14px; margin-left: 0; }
}

/* Sélecteur de langue : petit contrôle segmenté */
.lang-switch {
  display: flex; align-items: center; padding: 2px; margin-left: 12px;
  background: var(--surface); border-radius: 980px; position: relative; z-index: 31;
}
.lang-switch button {
  min-width: 36px; height: 28px; padding: 0 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  background: none; border: 0; border-radius: 980px; cursor: pointer; color: var(--grey);
  transition: color var(--dur-court), background var(--dur-court);
}
.lang-switch .sep { display: none; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.theme-sombre .lang-switch button[aria-pressed="true"] { background: var(--surface-2); }

.menu {
  position: fixed; inset: 0; z-index: 25;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 40px;
  padding: 96px var(--pad) 40px;
  background: var(--bg);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.menu-open .menu { opacity: 1; visibility: visible; }
.menu-main { display: grid; gap: 2px; }
.menu-main a { font: 600 32px/1.25 var(--font-display); letter-spacing: -0.025em; }
.menu-projects { display: grid; gap: 4px; font-size: 17px; color: var(--grey); }
.menu-projects a:hover { color: var(--ink); }

/* ---------- Boutons : pilule pleine (action) ou contour (secondaire) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 980px;
  background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  transition: opacity var(--dur-court);
}
.btn:hover { opacity: .85; }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-ghost:hover { opacity: 1; background: var(--surface-2); }

/* ---------- Accueil ---------- */

.hero { padding: clamp(56px, 10vw, 140px) var(--pad) clamp(48px, 7vw, 96px); }
.hero-title img { width: min(100%, 1040px); height: auto; }

/* Logo : « nolan » en Gloock avec le o penché, « levasseur » en violet dessous (piste 24) */
.logo-nl { display: inline-block; font: 700 clamp(72px, 12.5vw, 180px)/0.86 "Space Grotesk", "IBM Plex Mono", sans-serif; letter-spacing: -0.04em; -webkit-text-stroke: 0.045em currentColor; paint-order: stroke fill; color: var(--ink); }
.logo-nl > span { display: block; }
.logo-nl > span + span { color: var(--violet); }
.logo-nl em { display: inline-block; font-style: normal; transform: rotate(-28deg); }
.logo-nl.petit { font-size: 46px; margin-bottom: 16px; }
/* Logo tag « NL » (dessiné dans Illustrator) : la forme sert de masque, la couleur suit le texte */
.logo-tag {
  display: block; width: clamp(150px, 22vw, 300px); aspect-ratio: 727.8 / 704.2; background: url("../images/logo-nl.svg") center / contain no-repeat;
}
.hero-title .logo-tag { margin-inline: auto; }
.logo-tag.petit { width: 72px; margin-bottom: 16px; }
.hero-nom { flex-basis: 100%; font: 700 clamp(30px, 3.6vw, 48px)/1.05 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.footer-nom { font-weight: 600; color: var(--ink); }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  margin-top: clamp(28px, 4vw, 48px);
  font: 500 clamp(21px, 2.2vw, 28px)/1.3 var(--font-display); letter-spacing: -0.02em; color: var(--grey);
}
.hero-meta strong { color: var(--ink); font-weight: 600; }

/* Sous la signature : infos et boutons à gauche, encadré CV à droite */
.hero-bas { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: clamp(28px, 4vw, 64px); align-items: start; }
.hero-cv {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: start;
  margin-top: clamp(28px, 4vw, 48px); padding: 22px; border-radius: var(--radius); background: var(--surface);
}
.cv-photo { aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, var(--surface-2), #d2d2d7); display: grid; place-items: center; }
.cv-photo img { width: 100%; height: 100%; object-fit: cover; }
/* avec une vraie photo : le cadre prend le format de la photo, rien n'est coupé */
.cv-photo:has(img) { aspect-ratio: auto; display: block; }
.cv-photo:has(img) img { height: auto; display: block; }
.cv-photo span { font: 600 30px/1 var(--font-display); letter-spacing: -0.02em; color: var(--grey); }
.cv-nom { font: 600 19px/1.2 var(--font-display); color: var(--ink); }
.cv-statut { margin-top: 2px; font-size: 14px; color: var(--grey); }
.cv-titre { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.cv-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cv-liste li { display: grid; font-size: 14px; line-height: 1.35; }
.cv-liste strong { font-weight: 600; color: var(--ink); }
.cv-liste span { color: var(--grey); }
.cv-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cv-tags li { padding: 4px 10px; border-radius: 980px; background: var(--bg); font-size: 13px; color: var(--ink); }
.cv-pdf { padding: 7px 14px; font-size: 14px; background: var(--bg); }
.cv-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
/* Ce que je cherche : bien visible, juste sous le nom */
.cv-recherche { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; line-height: 1.35; }
.cv-recherche strong { font-weight: 600; }
/* Logiciels : logo de la marque dans sa couleur, puis le nom */
.cv-logiciels:empty { display: none; }
.cv-logiciels { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cv-logiciels li { display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 6px; border-radius: 980px; background: var(--bg); font-size: 13px; color: var(--ink); }
.cv-logo { width: 18px; height: 18px; flex: none; background: var(--ink); -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }
.cv-logo[data-ia] { -webkit-mask: none; mask: none; background: none; }
.cv-logo[data-ia]::before { content: "✦"; display: block; font-size: 15px; line-height: 18px; text-align: center; color: var(--ink); }
@media (max-width: 860px) { .hero-bas { grid-template-columns: 1fr; } .hero-cv { margin-top: 0; } }
/* Grand écran : l'encadré CV passe sous les boutons, sur toute la largeur, son contenu en colonnes
   (identité en haut, puis parcours | hard skills | soft skills et boutons), sans grand vide à côté */
@media (min-width: 1100px) {
  .hero-bas { grid-template-columns: 1fr; gap: 0; }
  .hero-cv { grid-template-columns: 150px 1fr; gap: 32px; padding: 28px; }
  .cv-corps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 40px; align-items: start; }
  .cv-bloc-id { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-bottom: 4px; }
  .cv-bloc-id .cv-statut { margin-top: 0; }
  .cv-bloc-id .cv-recherche { margin-top: 0; margin-left: auto; }
}
@media (max-width: 420px) { .hero-cv { grid-template-columns: 84px 1fr; padding: 16px; gap: 14px; } }
.hero-meta span + span::before { content: "·"; margin-right: 10px; color: var(--grey); }

.section { padding: 0 var(--pad) clamp(88px, 11vw, 160px); }
.section-title { font-size: clamp(32px, 4vw, 56px); line-height: 1.07; color: var(--ink); margin-bottom: clamp(24px, 3vw, 40px); }
.section-title small { display: none; }

/* Grille de projets : deux grandes colonnes, images entières */
.grid { columns: 2 340px; column-gap: clamp(16px, 2vw, 28px); }
.card { display: block; break-inside: avoid; margin-bottom: clamp(32px, 4vw, 56px); }
.card-img { overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.card-img img { width: 100%; height: auto; transition: transform .8s var(--ease-out); }
.card:hover .card-img img { transform: scale(1.02); }
.card h3 { margin: 16px 2px 0; font-size: clamp(21px, 1.8vw, 24px); line-height: 1.2; }
.card p { margin: 4px 2px 0; font-size: 17px; color: var(--grey); }

/* ---------- Roulette de projets (accueil et page Projets) ---------- */
/* Le projet du centre est net ; ses voisins dépassent sur les côtés, flous, plus pâles et un peu plus petits.
   --k (0 au centre, 1 à un cran) est mis à jour en JS pendant le défilement. */
.roulette { --larg: min(60vw, 960px); margin: 0 calc(-1 * var(--pad)); }
.roulette-piste {
  position: relative; display: flex; gap: clamp(14px, 2.4vw, 36px);
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 6px calc((100% - var(--larg)) / 2) 8px;
  scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; outline: none;
}
.roulette-piste::-webkit-scrollbar { display: none; }
.roulette-piste:focus-visible .roulette-item.actif .roulette-img { outline: 2px solid var(--ink); outline-offset: 4px; }
.roulette-piste.glisse { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
/* Effet de profondeur : les voisins reculent dans l'espace (translateZ), pivotent vers le centre
   comme des panneaux vus de biais, et se perdent dans le flou et la pâleur du lointain */
.roulette-item {
  --k: 1; --s: 1; flex: 0 0 var(--larg); scroll-snap-align: center; display: block;
  transform: perspective(1400px) translateX(calc(var(--s) * -16%)) translateZ(calc(var(--k) * -320px)) rotateY(calc(var(--s) * -24deg));
  transform-origin: 50% 40%;
  opacity: calc(1 - var(--k) * .4);
  filter: blur(calc(var(--k) * 9px)) brightness(calc(1 - var(--k) * .18)) saturate(calc(1 - var(--k) * .35));
  user-select: none; -webkit-user-drag: none;
}
/* Accélération graphique pendant le mouvement seulement : à l'arrêt, Chrome redessine chaque image
   à sa vraie taille (sinon le projet du centre garde la netteté qu'il avait au loin) */
.roulette-piste.anime .roulette-item { will-change: transform, filter; }
.roulette-piste.glisse .roulette-item { will-change: transform, filter; }
.roulette-img { aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.roulette-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform .8s var(--ease-out); }
.roulette-item.actif:hover .roulette-img img { transform: scale(1.03); }
.roulette-texte { margin: 16px 4px 0; }
.roulette-texte h3 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; }
.roulette-texte span { display: block; margin-top: 4px; font-size: 15px; color: var(--grey); }
.roulette-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: clamp(20px, 3vw, 32px); }
.roulette-fleche {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--violet); color: #1d1d1f;
  font-size: 18px; cursor: pointer; transition: filter .2s, opacity .2s;
}
.roulette-fleche:hover:not(:disabled) { filter: brightness(.9); }
.roulette-fleche:disabled { opacity: .3; cursor: default; }
.roulette-compte { min-width: 64px; text-align: center; font: 500 15px/1 var(--font-display); color: var(--grey); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .roulette { --larg: 80vw; } .roulette-img { aspect-ratio: 4 / 3; } }

/* ---------- Accueil : boutons d'action + projets en accès direct ---------- */

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 3vw, 36px); }

.showcase-wrap { padding-bottom: clamp(88px, 11vw, 160px); }
.home-projets {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 3vw, 44px) clamp(14px, 1.6vw, 24px);
}
.home-projet { display: block; }
.home-projet-img { overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 4 / 3; }
.home-projet-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.home-projet:hover .home-projet-img img { transform: scale(1.03); }
/* Un projet seul sur la dernière ligne prend toute la largeur */
.home-projet:last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.home-projet:last-child:nth-child(3n + 1) .home-projet-img { aspect-ratio: 21 / 8; }
.home-projet-num { display: block; margin: 14px 2px 0; font-size: 13px; color: var(--grey); }
.home-projet h3 { margin: 4px 2px 0; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.2; }
.home-projet p { margin: 4px 2px 0; font-size: 15px; color: var(--grey); }
@media (max-width: 900px) { .home-projets { grid-template-columns: repeat(2, 1fr); }
  .home-projet:last-child:nth-child(3n + 1) { grid-column: auto; }
  .home-projet:last-child:nth-child(3n + 1) .home-projet-img { aspect-ratio: 4 / 3; }
  .home-projet:last-child:nth-child(2n + 1) { grid-column: 1 / -1; } }
@media (max-width: 560px) { .home-projets { grid-template-columns: 1fr; } }

/* Contact toujours visible en haut, en pilule pleine */
.topnav a.topnav-cta { background: var(--ink); color: var(--bg); opacity: 1; padding-inline: 16px; margin-left: 4px; }
.topnav a.topnav-cta:hover { opacity: .85; }

/* Barre de lecture des pages projet */
.lecture {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--ink); transform-origin: left; transform: scaleX(0);
}

/* Pied de page projet : astuce clavier + les autres projets */
.pager-hint { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; color: var(--grey); text-align: center; }
@media (hover: none) { .pager-hint { display: none; } }
.autres { margin: 0 var(--pad) clamp(64px, 8vw, 120px); }
.autres h2 { font-size: clamp(21px, 2vw, 28px); margin-bottom: 16px; }
.autres-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.autres-liste a { font-size: 14px; font-weight: 500; line-height: 1.3; }
.autres-liste small { display: block; font-weight: 400; color: var(--grey); }
.autres-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.autres-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.autres-liste a:hover .autres-img img { transform: scale(1.04); }
.autres-liste a[aria-current="page"] { opacity: .4; pointer-events: none; }

/* En-tête de section avec lien à droite */
.section-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.more-link { font-size: 17px; color: var(--violet); }
.more-link:hover { text-decoration: underline; }
.more-link span { display: inline-block; }

/* ---------- Vrac : le bureau en désordre ---------- */

/* Dossier du Laboratoire : il se déroule de haut en bas par-dessus la page */
.dossier {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--ink);
  animation: derouler .55s var(--ease-out) both;
}
.dossier.ferme { animation: enrouler .3s ease-in both; }
@keyframes derouler { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes enrouler { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }
@media (prefers-reduced-motion: reduce) { .dossier, .dossier.ferme { animation-duration: .01s; } }
.dossier-barre {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  height: 64px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 14px; color: var(--grey);
}
.dossier-barre b { color: var(--ink); font-weight: 600; }
.dossier-fermer { border: 0; cursor: pointer; font: 500 15px/1 var(--font); box-shadow: 0 0 0 1px var(--line); }
.dossier-corps { max-width: var(--max); margin-inline: auto; padding: clamp(24px, 4vw, 48px) var(--pad) clamp(64px, 8vw, 120px); }
.dossier-tete { margin-bottom: clamp(24px, 3vw, 40px); }
.dossier-corps > .renders, .dossier-corps > .masonry { margin-bottom: 12px; }
.dossier-corps .final-why { margin-top: clamp(56px, 7vw, 104px); }
.dossier-corps .docs { margin-top: 24px; }
.vrac-item.a-dossier { cursor: pointer; }
.vrac-head { display: grid; gap: 8px; margin-bottom: 8px; max-width: 70ch; }
.vrac-head .section-title { margin: 0 0 8px; }
.vrac-intro { font-size: 21px; line-height: 1.38; color: var(--ink); }
.vrac-hint { font-size: 15px; color: var(--grey); }
.vrac-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.vrac-tag {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 14px; border-radius: 980px;
  background: var(--surface); border: 0; cursor: pointer;
  font-size: 14px; color: var(--ink);
  transition: background var(--dur-court), color var(--dur-court);
}
.vrac-tag small { color: var(--grey); font-size: 13px; font-variant-numeric: tabular-nums; }
.vrac-tag:hover { background: var(--surface-2); }
.vrac-tag.active { background: var(--ink); color: var(--bg); }
.vrac-tag.active small { color: inherit; opacity: .7; }
.vrac-tag i { display: inline-block; width: 18px; height: 0; border-top: 1.5px solid currentColor; }
.vrac-tag i.fil-affiche { border-top-style: dashed; }
.vrac-tag i.fil-photo { border-top: 2px dotted currentColor; }
.vrac-tag i.fil-3d { border-top-width: 2.5px; }

.vrac-board {
  position: relative; overflow: hidden; isolation: isolate;
  transform-origin: 50% 0; /* s'agrandit depuis le haut, centré, au défilement */
  will-change: transform; /* calque à part : le zoom au défilement reste fluide */
  height: clamp(720px, 62vw, 980px);
  margin-top: 28px; border-radius: var(--radius);
  background-color: var(--surface);
  background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1px);
  background-size: 22px 22px;
}
.vrac-threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }

.fil { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .35; transition: opacity .3s, stroke-width .3s; }
.fil-3d { stroke-width: 1.8; }
.fil-affiche { stroke-dasharray: 4 5; }
.fil-photo { stroke-dasharray: 1 5; stroke-linecap: round; stroke-width: 1.8; }
.vrac-board.focus .fil, .vrac-board.filtered .fil { opacity: .08; }
.vrac-board .fil.hot, .vrac-board.filtered .fil.match { opacity: .9; stroke-width: 2; }

.vrac-item {
  position: absolute; left: 0; top: 0; margin: 0;
  background: #fff; padding: 6px; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08);
  cursor: grab; user-select: none; will-change: transform;
  transition: opacity .3s, box-shadow .3s;
}
.vrac-item img { width: 100%; height: auto; pointer-events: auto; }
.vrac-item.a-modele { position: relative; background: #000; }
.vrac-item.a-modele img { visibility: hidden; }
.vrac-item.a-video img { visibility: hidden; }
.vrac-item.a-video video { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; background: #000; pointer-events: none; }
.lightbox video.lb-video { max-height: 84vh; max-width: 100%; background: #000; }
.lightbox video.lb-video[hidden] { display: none; }
.vrac-item.a-modele model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; --poster-color: #000; pointer-events: none; }
.vrac-item.sans-fond { background: none; padding: 0; box-shadow: none; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .16)); }
.vrac-item.sans-fond.hot { box-shadow: none; }
.vrac-item.sans-fond figcaption { left: 0; right: 0; bottom: 0; }
.ideation-une { margin-bottom: clamp(24px, 3vw, 40px); }
/* Le texte vient après les images, bien séparé */
.textes-fin { margin-top: clamp(56px, 7vw, 104px); }
.models-rendus + .renders, .renders + .docs { margin-top: clamp(16px, 2vw, 24px); }
.renders + .final-why, .docs + .final-why { margin-top: clamp(56px, 7vw, 104px); }
.vrac-item.grab { cursor: grabbing; box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 20px 40px rgba(0, 0, 0, .18); }
.vrac-item figcaption {
  position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 6px 8px; border-radius: 3px;
  background: rgba(29, 29, 31, .86); color: #fff; font-size: 12px; line-height: 1.35;
  opacity: 0; transition: opacity .25s;
}
.vrac-item.hot { box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 20px 40px rgba(0, 0, 0, .18); }
.vrac-item.hot figcaption { opacity: 1; }
.vrac-board.filtered .vrac-item:not(.match) { opacity: .15; }

/* ---------- Page Projets ---------- */

.page-head { padding: clamp(40px, 7vw, 100px) var(--pad) clamp(32px, 4vw, 56px); }
.back-link { font-size: 17px; color: var(--violet); }
.back-link:hover { text-decoration: underline; }
.page-title { margin-top: 12px; font-size: clamp(48px, 7vw, 96px); line-height: 1.02; }
.page-title small { display: none; }
.page-intro { margin-top: 16px; max-width: 46ch; font-size: clamp(19px, 1.6vw, 21px); line-height: 1.4; color: var(--grey); }

/* À propos + contact */
.about-text { max-width: 24ch; font: 600 clamp(32px, 4vw, 56px)/1.1 var(--font-display); letter-spacing: -0.025em; }
.about-cols { columns: 2 340px; column-gap: clamp(32px, 5vw, 72px); margin-top: clamp(40px, 5vw, 64px); }
.about-cols p { break-inside: avoid; margin-bottom: 1.1em; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; color: var(--grey); }
.about-fin { margin-top: clamp(24px, 3vw, 40px); font: 600 clamp(24px, 2.4vw, 32px)/1.25 var(--font-display); letter-spacing: -0.02em; }
.about-fin strong { font-weight: inherit; }
.contact-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius); background: var(--surface); }
.contact-links { display: grid; gap: 4px; }
.big-link { font-size: clamp(24px, 3.4vw, 48px); line-height: 1.15; word-break: break-word; }
.big-link:hover { color: var(--violet); }

/* ---------- Page projet ---------- */

.project-hero { padding: clamp(16px, 2vw, 32px) var(--pad) 0; }
.project-hero-img { border-radius: var(--radius); overflow: hidden; width: fit-content; max-width: 100%; }
.project-hero-img img { width: auto; max-width: 100%; height: auto; max-height: 82vh; }
.project-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: clamp(28px, 4vw, 48px) 0 clamp(28px, 4vw, 48px);
}
.project-title { font-size: clamp(40px, 6vw, 80px); line-height: 1.03; }
.project-sub { margin-top: 8px; max-width: 40ch; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.3; color: var(--grey); }
.project-sub b { display: none; }
.project-cadre { margin-top: 10px; font-size: 14px; line-height: 1.4; color: var(--grey); }
.project-cadre:empty { display: none; }
.conclusion { margin: 48px 0 24px; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.conclusion p { margin: 0; max-width: 62ch; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; color: var(--ink); }
.descriptif {margin: 0; padding: 12px 2px 6px; font-size: 15px; line-height: 1.5; color: var(--ink); max-width: 68ch; }
.renders figure:has(.descriptif) { border-radius: 0; overflow: visible; }
.renders figure:has(.descriptif) img { border-radius: var(--radius-s); }
/* avec un descriptif, la légende passe sous l'image, en petit titre au-dessus du texte */
/* avec un descriptif, la petite légende grise n'est pas affichée : seul le descriptif reste sous l'image */
.renders figure:has(.descriptif) figcaption, .masonry figure:has(.descriptif) figcaption { display: none; }
.project-logiciels {list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.project-logiciels:empty { display: none; }
.project-logiciels li { display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border-radius: 980px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); font-size: 13px; color: var(--ink); }
.logiciel-logo { width: 18px; height: 18px; flex: none; display: block; border-radius: 4px; }
.logiciel-logo.masque { border-radius: 0; background: var(--c); -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat; }

/* Onglets du projet : contrôle segmenté collant */
.tabs {
  position: sticky; top: var(--haut-barre, 64px); z-index: 9;
  display: flex; gap: 2px; width: fit-content; max-width: calc(100% - 2 * var(--pad));
  overflow-x: auto; scrollbar-width: none;
  margin: 0 var(--pad); padding: 3px;
  background: var(--surface); border-radius: 980px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; display: flex; align-items: center; min-height: 36px;
  padding: 6px 18px; border-radius: 980px;
  font-size: 14px; font-weight: 500; color: var(--grey);
  transition: color var(--dur-court), background var(--dur-court);
}
.tabs a span { display: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.theme-sombre .tabs a.active { background: var(--surface-2); }

.project-body { padding: clamp(48px, 6vw, 88px) var(--pad); animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; } }

/* Rendus : pourquoi la version finale l'a emporté */
.final-why { max-width: 72ch; margin-bottom: clamp(40px, 5vw, 64px); }
.final-why h2 { margin-bottom: 12px; }
.final-why p { font-size: clamp(19px, 1.5vw, 21px); line-height: 1.5; color: var(--grey); }

.process { max-width: 72ch; margin-bottom: clamp(40px, 5vw, 64px); }
.renders + .process { margin-top: clamp(56px, 7vw, 104px); }
.process h2 { margin-bottom: 20px; }
/* Explication : photos de fabrication sous le titre « Process de création » */
.creation { margin: clamp(56px, 7vw, 104px) 0 clamp(40px, 5vw, 64px); }
.creation h2 { margin-bottom: 20px; }
.process ol { list-style: none; margin: 0; padding: 0; }
.process li {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px;
  padding: 20px 0; border-top: 1px solid var(--line, rgba(0, 0, 0, .1));
}
.process li:last-child { border-bottom: 1px solid var(--line, rgba(0, 0, 0, .1)); }
.process-num { font: 600 15px/1.6 var(--font-display); color: var(--grey); font-variant-numeric: tabular-nums; }
.process h3 { font: 600 19px/1.3 var(--font-display); margin: 0 0 6px; }
.process p { font-size: 17px; line-height: 1.5; color: var(--grey); margin: 0; }

.lead {
  max-width: 30ch;
  font: 600 clamp(28px, 3.2vw, 44px)/1.15 var(--font-display); letter-spacing: -0.025em;
  margin-bottom: clamp(40px, 6vw, 80px);
}

h2 { font: 600 21px/1.25 var(--font-display); letter-spacing: -0.015em; color: var(--ink); margin-bottom: 10px; }

/* Explication */
.explain { display: grid; grid-template-columns: minmax(200px, 1fr) 2.6fr; gap: clamp(32px, 5vw, 80px); align-items: start; }
.explain.sans-fiche { grid-template-columns: 1fr; }
.facts { position: sticky; top: 132px; padding: 24px; border-radius: var(--radius); background: var(--surface); }
.facts dl { display: grid; gap: 2px 0; font-size: 15px; line-height: 1.45; }
.facts dt { color: var(--grey); font-size: 13px; margin-top: 16px; }
.facts dt:first-child { margin-top: 0; }
.explain-blocks { display: grid; gap: clamp(36px, 4vw, 56px); }
.explain-blocks p { max-width: 64ch; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; color: var(--grey); }
.theme-sombre .explain-blocks p { color: var(--grey); }

/* Moodboard */
.mood-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: clamp(40px, 5vw, 72px); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 14px; border-radius: 980px; background: var(--surface); font-size: 15px; }
.palette { list-style: none; display: flex; gap: 10px; }
.palette li { flex: 1; min-width: 0; }
.palette span { display: block; aspect-ratio: 1; border-radius: var(--radius-s); box-shadow: inset 0 0 0 1px var(--line); }
.palette code { display: block; color: var(--grey); margin-top: 8px; overflow: hidden; text-overflow: ellipsis; }

.refs-titre { margin: clamp(40px, 5vw, 72px) 0 20px; font-size: clamp(28px, 3vw, 40px); }
.refs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ref a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 0 0 24px; border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--ink); transition: background var(--dur-court); }
.ref a:hover { background: var(--surface-2); }
.ref a > :not(.ref-img) { margin-inline: 22px; }
.ref-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #000; margin-bottom: 16px; }
.ref-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-num { display: none; }
.ref-type { font-size: 13px; color: var(--grey); }
.ref strong { font: 600 19px/1.25 var(--font-display); letter-spacing: -0.015em; }
.ref em { font-style: normal; color: var(--grey); font-size: 15px; }
.ref p { font-size: 15px; line-height: 1.5; margin: 8px 22px auto; }
.ref-lien { margin-top: 14px; font-size: 15px; color: var(--violet); }

.masonry { columns: 3 280px; column-gap: 12px; }
.masonry > * { break-inside: avoid; margin-bottom: 12px; }
.masonry.solo { columns: 1; }
.masonry figure.video { display: grid; justify-items: center; }
.masonry figure.video video { display: block; max-width: 100%; max-height: 85vh; border-radius: var(--radius-s); }
.masonry .pleine { column-span: all; }
.masonry .paire { column-span: all; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.masonry .paire figure { margin: 0; }
.masonry .pleine img { width: 100%; max-height: 85vh; object-fit: contain; }
.masonry.solo img { width: 100%; max-height: 85vh; object-fit: contain; }
.masonry figure img { border-radius: var(--radius-s); }

.placeholder {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  padding: 16px; border-radius: var(--radius-s);
  background: var(--surface); color: var(--grey); font-size: 15px;
}
.placeholder small { font-size: 13px; }
.masonry .placeholder:nth-child(3n+1) { aspect-ratio: 3 / 4; }
.masonry .placeholder:nth-child(3n+2) { aspect-ratio: 1; }
.masonry .placeholder:nth-child(3n) { aspect-ratio: 4 / 3; }

figure img { width: 100%; }
figcaption { font-size: 14px; line-height: 1.4; color: var(--grey); padding-top: 10px; }
.zoomable img { cursor: zoom-in; }

/* Pistes d'idéation */
.pistes-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 clamp(32px, 4vw, 48px); }
.pistes-nav a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 16px; border-radius: 980px;
  background: var(--surface); font-size: 15px; font-weight: 500;
  transition: background var(--dur-court);
}
.pistes-nav a span { display: none; }
.pistes-nav a:hover { background: var(--surface-2); }

.piste { padding-top: clamp(56px, 7vw, 96px); }
.piste-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 5vw, 80px); margin-bottom: clamp(28px, 4vw, 48px); }
.piste:first-of-type { padding-top: 0; }
.piste-num { font-size: 15px; color: var(--grey); }
.piste-titre { margin: 6px 0 8px; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; color: var(--ink); }
.piste-sous { font-size: 19px; line-height: 1.35; color: var(--grey); max-width: 32ch; }
.theme-sombre .model model-viewer { background: radial-gradient(circle at 50% 35%, #2b2b2e, #070708 78%); }
.models-rendus .models { grid-template-columns: minmax(0, 1fr); margin: 0 0 12px; }
.models-rendus .model model-viewer { aspect-ratio: 16 / 9; }
.piste-head .models { grid-template-columns: 1fr; margin: 24px 0 0; max-width: 420px; }
.piste-texte { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.55; max-width: 62ch; }
.piste-points { margin-top: 20px; padding-left: 1.2em; display: grid; gap: 6px; }
.piste-points li { font-size: 17px; line-height: 1.45; color: var(--grey); }
.piste-points li::marker { color: var(--grey); }

/* Modèles 3D à faire tourner */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; margin-bottom: clamp(24px, 3vw, 40px); }
.model { position: relative; }
.model model-viewer {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  background: var(--bg); border-radius: var(--radius);
  cursor: grab; --poster-color: transparent;
}
.model model-viewer:active { cursor: grabbing; }
.model-hint {
  position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 980px;
  background: var(--surface); color: var(--grey); font-size: 12px;
  pointer-events: none; transition: opacity .3s;
}
.theme-sombre .model-hint { background: var(--surface-2); }
.model:hover .model-hint { opacity: 0; }
/* La planche du Laboratoire, agrandie au défilement, ne doit jamais faire déborder la page */
.vrac-section { overflow-x: clip; }
/* 3D posée directement sur le fond de la page, sans encadré gris */
.model.fond-page model-viewer { background: var(--bg); }
/* Bouton vue éclatée / vue assemblée, même pilule noire que « Fermer × » */
.model-eclate {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  padding: 10px 22px; border: 0; border-radius: 980px;
  background: #1c1c1e; color: #fff; font: 500 15px/1 var(--font-text, inherit); cursor: pointer;
  transition: background .2s, transform .2s;
}
.model-eclate:hover { background: #3a3a3c; }
/* Curseur vertical à gauche pour monter / descendre l'anneau de la lampe */
.model-coulisse {
  position: absolute; left: 16px; top: 22%; bottom: 22%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 8px; border-radius: 980px; background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .08);
  font-size: 12px; color: var(--grey); cursor: default;
}
.model-coulisse input {
  flex: 1; width: 22px; margin: 0; writing-mode: vertical-lr; direction: rtl;
  accent-color: #1c1c1e; cursor: ns-resize;
}
/* Curseur horizontal en bas, pour faire glisser les ailes de la patère de gauche à droite */
.model-coulisse.horizontale { left: 50%; right: auto; top: 16px; bottom: auto; transform: translateX(-50%); flex-direction: row; padding: 8px 16px; width: min(320px, 70%); }
.model-coulisse.horizontale input { width: auto; height: 22px; writing-mode: horizontal-tb; direction: ltr; cursor: ew-resize; }
.model-eclate:active { transform: scale(.97); }
.model-eclate[aria-pressed="true"] { background: #fff; color: #1c1c1e; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }

/* Rendus : mosaïque, images dans leur format, légende au survol ; la première en grand */
.renders { columns: 3 280px; column-gap: 12px; }
.renders figure { position: relative; break-inside: avoid; margin: 0 0 12px; overflow: hidden; border-radius: var(--radius-s); }
.renders figure img { display: block; width: 100%; height: auto; }
.renders figure figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 32px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6)); color: #fff;
  font-size: 14px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.renders figure:hover figcaption { opacity: 1; }
.renders .pleine { column-span: all; }.renders figure.legende-visible { border-radius: 0; }
.renders figure.legende-visible img { border-radius: var(--radius-s); }
.renders figure.legende-visible figcaption { position: static; opacity: 1; background: none; color: var(--grey); padding: 12px 0 8px; font-size: 17px; line-height: 1.5; max-width: 70ch; }
.renders .paire { column-span: all; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.renders .paire figure { margin: 0; }
/* Images « bord » : d'un bord de l'écran à l'autre */
body[data-page="projet"] { overflow-x: clip; }
.renders .bord { column-span: all; width: var(--bord-l, 100vw); max-width: none; margin-left: var(--bord-g, calc(50% - 50vw)); margin-right: 0; }
.renders .paire.bord { gap: 0; }
/* « grand » : l'image remplit toute la hauteur de l'écran, quitte à rogner un peu les côtés */
/* (ordinateur seulement : sur téléphone, l'écran est en hauteur et on ne verrait plus qu'une bande au milieu) */
@media (min-width: 768px) { .renders .bord.grand img { height: 100svh; object-fit: cover; } }
.renders .paire.bord img { max-height: none; }
/* Trois images « paire » à la suite : une ligne de trois */
.renders .paire:has(> :nth-child(3):last-child),
.masonry .paire:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.renders .paire img { max-height: 85vh; object-fit: contain; background: var(--bg); }
@media (min-width: 600px) {
  .renders .paire.ajuste { display: flex; }
  .renders .paire.ajuste > figure { flex: var(--r, 1) 1 0; min-width: 0; }
  .renders .paire.ajuste img { width: 100%; height: auto; max-height: none; }
}
.renders > figure:first-child { column-span: all; margin-bottom: 12px; border-radius: var(--radius); }
.renders > figure:first-child img { max-height: 90vh; width: 100%; object-fit: contain; margin: 0 auto; }
/* Une image « bord » n'est jamais rétrécie en hauteur : elle doit toucher les deux côtés sur grand écran aussi */
.renders figure.bord img { max-height: none; }
/* Image « reduit » : centrée et plus petite que la colonne, sans recadrage */
.renders figure.reduit { column-span: all; width: min(100%, 72vh, 760px); margin-left: auto; margin-right: auto; }
.renders figure.reduit img { max-height: none; width: 100%; }
@media (min-width: 600px) { .renders figure.reduit { width: min(100%, 96vh, 1100px); } }@media (hover: none) { .renders figure figcaption { opacity: 1; } }
.renders figure.video { display: grid; justify-items: center; border-radius: 0; }
.renders figure.video figcaption { position: static; opacity: 1; background: none; color: var(--grey); padding: 10px 0 0; }
.renders figure.video video { display: block; width: auto; height: auto; max-height: 90vh; max-width: 100%; border-radius: var(--radius-s); }

.docs { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 clamp(28px, 4vw, 44px); }
.renders + .docs { margin-top: clamp(28px, 4vw, 44px); }

/* Navigation en bas de projet */
.pager {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin: 0 var(--pad) clamp(64px, 8vw, 120px);
}
/* Un seul bouton, en magenta : il mène à l'autre onglet du projet (Explication ↔ Rendus) */
.pager a {
  display: block; padding: 24px 28px; border-radius: var(--radius); background: var(--violet); color: #0d0d0e;
  font: 600 clamp(21px, 2vw, 28px)/1.2 var(--font-display); letter-spacing: -0.02em;
  transition: filter var(--dur-court);
}
.pager a:hover { filter: brightness(.92); }
.pager small { display: block; font: 400 15px var(--font); letter-spacing: -0.01em; color: #0d0d0e; opacity: .7; margin-bottom: 6px; }
.pager .next { text-align: right; }

/* Visionneuse */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: 72px 1fr 72px; align-items: center;
  background: #000;
}
.lightbox[hidden] { display: none; }
.lb-count { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); font-size: 13px; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.lightbox figure { display: grid; justify-items: center; gap: 12px; padding: 24px 0; }
.lightbox img { max-height: 84vh; width: auto; max-width: 100%; object-fit: contain; cursor: zoom-in; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; z-index: 0; }
/* Photo zoomée : elle passe au-dessus de la légende, on la déplace en la glissant */
.lightbox img.zoome { cursor: grab; z-index: 1; }
.lightbox img.zoome.glisse { cursor: grabbing; }
.lightbox { overflow: hidden; }
.lightbox .lb-prev, .lightbox .lb-next { position: relative; z-index: 2; }
.lightbox button.lb-close, .lightbox .lb-count { z-index: 3; }
.lightbox model-viewer { width: min(84vh, 90vw); height: 78vh; background: #000; --poster-color: #000; }
.lightbox model-viewer[hidden], .lightbox img[hidden] { display: none; }
.lightbox figcaption { color: rgba(255, 255, 255, 0.7); text-align: center; max-width: 70ch; }
.lightbox button {
  justify-self: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); border: 0; color: #fff; cursor: pointer;
  font: 300 28px/1 var(--font); transition: background var(--dur-court);
}
.lightbox button:hover { background: rgba(255, 255, 255, .24); }
/* Même pilule « Fermer × » que le dossier du Laboratoire */
.lightbox .lb-close {
  position: absolute; top: 12px; right: 16px; z-index: 1;
  width: auto; height: auto; min-height: 44px; padding: 10px 22px; border-radius: 980px;
  background: #1c1c1e; color: #f5f5f7; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
  font: 500 15px/1 var(--font);
}
.lightbox .lb-close:hover { background: #2c2c2e; }

.lb-note { display: none; }
.lightbox.with-note { grid-template-rows: auto auto; align-content: start; overflow-y: auto; }
.lightbox.with-note .lb-prev, .lightbox.with-note .lb-next { grid-row: 1; align-self: center; position: sticky; top: 42vh; }
.lightbox.with-note figure { grid-column: 2; grid-row: 1; }
.lightbox.with-note img { max-height: 78vh; }
.lightbox.with-note .lb-note {
  display: block; grid-column: 2; grid-row: 2; justify-self: center;
  width: min(100%, 680px); margin: 8px 0 56px;
  color: rgba(255, 255, 255, 0.78); font-size: 17px; line-height: 1.6;
}
.lb-note h3 { color: #fff; font: 600 24px/1.2 var(--font-display); letter-spacing: -0.02em; margin-bottom: 16px; }
.lb-note p + p { margin-top: 12px; }

/* ---------- Pied de page ---------- */

.footer { padding: 0 var(--pad); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 40px 0; border-top: 1px solid var(--line); }
.footer-cols h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.footer-cols p, .footer-cols a { display: block; font-size: 13px; color: var(--grey); line-height: 2; }
.footer-cols a:hover { color: var(--ink); text-decoration: underline; }
.footer-brand { width: 180px; max-width: 100%; height: auto; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0 32px; font-size: 12px; color: var(--grey); }

/* ---------- Petits écrans ---------- */

@media (max-width: 760px) {
  body { font-size: 17px; }
  .vrac-board { height: 1250px; }
  .vrac-item { padding: 4px; }
  .grid { columns: 1; }
  .showcase { aspect-ratio: 4 / 3; grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr 1fr; }
  .tile:first-child { grid-row: auto; grid-column: 1 / 3; }
  .showcase-cta { left: 12px; bottom: 12px; }
  .explain, .mood-meta, .footer-cols, .piste-head { grid-template-columns: 1fr; }
  .facts { position: static; }
  .facts dl { grid-template-columns: auto 1fr; gap: 8px 16px; }
  .facts dt { grid-column: 1; margin-top: 0; }
  .facts dd { grid-column: 2; }
  .renders, .masonry { columns: 1; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .pistes-nav { margin-top: -16px; }
  .hero-meta { flex-direction: column; gap: 2px; }
  .hero-meta span + span::before { display: none; }
  .tabs { width: auto; }
  .tabs a { flex: 1 1 0; justify-content: center; padding: 6px 8px; font-size: 13px; }
  .lightbox { grid-template-columns: 52px 1fr 52px; }
  .lightbox.with-note .lb-note { grid-column: 1 / 4; width: auto; margin: 8px 20px 32px; }
  .lightbox.with-note img { max-height: 65vh; }
}

/* ================= Mouvement ================= */

a:focus-visible, button:focus-visible, model-viewer:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px;
}

/* Le seul moment de mise en scène : la signature s'écrit au chargement */
.hero-title img { clip-path: inset(0 100% 0 0); animation: signer 1.6s var(--ease-out) 0.15s forwards; }
@keyframes signer { to { clip-path: inset(0 0 0 0); } }
/* Logo : chaque ligne se dévoile lentement de gauche à droite, avec un bord fondu plutôt qu'une coupe nette */
.hero-title .logo-nl > span {
  -webkit-mask-image: linear-gradient(90deg, #000 0 38%, transparent 62%); mask-image: linear-gradient(90deg, #000 0 38%, transparent 62%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  animation: devoiler 2.8s cubic-bezier(.45, 0, .2, 1) 0.2s forwards;
}
.hero-title .logo-nl > span + span { animation-delay: 0.75s; }
/* Le tag arrive pixelisé puis se dépixelise (canvas posé par JS, retiré à la fin) */
.hero-title .logo-tag { position: relative; }
.logo-tag.pixelise { background: none; }
.logo-pixels { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
@keyframes devoiler { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }

/* Apparition douce au scroll (ajoutée par JS : sans JS, tout reste visible) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
.apparait { opacity: 0; transform: translateY(65px); transition: opacity 0.9s cubic-bezier(.22,1,.36,1), transform 1.1s cubic-bezier(.22,1,.36,1); }
.apparait.in { opacity: 1; transform: none; }

/* Transitions entre pages : fondu + l'image du projet qui vole vers sa page */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: sortie var(--dur-court) var(--ease-in) both; }
::view-transition-new(root) { animation: entree var(--dur-moyen) var(--ease-out) both; }
::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: var(--ease-out); }
@keyframes sortie { to { opacity: 0; } }
@keyframes entree { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .hero-title img { animation: none; clip-path: none; }
  .hero-title .logo-nl > span { animation: none; -webkit-mask-image: none; mask-image: none; }  .reveal { opacity: 1; transform: none; transition: none; }
  .project-body { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(*) { animation: none; }
  html { scroll-behavior: auto; }
}

/* Dans les pages projet, toutes les images ont des coins carrés, sans arrondi :
   grande image du haut, galeries d'idéation et de rendus, vidéos, 3D et vignettes « autres projets ».
   (La roulette de l'accueil et de la page Projets garde ses images arrondies.) */
.project-hero-img,
.masonry figure img, .masonry figure.video video, .masonry .placeholder,
.renders figure, .renders > figure:first-child, .renders figure.legende-visible img, .renders figure.video video,
.model model-viewer, .autres-img,
.dossier-corps figure, .dossier-corps img, .dossier-corps video { border-radius: 0; }

/* ---------- Page Archive (tous les projets) : fond noir, grandes bandes, capitales blanches et magenta ---------- */
body.page-archive { --bg: #0d0d0e; }
.page-archive .page-title { text-transform: uppercase; letter-spacing: -0.01em; }
.page-archive .page-title small { color: var(--violet); }
.page-archive .back-link { text-transform: uppercase; font-size: 15px; letter-spacing: .02em; }
.archive { display: grid; gap: 14px; }
.archive-ligne { background: #262628; transition: background .25s; }
.archive-ligne:hover, .archive-ligne.ouverte { background: #2f2f32; }
.archive-tete {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; align-items: start;
  padding: clamp(18px, 2vw, 26px) clamp(18px, 2.2vw, 30px); border: 0; background: none; cursor: pointer;
  text-align: left; color: #f5f5f7; font: 400 clamp(17px, 1.6vw, 22px)/1.3 var(--font); text-transform: uppercase; letter-spacing: .01em;
}
.archive-nom b { font-weight: 500; transition: color .25s; }
.archive-tete:hover .archive-nom b, .archive-ligne.ouverte .archive-nom b { color: var(--violet); }
.archive-annee { grid-column: 1; color: #a1a1a6; font-variant-numeric: tabular-nums; }
.archive-num { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--violet); font-variant-numeric: tabular-nums; font-size: .9em; }
.archive-tete:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
/* Dépliage : la hauteur passe de 0 à son contenu, en douceur */
.archive-corps { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease-out); }
.archive-ligne.ouverte .archive-corps { grid-template-rows: 1fr; }
.archive-dedans { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px);
  padding: 0 clamp(18px, 2.2vw, 30px); opacity: 0; transition: opacity .4s, padding .55s var(--ease-out); }
.archive-ligne.ouverte .archive-dedans { opacity: 1; padding-bottom: clamp(18px, 2.2vw, 30px); }
.archive-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #1c1c1e; }
.archive-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease-out); }
.archive-img:hover img { transform: scale(1.03); }
.archive-texte { display: flex; flex-direction: column; gap: 14px; color: #f5f5f7; }
.archive-sous { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.4; }
.archive-cadre { font-size: 14px; line-height: 1.5; color: #a1a1a6; }
.archive-ouvrir { margin-top: auto; align-self: start; padding: 10px 16px; background: var(--violet); color: #0d0d0e; font-weight: 600; text-transform: uppercase; font-size: 14px; letter-spacing: .02em; }
.archive-ouvrir:hover { filter: brightness(.9); }
@media (max-width: 700px) { .archive-dedans { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .archive-corps, .archive-dedans { transition: none; } }

/* Plus aucun arrondi nulle part : photos, cartes, pastilles et boutons ont des angles droits
   (prioritaire, y compris sur les arrondis posés par le script, comme la planche de l'Archive) */
*, *::before, *::after { border-radius: 0 !important; }
input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-thumb, input[type="range"]::-moz-range-track { border-radius: 0 !important; }
/* Les flèches de la roulette deviennent des hexagones */
.roulette-fleche { width: 48px; height: 44px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
