/* =========================================================
   Base commune : page projet, visionneuse, rideau, message.
   index.html change les variables ci-dessous à sa façon.
   ========================================================= */
:root {
  --pj-papier: #F4F2EC;
  --pj-encre: #121212;
  --pj-doux: #55524B;
  --pj-titre: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --pj-texte: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --pj-rayon: 18px;
  --gouttiere: max(16px, 4vw);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.bloque { overflow: hidden; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- Page projet ---------- */
.pj { position: fixed; inset: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain; background: var(--pj-papier); color: var(--pj-encre); font-family: var(--pj-texte); font-size: 17px; line-height: 1.55; }
.pj.entre article { animation: pj-entre .7s cubic-bezier(.2, .8, .2, 1) both; }
.pj-barre { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px var(--gouttiere); background: var(--c); color: var(--on); }
.pj-retour { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; margin-right: auto; border: 1.5px solid currentColor; border-radius: 999px; font-weight: 700; }
.pj-retour:hover, .pj-fleche:hover { background: var(--on); color: var(--c); }
.pj-compteur { font-variant-numeric: tabular-nums; font-weight: 600; }
.pj-fleche { width: 44px; height: 44px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 18px; }
.pj article { max-width: 1440px; margin: 0 auto; }
.pj-tete { padding: clamp(36px, 6vw, 90px) var(--gouttiere) clamp(120px, 15vw, 210px); background: var(--c); color: var(--on); }
.pj-meta { margin: 0; font-weight: 600; font-size: 15px; }
.pj-titre { margin: .12em 0 .14em; font-family: var(--pj-titre); font-weight: 800; font-size: clamp(52px, 10vw, 170px); line-height: .88; letter-spacing: -.04em; text-transform: uppercase; text-wrap: balance; overflow-wrap: break-word; hyphens: manual; }
.pj-pitch { max-width: 28ch; margin: 0; font-size: clamp(21px, 2.3vw, 34px); line-height: 1.2; font-weight: 600; }
.pj-media { margin: calc(-1 * clamp(96px, 12vw, 170px)) var(--gouttiere) 0; overflow: hidden; border-radius: var(--pj-rayon); background: var(--fond); box-shadow: 0 30px 80px rgba(0, 0, 0, .22); }
.pj-media img { width: 100%; max-height: 78vh; object-fit: contain; margin: 0 auto; }
.pj-media video { width: 100%; max-height: 78vh; background: #000; }
.pj-media figcaption { padding: 10px 16px; color: #D8D4CA; font-size: 14px; background: #141414; }
.zoomable { display: block; width: 100%; cursor: zoom-in; }
.pj-corps { display: flex; flex-wrap: wrap; gap: 40px 72px; padding: 70px var(--gouttiere) 30px; }
.pj-texte { flex: 1 1 560px; display: grid; gap: 32px; align-content: start; }
.pj-desc { max-width: 58ch; margin: 0; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.5; }
.pj-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.pj-notes p { display: grid; gap: 8px; margin: 0; padding: 20px; border-radius: var(--pj-rayon); background: color-mix(in srgb, var(--c) 16%, var(--pj-papier)); font-size: 19px; font-weight: 700; line-height: 1.25; }
.pj-notes span { color: var(--pj-doux); font-size: 13px; font-weight: 600; }
.pj-fiche { flex: 0 1 360px; align-self: flex-start; display: grid; gap: 20px; padding: 26px; border-radius: var(--pj-rayon); background: var(--pj-encre); color: var(--pj-papier); }
.pj-fiche dl { display: grid; gap: 14px; margin: 0; }
.pj-fiche dt { font-size: 13px; font-weight: 600; opacity: .75; }
.pj-fiche dd { margin: 2px 0 0; font-weight: 500; }
.pj-lien { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--c); color: var(--on); font-weight: 700; text-decoration: none; }
.pj-equipe { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 30px var(--gouttiere) 16px; font-weight: 600; }
.pj-equipe span { padding: 5px 10px; border-radius: 999px; background: var(--pj-encre); color: var(--pj-papier); font-size: 13px; }
.pj-galerie { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; padding: 0 var(--gouttiere) 80px; }
.pj-galerie.serree { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.vignette { display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--pj-rayon); background: var(--fond); cursor: zoom-in; }
.serree .vignette { aspect-ratio: 3 / 4; }
.vignette img { width: 100%; height: 100%; object-fit: contain; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.vignette:hover img { transform: scale(1.04); }
.pj-suivant { display: grid; gap: 6px; width: 100%; padding: clamp(44px, 7vw, 110px) var(--gouttiere); background: var(--nc); color: var(--non); text-align: left; }
.pj-suivant span { font-weight: 600; }
.pj-suivant b { font-family: var(--pj-titre); font-size: clamp(44px, 8vw, 140px); line-height: .9; letter-spacing: -.04em; text-transform: uppercase; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.pj-suivant:hover b { transform: translateX(2%); }

/* ---------- Visionneuse ---------- */
.zoom { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px var(--gouttiere) 20px; background: rgba(10, 10, 10, .95); color: #F2EFE7; font-family: var(--pj-texte); }
.zoom-barre { display: flex; align-items: center; justify-content: space-between; }
.zoom-fermer { min-height: 44px; padding: 0 18px; border: 1.5px solid currentColor; border-radius: 999px; font-weight: 700; }
.zoom figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 10px; min-height: 0; margin: 0; }
.zoom img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 8px; }
.zoom figcaption { max-width: 70ch; text-align: center; color: #CFCBC0; }
.zoom-fleche { position: absolute; top: 50%; width: 54px; height: 54px; margin-top: -27px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; }
.zoom-prec { left: 14px; } .zoom-suiv { right: 14px; }
.zoom.seule .zoom-fleche { display: none; }

/* ---------- Rideau et message ---------- */
.rideau { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; animation: rideau .98s cubic-bezier(.7, 0, .25, 1) forwards; }
.rideau span { padding: 0 16px; font-family: var(--pj-titre); font-weight: 800; font-size: clamp(40px, 8vw, 130px); line-height: .9; letter-spacing: -.04em; text-transform: uppercase; text-align: center; }
.message { position: fixed; left: 50%; bottom: 20px; z-index: 90; margin: 0; padding: 12px 20px; border-radius: 999px; background: #111; color: #fff; font: 600 15px/1.3 var(--pj-texte); transform: translate(-50%, 140%); opacity: 0; transition: transform .35s, opacity .35s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.message.visible { transform: translate(-50%, 0); opacity: 1; }

@keyframes rideau { 0% { clip-path: inset(100% 0 0 0); } 42%, 58% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 100% 0); } }
@keyframes pj-entre { from { opacity: 0; transform: translateY(40px); } }

@media (max-width: 640px) {
  .pj-compteur { display: none; }
  .zoom { padding-bottom: 84px; }
  .zoom-fleche { top: auto; bottom: 14px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

