/* VLa — version 5 : carrousels à glissement souris/doigt, butée élastique, animation moutarde du logo en page 1. */
:root {
  --page-margin: 1.7vw;
  --header-top: 2.4svh; /* hauteur stable lorsque la barre Safari iOS se replie */
  --column-left: 56.78vw;
  --column-width: 41.53vw;
  --logo-width: 13.48vw;
  --logo-height: calc(var(--logo-width) * 1.371841); /* ratio exact 380 / 277 */
  --menu-gap: clamp(14px, 2vw, 34px);
  --menu-row-gap: clamp(4px, .35vw, 8px);
  --menu-indent: 1.85vw; /* retrait relatif au logo, preserve quel que soit le format */
  --menu-left: calc(var(--page-margin) + var(--menu-indent));
  --sidebar-links-top: calc(var(--header-top) + var(--logo-height) + var(--menu-gap));
  --soft-grey: #ececec;
  --secondary: #999999;
  --black: #0a0a0a;
  --fade-speed: 250ms;
  --slide-speed: 560ms;
  font-family: Arial, Helvetica, sans-serif;
  --menu-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--black);
  background: white;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { padding: 0; margin: 0; min-height: 100%; }
body { min-width: 320px; overflow-x: hidden; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid #444; outline-offset: 4px; }
[hidden] { display: none !important; }
#stage { min-height: 100vh; background: #fff; transition: opacity var(--fade-speed) ease; }
#stage.stage-out { opacity: 0; pointer-events: none; }
#stage.stage-in { opacity: 0; }
#stage.stage-in.stage-visible { opacity: 1; }
.brand {
  position: fixed; z-index: 30;
  top: var(--header-top); left: var(--page-margin);
  width: var(--logo-width); aspect-ratio: 277 / 380;
  display: block; transform-origin: 50% 50%;
  transition: transform 220ms ease, opacity 180ms ease;
  color: var(--soft-grey);
  background: transparent !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  outline-color: transparent;
  touch-action: manipulation;
  isolation: isolate;
}
.brand:active, .brand:focus, .brand:hover { background: transparent !important; }
.brand:focus-visible { outline: 2px solid #444; outline-offset: 4px; }
.brand:hover { transform: scale(1.045); }
.brand-mark {
  display: block; width: 100%; height: 100%;
  background-color: currentColor;
  pointer-events: none;
  -webkit-mask: url('assets/logo-vla.png') center / contain no-repeat;
  mask: url('assets/logo-vla.png') center / contain no-repeat;
}
body.photo-mode .brand { color: #fff; }
/* Page 1 (uniquement) : respiration lente du blanc au moutarde puis au blanc.
   CMJN 0/19/72/14 traduit en valeur écran RVB approx. #DBB23D. */
body.home-first .brand-mark { animation: vla-mustard-pulse 6.4s ease-in-out infinite; }
@keyframes vla-mustard-pulse {
  0%, 100% { background-color: #ffffff; }
  50% { background-color: #dbb23d; }
}
body.lightbox-open .brand { visibility: hidden; opacity: 0; pointer-events: none; transition: none; }
body.lightbox-open { overflow: hidden !important; }
/* pages 1 à 1E : une photographie couvre toute la fenêtre. */
.home { height: 100vh; height: 100dvh; width: 100vw; overflow: hidden; position: relative; background: #e6e3df; }
/* Geste horizontal natif : pas de déplacement vertical accidentel sur l'accueil et le plein écran.
   La fiche laisse défiler la page verticalement (pan-y). */
.carousel { position: relative; overflow: hidden; width: 100%; height: 100%; background: #e9e9e9; user-select: none; -webkit-user-select: none; touch-action: pan-y; overscroll-behavior-x: contain; cursor: grab; }
.home .carousel, .lightbox .carousel { touch-action: none; }
.carousel.is-dragging { cursor: grabbing; }
.carousel .arrow { cursor: pointer; }
.carousel img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
.slide-track { display: flex; width: 300%; height: 100%; transform: translate3d(-33.333333%,0,0); will-change: transform; }
.slide { width: 33.333333%; height: 100%; flex: 0 0 33.333333%; overflow: hidden; position: relative; background: #e8e8e8; }
.slide img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transition: transform 230ms ease; }
.carousel-controls { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 6.2vw; min-width: 44px; height: 90px; display: grid; place-items: center; color: white; pointer-events: auto; }
.arrow--left { left: 0; }
.arrow--right { right: 0; }
.arrow svg { display: block; width: clamp(24px, 2.7vw, 45px); height: clamp(40px, 5vw, 70px); transition: transform 220ms ease; filter: drop-shadow(0 0 1px rgba(0,0,0,.08)); }
.arrow:hover svg { transform: scale(1.12); }
.arrow--left:hover svg { transform: scale(1.12); }
.arrow:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
/* page 2 : logo et menu partagent un repere fixe ; le menu ne peut plus defiler sous le logo sur iOS. */
body.menu-mode { overflow: hidden; }
body.menu-mode #stage { height: 100svh; height: 100dvh; min-height: 0; overflow: hidden; }
.menu-screen { position: relative; width: 100%; height: 100svh; height: 100dvh; min-height: 0; background: #fff; overflow: hidden; }
.main-menu { position: fixed; z-index: 25; top: var(--sidebar-links-top); left: var(--menu-left); display: flex; flex-direction: column; align-items: flex-start; gap: var(--menu-row-gap); }
.menu-link { display: inline-block; font-family: var(--menu-font); font-size: clamp(19px, 1.66vw, 29px); line-height: 1.14; font-weight: 300; text-align: left; color: #080808; transform-origin: 0% 50%; transition: transform 220ms ease, opacity 290ms ease; }
.menu-link:hover { transform: scale(1.06); }
.main-menu.menu-fade-out { opacity: 0; transition: opacity 320ms ease; pointer-events: none; }
/* page 3 : axe de la liste au même x que l'image pleine largeur des fiches. */
.project-index { width: 100%; min-height: 100vh; background: #fff; }
.project-list { margin-left: var(--column-left); width: var(--column-width); padding-top: var(--header-top); padding-bottom: 12vh; }
.project-row { display: grid; grid-template-columns: minmax(0,1fr) 18.6vw; gap: 0; align-items: start; min-height: 18.6vh; margin-bottom: 12.3vh; }
.project-text { color: #0a0a0a; font-family: var(--menu-font); font-size: clamp(16px,1.66vw,26px); font-weight: 300; line-height: 1.22; text-align: left; display: flex; align-items: flex-start; flex-direction: column; max-width: max-content; }
.project-text span { display: block; }
.project-text .muted { color: var(--secondary); transition: color 180ms ease; }
.project-text:hover .muted, .project-text:focus-visible .muted { color: #0a0a0a; }
.project-thumb { display: block; position: relative; overflow: hidden; width: 18.6vw; height: 18.6vh; background: #ebebeb; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 230ms ease; }
.project-thumb:hover img { transform: scale(1.045); }
/* page 3, puis pages 3A et suivantes : boutons de retour identiques et fixes. */
.back-to-menu, .back-to-projects { position: fixed; z-index: 22; top: var(--sidebar-links-top); left: var(--menu-left); display: flex; align-items: center; gap: 7px; color: #000; font-family: var(--menu-font); font-size: clamp(19px, 1.66vw, 29px); line-height: 1.14; font-weight: 300; transform-origin: 0% 50%; transition: transform 220ms ease; }
.back-to-menu:hover, .back-to-projects:hover { transform: scale(1.055); }
.back-to-menu svg, .back-to-projects svg { display: block; width: clamp(13px,1.35vw,22px); height: clamp(23px,2.6vw,39px); }
.detail-page { min-height: 100vh; background: #fff; padding-top: var(--header-top); padding-bottom: 6vh; }
.detail-content { margin-left: var(--column-left); width: var(--column-width); }
.detail-frame { width: 100%; height: 41.53vh; position: relative; background: #ebebeb; overflow: hidden; cursor: zoom-in; }
.detail-frame .slide img { transition: transform 230ms ease; }
.detail-frame:hover .slide img { transform: scale(1.024); }
.detail-frame .arrow { width: 5.1vw; }
.detail-meta { margin-top: 2.2vh; font-family: var(--menu-font); font-size: clamp(16px,1.66vw,26px); font-weight: 300; line-height: 1.22; }
.detail-meta .name { color: #070707; }
.detail-meta .muted { display: block; color: var(--secondary); }
.detail-description { margin-top: 2.1vh; font-family: var(--menu-font); font-size: clamp(16px,1.65vw,26px); font-weight: 300; line-height: 1.22; color: var(--secondary); text-align: justify; hyphens: auto; overflow-wrap: break-word; }
/* Fullscreen galerie : uniquement l'image et les deux flèches. */
.lightbox { position: fixed; inset: 0; z-index: 100; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: #e9e9e9; }
.lightbox .slide { cursor: zoom-out; }
.lightbox .slide img { object-fit: cover; }
.lightbox .arrow { z-index: 101; }
/* Écrans 4 et 5 : aucune conception graphique inventée à ce stade. */
.pending-screen { background: #fff; min-height: 100vh; }
.pending-note { position: absolute; left: var(--column-left); top: 36vh; font-size: 15px; color: #aaa; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width: 760px) {
  :root { --page-margin: 5vw; --header-top: 3svh; --logo-width: 26vw; --column-left: 37vw; --column-width: 58vw; --menu-indent: 3.55vw; --menu-row-gap: 4px; }
  .brand { width: var(--logo-width); }
  .main-menu { top: var(--sidebar-links-top); left: var(--menu-left); gap: var(--menu-row-gap); }
  .menu-link { font-size: 21px; }
  .project-row { grid-template-columns: minmax(0,1fr) 22vw; min-height: 19vh; margin-bottom: 9vh; }
  .project-thumb { width: 22vw; height: 17vh; }
  .project-text, .detail-meta { font-size: 14px; }
  .detail-description { font-size: 14px; line-height: 1.35; }
  .back-to-menu, .back-to-projects { top: var(--sidebar-links-top); left: var(--menu-left); font-size: 21px; }
  .detail-frame { height: 34vh; }
  .arrow { width: 12vw; }
  .menu-link, .back-to-menu, .back-to-projects { -webkit-tap-highlight-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
