/* ==========================================================================
   OBUCINA ARCHITECTES — Design system & global styles
   Palette : noir #000 · blanc #fff · bleu nuit #060030 · placeholder #d9d9d9
   Typo   : Helvetica Neue / Helvetica / Arial
   ========================================================================== */

/* ---- Polices : Helvetica Neue LT (fournies par le client) ---- */
@font-face {
  font-family: "Helvetica Neue LT";
  src: url("../fonts/HelveticaNeue-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Helvetica Neue LT";
  src: url("../fonts/HelveticaNeue-Medium.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Helvetica Neue LT";
  src: url("../fonts/HelveticaNeue-Heavy.otf") format("opentype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Helvetica Neue LT";
  src: url("../fonts/HelveticaNeue-Black.otf") format("opentype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #000000;
  --white: #ffffff;
  --navy: #060030;
  --placeholder: #d9d9d9;
  --border: rgba(0, 0, 0, 0.9);
  --border-soft: rgba(0, 0, 0, 0.18);
  --card-radius: 18px;
  --card-padding: clamp(16px, 2vw, 28px);

  --font: "Helvetica Neue LT", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Tailles issues des variables Figma (desktop par défaut, surcharge mobile plus bas) */
  --h1: 84px;
  --h2: 36px;
  --cta: 30px;
  --header: 70px;      /* liens du menu */
  --footer: 30px;      /* bas de page */
  --main-text: 25px;
  --project-title: 20px;
  --project-desc: 16px;

  --gutter: 20px;
  --loader-duration: 2s;
  /* Safe-area iOS (nécessite viewport-fit=cover) + marge anti-barre URL Safari */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-clearance: 0px;

  /* Light forcé par défaut — ne suit jamais prefers-color-scheme */
  color-scheme: light;
}

/* Dark mode : inversion noir / blanc (le light reste le défaut) */
html[data-theme="dark"] {
  --black: #ffffff;
  --white: #000000;
  --placeholder: #2a2a2a;
  --border: rgba(255, 255, 255, 0.9);
  --border-soft: rgba(255, 255, 255, 0.18);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

/* overflow-x sur html (pas body) : sinon overflow-y devient auto et body
   devient scrollport — position:fixed du menu se décale une fois scrollé. */
html {
  overflow-x: hidden;
  /* Le menu-overlay est rattaché à <html> (hors <body>) : sans ça il hérite
     de la police par défaut du navigateur (Times/serif). */
  font-family: var(--font);
}

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s ease, color 0.35s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Verrouille le fond derrière le menu.
   body position:fixed + top:-scrollY (JS) évite le saut de scroll.
   Pas d’overflow:hidden sur html : ça gèle le scrollport déjà scrollé et
   décale position:fixed (menu qui « démarre » au milieu de la page). */
html.no-scroll {
  overscroll-behavior: none;
}

body.no-scroll {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

/* Surlignage de texte */
::selection {
  background: var(--black);
  color: var(--white);
}
::-moz-selection {
  background: var(--black);
  color: var(--white);
}

/* ==========================================================================
   Curseur personnalisé — point qui s'inverse selon le fond
   (noir sur clair, blanc sur foncé) via mix-blend-mode: difference
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  * {
    cursor: none;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease;
    will-change: left, top;
  }

  .cursor-dot--big {
    width: 38px;
    height: 38px;
  }
}

/* ==========================================================================
   Logo
   ========================================================================== */

.logo {
  display: block;
  width: 140px;
  aspect-ratio: 139.16 / 35.23;
  /* Logo SVG en masque : prend `currentColor` → même auto-inversion (header
     mix-blend difference) et même couleur (menu) que l'ancien logo texte. */
  background-color: currentColor;
  -webkit-mask: url("../img/Obucina-Logo.svg?v=2") no-repeat center / contain;
  mask: url("../img/Obucina-Logo.svg?v=2") no-repeat center / contain;
}

.logo--lg {
  width: 170px;
}

/* ==========================================================================
   Header (fixe, s'inverse automatiquement selon le fond)
   ========================================================================== */

.site-header {
  position: fixed;
  top: calc(var(--gutter) + var(--safe-top));
  left: var(--gutter);
  width: calc(100% - (var(--gutter) * 2));
  padding: var(--card-padding);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 50;
  mix-blend-mode: difference;
  color: var(--white); /* difference => noir sur fond clair, blanc sur fond sombre */
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.site-header .logo,
.site-header .burger,
.site-header .projects__switcher button {
  pointer-events: auto;
}

/* html:has — le menu est rattaché à <html> pour rester ancré au viewport. */
html:has(.menu-overlay.open) .site-header {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hors home : léger flou du contenu sous le menu (ouverture / fermeture fluides).
   La home a [data-section] ; le menu est hors <body>, donc seul le body floute. */
body {
  transition: filter 0.65s cubic-bezier(0.77, 0, 0.175, 1);
}

html:has(.menu-overlay.open):not(:has([data-section])) body {
  filter: blur(6px);
}

@media (prefers-reduced-motion: reduce) {
  body {
    transition: none;
  }

  html:has(.menu-overlay.open):not(:has([data-section])) body {
    filter: none;
  }
}

/* Home : logo + menu forcés en blanc (pas d'inversion) */
.site-header--light {
  mix-blend-mode: normal;
  color: var(--white);
}

.site-header--light .burger span {
  background: var(--white);
}

/* Home / bloc ouvrages : réactive l’inversion pour rester lisible sur la vidéo */
.site-header--light.site-header--over-works {
  mix-blend-mode: difference;
}

.site-header--light.site-header--over-works .burger span {
  background: var(--white);
}

/* Pages projets : couleur fixe (noir en light / blanc en dark), sans inversion
   au-dessus des images. `--black` = foreground du thème. */
.site-header--solid {
  mix-blend-mode: normal;
  color: var(--black);
}

.site-header--solid .burger span {
  background: var(--black);
}

/* Menu hamburger : 4 barres */
.burger {
  width: 34px;
  height: 22px;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger span {
  display: block;
  width: 34px;
  height: 2px;
  background: var(--white);
}

/* ==========================================================================
   Overlay menu plein écran
   ========================================================================== */

.menu-overlay {
  position: fixed;
  inset: var(--gutter);
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
  z-index: 100;
  padding: var(--card-padding);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  clip-path: circle(0% at 100% 0%);
  transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1),
    visibility 0s linear 0.7s,
    background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
  pointer-events: none;
  visibility: hidden;
}

.menu-overlay.open {
  clip-path: circle(150vmax at 100% 0%);
  pointer-events: auto;
  visibility: visible;
  transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1), visibility 0s;
}

.menu-overlay__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.menu-close {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  position: relative;
  padding: 0;
  flex: none;
  pointer-events: auto;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.menu-close::before,
.menu-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 2px;
  background: var(--black);
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.25s ease;
}

.menu-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.menu-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Au survol (desktop) : un trait devient l'horizontale, l'autre disparaît → « − » */
@media (hover: hover) {
  .menu-close:hover::before {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  .menu-close:hover::after {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
  }
}

.menu-overlay__nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 8px;
}

.menu-overlay__nav a {
  font-size: var(--header);
  font-weight: 700;
  line-height: 1.2;
  height: 1.2em;
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

/* Glissement vertical : le mot monte, une copie identique arrive par le bas */
.menu-overlay__nav a .swap {
  display: block;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.menu-overlay__nav a .swap > span {
  display: block;
  line-height: 1.2;
}

@media (hover: hover) {
  .menu-overlay__nav a:hover .swap {
    transform: translateY(-50%);
  }
}

.menu-overlay__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--footer);
  font-weight: 300;
}

/* Toggle clair / sombre — entre lieu et météo */
.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 4px;
  border: none;
  background: transparent;
  color: inherit;
  line-height: 0;
  align-self: center;
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.theme-toggle__thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.theme-toggle[aria-checked="true"] .theme-toggle__thumb {
  transform: translate(20px, -50%);
}

@media (hover: hover) {
  .theme-toggle:hover .theme-toggle__track {
    background: color-mix(in srgb, currentColor 8%, transparent);
  }
}

/* Apparition décalée des liens du menu */
.menu-overlay__nav a {
  opacity: 0;
  transform: translateY(20px);
}

.menu-overlay.open .menu-overlay__nav a {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.menu-overlay.open .menu-overlay__nav a:nth-child(1) { transition-delay: 0.25s; }
.menu-overlay.open .menu-overlay__nav a:nth-child(2) { transition-delay: 0.35s; }
.menu-overlay.open .menu-overlay__nav a:nth-child(3) { transition-delay: 0.45s; }

/* ==========================================================================
   Boutons / CTA
   ========================================================================== */

.btn {
  display: inline-grid;
  place-items: center;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--white);
  font-weight: 700;
  font-size: var(--cta);
  padding: 0.52em 0.87em 0.38em;
  line-height: 1;
  text-align: center;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing {
  position: fixed;
  inset: var(--gutter);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  perspective: 1100px;
  overflow: hidden;
  box-sizing: border-box;
  transition: opacity 0.8s ease, background-color 0.35s ease, border-color 0.35s ease;
  will-change: opacity;
}

.landing.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* Pendant l'intro : on masque header / UI pour éviter les superpositions */
body.is-intro {
  overflow: hidden;
}

body.is-intro .site-header,
body.is-intro .section-indicator,
body.is-intro .scroll-progress {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* Pendant le crossfade : l'UI réapparaît avec la home, sous la landing */
body.is-intro.is-crossing .site-header,
body.is-intro.is-crossing .section-indicator,
body.is-intro.is-crossing .scroll-progress {
  opacity: 1;
  z-index: 180;
  pointer-events: none;
}

body.is-intro .home,
body.is-intro .home.revealed {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  will-change: opacity;
}

body.is-intro .home.is-ready {
  opacity: 1;
}

/*
  Crossfade : la home quitte le mode `fixed` pour son layout FINAL (flux
  document) PENDANT que la landing la recouvre encore à 100 %. Le reflow
  fixed→statique — responsable du saut « entre section 1 et 2 » au reveal — se
  produit donc caché. Seule la landing fond ensuite : plus aucun à-coup visible.
  (Spécificité + position dans le fichier > la règle `fixed` ci-dessus.)
*/
body.is-intro.is-crossing .home,
body.is-intro.is-crossing .home.revealed,
body.is-intro.is-crossing .home.is-ready {
  position: static;
  inset: auto;
  z-index: 1;
  overflow: visible;
  opacity: 1;
  transition: none;
  will-change: auto;
}

.landing__stage {
  position: relative;
  width: min(88vw, 420px);
  height: 3em;
  transform: rotateX(6deg);
  transform-style: preserve-3d;
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(22px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--black);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.landing.is-loading .landing__stage {
  opacity: 0;
}

.landing__ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: landingSpin 22s linear infinite;
}

.landing.is-loading .landing__ring {
  animation-play-state: paused;
}

.landing__face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 360deg / var(--n, 6))) translateZ(var(--radius, 220px));
}

/* Zone cliquable invisible au-dessus du texte */
.landing__hit {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  z-index: 1;
}

.landing__hit:focus-visible {
  outline: 1px solid var(--black);
  outline-offset: -24px;
}

.landing.is-loading .landing__hit {
  pointer-events: none;
}

/* Barre de chargement fine, centrée */
.landing__progress {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(160px, 36vw);
  height: 1px;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.35s ease;
}

.landing.is-loading .landing__progress {
  opacity: 1;
}

.landing.is-leaving .landing__progress {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.landing__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--black);
}

.landing.is-loading .landing__progress span {
  animation: landingFill var(--loader-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes landingSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-360deg); }
}

@keyframes landingFill {
  from { width: 0; }
  to { width: 100%; }
}

/* ==========================================================================
   HOME
   ========================================================================== */

.home {
  opacity: 0;
  transition: opacity 0.8s ease;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.home.revealed {
  opacity: 1;
}

.home > section[data-section] {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

/* Bloc 1 — hero */
.hero {
  position: relative;
  height: calc(100vh - (var(--gutter) * 2));
  min-height: 560px;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
}

.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Laisse passer les taps vers la vidéo (bouton play iOS en éco d'énergie). */
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.28) 45%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.hero__title {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 var(--card-padding);
  max-width: 1400px;
  font-size: var(--h1);
  font-weight: 700;
  line-height: 1.05;
  /* Décoratif : ne bloque pas le tap sur la vidéo (bouton play iOS). */
  pointer-events: none;
}

/* Reveal du titre à l'arrivée (mot par mot) */
.hero__title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px);
}

.home.revealed .hero__title .word {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-hint {
  position: absolute;
  left: var(--card-padding);
  bottom: var(--card-padding);
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.scroll-hint span {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(45deg);
  opacity: 0.2;
  animation: chevWave 1.8s ease-in-out infinite;
}

.scroll-hint span:nth-child(2) { animation-delay: 0.18s; }
.scroll-hint span:nth-child(3) { animation-delay: 0.36s; }

@keyframes chevWave {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

/* Bloc 2 — noms défilants */
.names {
  position: relative;
  height: calc(100vh - (var(--gutter) * 2));
  min-height: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--black);
  color: var(--white);
}

.names__fill,
.works__fill {
  position: absolute;
  inset: 0;
  background: var(--black);
  pointer-events: none;
  z-index: 4;
  clip-path: circle(0 at var(--fill-x, 50%) var(--fill-y, 50%));
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.names__media {
  position: absolute;
  inset: 0;
}

.names__media-bg,
.names__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.names__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
  pointer-events: none;
}

.names__portrait {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(200px, 28vw);
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s ease, left 0.35s ease, top 0.35s ease;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.names.is-cta-black .names__fill,
.works.is-cta-black .works__fill {
  clip-path: circle(var(--fill-r, 150%) at var(--fill-x, 50%) var(--fill-y, 50%));
}

.names.is-cta-black .names__track,
.names.is-cta-black .names__portrait {
  opacity: 0;
}

.names.is-cta-black .names__track {
  transition-delay: 0.12s;
}

.names.is-portrait .names__portrait {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.names__track {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 8vh 0 16vh;
  z-index: 3;
  transition: opacity 0.45s ease;
}

.names__row {
  display: flex;
  width: max-content;
  white-space: nowrap;
  font-size: 96px;
  line-height: 1.25;
  font-weight: 300;
  color: var(--white);
  will-change: transform;
  animation: marquee var(--dur, 42s) linear infinite;
}

.names__row-block {
  display: flex;
  align-items: baseline;
  padding-right: 60px;
}

.names__row--rev {
  animation-name: marquee-rev;
}

.names__row.is-paused {
  animation-play-state: paused;
}

.names__name {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.25s ease, opacity 0.25s ease;
}

.names__name:hover,
.names__name.is-active {
  opacity: 1;
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.names__sep {
  white-space: pre;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes marquee-rev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.names__cta {
  position: relative;
  z-index: 6;
  align-self: center;
  margin: var(--card-padding);
  border-color: var(--white);
  color: var(--white);
}

.names__cta:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

/* Bloc 3 — découvrir nos ouvrages (placeholder image/vidéo) */
.works {
  position: sticky;
  top: var(--gutter);
  height: calc(100vh - (var(--gutter) * 2));
  min-height: 560px;
  background: var(--placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 0;
}

.home .site-footer {
  position: relative;
  z-index: 1;
  border-radius: var(--card-radius);
}

.works__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: opacity 0.45s ease;
}

.works__media img,
.works__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works__media video[data-parallax] {
  position: absolute;
  top: -9%;
  left: 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
  will-change: transform;
}

.works .btn,
.works__cta {
  position: relative;
  z-index: 6;
  margin: var(--card-padding);
  border-color: var(--white);
  color: var(--white);
}

.works .btn:hover,
.works__cta:hover {
  background: var(--white);
  color: var(--black);
  border-color: var(--black);
}

.works.is-cta-black .works__media {
  opacity: 0;
  transition: opacity 0.45s ease;
  transition-delay: 0.12s;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  padding: 24px var(--gutter);
  font-weight: 700;
  font-size: var(--footer);
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.site-footer__addr {
  text-align: left;
  font-size: 30px;
  white-space: nowrap;
}
.site-footer__copy {
  position: relative;
  z-index: 2;
  text-align: center;
  font-weight: 300;
  font-size: 16px;
  white-space: nowrap;
}
.site-footer__weather {
  text-align: right;
  white-space: nowrap;
  font-size: 30px;
}

/* Pop-up crédit Studio Issaya — couvre tout le bloc page (viewport) */
.issaya-credit {
  position: static;
  display: inline-block;
}

.site-footer .issaya-credit__popup {
  position: fixed;
  inset: var(--gutter);
  left: var(--gutter);
  right: var(--gutter);
  top: var(--gutter);
  bottom: var(--gutter);
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 64px);
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--card-radius);
  font-size: clamp(16px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  max-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transition: opacity 0.35s ease, visibility 0.35s;
  z-index: 120;
}

/* Hors footer (projet) : pop-up compact au-dessus */
.project__copy .issaya-credit {
  position: relative;
}

.project__copy .issaya-credit__popup {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  width: min(340px, 72vw);
  padding: 14px 16px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 30;
}

@media (hover: hover) and (pointer: fine) {
  .issaya-credit:hover .issaya-credit__popup,
  .issaya-credit:focus-visible .issaya-credit__popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .project__copy .issaya-credit:hover .issaya-credit__popup,
  .project__copy .issaya-credit:focus-visible .issaya-credit__popup {
    transform: translate(-50%, 0);
  }
}

.issaya-credit:focus-visible .issaya-credit__popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* --- Panneau Studio Issaya : se superpose au footer (même taille) au survol --- */
.issaya-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(16px, 2.2vw, 32px);
  padding: 14px clamp(24px, 4vw, 48px);
  background: #000;
  color: #fff;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 20;
}

.site-footer.is-issaya-open .issaya-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.issaya-panel__text {
  flex: 0 1 auto;
  margin: 0;
  max-width: 62ch;
  font-size: clamp(13px, 1.35vw, 17px);
  font-weight: 700;
  line-height: 1.35;
}

/* Zone flexible : CTA centré entre le texte et la croix */
.issaya-panel__mid {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.issaya-panel__cta {
  display: inline-block;
  flex: 0 0 auto;
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.issaya-panel__cta:hover {
  background: #fff;
  color: #000;
}

.issaya-panel__close {
  position: static;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.issaya-panel__close:hover {
  opacity: 1;
}

/* ==========================================================================
   Placeholder générique (deviendra image ou vidéo)
   ========================================================================== */

.ph {
  background: var(--placeholder);
  position: relative;
  overflow: hidden;
}

.ph > img,
.ph > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Effets de scroll : reveals, parallax, indicateur de sections, progression
   ========================================================================== */

/* Reveals au scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Home : texte + CTA — apparition au scroll (cascade légère) */
.home .names__track[data-reveal] {
  transform: translateY(28px);
}

.home .names__cta[data-reveal],
.home .works__cta[data-reveal] {
  transform: translateY(28px);
  transition-delay: 0.14s;
}

.home .names__cta[data-reveal].is-in,
.home .works__cta[data-reveal].is-in,
.home .names__track[data-reveal].is-in {
  transform: none;
}

/* Cascade pour la grille de projets (3 colonnes) */
.projects__grid [data-reveal]:nth-child(3n+2) { transition-delay: 0.08s; }
.projects__grid [data-reveal]:nth-child(3n) { transition-delay: 0.16s; }

/* Média en parallax (agrandi pour laisser de la marge au mouvement) */
.hero__media video[data-parallax] {
  position: absolute;
  top: -9%;
  left: 0;
  width: 100%;
  height: 118%;
  object-fit: cover;
  will-change: transform;
}

/* Barre de progression du scroll */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--white);
  z-index: 80;
  pointer-events: none;
  mix-blend-mode: difference;
}

/* Indicateur de sections */
.section-indicator {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 16px;
  mix-blend-mode: difference;
}

.section-indicator button {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--white);
  opacity: 0.35;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  transition: opacity 0.3s ease;
}

.section-indicator button::after {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--white);
  transform: scaleX(0.4);
  transform-origin: right center;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

.section-indicator button.active {
  opacity: 1;
}

.section-indicator button.active::after {
  transform: scaleX(1);
}

@media (max-width: 768px) {
  .section-indicator {
    gap: 10px;
  }

  .section-indicator button {
    font-size: 10px;
    gap: 3px;
  }

  .section-indicator button::after {
    width: 14px;
  }
}

/* ==========================================================================
   PAGE — Bureau
   ========================================================================== */

.bureau {
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  padding: var(--gutter);
  display: grid;
  /* Carte grandit pour remplir ; footer toujours visible sans scroll inutile */
  grid-template-rows: minmax(min-content, 1fr) auto;
  gap: var(--gutter);
  box-sizing: border-box;
}

.bureau__card {
  position: relative;
  min-height: 0;
  display: grid;
  /* Image gauche · À propos centré · Équipe à droite */
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(16px, 2vw, 24px);
  align-content: start;
  justify-content: stretch;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--white);
  /* Espace sous le header + respiration autour des 3 cadres internes */
  padding: calc(100px - var(--gutter) + var(--safe-top)) var(--card-padding) var(--card-padding);
  overflow: clip;
  box-sizing: border-box;
}

.bureau__aside,
.bureau__about,
.bureau__equipe {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--white);
  padding: var(--card-padding);
  box-sizing: border-box;
  align-self: start;
  height: fit-content;
}

.bureau__aside {
  grid-column: 1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  width: min(100%, calc(280px + 2 * var(--card-padding)));
}

.bureau__about {
  grid-column: 2;
  justify-self: center;
  min-width: 0;
  width: min(100%, calc(28rem + 2 * var(--card-padding)));
  max-width: calc(28rem + 2 * var(--card-padding));
}

.bureau__equipe {
  grid-column: 3;
  justify-self: end;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  text-align: left;
}

.bureau__media {
  width: 100%;
  aspect-ratio: 4102 / 6153;
  overflow: hidden;
  background: var(--placeholder);
}

.bureau__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1);
  transition: filter 0.4s ease;
}

@media (hover: hover) and (pointer: fine) {
  .bureau__aside:hover .bureau__media img {
    filter: grayscale(0);
  }
}

.bureau__addr {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  font-style: normal;
}

.bureau__addr .bureau__heading {
  margin: 0;
  font-size: inherit;
}

.bureau__addr a {
  font-weight: inherit;
}

.bureau__links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65em;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.45;
}

.bureau__links a {
  color: inherit;
  text-decoration: none;
}

.bureau__links a.bureau__links-mail {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.bureau__links a.bureau__links-ig:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.bureau__heading {
  display: inline-block;
  margin: 0 0 1.1em;
  padding: 0.15em 0.35em 0.02em;
  font-size: var(--project-title);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #000;
  color: #fff;
}

html[data-theme="dark"] .bureau__heading {
  background: #fff;
  color: #000;
}

.bureau__prose {
  width: 100%;
}

.bureau__text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  margin: 0;
  color: var(--black);
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  text-indent: 1.75em;
}

.bureau__text + .bureau__text {
  margin-top: 1.05em;
}

.bureau__people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15em;
}

.bureau__person {
  margin: 0;
}

.bureau__person-name {
  margin: 0;
  font-size: var(--project-desc);
  font-weight: 400;
  line-height: 1.3;
}

.bureau__person-role {
  margin: 0.15em 0 0;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.35;
  opacity: 0.72;
}

.bureau__person-mail,
.bureau__person-phone {
  display: block;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
  transition:
    opacity 0.35s ease,
    max-height 0.35s ease,
    margin 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .bureau__equipe:hover .bureau__person-mail,
  .bureau__equipe:hover .bureau__person-phone {
    margin-top: 0.2em;
    max-height: 1.5em;
    opacity: 0.72;
    pointer-events: auto;
  }

  .bureau__equipe:hover .bureau__person-mail:hover,
  .bureau__equipe:hover .bureau__person-phone:hover {
    text-decoration: underline;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bureau__person-mail,
  .bureau__person-phone {
    transition: none;
  }
}

/* Footer bureau : aligné sur les bords des 3 cartes (padding du .bureau) */
.bureau .site-footer {
  padding-left: var(--card-padding);
  padding-right: var(--card-padding);
}

/* Survol « À propos » : floute le reste du contenu (header/nav inchangés) */
@media (hover: hover) and (pointer: fine) {
  .bureau__aside[data-reveal],
  .bureau__equipe[data-reveal] {
    transition:
      opacity 0.8s ease,
      transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
      filter 0.4s ease;
  }

  .bureau .site-footer {
    transition: filter 0.4s ease;
  }

  .bureau:has(.bureau__about:hover) .bureau__aside,
  .bureau:has(.bureau__about:hover) .bureau__equipe,
  .bureau:has(.bureau__about:hover) .site-footer {
    filter: blur(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bureau:has(.bureau__about:hover) .bureau__aside,
  .bureau:has(.bureau__about:hover) .bureau__equipe,
  .bureau:has(.bureau__about:hover) .site-footer {
    filter: none;
  }
}

/* ==========================================================================
   PAGE — Contact
   ========================================================================== */

.contact {
  min-height: 100vh;
  height: 100vh;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  box-sizing: border-box;
}

.contact__card {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  background: var(--white);
  padding: var(--card-padding);
}

.contact__card--office {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--card-padding);
}

.contact__plan {
  flex: 0 1 auto;
  width: auto;
  max-width: min(64%, 780px);
  max-height: min(72%, 520px);
  align-self: flex-end;
  margin-left: auto;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  line-height: 0;
  overflow: hidden;
  /* Le plan est monochrome et suit currentColor (adapté au dark mode) */
  color: #111;
  cursor: default;
}


html[data-theme="dark"] .contact__plan {
  color: #f2f2f2;
}

.contact__plan svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(68vh, 520px);
}

/* Plan monochrome : inversion propre en mode sombre (noir <-> blanc) */
html[data-theme="dark"] .contact__plan svg {
  filter: invert(1);
}

/* L'apparition progressive (trait par trait, bâtiment par bâtiment) est pilotée
   en JS élément par élément — voir initPlanDraw() dans main.js. */

.contact__plan img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(68vh, 520px);
  object-fit: contain;
  object-position: right bottom;
}

.contact__info {
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  max-width: none;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  align-self: flex-end;
  white-space: nowrap;
  transition: opacity 0.35s ease;
}

.contact__info a {
  font-weight: 400;
  white-space: nowrap;
}

.contact__info a[href^="tel:"] {
  font-weight: 700;
  display: inline-block;
  line-height: 1;
}

.contact__grid {
  display: flex;
  align-items: stretch;
  gap: var(--gutter);
  width: 100%;
}

.contact__grid .contact__card {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 14px 18px;
}

.contact__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2em 0.65em;
  margin: 0 0 0.15em;
}

.contact__name {
  margin: 0;
  font-size: var(--project-title);
  font-weight: 700;
  line-height: 1.15;
}

.contact__role {
  margin: 0;
  font-size: var(--project-desc);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.contact__mail {
  font-size: var(--project-desc);
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
}

.contact__coords {
  margin: 0;
  font-size: var(--project-desc);
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
}

.contact__coords .contact__mail {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  word-break: inherit;
}

.contact__phone-reveal {
  display: inline;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.contact__phone,
.contact__sep {
  font-weight: inherit;
  color: inherit;
  text-decoration: none;
}

.contact a[href^="mailto"]:hover,
.contact__phone:hover {
  text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
  .contact__card:hover .contact__phone-reveal {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact__phone-reveal {
    transition: none;
  }
}

/* ==========================================================================
   PAGE — Projets (3 vues : Index / Liste / Cartes)
   ========================================================================== */

.projects {
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  box-sizing: border-box;
  min-height: 100vh;
}

.projects__switcher {
  position: absolute;
  left: 50%;
  top: var(--card-padding);
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  white-space: nowrap;
}

.projects__switcher button {
  pointer-events: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  mix-blend-mode: normal;
  transition: opacity 0.2s ease;
}

.projects__switcher button.is-active {
  font-weight: 700;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.projects__switcher button:hover {
  opacity: 1;
}

.projects__view[hidden] {
  display: none !important;
}

.projects__panel {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--white);
  padding: calc(100px - var(--gutter) + var(--safe-top)) var(--card-padding) var(--card-padding);
  box-sizing: border-box;
}

/* --- Vue Index --- */
.projects[data-view="index"] {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  gap: 0;
}

.projects[data-view="index"] .projects__view--index {
  flex: 1;
  min-height: 0;
  display: flex;
}

.projects[data-view="index"] .site-footer {
  display: none;
}

.projects-index {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--white);
  display: flex;
}

.projects-index__stage {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.projects-index__stage.is-driven {
  overflow: hidden;
  scroll-snap-type: none;
  /* Le glissement vertical est géré en JS (transform) — pas de scroll natif. */
  touch-action: none;
}

/* Hors driven : le track ne crée pas de boîte → slides = enfants layout du stage. */
.projects-index__track {
  display: contents;
}

.projects-index__stage.is-driven .projects-index__track {
  display: flex;
  flex-direction: column;
  height: 100%;
  will-change: transform;
}

.projects-index__stage.is-driven .projects-index__slide {
  flex: 0 0 100%;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: none;
}

.projects-index__stage::-webkit-scrollbar {
  display: none;
}

.projects-index__slide {
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 72px 72px 72px 48px;
}

.projects-index__link {
  display: block;
  position: relative;
  width: min(68%, 920px);
  color: inherit;
  text-decoration: none;
}

.projects-index__slide-lieu {
  display: none;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: var(--black);
  white-space: nowrap;
}

.projects-index__media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--placeholder);
}

.projects-index__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--placeholder);
}

.projects-index__meta {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  margin: 0;
  width: calc(100% - 24px);
  text-align: center;
  pointer-events: none;
}

.projects-index__title {
  margin: 0;
  font-size: clamp(40px, 7.5vw, 96px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--black);
}

.projects-index__year {
  display: none;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--black);
}

.projects-index__lieu {
  position: absolute;
  left: 16px;
  top: 50%;
  z-index: 3;
  margin: 0;
  max-width: calc(50% - 40px);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  color: var(--black);
  transform: translateY(-50%);
  pointer-events: none;
  white-space: nowrap;
}

.projects-index__side-year {
  display: none;
}

.projects-index__rail {
  --rail-thumb: 64px;
  --rail-gap: 8px;
  --rail-active-scale: 1.4;
  --rail-year-space: 56px;
  --rail-window: 40%;
  position: absolute;
  top: 50%;
  right: 0;
  bottom: auto;
  z-index: 4;
  width: calc(var(--rail-thumb) * var(--rail-active-scale) + var(--rail-year-space));
  height: var(--rail-window);
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  transform: translateY(-50%);
  pointer-events: none;
}

.projects-index__rail-track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--rail-gap);
  width: calc(var(--rail-thumb) * var(--rail-active-scale));
  box-sizing: border-box;
  flex: none;
  will-change: transform;
}

.projects-index__rail-year {
  position: absolute;
  right: calc(var(--rail-thumb) * var(--rail-active-scale) + 8px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--black);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.projects-index__thumb {
  display: block;
  position: relative;
  width: var(--rail-thumb);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex: none;
  opacity: 0.3;
  transform-origin: right center;
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.projects-index__thumb.is-active {
  opacity: 1;
  z-index: 1;
  transform: scale(var(--rail-active-scale));
}

.projects-index__thumb:hover {
  opacity: 0.75;
}

.projects-index__thumb-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--placeholder);
  object-fit: cover;
}

.projects-index__thumb-spacer {
  width: var(--rail-thumb);
  aspect-ratio: 16 / 10;
  flex: none;
  pointer-events: none;
  visibility: hidden;
}

/* --- Vue Liste --- */
.projects-list {
  display: flex;
  flex-direction: column;
}

.projects-list__row {
  display: grid;
  grid-template-columns: 120px 1fr auto 1fr;
  align-items: center;
  gap: 20px 28px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--border-soft);
  color: inherit;
  text-decoration: none;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-list__row:first-child {
  border-top: 1px solid var(--border-soft);
}

/* Focus : au survol de la liste, seuls les textes des autres lignes s'estompent ;
   la ligne active reste nette et glisse légèrement vers la droite. */
.projects-list__title,
.projects-list__lieu,
.projects-list__year {
  transition: opacity 0.45s ease;
}

.projects-list:hover .projects-list__row:not(:hover) .projects-list__title,
.projects-list:hover .projects-list__row:not(:hover) .projects-list__lieu,
.projects-list:hover .projects-list__row:not(:hover) .projects-list__year {
  opacity: 0.3;
}

.projects-list__row:hover {
  transform: translateX(12px);
}

.projects-list__thumb {
  width: 120px;
  flex: none;
  align-self: center;
}

.projects-list__thumb-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--placeholder);
  object-fit: cover;
}

/* Grande image de projet qui suit le curseur (inertie gérée en JS). */
.projects-list__preview {
  position: fixed;
  top: 0;
  left: 0;
  width: clamp(170px, 19vw, 280px);
  aspect-ratio: 4 / 3;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  overflow: hidden;
  background: var(--placeholder);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease;
  will-change: transform, opacity;
}

.projects-list__preview.is-visible {
  opacity: 1;
}

.projects-list__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.projects-list__preview-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 0;
  text-align: center;
  font-size: var(--project-title);
  font-weight: 700;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.projects-list__title {
  font-size: var(--project-title);
  font-weight: 700;
  line-height: 1.2;
}

.projects-list__lieu {
  font-size: var(--project-title);
  font-weight: 300;
  white-space: nowrap;
  justify-self: center;
  text-align: center;
}

.projects-list__year {
  font-size: var(--project-title);
  font-weight: 300;
  white-space: nowrap;
  justify-self: end;
}

/* --- Vue Cartes --- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

.project-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card__media {
  background: var(--placeholder);
  aspect-ratio: 2 / 3;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

.project-card__media img,
.project-card__media video,
.project-card__media-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--placeholder);
}

.project-card:hover .project-card__media { opacity: 0.85; }

.project-card__label {
  border: none;
  padding: 10px 0 0;
  font-size: var(--project-title);
  text-align: left;
}

/* Footer projets : carte noire */
.projects .site-footer {
  margin: 0;
  padding: 40px var(--card-padding);
  background: var(--black);
  color: var(--white);
  border-color: color-mix(in srgb, var(--white) 35%, transparent);
  border-radius: var(--card-radius);
}

.projects .site-footer[hidden] {
  display: none !important;
}

.projects .site-footer a {
  color: inherit;
}

/* ==========================================================================
   PAGE — Projet (détail + collage) — aligné Figma 1:377
   ========================================================================== */

.project {
  position: relative;
  padding: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
  background: var(--white);
  color: var(--black);
}

/* Bloc projet : .project__body enferme le sticky ;
   footer nav / crédits restent hors du bloc (après). */
.project__body {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
}

/* Bloc projet : .project__frame (haut) + .project__last (bas) ; footer nav après */
.project__frame {
  position: relative;
  z-index: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  background: var(--white);
  box-sizing: border-box;
  overflow: clip;
}

.project__last {
  position: sticky;
  top: var(--gutter);
  z-index: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  background: var(--white);
  /* Découpe les images au radius : sinon les coins carrés dépassent
     et masquent la bordure noire sur une fine arête. */
  overflow: clip;
}

.project__stage {
  position: relative;
  z-index: 2;
  /* Un seul gutter : le padding bas de .project est après tout le cadre.
     2*gutter laisserait une bande de collage sous le fold.
     svh = viewport réel (barre d’adresse mobile), pour que cover + intro
     tiennent sans laisser le collage dépasser. */
  height: calc(100vh - var(--gutter));
  height: calc(100svh - var(--gutter));
  min-height: calc(100vh - var(--gutter));
  min-height: calc(100svh - var(--gutter));
  background: var(--white);
  box-sizing: border-box;
  overflow: hidden;
  border-top-left-radius: calc(var(--card-radius) - 1px);
  border-top-right-radius: calc(var(--card-radius) - 1px);
}

/* Image A — top-right, calée dans la carte, jusqu’en bas du stage */
.project__hero {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: calc(100% * 5 / 12);
  height: 100%;
  overflow: hidden;
  z-index: 1;
  border-top-right-radius: calc(var(--card-radius) - 1px);
}

.project__hero-media {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background: var(--placeholder);
  will-change: transform;
}

.project__hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.project__intro {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: calc(100% * 7 / 12);
  height: 100%;
  min-height: 100%;
  padding: calc(100px - var(--gutter) + var(--safe-top)) var(--card-padding) var(--card-padding);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 40px;
}

.project__head {
  position: relative;
  display: block;
  grid-row: 1;
  grid-column: 1;
  min-height: 1.15em;
}

.project__switcher-slot {
  grid-row: 1;
  grid-column: 1;
  justify-self: center;
  align-self: center;
  width: max-content;
  z-index: 1;
}

.project__switcher {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  transform: none;
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  white-space: nowrap;
  /* Dans le bloc intro (fond page) : contraste via tokens thème */
  color: #000;
  -webkit-text-fill-color: #000;
  mix-blend-mode: normal;
}

html[data-theme="dark"] .project__switcher {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

/* Docké (fixed) : même logique que le header — blanc + difference
   pour rester lisible sur photos claires ET sombres au scroll.
   Le JS déplace le nav vers <html> pour qu’il reste au-dessus du sticky
   .project__last (sinon z-index piégé dans .project__frame). */
.project__switcher.is-docked {
  position: fixed;
  top: var(--project-switcher-y, 0px);
  bottom: auto;
  z-index: 55;
  margin: 0;
  color: var(--black);
  -webkit-text-fill-color: var(--black);
  mix-blend-mode: normal;
  isolation: auto;
  pointer-events: auto;
}

html[data-theme="dark"] .project__switcher.is-docked {
  color: var(--black);
  -webkit-text-fill-color: var(--black);
  mix-blend-mode: normal;
}

/* Desktop docké : groupe centré */
.project__switcher.is-docked:not(.is-docked--spread) {
  left: var(--project-switcher-x, 50%);
  right: auto;
  width: max-content;
  transform: translateX(-50%);
  justify-content: center;
}

/* Mobile docké : gauche / droite en overlay */
.project__switcher.is-docked--spread {
  left: var(--project-switcher-left, var(--gutter));
  right: var(--project-switcher-right, var(--gutter));
  width: auto;
  transform: none;
  justify-content: space-between;
}

.project__switcher[hidden] {
  display: none !important;
}

.project__switcher a {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: inherit !important;
  -webkit-text-fill-color: inherit;
  mix-blend-mode: normal;
  text-decoration: none;
}

.project__switcher.is-docked a {
  color: var(--black) !important;
  -webkit-text-fill-color: var(--black);
}

.project__nav a {
  font-weight: 300;
}

.project__title {
  font-size: var(--h2);
  font-weight: 700;
  margin: 0;
  padding-right: 5.5em;
  line-height: 1.15;
  max-width: 34vw;
}

.project__year {
  position: absolute;
  right: 0;
  top: 0;
  font-size: var(--h2);
  font-weight: 300;
  line-height: 1.15;
  white-space: nowrap;
}

.project__desc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  align-self: stretch;
  grid-row: 3;
  grid-column: 1;
}

.project__desc-toggle {
  margin: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: var(--main-text);
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
}

/* Masque le « [ » sous le coin arrondi bas-gauche quand la boîte est ouverte */
.project__desc-toggle.open .project__desc-toggle__bracket {
  visibility: hidden;
}

.project__scroll-down {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex: none;
}

.project__scroll-down .chevrons {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.project__scroll-down .chevrons span {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--black);
  border-bottom: 2px solid var(--black);
  transform: rotate(45deg);
  opacity: 0.2;
  animation: chevWave 1.8s ease-in-out infinite;
}

.project__scroll-down .chevrons span:nth-child(2) { animation-delay: 0.18s; }
.project__scroll-down .chevrons span:nth-child(3) { animation-delay: 0.36s; }

/* Boîte description — s’ouvre depuis le coin bas-gauche de [Description] ;
   le « [ » du bouton est masqué via .project__desc-toggle.open */
.desc-box {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  width: min(640px, calc(100% * 8 / 12 - 40px));
  max-height: min(380px, calc(100vh - 200px));
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  display: flex;
  gap: 14px;
  font-size: var(--project-desc);
  line-height: 1.35;
  z-index: 40;
  opacity: 0;
  transform-origin: left bottom;
  transform: scaleY(0);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.desc-box.open {
  opacity: 1;
  transform: scaleY(1);
  pointer-events: auto;
}

.desc-box p {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.desc-box__title {
  display: block;
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.7em;
}

.desc-box__credit {
  display: block;
  margin-top: 0.8em;
  font-style: italic;
  font-weight: 300;
}

.desc-box a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  word-break: break-all;
}

.desc-box__close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  flex: none;
  padding: 0;
  align-self: flex-start;
  cursor: pointer;
}

/* Collage B→G sous le hero — positions Figma 1:377 (canvas 1280) */
.collage {
  position: relative;
  z-index: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  /* Léger décalage sous le hero ; les sections restent collées entre elles */
  padding: 32px 0 0;
  box-sizing: border-box;
}

.collage__item {
  background: transparent;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.collage__item:last-child,
.project__last .collage__item:last-child {
  margin-bottom: 0;
}

/* Dernière image du bloc : coins bas alignés sur la carte
   (renforce overflow:clip si un navigateur clippe mal avec sticky). */
.project__last > .collage__item:last-child.collage__item--left {
  border-bottom-left-radius: calc(var(--card-radius) - 1px);
}

.project__last > .collage__item:last-child.collage__item--right {
  border-bottom-right-radius: calc(var(--card-radius) - 1px);
}

.collage__media {
  position: absolute;
  /* Overscan discret (moins que 120% / -10%) pour un parallax interne faible */
  top: -5%;
  left: 0;
  width: 100%;
  height: 110%;
  background: var(--placeholder);
  will-change: transform;
}

.collage__media img,
.collage__media video,
.collage__item img,
.collage__item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Collage éditorial : blocs collés à gauche ou à droite, 3 tailles en rythme */
.collage__item--left {
  margin-left: 0;
  margin-right: auto;
}

.collage__item--right {
  margin-left: auto;
  margin-right: 0;
}

/* Portrait (défaut) */
.collage__item--sm { width: 34%; }
.collage__item--md { width: 44%; }
.collage__item--lg { width: 56%; }

/* Paysage : plus larges, toujours collés au bord */
.collage__item.is-landscape.collage__item--sm { width: 58%; }
.collage__item.is-landscape.collage__item--md { width: 68%; }
.collage__item.is-landscape.collage__item--lg { width: 78%; }

/* Plans : fond blanc, image contenue, même logique L/R */
.collage__item.is-plan {
  background: var(--white);
  margin-top: 0;
}

.collage__item.is-plan.collage__item--sm { width: 62%; }
.collage__item.is-plan.collage__item--md { width: 72%; }
.collage__item.is-plan.collage__item--lg { width: 84%; }

.collage__item.is-plan.is-landscape.collage__item--sm { width: 70%; }
.collage__item.is-plan.is-landscape.collage__item--md { width: 80%; }
.collage__item.is-plan.is-landscape.collage__item--lg { width: 88%; }

.collage__item.is-plan .collage__media {
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
}

.collage__item.is-plan img {
  object-fit: contain;
  object-position: center;
  padding: 20px;
  box-sizing: border-box;
}

.project__foot {
  position: relative;
  z-index: 1;
  margin-top: var(--gutter);
  background: none;
  padding: 0 var(--card-padding) 24px;
  box-sizing: border-box;
  border: none;
  border-radius: 0;
  overflow: visible;
}

/* Si un projet n’a pas de .project__last, fermer le cadre sur le frame seul */
.project__body:not(:has(.project__last)) .project__frame {
  border-bottom: 1px solid var(--border);
  border-radius: var(--card-radius);
}

.project__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 812px;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
  font-size: var(--footer);
  font-weight: 700;
  color: #000;
}

html[data-theme="dark"] .project__nav {
  color: #fff;
}

.project__copy {
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  padding: 12px 0 8px;
}

.project__copy a {
  color: inherit;
}

/* Bureau : empile avant le mobile pour éviter un « À propos » trop étroit / coupé */
@media (max-width: 1100px) {
  .bureau__card {
    grid-template-columns: 1fr;
    gap: var(--gutter);
    flex: none;
    min-height: 0;
  }

  .bureau__aside,
  .bureau__about,
  .bureau__equipe {
    grid-column: 1;
    justify-self: stretch;
    width: auto;
    max-width: none;
  }

  .bureau__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .bureau__media {
    width: min(42vw, 180px);
  }
}

/* ==========================================================================
   RESPONSIVE — Mobile
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --gutter: 12px;
    --card-radius: 14px;
    /* Loader plus long sur mobile (chargement des vidéos). */
    --loader-duration: 4s;
    /* Tailles mobiles (variables Figma) */
    --h1: 25px;
    --h2: 22px;
    --cta: 16px;
    --header: 25px;
    --footer: 12px;
    --main-text: 16px;
    --project-title: 20px;
    --project-desc: 13px;
    /* Dégagement texte bas : barre URL Safari iPhone (au-delà du safe-area) */
    --bottom-clearance: 24px;
  }

  .logo, .logo--lg { width: 130px; }

  .names__row { font-size: 42px; }
  .names__row-block { padding-right: 24px; }
  .names__track { padding: 4vh 0 10vh; }

  .hero,
  .names,
  .works {
    min-height: calc(100vh - (var(--gutter) * 2));
  }

  /* Version verticale : pas d’overscan parallax (sinon crop haut/bas) */
  .hero__media video[data-parallax] {
    top: 0;
    height: 100%;
  }

  .menu-overlay__nav {
    width: 100%;
    justify-content: space-evenly;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .menu-overlay__nav a {
    /* Garder overflow:hidden + height pour masquer la 2e copie du .swap */
    overflow: hidden;
    height: 1.2em;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .theme-toggle__track {
    width: 36px;
    height: 20px;
  }

  .theme-toggle__thumb {
    width: 11px;
    height: 11px;
  }

  .theme-toggle[aria-checked="true"] .theme-toggle__thumb {
    transform: translate(16px, -50%);
  }

  .site-footer {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px 12px;
    align-items: end;
    padding: 16px var(--gutter);
  }
  .site-footer__addr { grid-column: 1; }
  .site-footer__addr,
  .site-footer__weather {
    font-size: 10px;
  }
  .site-footer__copy {
    grid-column: 2;
    text-align: center;
    font-size: 9px;
  }
  .site-footer__weather { grid-column: 3; }

  .projects .site-footer {
    padding: 18px var(--card-padding) calc(12px + var(--safe-bottom) + var(--bottom-clearance));
  }

  .menu-overlay__foot {
    padding-bottom: calc(var(--safe-bottom) + var(--bottom-clearance));
  }

  .bureau {
    min-height: 100vh;
  }

  .bureau__media {
    width: min(44vw, 150px);
  }

  .bureau__card {
    grid-template-columns: 1fr;
    gap: var(--gutter);
    flex: none;
    min-height: 0;
    padding: calc(var(--card-padding) + 64px + var(--safe-top)) var(--card-padding) var(--card-padding);
  }

  .bureau__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: none;
  }

  .bureau__about {
    max-width: none;
  }

  .bureau__heading {
    margin-bottom: 0.85em;
    font-size: 14px;
  }

  .bureau__text {
    font-size: 12px;
    line-height: 1.45;
    text-indent: 1.35em;
  }

  .bureau__person-name {
    font-size: 13px;
  }

  .bureau__person-role {
    font-size: 11px;
  }

  .bureau__people {
    gap: 0.85em;
  }

  .bureau__addr,
  .bureau__links {
    font-size: 11px;
  }

  .contact {
    height: auto;
    min-height: 100vh;
  }

  .contact__card--office {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    /* Plus de min-height arbitraire : la place du plan est réservée ci-dessous */
    min-height: 0;
    /* Dégage le header fixe (gutter + padding + logo 2 lignes + safe-area) */
    padding-top: calc(var(--card-padding) + 64px + var(--safe-top));
  }

  .contact__info {
    max-width: none;
    align-self: flex-start;
    width: 100%;
    font-size: var(--main-text);
    white-space: normal;
  }

  .contact__info a {
    white-space: normal;
    word-break: break-word;
  }

  /* Réserve dès le paint la hauteur finale du plan (évite le saut au fetch SVG). */
  .contact__plan {
    position: relative;
    flex: none;
    width: 100%;
    max-width: none;
    max-height: none;
    height: 0;
    margin-left: 0;
    align-self: stretch;
    padding-bottom: calc(498.061 / 649.317 * 100%);
    overflow: hidden;
  }

  .contact__plan svg,
  .contact__plan img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: left top;
  }

  .contact__grid {
    flex-direction: column;
    align-items: stretch;
  }

  .contact__grid .contact__card {
    width: 100%;
    max-width: none;
  }

  .contact__name {
    font-size: var(--project-title);
  }

  .contact__mail {
    font-size: var(--project-desc);
  }

  /* Mobile : pas de survol → on affiche le téléphone sous l'e-mail. */
  .contact__phone-reveal {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .contact__phone-reveal .contact__sep {
    display: none;
  }

  .projects__switcher {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    justify-content: flex-start;
    grid-column: 1;
    grid-row: 2;
    margin-top: 6px;
    margin-bottom: 2px;
    padding-bottom: 4px;
    gap: 6px;
  }

  .site-header:has(.projects__switcher) {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
  }

  .site-header:has(.projects__switcher) .logo {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header:has(.projects__switcher) .burger {
    grid-column: 2;
    grid-row: 1;
  }

  .projects__switcher button {
    font-size: 11px;
    padding: 2px 2px 4px;
    line-height: 1.25;
  }

  .projects__panel {
    /* Dégagement sous le switcher (11px) pour ne pas coller à la bordure liste */
    padding-top: calc(90px - var(--gutter) + var(--safe-top));
  }

  .projects-index__slide {
    padding: 64px 20px 48px;
    justify-content: center;
  }

  .projects-index__stage {
    position: relative;
    z-index: 2;
  }

  .projects-index__link {
    width: min(72vw, 300px);
    margin-inline: auto;
  }

  .projects-index__lieu {
    left: 10px;
    font-size: 10px;
    max-width: calc(50% - 28px);
    z-index: 6;
  }

  /*
    Mobile : même carousel de miniatures que desktop, mais centré.
    Image active au milieu ; voisins visibles au-dessus / en dessous ;
    le scroll fait défiler le rail comme sur desktop.
  */
  .projects-index__media-wrap {
    visibility: hidden;
    pointer-events: none;
  }

  .projects-index__meta {
    z-index: 6;
  }

  .projects-index__side-year {
    display: block;
    position: absolute;
    right: 10px;
    top: 50%;
    z-index: 6;
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--black);
    transform: translateY(-50%);
    pointer-events: none;
    white-space: nowrap;
  }

  .projects-index__rail {
    --rail-thumb: min(72vw, 300px);
    --rail-gap: 10px;
    --rail-active-scale: 1.12;
    --rail-year-space: 0px;
    left: 50%;
    right: auto;
    top: 50%;
    width: calc(var(--rail-thumb) * var(--rail-active-scale));
    height: var(--rail-window);
    overflow: hidden;
    align-items: center;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
  }

  .projects-index__rail-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--rail-thumb);
    align-self: center;
  }

  .projects-index__thumb {
    width: 100%;
    opacity: 0.35;
    transform-origin: center center;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  .projects-index__thumb.is-active {
    opacity: 1;
    transform: scale(var(--rail-active-scale));
  }

  .projects-index__rail-year {
    display: none;
  }

  .projects-index__title {
    font-size: clamp(28px, 9vw, 48px);
  }

  .projects-list__row {
    grid-template-columns: min(42vw, 160px) 1fr auto;
    gap: 12px 16px;
    padding: 14px 0;
    align-items: center;
  }

  .projects-list__thumb {
    width: min(42vw, 160px);
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-card__media {
    aspect-ratio: 2 / 3;
  }

  /* Mobile : intro en haut (titre + année, puis description + flèches),
     photo de garde en pleine largeur sur la moitié basse du 1er écran. */
  .project__stage {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--gutter));
    height: calc(100svh - var(--gutter));
    min-height: calc(100vh - var(--gutter));
    min-height: calc(100svh - var(--gutter));
  }

  .project__intro {
    position: relative;
    z-index: 2;
    order: 1;
    width: 100%;
    flex: 1 1 50%;
    height: auto;
    min-height: 0;
    padding: calc(80px - var(--gutter) + var(--safe-top)) var(--card-padding) var(--card-padding);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
  }

  .project__hero {
    position: relative;
    order: 2;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    flex: 1 1 50%;
    min-height: 0;
    margin-left: 0;
    aspect-ratio: auto;
  }

  .project__head {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 1.15em;
    order: 1;
  }

  /* Une ligne : gauche / droite, entre le titre et Description */
  .project__switcher-slot {
    order: 2;
    width: 100%;
    max-width: none;
    justify-self: auto;
    align-self: stretch;
  }

  .project__switcher {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    max-width: none;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    gap: 8px;
  }

  .project__switcher.is-docked {
    position: fixed;
    top: var(--project-switcher-y, 0px);
    color: var(--black);
    -webkit-text-fill-color: var(--black);
    mix-blend-mode: normal;
    isolation: auto;
  }

  .project__switcher.is-docked a {
    color: var(--black) !important;
    -webkit-text-fill-color: var(--black);
  }

  html[data-theme="dark"] .project__switcher.is-docked,
  html[data-theme="dark"] .project__switcher.is-docked a {
    color: var(--black) !important;
    -webkit-text-fill-color: var(--black);
  }

  .project__switcher.is-docked--spread {
    left: var(--project-switcher-left, var(--gutter));
    right: var(--project-switcher-right, var(--gutter));
    width: auto;
    transform: none;
    justify-content: space-between;
  }

  .project__switcher a {
    font-size: 9px;
  }

  .project__title {
    max-width: none;
    padding-right: 0;
    flex: 1 1 auto;
  }

  .project__year {
    position: static;
    top: auto;
    right: auto;
    flex: none;
  }

  .project__desc-row {
    order: 3;
    gap: 14px;
  }

  /* Mobile : la boîte prend toute la largeur (bord à bord),
     jusqu'à la fin des flèches, et se superpose par-dessus. */
  .desc-box {
    right: var(--gutter);
    width: auto;
    max-height: min(60vh, calc(100vh - 160px));
  }

  .project__nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: none;
    margin: 0;
    padding: 8px 0 16px;
    font-size: var(--footer);
  }

  .project__nav a {
    white-space: nowrap;
  }

  .project__copy {
    padding: 8px 0 0;
    font-size: 9px;
  }

  /* Marge fine et identique entre toutes les images
     (y compris hero → 1re du collage, et jonction collage → .project__last). */
  .collage {
    padding-top: 12px;
  }

  .collage__item {
    margin-bottom: 12px;
    margin-top: 0;
  }

  .collage__item:last-child {
    margin-bottom: 12px;
  }

  .project__last > .collage__item {
    margin-bottom: 0;
  }

  /* Mobile : toutes les images (portrait, paysage, plans) prennent
     toute la largeur de la carte, dans le collage ET dans .project__last.
     Le préfixe .project augmente la spécificité pour battre les
     règles .is-landscape / tailles de base. */
  .project .collage__item,
  .project .collage__item.is-landscape,
  .project .collage__item.is-plan,
  .project .collage__item.is-plan.is-landscape {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
  }

  /* Mobile : images pleine largeur → les deux coins bas du dernier bloc */
  .project__last > .collage__item:last-child {
    border-bottom-left-radius: calc(var(--card-radius) - 1px);
    border-bottom-right-radius: calc(var(--card-radius) - 1px);
  }

  .collage__item.is-plan img {
    padding: 12px;
  }

  .project__last {
    position: static;
    min-height: 0;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 0 12px;
  }

  /* Footer : marge basse pour la barre de navigation iOS. */
  .project__foot {
    margin-top: 20px;
    padding-bottom: calc(56px + var(--safe-bottom) + var(--bottom-clearance));
  }
}

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

  .projects-list__row {
    grid-template-columns: min(42vw, 160px) 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 6px 16px;
  }

  .projects-list__thumb {
    width: min(42vw, 160px);
    grid-row: 1 / span 3;
    align-self: center;
  }

  .projects-list__title {
    grid-column: 2;
    grid-row: 1;
  }

  .projects-list__lieu {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    text-align: left;
    font-size: var(--project-desc);
  }

  .projects-list__year {
    justify-self: start;
    grid-column: 2;
    grid-row: 3;
    font-size: var(--project-desc);
  }

  .projects-index__link {
    width: min(72vw, 300px);
  }

  .projects-index__title {
    font-size: clamp(26px, 10vw, 40px);
  }
}

/* Réduction des animations si préférence système */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint span,
  .project__scroll-down .chevrons span,
  .names__row { animation: none !important; }

  .landing__ring { animation: none !important; }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Dark mode — blanc / noir fixes sur surfaces photo & mix-blend
   (l'inversion des tokens ne doit pas casser le contraste sur médias)
   ========================================================================== */

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-header--light,
html[data-theme="dark"] .section-indicator button,
html[data-theme="dark"] .projects[data-view="index"] .projects__switcher button {
  color: #fff;
}

html[data-theme="dark"] .burger span,
html[data-theme="dark"] .site-header--light .burger span,
html[data-theme="dark"] .scroll-progress,
html[data-theme="dark"] .section-indicator button::after {
  background: #fff;
}

html[data-theme="dark"] .hero,
html[data-theme="dark"] .names,
html[data-theme="dark"] .names__row,
html[data-theme="dark"] .names__name:hover,
html[data-theme="dark"] .names__name.is-active {
  color: #fff;
}

html[data-theme="dark"] .names,
html[data-theme="dark"] .names__fill,
html[data-theme="dark"] .works__fill {
  background: #000;
}

html[data-theme="dark"] .scroll-hint span {
  border-right-color: #fff;
  border-bottom-color: #fff;
}

html[data-theme="dark"] .names__cta,
html[data-theme="dark"] .works .btn,
html[data-theme="dark"] .works__cta {
  background: #000;
  color: #fff;
  border-color: #fff;
}

html[data-theme="dark"] .names__cta:hover,
html[data-theme="dark"] .works .btn:hover,
html[data-theme="dark"] .works__cta:hover {
  background: #fff;
  color: #000;
  border-color: #000;
}

