/*
 * Feuille des pages rendues par le serveur.
 *
 * Elle vit dans `public/` et non dans le bundle : ces pages sont servies sans
 * JavaScript, donc sans la chaîne de build, et doivent tenir seules. C'est la
 * raison pour laquelle les jetons de design sont redéclarés ici plutôt
 * qu'importés — le prix à payer pour des pages qui s'affichent complètes dès la
 * première réponse. Ils doivent rester en phase avec `src/styles/tokens.css`.
 */

:root {
  --void: #030304;
  --black: #050507;
  --anthracite: #0b0c10;
  --white: #f4f3f0;
  --grey-100: #d6d5d1;
  --grey-300: #9c9d9f;
  --grey-500: #6d6f74;
  --grey-700: #45474d;
  --gold: #c9a227;
  --gold-soft: #d8b45a;
  --champagne: #e6cf9a;
  --gold-dim: rgba(201, 162, 39, 0.28);
  --gold-ghost: rgba(201, 162, 39, 0.1);
  --hairline: rgba(244, 243, 240, 0.08);
  --hairline-hi: rgba(244, 243, 240, 0.16);

  --font-display: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --micro: 0.6875rem;
  --track-micro: 0.28em;
  --track-wide: 0.16em;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(90% 55% at 18% -5%, rgba(201, 162, 39, 0.06), transparent 62%),
    var(--black);
  color: var(--grey-300);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

::selection { background: var(--gold-dim); color: var(--white); }

/* ------------------------------------------------------------------ barre */

.pg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.4vh, 1.8rem) var(--gutter);
  border-bottom: 1px solid var(--hairline);
}

.pg-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  padding-left: 0.1em;
}

.pg-corner { width: 13px; height: 13px; color: var(--gold); flex: none; overflow: visible; }

.pg-bar__nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }

.pg-bar__nav a {
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--grey-500);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.4s var(--ease-out);
}

/* Le même filet d'or tiré depuis la gauche que partout ailleurs sur le site. */
.pg-bar__nav a::after,
.pg-back::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.55s var(--ease-out);
}

.pg-bar__nav a:hover { color: var(--white); }
.pg-bar__nav a:hover::after { transform: scaleX(1); transform-origin: left center; }

/* ------------------------------------------------------------------- corps */

.pg-main {
  /* Deux largeurs, pas une. Le texte garde une longueur de ligne qui se lit
     sans que l’œil se perde en revenant à la ligne ; les visuels, eux, n’ont
     aucune raison d’être bridés par cette contrainte, et débordent la colonne. */
  --measure: 46rem;
  --bleed: 64rem;

  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(3rem, 9vh, 6rem) var(--gutter) clamp(4rem, 10vh, 7rem);
}

.pg-hero { margin-bottom: clamp(2.5rem, 6vh, 4rem); }

.pg-back {
  display: inline-block;
  position: relative;
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--grey-500);
  text-decoration: none;
  margin-bottom: 1.6rem;
  padding-bottom: 3px;
  transition: color 0.4s var(--ease-out);
}

.pg-back:hover { color: var(--white); }
.pg-back:hover::after { transform: scaleX(1); transform-origin: left center; }

.pg-eyebrow {
  display: block;
  font-size: var(--micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.9rem;
}

.pg-hero h1 {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--white);
  margin: 0;
  text-wrap: balance;
}

.pg-lede {
  margin: 1.2rem 0 0;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.6;
  color: var(--grey-100);
  max-width: 56ch;
}

/* ------------------------------------------------------------------ blocs */

.pg-block { margin-block: clamp(2rem, 5vh, 3.2rem); }
.pg-block:first-of-type { margin-top: 0; }

.pg-head { margin-bottom: 1.2rem; }

.pg-head h2,
.pg-rich h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--white);
  margin: 0;
}

.pg-rich h2 { margin-top: 2.4rem; }
.pg-rich h2:first-child { margin-top: 0; }

.pg-rich h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--white);
  margin: 2rem 0 0.6rem;
}

.pg-rich,
.pg-points p,
.pg-faq__item .pg-rich { font-size: 1.0625rem; line-height: 1.7; }

.pg-rich p { margin: 0 0 1.1rem; }
.pg-rich p:last-child { margin-bottom: 0; }

.pg-rich strong { color: var(--grey-100); font-weight: 500; }
.pg-rich code {
  font-family: var(--font-body);
  font-size: 0.9em;
  color: var(--gold-soft);
  background: var(--gold-ghost);
  padding: 0.08em 0.34em;
  border-radius: 4px;
}

.pg-rich ul,
.pg-rich ol { margin: 0 0 1.1rem; padding-left: 1.2rem; }
.pg-rich li { margin-bottom: 0.4rem; }
.pg-rich li::marker { color: var(--gold); }

.pg-rich blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--gold-dim);
  color: var(--grey-100);
  font-style: normal;
}

.pg-rich a {
  color: var(--champagne);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  transition: border-color 0.4s var(--ease-out);
}

.pg-rich a:hover { border-bottom-color: var(--gold); }

/* ----------------------------------------------------------- points clés */

.pg-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }

.pg-points li {
  padding: 1.15rem 0;
  border-top: 1px solid var(--hairline);
}

.pg-points li:last-child { border-bottom: 1px solid var(--hairline); }

.pg-points h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  margin: 0 0 0.4rem;
}

.pg-points p { margin: 0; }

/* ---------------------------------------------------------------- faq */

.pg-faq { display: grid; }

.pg-faq__item { border-top: 1px solid var(--hairline); }
.pg-faq__item:last-child { border-bottom: 1px solid var(--hairline); }

.pg-faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2rem 1.15rem 0;
  position: relative;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.05rem;
  color: var(--grey-100);
  transition: color 0.4s var(--ease-out);
}

.pg-faq__item summary::-webkit-details-marker { display: none; }
.pg-faq__item summary:hover { color: var(--white); }

.pg-faq__item summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 1.05rem;
  color: var(--gold);
  font-size: 1.1rem;
  transition: transform 0.4s var(--ease-out);
}

.pg-faq__item[open] summary::after { content: '−'; }
.pg-faq__item .pg-rich { padding-bottom: 1.3rem; }

/* ---------------------------------------------------------------- cartes */

.pg-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.pg-cards a {
  display: block;
  position: relative;
  height: 100%;
  background: var(--black);
  text-decoration: none;
  transition: background-color 0.5s var(--ease-out);
}

.pg-cards a:hover { background: var(--anthracite); }

.pg-card__body { display: block; padding: 1.4rem 1.3rem 2.4rem; }

/* Même traitement que sur la page d'accueil : gris au repos, couleur au survol.
   Les deux endroits qui listent les projets doivent se ressembler. */
.pg-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 560;
  object-fit: cover;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  filter: grayscale(1) brightness(0.8);
  transition: filter 0.6s var(--ease-out);
}

.pg-cards a:hover .pg-card__img { filter: grayscale(0) brightness(1); }

.pg-card__year {
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  color: var(--gold);
}

.pg-cards h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin: 0.5rem 0 0.4rem;
}

.pg-cards p { margin: 0; font-size: 0.9rem; color: var(--grey-500); }

.pg-card__go {
  position: absolute;
  left: 1.3rem;
  bottom: 1.2rem;
  color: var(--gold);
  transition: transform 0.5s var(--ease-out);
}

.pg-cards a:hover .pg-card__go { transform: translateX(6px); }

/* ------------------------------------------------------------------- cta */

.pg-cta { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }

.pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.8rem;
  border: 1px solid var(--gold-dim);
  color: var(--grey-100);
  text-decoration: none;
  transition: color 0.45s var(--ease-out), border-color 0.45s var(--ease-out),
    background-color 0.45s var(--ease-out);
}

.pg-btn:hover { color: var(--void); background: var(--gold); border-color: var(--gold); }

.pg-btn span:first-child {
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
}

.pg-btn__arrow { color: var(--gold); transition: color 0.45s var(--ease-out), transform 0.5s var(--ease-out); }
.pg-btn:hover .pg-btn__arrow { color: var(--void); transform: translateX(5px); }

.pg-cta__note { font-size: var(--micro); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--grey-700); }

/* ------------------------------------------------------------ fiche projet */

.pg-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.6rem;
  margin: 0 0 clamp(2rem, 5vh, 3rem);
  padding-bottom: clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--hairline);
}

.pg-facts dt {
  font-size: var(--micro);
  letter-spacing: var(--track-micro);
  text-transform: uppercase;
  color: var(--grey-700);
  margin-bottom: 0.5rem;
}

.pg-facts dd { margin: 0; color: var(--grey-100); font-size: 0.92rem; }
.pg-facts dd span { display: block; }

/* ---------------------------------------------------------------- images */

/* width et height sont toujours dans le HTML : le navigateur connaît alors les
   proportions avant le chargement et réserve la place. Sans eux, la page saute
   quand l'image arrive — et c'est ce saut que Google mesure. */
.pg-cover,
.pg-figure { margin: 0 0 clamp(2rem, 5vh, 3rem); }

/* La sortie de colonne : `100%` se résout sur le bloc parent, donc sur la
   mesure, et la marge négative rend la différence. Le min() avec la fenêtre
   garantit qu’on ne provoque jamais de défilement horizontal. */
.pg-cover,
.pg-figure,
.pg-gallery,
.pg-cards {
  --out: min(var(--bleed, 64rem), calc(100vw - var(--gutter) * 2));
  width: var(--out);
  margin-inline: calc((100% - var(--out)) / 2);
}

.pg-cover img,
.pg-figure img,
.pg-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  background: var(--anthracite);
}

.pg-figure figcaption {
  margin-top: 0.7rem;
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--grey-700);
}

.pg-gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
}

/* ------------------------------------------------------- agrandissement */

/* L'image cliquable. Le « + » n'apparaît qu'au survol : au repos, rien ne doit
   se poser par-dessus une photo qu'on est en train de regarder. */
.pg-zoomin {
  display: block;
  position: relative;
  cursor: zoom-in;
}

.pg-zoomin img { transition: opacity 0.4s var(--ease-out); }
.pg-zoomin:hover img { opacity: 0.86; }

.pg-zoomin__mark {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--void);
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.pg-zoomin:hover .pg-zoomin__mark,
.pg-zoomin:focus-visible .pg-zoomin__mark { opacity: 1; transform: none; }

/* Le calque. Caché tant que rien ne le vise, montré par `:target` — donc sans
   une ligne de JavaScript, et fermable au bouton Précédent. */
.pg-zoom {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease-out), visibility 0.35s var(--ease-out);
}

.pg-zoom:target { opacity: 1; visibility: visible; }

.pg-zoom__scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 4, 0.94);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.pg-zoom img {
  position: relative;
  max-width: min(1400px, 94vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--hairline-hi);
  transform: scale(0.97);
  transition: transform 0.4s var(--ease-out);
}

.pg-zoom:target img { transform: none; }

.pg-zoom__close {
  position: absolute;
  top: clamp(0.8rem, 3vh, 1.8rem);
  right: clamp(0.8rem, 3vw, 1.8rem);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--grey-300);
  text-decoration: none;
  border: 1px solid var(--hairline-hi);
  border-radius: 50%;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.pg-zoom__close:hover { color: var(--white); border-color: var(--gold-dim); }

/* Une cellule de galerie : la vignette est carrée, l'agrandissement montre
   l'image entière. */
.pg-gcell { margin: 0; }
.pg-gcell .pg-zoomin img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  height: auto;
}

/* -------------------------------------------------------- site en ligne */

.pg-visit {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.pg-visit__host {
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--grey-700);
}

@media (prefers-reduced-motion: reduce) {
  .pg-zoom,
  .pg-zoom img,
  .pg-zoomin img,
  .pg-zoomin__mark { transition: none; }
}

/* ----------------------------------------------------------------- pied */

.pg-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: clamp(1.6rem, 4vh, 2.4rem) var(--gutter);
  border-top: 1px solid var(--hairline);
  font-size: var(--micro);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--grey-700);
}

.pg-foot__links { display: flex; flex-wrap: wrap; gap: 0.4rem clamp(0.9rem, 2.5vw, 1.8rem); }

.pg-foot a { text-decoration: none; transition: color 0.4s var(--ease-out); }
.pg-foot a:hover { color: var(--champagne); }

.pg-foot__brand {
  font-family: var(--font-display);
  letter-spacing: 0.42em;
  color: var(--grey-500);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
