/* ==========================================================================
   Dylan Etonno — portfolio / candidature en alternance
   Voir .anti-slop/IDENTITY.md : ce fichier doit s'y conformer.

   Jetons nommés par FONCTION, jamais par apparence. C'est volontaire :
   un dégradé décoratif n'a pas de fonction, donc pas de jeton, donc il
   n'est pas plaçable. La convention fait respecter la règle toute seule.
   ========================================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ── Jetons ─────────────────────────────────────────────────────────────── */
:root {
  /* Surfaces — sable et sienne */
  --surface-base:     #EDE3D1;
  --surface-raised:   #F7F1E5;
  --surface-sunken:   #E3D7C1;
  --surface-shell:    rgba(43, 33, 24, .035);
  --surface-hover:    rgba(43, 33, 24, .06);
  --surface-deep:     #2B2118;   /* fond des couches plein écran */

  /* Texte — ratios mesurés, pas estimés */
  --text-primary:     #2B2118;                 /* 12.38:1 sur base */
  --text-secondary:   #6B5B45;                 /*  5.15:1 sur base */
  --text-invert:      #F7F1E5;

  /* Action */
  --accent:           #8D5416;                 /*  4.82:1 sur base — texte OK */
  --accent-surface:   #A8641A;                 /*  remplissages NON textuels   */
  --accent-wash:      rgba(168, 100, 26, .12);

  /* Bordures */
  --border-hairline:  #DCCDB4;
  --border-strong:    #C9B695;

  /* Élévation neutre, dérivée de l'encre — pas un halo coloré */
  --shadow-card:      0 1px 2px rgba(43, 33, 24, .05), 0 14px 30px -20px rgba(43, 33, 24, .30);
  --shadow-lift:      0 2px 5px rgba(43, 33, 24, .06), 0 26px 48px -24px rgba(43, 33, 24, .38);

  --r-lg:       2rem;
  --r-md:       1.35rem;
  --r-sm:       .85rem;

  --gap:        clamp(1rem, 2vw, 1.75rem);
  --pad:        clamp(1.25rem, 5vw, 4.5rem);
  --section:    clamp(6rem, 14vh + 3rem, 11rem);

  --ease:       cubic-bezier(.32, .72, 0, 1);
  --ease-soft:  cubic-bezier(.22, 1, .36, 1);

  --z-nav:      100;
  --z-menu:     200;
  --z-overlay:  300;
  --z-grain:    400;
}

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

/* IMPÉRATIF. Les couches plein écran (.menu, .lb, .reader) portent un `display`
   en CSS, qui l'emporte sur le `display:none` de l'attribut `hidden` défini par
   la feuille de style du navigateur. Sans cette règle, elles restent étalées sur
   toute la page — invisibles à cause de l'opacité, mais captant chaque clic. */
[hidden] { display: none !important; }

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

/* La barre de navigation flotte au-dessus : sans cette marge, une ancre place
   le titre de section juste dessous, caché. */
section[id], header[id] { scroll-margin-top: clamp(4.5rem, 10vh, 6.5rem); }

body {
  margin: 0;
  background: var(--surface-base);
  color: var(--text-primary);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1rem, .35vw + .93rem, 1.12rem);
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent-surface); color: var(--text-invert); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  z-index: var(--z-overlay);
  padding: .75rem 1.25rem; border-radius: 999px;
  background: var(--text-primary); color: var(--text-invert); font-weight: 600;
  transition: top .4s var(--ease), background-color .4s var(--ease), transform .4s var(--ease);
}
.skip:focus { top: 1rem; }
.skip:hover { background: #1C150E; }
.skip:active { transform: translateX(-50%) scale(.97); }

.noscript {
  padding: 1.25rem var(--pad); margin: 0;
  background: var(--accent-surface); color: var(--text-invert); font-weight: 600; text-align: center;
}

/* Grain : fixe, non interactif. En multiply sur fond clair, il donne le
   grain d'un papier plutôt qu'un voile. */
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain);
  pointer-events: none; opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Typographie ────────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: "Bricolage", system-ui, sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.03em;
  margin: 0;
  text-wrap: balance;
}

/* Casse basse, crénage normal : les micro-labels ALL-CAPS très espacés sont
   un tic de génération. Le libellé porte une information réelle. */
.kicker {
  display: block;
  margin: 0 0 1.25rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Navigation flottante ───────────────────────────────────────────────── */
.nav {
  position: fixed; top: clamp(.9rem, 2vh, 1.75rem); left: 0; right: 0;
  z-index: var(--z-nav);
  display: flex; justify-content: center;
  padding: 0 var(--pad);
  pointer-events: none;
}
/* Seul élément flouté du site : elle flotte au-dessus du contenu qui défile,
   le flou y est fonctionnel (lisibilité), pas décoratif. */
.nav__pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: clamp(.5rem, 2vw, 1.5rem);
  padding: .5rem .5rem .5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: rgba(247, 241, 229, .86);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-card);
}

.nav__brand {
  font-family: "Bricolage", sans-serif; font-weight: 800;
  letter-spacing: -.04em; font-size: 1rem;
  transition: color .5s var(--ease);
}
.nav__brand:hover { color: var(--accent); }
.nav__brand:active { color: var(--text-secondary); }

.nav__links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.nav__links a {
  display: block; padding: .5rem .85rem; border-radius: 999px;
  font-size: .88rem; color: var(--text-secondary);
  transition: color .5s var(--ease), background-color .5s var(--ease);
}
.nav__links a:hover { color: var(--text-primary); background: var(--surface-shell); }
.nav__links a:active { background: var(--surface-hover); }
.nav__links a.is-cta { color: var(--accent); font-weight: 600; }

.burger {
  display: none;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--surface-shell); border: 1px solid var(--border-hairline);
  position: relative;
  transition: background-color .5s var(--ease), transform .5s var(--ease);
}
.burger:hover { background: var(--surface-hover); }
.burger:active { transform: scale(.94); }
.burger span {
  position: absolute; left: 50%; top: 50%;
  width: 15px; height: 1.5px; border-radius: 2px; background: var(--text-primary);
  transition: transform .6s var(--ease);
}
.burger span:nth-child(1) { transform: translate(-50%, -4px); }
.burger span:nth-child(2) { transform: translate(-50%, 3px); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

/* Menu plein écran — surface opaque, pas de verre dépoli. */
.menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  display: grid; place-items: center;
  background: var(--surface-base);
  opacity: 0; transition: opacity .6s var(--ease);
}
.menu.is-open { opacity: 1; }
.menu__list { list-style: none; margin: 0; padding: 0; text-align: center; }
.menu__list li {
  opacity: 0; transform: translateY(2.5rem);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: calc(var(--i) * 60ms);
}
.menu.is-open .menu__list li { opacity: 1; transform: none; }
.menu__list a {
  display: block; padding: .35rem 1rem;
  font-family: "Bricolage", sans-serif; font-weight: 600;
  font-size: clamp(2rem, 8vw, 3.25rem); letter-spacing: -.04em;
  transition: color .5s var(--ease);
}
.menu__list a:hover { color: var(--accent); }
.menu__list a:active { color: var(--text-secondary); }

/* Les mentions légales ne sont pas un item de navigation principal :
   présentes dans le menu, mais à leur juste échelle. */
.menu__legal {
  font-family: "Newsreader", Georgia, serif !important;
  font-size: 1rem !important; font-weight: 400 !important;
  color: var(--text-secondary); margin-top: 1.5rem;
  text-decoration: underline; text-underline-offset: .25em;
}

/* ── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .85rem;
  padding: .6rem .6rem .6rem 1.5rem;
  border-radius: 999px;
  background: var(--text-primary); color: var(--text-invert);
  font-size: .95rem; font-weight: 600; letter-spacing: -.01em;
  transition: transform .6s var(--ease), background-color .6s var(--ease);
}
.btn:hover { background: #1C150E; }
.btn:active { transform: scale(.975); }

.btn__ico {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: rgba(247, 241, 229, .14);
  transition: transform .6s var(--ease), background-color .6s var(--ease);
}
.btn__ico svg { width: 15px; height: 15px; }
.btn:hover .btn__ico { transform: translate(2px, -1px) scale(1.06); background: rgba(247, 241, 229, .22); }

.btn--ghost {
  padding: .6rem 1.5rem;
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-shell); }
.btn--ghost:active { transform: scale(.975); }

/* ── Header 3D ──────────────────────────────────────────────────────────── */
/* Le cylindre occupe tout le header, en arrière-plan ; le texte passe devant
   sur toute la largeur. */
.hero {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(5rem, 12vh, 8rem) var(--pad) clamp(2.5rem, 7vh, 5rem);
  overflow: hidden;
}

/* Le cylindre occupe sa propre moitié : il ne passe jamais derrière le titre.
   C'est la composition qui règle la lisibilité, là où un voile dégradé ne
   faisait que masquer le problème. */
/* Arrière-plan du header. L'opacité est plafonnée à 0,32 : au-delà, le titre
   passant par-dessus un pixel d'affiche noir descend sous le seuil AA de 4,5:1
   (limite calculée : 0,399). Voir .anti-slop/IDENTITY.md. */
.stage {
  position: absolute; inset: 0; z-index: 0;
  display: grid; place-items: center;
  /* Origine centrée : la projection reste symétrique, ce qui rend l'emprise
     verticale calculable par le script. --perspective est lu par main.js. */
  --perspective: 1500;
  perspective: calc(var(--perspective) * 1px);
  perspective-origin: 50% 50%;
  opacity: .32;
  pointer-events: none;
  --card-w: 12rem;
}
/* --tilt est lu par main.js pour calculer le débordement vertical réel.
   Les deux valeurs doivent rester identiques. */
.stage__ring {
  position: relative;
  --tilt: 7;
  transform: rotateX(calc(var(--tilt) * -1deg));
  transform-style: preserve-3d;
}
.stage__spin {
  position: relative;
  width: var(--card-w); height: calc(var(--card-w) * 4 / 3);
  transform-style: preserve-3d;
  animation: spin var(--dur, 48s) linear infinite;
  will-change: transform;
}
@keyframes spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(-360deg); }
}

.card3d {
  position: absolute; inset: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  transform: rotateY(calc(var(--i) * var(--theta))) translateZ(var(--r));
  box-shadow: var(--shadow-card);
}
.card3d img { width: 100%; height: 100%; object-fit: cover; }

/* Sur fond clair, un plan qui s'éloigne se DÉLAVE vers le fond au lieu de
   noircir : c'est de la perspective atmosphérique. Un aplat suffit — le
   dégradé n'apportait rien que l'opacité animée ne fasse déjà. */
.card3d::after {
  content: ""; position: absolute; inset: 0;
  background: var(--surface-base);
  animation: dim var(--dur, 48s) linear infinite;
  animation-delay: calc((var(--i) / var(--n) - 1) * var(--dur, 48s));
}
@keyframes dim {
  0%, 100% { opacity: 0; }
  50%      { opacity: .88; }
}

.stage.is-paused .stage__spin,
.stage.is-paused .card3d::after { animation-play-state: paused; }

.hero__type {
  position: relative; z-index: 1;
  width: 100%; max-width: 62rem;
  margin-inline: auto;
  text-align: center;
}

.hero__name {
  font-size: clamp(3.2rem, 13vw, 10rem);
  font-weight: 800; letter-spacing: -.055em; line-height: .82;
  margin: 0 0 1rem;
  text-transform: uppercase;
}
.hero__name span { display: block; }
.hero__name .l2 {
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(43, 33, 24, .62);
}

/* Texte principal et non secondaire : par-dessus le cylindre, le gris chaud
   tombe à 1,9:1 sur une affiche sombre, très en dessous du seuil AA. */
.hero__role {
  margin: 0 0 1.75rem;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--text-primary);
}
.hero__role i { color: var(--text-primary); font-style: normal; margin: 0 .4rem; opacity: .55; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: var(--section) var(--pad); position: relative; }

.section__head { max-width: 42rem; margin-bottom: clamp(3rem, 7vw, 5.5rem); }
.section__title { font-size: clamp(2rem, 5.5vw, 3.9rem); margin-bottom: 1.5rem; }
.section__intro { margin: 0; color: var(--text-secondary); max-width: 34rem; }

/* Colonnes CSS plutôt qu'une grille rigide : chaque visuel garde ses
   proportions natives au lieu d'être recadré. */
.grid { columns: 3 18rem; column-gap: var(--gap); }
.grid--tall { columns: 4 13rem; }
.grid--wide { columns: 2 24rem; }
.grid > .piece { break-inside: avoid; margin-bottom: var(--gap); }

/* Une pièce seule laisserait un vide béant dans une grille en colonnes.
   On repasse en grille explicite : la pièce fait face à un bloc rédigé. */
.grid--solo { columns: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.grid--solo > .piece { margin-bottom: 0; }
@media (min-width: 800px) {
  .grid--solo { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; }
}

.slot__core--compact { padding: clamp(1.75rem, 4vw, 2.75rem); }
.complement__title {
  font-family: "Bricolage", sans-serif; font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.45rem); margin: 0 0 .85rem;
}
.complement__text { margin: 0 0 1.5rem; color: var(--text-secondary); font-size: 1rem; }

/* ── LA primitive : coque extérieure + noyau intérieur, répétée partout ──
   Travaux, catalogues, bloc alternance et bloc contact partagent cette même
   structure. C'est ce qui fait lire le site comme dessiné, pas assemblé. */
.piece {
  display: block; width: 100%; text-align: left; padding: 6px;
  border-radius: var(--r-lg);
  background: var(--surface-shell);
  border: 1px solid var(--border-hairline);
  transition: transform .8s var(--ease), background-color .8s var(--ease),
              border-color .8s var(--ease), box-shadow .8s var(--ease);
}
.piece:hover {
  transform: translateY(-6px);
  background: var(--surface-hover); border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}
.piece:active { transform: translateY(-2px) scale(.995); }

.piece__core {
  position: relative;
  border-radius: calc(var(--r-lg) - 6px);
  overflow: hidden;
  background: var(--surface-raised);
}
.piece__core img {
  width: 100%; height: 100%; object-fit: cover;
  background-size: cover; background-position: center;
  transition: transform 1.1s var(--ease-soft);
}
.piece:hover .piece__core img { transform: scale(1.035); }

/* ── Cartes vidéo ───────────────────────────────────────────────────────── */
.piece--video .piece__core { position: relative; }
.piece--video .piece__video {
  width: 100%; height: 100%; display: block;
  background: var(--surface-deep);
}

.play {
  position: absolute; left: 50%; top: 50%;
  width: clamp(3.25rem, 7vw, 4.25rem); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-raised); color: var(--text-primary);
  box-shadow: var(--shadow-card);
  transition: transform .5s var(--ease), background-color .5s var(--ease);
}
.play svg { width: 42%; height: 42%; margin-left: 6%; }
.play:hover { transform: translate(-50%, -50%) scale(1.08); background: #fff; }
.play:active { transform: translate(-50%, -50%) scale(.96); }
.piece--video:hover .play { transform: translate(-50%, -50%) scale(1.05); }

.piece__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1rem .6rem .35rem;
}
.piece__title { font-family: "Bricolage", sans-serif; font-size: 1.05rem; font-weight: 600; margin: 0; }
.piece__sub { margin: .15rem 0 0; font-size: .9rem; color: var(--text-secondary); }
.piece__year { font-size: .85rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ── Catalogues : même primitive que les travaux ─────────────────────────── */
.cat__cover {
  border-radius: calc(var(--r-lg) - 6px);
  overflow: hidden;
  background: var(--surface-raised);
}
.cat__cover img { width: 100%; transition: transform 1.1s var(--ease-soft); }
.piece:hover .cat__cover img { transform: scale(1.035); }

.cat__body { padding: 1rem .6rem .35rem; }
.cat__title { font-family: "Bricolage", sans-serif; font-size: clamp(1.15rem, 2vw, 1.5rem); margin: 0 0 .5rem; }
.cat__note { margin: 0 0 1rem; font-size: .95rem; color: var(--text-secondary); }
.cat__open {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .9rem; font-weight: 600; color: var(--accent);
}
.cat__open svg { width: 14px; height: 14px; transition: transform .6s var(--ease); }
.piece:hover .cat__open svg { transform: translateX(3px); }

/* ── Bloc alternance : même primitive, en grand ──────────────────────────── */
.slot { padding: 8px; border-radius: calc(var(--r-lg) + 8px);
        background: var(--surface-shell); border: 1px solid var(--border-hairline); }
.slot__core {
  padding: clamp(2rem, 6vw, 4.5rem);
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}
.slot__title { font-size: clamp(1.9rem, 5vw, 3.4rem); margin-bottom: 1.25rem; }
.slot__lead { margin: 0 0 2.5rem; color: var(--text-secondary); max-width: 36rem; font-size: 1.1rem; }
.slot__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.5rem; }

/* Listes de faits : filets horizontaux, un seul traitement réutilisé
   pour l'alternance, le savoir-faire et le parcours. */
.facts { margin: 0; display: grid; gap: 0; }
.facts > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 2rem;
  padding: .95rem 0; border-top: 1px solid var(--border-hairline);
}
.facts dt { font-size: .9rem; color: var(--text-secondary); flex: none; }
.facts dd { margin: 0; font-size: 1rem; text-align: right; font-weight: 600; }

.proofs { list-style: none; margin: 0; padding: 0; }
.proofs li { padding: 1.35rem 0; border-top: 1px solid var(--border-hairline); }
.proofs h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .35rem; }
.proofs p { margin: 0; color: var(--text-secondary); font-size: .98rem; }
.proofs .proofs__ref { display: block; margin-top: .3rem; font-size: .88rem; color: var(--accent); }

/* ── À propos ───────────────────────────────────────────────────────────── */
.about__grid {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
  align-items: start;
}
.about__text p { margin: 0 0 2.5rem; color: var(--text-secondary); font-size: 1.15rem; }

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact__title { font-size: clamp(2.1rem, 6.5vw, 4.4rem); margin-bottom: 1.25rem; }
.contact__sub { margin: 0 0 2.5rem; color: var(--text-secondary); max-width: 32rem; font-size: 1.1rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.contact__alt { margin: 2rem 0 0; font-size: .95rem; color: var(--text-secondary); }
.contact__alt a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.contact__alt a:hover { color: var(--text-primary); }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 2.5rem var(--pad) 3rem;
  border-top: 1px solid var(--border-hairline);
  font-size: .9rem; color: var(--text-secondary);
}
.footer p { margin: 0; }
.footer a { transition: color .5s var(--ease); }
.footer a:hover { color: var(--text-primary); }
.footer a:active { color: var(--accent); }

/* ── Mentions légales ───────────────────────────────────────────────────── */
.legal { max-width: 44rem; margin-inline: auto; padding-top: calc(var(--section) * .9); }
.legal h2 {
  font-size: clamp(1.05rem, 2vw, 1.3rem); font-weight: 600;
  margin: 3rem 0 .85rem; padding-top: 1.75rem; border-top: 1px solid var(--border-hairline);
}
.legal p { color: var(--text-secondary); margin: 0 0 1rem; }
.legal strong { color: var(--text-primary); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; transition: color .5s var(--ease); }
.legal a:hover { color: var(--text-primary); }
.legal a:active { color: var(--text-secondary); }
.legal__back { margin-top: 3.5rem; }

/* ── Lightbox — fond encre : les affiches sont sombres, elles doivent
      ressortir. La couleur vient de la palette, pas d'ailleurs. ──────────── */
.lb {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(43, 33, 24, .97);
  opacity: 0; transition: opacity .5s var(--ease);
}
.lb.is-open { opacity: 1; }
.lb__figure { margin: 0; display: grid; gap: 1rem; justify-items: center; max-height: 100%; }
.lb__figure img {
  max-height: min(78dvh, 900px); width: auto; border-radius: var(--r-sm);
  transform: scale(.965); opacity: 0;
  transition: transform .7s var(--ease), opacity .7s var(--ease);
}
.lb.is-open .lb__figure img { transform: none; opacity: 1; }
.lb__figure figcaption {
  font-size: .95rem; color: rgba(247, 241, 229, .72); text-align: center; max-width: 34rem;
}

.lb__close, .lb__nav {
  position: absolute; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 999px;
  color: var(--text-invert);
  border: 1px solid rgba(247, 241, 229, .22); background: rgba(247, 241, 229, .08);
  transition: background-color .5s var(--ease), transform .5s var(--ease);
}
.lb__close:hover, .lb__nav:hover { background: rgba(247, 241, 229, .18); }
.lb__close:active, .lb__nav:active { transform: scale(.92); }
.lb__close svg, .lb__nav svg { width: 18px; height: 18px; }
.lb__close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); }
.lb__nav { top: 50%; margin-top: -23px; }
.lb__nav--prev { left: clamp(.5rem, 3vw, 2rem); }
.lb__nav--next { right: clamp(.5rem, 3vw, 2rem); }
.lb__nav--prev:hover { transform: translateX(-3px); }
.lb__nav--next:hover { transform: translateX(3px); }

/* ── Lecteur de catalogue ───────────────────────────────────────────────── */
.reader {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--surface-sunken);
  opacity: 0; transition: opacity .5s var(--ease);
}
.reader.is-open { opacity: 1; }

.reader__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-raised);
}
.reader__title { margin: 0; font-family: "Bricolage", sans-serif; font-weight: 600; font-size: 1rem; }
.reader__count { margin: 0 auto 0 0; font-size: .88rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.reader__close {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--border-hairline); background: var(--surface-shell);
  transition: background-color .5s var(--ease), transform .5s var(--ease);
}
.reader__close:hover { background: var(--surface-hover); }
.reader__close:active { transform: scale(.92); }
.reader__close svg { width: 17px; height: 17px; }

.reader__pages {
  height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 clamp(.75rem, 4vw, 2rem) 4rem;
  scroll-padding-top: 5rem;
}
.reader__pages img {
  width: min(100%, 52rem); margin: clamp(.75rem, 2vw, 1.5rem) auto;
  border-radius: var(--r-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-card);
}

/* ── Révélations au défilement ──────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(3rem);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ── Adaptation ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .burger { display: block; }
  .nav__pill { padding: .5rem .5rem .5rem 1.25rem; }

  .stage__ring { --tilt: 5; }

  .hero__name .l2 { -webkit-text-stroke-width: .9px; }

  /* Tout retombe en colonne unique : sinon les zones tactiles se
     chevauchent et les cartes deviennent illisibles. */
  .grid, .grid--tall, .grid--wide { columns: 1; }
  .facts > div { flex-direction: column; gap: .2rem; }
  .facts dd { text-align: left; }
  .lb__nav { width: 40px; height: 40px; margin-top: -20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage__spin { animation: none; transform: rotateY(-18deg); }
  .card3d::after { animation: none; opacity: 0; }
  .card3d { transform: rotateY(calc(var(--i) * var(--theta))) translateZ(var(--r)); }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
