/* =============================================
   VARIABLES & RESET
   ============================================= */
:root {
  --bg: #ffffff;
  --text: #0d0d0d;
  --text-mid: #555550;
  --text-light: #9a9690;
  --placeholder: #e6e2da;
  --border: #dedad2;
  --font-display: 'Syne', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --side-padding: 28px;
  --header-h: 25px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Intro already seen this session: no branded screen, no scale/rotate
   cascade — the list comes in with the masked text reveal below */
html.intro-played .intro-screen { display: none; }

html.intro-played .project-item {
  opacity: 1;
  transform: none;
  transition: color 0.35s ease;
}

/* =============================================
   PAGE TRANSITIONS — masked text reveal
   Each text line sits in an overflow:hidden mask and slides in from below
   (100% → 0), then out through the top (0 → -100%) when leaving the page,
   staggered line by line.
   ============================================= */
.mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* room for accents and descenders inside the clip */
  padding: 0.12em 0;
  margin: -0.12em 0;
}

/* Entrance: long expo-out glide with a slight tilt that straightens as the
   line settles, plus a fade so the mask edge never reads as a hard cut */
.mask-inner {
  display: inline-block;
  transform: translateY(115%) rotate(3deg);
  transform-origin: left bottom;
  opacity: 0;
  transition:
    transform 1.15s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.mask-inner.is-in {
  transform: none;
  opacity: 1;
}

/* Exit: eases in and out so lines lift off softly rather than snapping */
.mask-inner.is-out {
  transform: translateY(-115%) rotate(-2deg);
  opacity: 0;
  transition:
    transform 0.85s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Photo breathes with the text: settles from a slight zoom on entrance,
   eases back and fades on exit */
.project-row .project-hero,
.preview-col .hover-preview {
  transition:
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-col .hover-preview.is-leaving,
.project-row .project-hero.is-leaving {
  opacity: 0;
  transform: scale(1.04);
}

.preview-col .hover-preview.is-exiting,
.project-row .project-hero.is-exiting {
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 0.7s cubic-bezier(0.65, 0, 0.35, 1),
    transform 0.85s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Page projet : la photo apparaît et s'en va en simple fondu, sans zoom —
   le retour de 104 % à 100 % pendant que la photo se chargeait donnait un
   effet de rebond */
.project-row .project-hero.is-leaving,
.project-row .project-hero.is-exiting { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .mask-inner,
  .mask-inner.is-out,
  .preview-col .hover-preview,
  .project-row .project-hero { transition: none; }
}

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

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

::selection {
  background: var(--text);
  color: var(--bg);
}

body.locked,
body.is-tracing-open { overflow: hidden; }

/* =============================================
   HEADER
   ============================================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: calc(var(--side-padding) + var(--safe-left));
  padding-right: calc(var(--side-padding) + var(--safe-right));
}

.site-name {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.site-name:hover { opacity: 0.4; }

/* Hidden on desktop — replaced by .top-site-name, aligned with the photo. Shown again on mobile. */
header .site-name { display: none; }

/* =============================================
   TOP BAR — Arthur Vialle + Overview, aligned with the photo's top edge
   ============================================= */
.top-bar {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--header-h) + var(--safe-top));
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5vw;
  z-index: 40;
  pointer-events: none;
}

.top-site-name,
.list-overview-link {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  line-height: 1;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.top-site-name {
  justify-self: start;
  padding-left: calc(var(--side-padding) + var(--safe-left));
}

.list-overview-link {
  justify-self: end;
  /* annule l'espacement après la dernière lettre : le W finit pile au bord */
  margin-right: -0.1em;
}

.top-site-name:hover,
.list-overview-link:hover { opacity: 0.4; }

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.header-link {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.header-link:hover { opacity: 0.4; }

/* =============================================
   HAMBURGER
   ============================================= */
.menu-btn {
  display: none;
  background: none;
  border: none;
  width: 30px;
  height: 20px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--text);
  position: absolute;
  left: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-btn span:nth-child(1) { top: 2px; }
.menu-btn span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-btn span:nth-child(3) { bottom: 2px; }

.menu-btn.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* =============================================
   MOBILE NAV
   ============================================= */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--header-h) + var(--safe-top) + 40px)
           calc(var(--side-padding) + var(--safe-left))
           calc(40px + var(--safe-bottom));
  gap: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-nav.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav a:hover,
.mobile-nav a:active { opacity: 0.4; }

/* =============================================
   MAIN — two-column layout
   ============================================= */
main {
  padding-top: calc(var(--header-h) + var(--safe-top));
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5vw;
  min-height: 100dvh;
}

.list-col {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-h) - var(--safe-top));
  padding: 8vh 0 7vh calc(var(--side-padding) + var(--safe-left));
}

.project-list-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preview-col {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  height: calc(100dvh - var(--header-h) - var(--safe-top));
  display: flex;
  flex-direction: column;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) 25px 0;
  overflow: visible;
  pointer-events: none;
}

/* =============================================
   BOTTOM BAR — Contact (aligned with list, left) + About (just left of the photo)
   ============================================= */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1.5vw;
  padding-bottom: calc(25px + var(--safe-bottom));
  z-index: 40;
  pointer-events: none;
}

.list-contact-link,
.list-about-link {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  line-height: 1;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.list-contact-link {
  justify-self: start;
  padding-left: calc(var(--side-padding) + var(--safe-left));
}

.list-about-link {
  justify-self: end;
  margin-right: -0.1em;  /* idem : le T finit pile au bord */
}

.list-contact-link:hover,
.list-about-link:hover { opacity: 0.4; }

/* =============================================
   PROJECT LIST
   ============================================= */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  /* Titre à gauche (aplomb de Arthur Vialle / Contact), infos groupées à droite
     (aplomb de Overview / About), séparées par un seul et même écart */
  display: flex;
  align-items: baseline;
  --meta-gap: 2.4em;
  padding: 0.52rem 0;
  font-family: 'Josefin Sans', sans-serif;
  color: #b8b8b8;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: left center;
  opacity: 0;
  transform: scale(0.92) rotate(-1.5deg) translateY(6px);
  transition:
    opacity 0.4s ease-out,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    color 0.35s ease;
}

.project-item.is-revealed {
  opacity: 1;
  transform: scale(1) rotate(0deg) translateY(0);
}

.project-list:hover .project-item {
  color: #d8d8d8;
}
.project-list:hover .project-item:hover {
  color: #000;
}

.project-item-title {
  font-weight: 500;
  flex: 1 1 auto;
  min-width: 0;
  /* one step above the nav links (11.5px) on a ~1.125 scale: ~13px */
  font-size: clamp(0.76rem, 0.9vw, 0.84rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-item:hover .project-item-title {
  transform: translateX(22px);
}

.project-item-client,
.project-item-location,
.project-item-film {
  flex: none;
  margin-left: var(--meta-gap);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  /* annule l'espacement après la dernière lettre : la dernière info finit
     sur la même verticale que la fin de OVERVIEW / ABOUT */
  margin-right: -0.06em;
}

/* Info absente (pas de client, pas de film…) : aucune place réservée */
.project-item .is-empty { display: none; }

/* Les infos montent de leur masque en cascade au survol : client, lieu, durée */
.meta-in {
  display: inline-block;
  transform: translateY(115%) rotate(3deg);
  transform-origin: left bottom;
  opacity: 0;
  transition:
    transform 0.5s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.3s ease;
}

.project-item:hover .meta-in {
  transform: none;
  opacity: 1;
  transition:
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover .project-item-location .meta-in { transition-delay: 0.05s; }
.project-item:hover .project-item-film .meta-in     { transition-delay: 0.1s; }

/* =============================================
   HOVER IMAGE PREVIEW
   ============================================= */
.hover-preview {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hover-preview.visible {
  opacity: 1;
}

.hover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.hover-img.is-active {
  opacity: 1;
}

/* =============================================
   OVERLAY (About — full-screen, content in right half)
   ============================================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: calc(var(--side-padding) + var(--safe-left));
  padding-right: calc(var(--side-padding) + var(--safe-right));
  flex-shrink: 0;
}

.overlay-top .site-name {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.overlay-close {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  background: none;
  border: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  padding: 8px 0 8px 16px;
}

.overlay-close:hover { opacity: 0.4; }

/* =============================================
   ABOUT — oversized statement on top, bio in two columns and portrait
   anchored to the bottom, small labels in the four corners
   ============================================= */
.about-overlay .overlay-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  height: auto;
  padding-top: calc(var(--header-h) + var(--safe-top));
}

.about-overlay .overlay-top .site-name,
.about-overlay .overlay-close {
  line-height: 1;
  padding: 0;
}

.about-overlay .overlay-close { grid-column: 3; justify-self: end; }

.about-location {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
}

.about-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 3.5vh calc(var(--side-padding) + var(--safe-right)) 3.5vh calc(var(--side-padding) + var(--safe-left));
}

.about-headline {
  margin: 0;
  /* At this size the glyphs' built-in left spacing shows (~0.07em on P, F):
     pull the block back so the ink lines up with the small text below */
  margin-left: -0.07em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.6vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
  /* even line lengths, never a lone word on the last line */
  text-wrap: balance;
}

/* Bio + portrait sit at the bottom of the page, bottoms aligned */
.about-bottom {
  margin-top: auto;
  padding-top: 5vh;
  display: grid;
  /* info (profile + clients) · portrait, bottoms aligned */
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 5vw;
  align-items: end;
}

/* Two quiet columns: bio, then the numbered client list */
.about-info {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  column-gap: 3vw;
  /* bio, clients et portrait finissent sur la même ligne */
  align-items: end;
  max-width: 820px;
}

/* La dernière ligne de base des textes se pose sur le bas du portrait : on
   descend chaque colonne de l'interligne + jambage sous la ligne de base
   (~0.52em du texte à 0.84rem) */
@media (min-width: 701px) {
  .about-info > .about-col { margin-bottom: calc(-0.84rem * 0.52); }
}

/* Discreet heading in the same tiny grey mono as the numbers below */
.about-col-title {
  margin-bottom: 1.2em;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text-light);
}

.about-text,
.about-clients {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text);
}

.about-text p + p { margin-top: 1em; }

/* Liste des clients : un tiret fin et gris en guise de puce (dans le ton des
   petits libellés gris du site), centré sur la hauteur des minuscules */
.about-clients { list-style: none; }

.about-clients li {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
}

.about-clients li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 1px;
  /* tiret aligné sur le trait du S de « Selected clients » (le S de Space Mono
     commence à ~0.04em de son bord, à 0.55rem) */
  margin-left: calc(0.55rem * 0.04);
  background: var(--text-light);
  /* posé sur la ligne de base, remonté au milieu des minuscules */
  transform: translateY(calc(-0.24em + 0.5px));
}

.about-photo {
  justify-self: end;
  display: block;
  height: min(50vh, 560px);
  width: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.about-footer {
  display: flex;
  justify-content: flex-end;  /* seule mention : Available worldwide, à droite */
  align-items: flex-end;
  flex-shrink: 0;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) calc(25px + var(--safe-bottom)) calc(var(--side-padding) + var(--safe-left));
}

/* Text blocks and the portrait rise in like the overview photos */
.reveal-block {
  transform: translateY(40px);
  opacity: 0;
  transition:
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-block.is-in {
  transform: none;
  opacity: 1;
}

.reveal-block.is-out {
  transform: translateY(-30px);
  opacity: 0;
  transition:
    transform 0.8s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-block,
  .reveal-block.is-out { transition: none; }
}

@media (max-width: 700px) {
  .about-overlay .overlay-top { align-items: center; padding-top: var(--safe-top); height: calc(var(--header-h) + var(--safe-top)); }
  .about-overlay .overlay-top .site-name { font-size: 0.88rem; letter-spacing: 0.08em; }
  .about-headline { font-size: 5.4vw; }
  .about-bottom { grid-template-columns: 1fr; row-gap: 5vh; }
  .about-info { grid-template-columns: 1fr; row-gap: 5vh; max-width: none; }
  .about-photo { justify-self: stretch; width: 100%; height: auto; }
  .about-footer { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* Mobile : toute la page About défile d'un bloc (le lien Personal work vient
   après le portrait au lieu de rester collé en bas de l'écran, où il
   semblait recouvrir la photo) */
@media (max-width: 700px) {
  .about-overlay {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .about-overlay .about-body { flex: none; overflow: visible; }
  .about-overlay .about-footer { padding-top: 5vh; }
}

/* Le menu mobile (☰) passe sous le voile de Contact : on le masque, il
   transparaissait derrière « Close » */
body:has(.contact-overlay.open) .menu-btn {
  opacity: 0;
  pointer-events: none;
}
.menu-btn { transition: opacity 0.3s ease; }

/* =============================================
   CONTACT — voile flou sur l'accueil (qui reste visible dessous),
   « CONTACT » en très grand puis 4 colonnes d'infos calées par le bas,
   sur la grille de l'accueil ; ce qui est cliquable est souligné
   ============================================= */
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  visibility: hidden;
  /* reste visible le temps que le flou se retire */
  transition: visibility 0s linear 0.8s;
}

.contact-overlay.open {
  pointer-events: auto;
  visibility: visible;
  transition: none;
}

/* Le voile : blanc à moitié transparent + flou fort de ce qu'il y a dessous */
.contact-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  /* On anime le rayon du flou et le voile blanc, pas l'opacité du calque :
     un fondu d'opacité superpose l'accueil net et l'accueil flou (image
     dédoublée pendant la transition) */
  /* le calque déborde de l'écran : le flou s'éclaircit sur ses bords, on
     pousse ce liseré hors champ */
  inset: -3rem;
  background: rgba(255, 255, 255, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  will-change: backdrop-filter;
  /* Courbe douce des deux côtés : l'œil perçoit surtout les petits rayons,
     une courbe qui démarre sec fait « claquer » le flou puis le laisse
     traîner. À la fermeture, le flou part après le texte. */
  transition:
    background-color 0.6s cubic-bezier(0.45, 0, 0.25, 1) 0.2s,
    -webkit-backdrop-filter 0.6s cubic-bezier(0.45, 0, 0.25, 1) 0.2s,
    backdrop-filter 0.6s cubic-bezier(0.45, 0, 0.25, 1) 0.2s;
}

.contact-overlay.open::before {
  /* rayon plus modéré (plus fluide à animer en plein écran), compensé par
     un voile un peu plus blanc */
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(1.5rem);
  backdrop-filter: blur(1.5rem);
  transition-delay: 0s;
}

/* Fermeture : le flou se retire pendant que le texte sort, avec juste assez
   d'avance au texte pour qu'il ne passe pas sur l'accueil redevenu net */
.contact-overlay.open.closing { pointer-events: none; }
.contact-overlay.open.closing::before {
  background: rgba(255, 255, 255, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background-color 0.7s cubic-bezier(0.45, 0, 0.25, 1) 0.3s,
    -webkit-backdrop-filter 0.7s cubic-bezier(0.45, 0, 0.25, 1) 0.3s,
    backdrop-filter 0.7s cubic-bezier(0.45, 0, 0.25, 1) 0.3s;
}

/* Haut : Close à droite */
.contact-top {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: calc(var(--header-h) + var(--safe-top)) calc(var(--side-padding) + var(--safe-right)) 0 calc(var(--side-padding) + var(--safe-left));
}

.contact-close {
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.contact-close:hover { opacity: 0.4; }

/* Le nom éclaté comme le logo de la référence : ARTHUR au bord gauche,
   VIALLE au bord droit, à mi-hauteur de l'écran */
.contact-name {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) 0 calc(var(--side-padding) + var(--safe-left));
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
  pointer-events: none;
}

.contact-body {
  position: relative;
  /* titre et colonnes en retrait du bord, comme dans la référence (le nom,
     lui, reste collé aux bords) */
  padding: 0 calc(var(--side-padding) + var(--safe-right)) calc(8vh + var(--safe-bottom)) calc(7.6vw + var(--safe-left));
}

/* « CONTACT » : Syne en capitales, très grand */
.contact-title {
  margin: 0 0 5vh;
  /* à cette taille l'approche du C se voit : on recale son trait sur les
     colonnes en dessous */
  margin-left: -0.04em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(4rem, 13vw, 17rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text);
}

/* 4 colonnes égales, du retrait jusqu'au bord droit */
.contact-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 1.5vw;
  align-items: end;
}

.contact-col p {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--text);
}

/* Le soulignement est porté par le texte masqué (un lien ne souligne pas un
   bloc en ligne à l'intérieur) */
.contact-col a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s;
}

.contact-col a,
.contact-col a .mask-inner {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
}

.contact-col a:hover { opacity: 0.4; }

/* « CONTACT » fait toute la largeur : la bascule de 3° du masque (pensée
   pour des lignes courtes) y devient un biseau de ~70 px, la fin du mot
   arrive bien après le début et se fait couper en diagonale. Ici on monte
   droit, à peine incliné. Même chose pour le nom éclaté. */
.contact-title .mask-inner,
.contact-name .mask-inner {
  transform: translateY(115%) rotate(0.6deg);
}
.contact-title .mask-inner.is-in,
.contact-name .mask-inner.is-in { transform: none; }
.contact-title .mask-inner.is-out,
.contact-name .mask-inner.is-out { transform: translateY(-115%) rotate(-0.4deg); }

.contact-time { font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
  .contact-top { align-items: center; padding-top: var(--safe-top); height: calc(var(--header-h) + var(--safe-top)); }
  .contact-body { padding-left: calc(var(--side-padding) + var(--safe-left)); }
  .contact-name { font-size: 1.2rem; }
  .contact-title { font-size: 18vw; margin-bottom: 4vh; }
  .contact-cols { grid-template-columns: 1fr 1fr; row-gap: 1.6rem; align-items: start; }
}

/* =============================================
   PERSONAL WORK — carnet feuilletable (js/book.js)
   Fond papier blanc par-dessus About, le livre au centre, les doubles
   pages glissent de côté ; libellés en haut et en bas comme le reste
   ============================================= */
.about-book-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: opacity 0.3s;
}
.about-book-link .mask-inner { text-decoration: inherit; }
.about-book-link:hover { opacity: 0.4; }

.book-overlay {
  --book-ratio: 1.3333;  /* largeur / hauteur d'une double page : 4:3, le format des doubles pages
                            du carnet (le scan d'ouverture, 1.29, y tient sans se voir) */
  --book-bars: calc(var(--header-h) * 2 + var(--safe-top) + var(--safe-bottom) + 4.5rem);
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: #fff;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.45, 0, 0.25, 1) 0.15s, visibility 0s linear 0.75s;
}

.book-overlay.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.45, 0, 0.25, 1);
}

.book-top,
.book-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) 0 calc(var(--side-padding) + var(--safe-left));
}
.book-top { padding-top: calc(var(--header-h) + var(--safe-top)); }
.book-bottom { padding-bottom: calc(var(--header-h) + var(--safe-bottom)); }

.book-label,
.book-close,
.book-prev,
.book-next,
.book-count {
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
}
.book-close, .book-prev, .book-next {
  cursor: pointer;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.book-close:hover, .book-prev:hover, .book-next:hover { opacity: 0.4; }
.book-prev.is-off, .book-next.is-off { opacity: 0.15; pointer-events: none; }
.book-count { font-family: var(--font-mono); letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
/* une seule double page (pas encore de photos) : pas de navigation */
.book-overlay:not(.has-pages) .book-bottom { visibility: hidden; }

.book-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
}
.book-overlay:not(.has-pages) .book-stage { cursor: default; }

/* les doubles pages côte à côte ; on fait glisser la piste */
.book-track {
  display: flex;
  height: 100%;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.book-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Le livre : posé un peu plus bas et transparent, il monte en place à
   l'ouverture et redescend à la fermeture */
.book-spread {
  position: relative;
  display: flex;
  height: min(calc(100dvh - var(--book-bars)), calc((100vw - 2 * var(--side-padding)) / var(--book-ratio)));
  aspect-ratio: var(--book-ratio);
  transform: translateY(4vh);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}
.book-overlay.open .book-spread { transform: none; opacity: 1; }
.book-overlay.closing .book-spread {
  transform: translateY(3vh);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

/* Pas de papier ni de reliure : les images seules, posées sur le blanc du
   site. Deux photos d'une même double page sont séparées par une gouttière */
.book-page {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.9vw;
}
.book-page:first-child:not(:only-child) { align-items: flex-end; }
.book-page:last-child:not(:only-child)  { align-items: flex-start; }
.book-page img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
}
.book-caption {
  margin-top: 1.1em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: center;
}

/* Double page déjà composée : toute la surface */
.book-page--scan { padding: 0; }
.book-page--scan img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
/* Photo seule : aussi grande que la double page le permet */
.book-page--solo { padding: 0; }

/* Formats normalisés : les photos d'une paire en 3:4, les photos seules
   (paysage ou carré) en 4:3. Recadrage au centre, les fichiers restent
   intacts. */
.book-page:not(.book-page--scan):not(.book-page--solo):not(.book-page--cover) img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.book-page--solo img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Couverture : le titre en très grand, calé en bas à gauche comme
   « CONTACT », le nom et le nombre d'images en dessous */
.book-page--cover {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
}
.book-title {
  margin: 0 0 0 -0.04em;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(3rem, 8.5vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text);
}
.book-subtitle {
  margin-top: 1.4rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

@media (max-width: 700px) {
  .book-overlay { --book-ratio: 0.7; --book-bars: calc(var(--header-h) + var(--safe-top) + 5rem); }
  .book-page { padding: 0; }
  .book-title { font-size: 17vw; }
  /* double page composée ou photo en largeur : toute la largeur */
  .book-spread.is-wide {
    width: calc(100vw - 2 * var(--side-padding));
    height: auto;
    aspect-ratio: auto;
  }
  .book-spread.is-wide img { width: 100%; height: auto; max-height: calc(100dvh - var(--book-bars)); }
}

@media (prefers-reduced-motion: reduce) {
  .book-track, .book-spread, .book-overlay.closing .book-spread { transition: none; }
}

/* =============================================
   OVERVIEW OVERLAY
   ============================================= */
.overview-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.overview-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.overview-overlay .overlay-top {
  border-bottom: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  /* bande blanche : la planche défile dessous sans passer sous les liens */
  background: var(--bg);
  padding-bottom: 16px;
}

/* Desktop: "Arthur Vialle" / "Back" sit exactly where the home top bar and
   the project page header put them (top edge on the header line) */
@media (min-width: 701px) {
  .overview-overlay .overlay-top {
    align-items: flex-start;
    height: auto;
    padding-top: calc(var(--header-h) + var(--safe-top));
  }

  .overview-overlay .overlay-top .site-name,
  .overview-overlay .overlay-close {
    line-height: 1;
    padding: 0;
  }
}

/* Mobile: match the home header (centered, same name size) */
@media (max-width: 700px) {
  .overview-overlay .overlay-top .site-name { font-size: 0.88rem; letter-spacing: 0.08em; }
}

/* Overview images: rise in like the text lines, lift off on close.
   Animated on the children so the item's own opacity stays free for the
   hover dimming */
.overview-item > * {
  transform: translateY(40px);
  opacity: 0;
  transition:
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.overview-item.is-in > * {
  transform: none;
  opacity: 1;
}

.overview-item.is-out > * {
  transform: translateY(-30px);
  opacity: 0;
  transition:
    transform 0.8s cubic-bezier(0.65, 0, 0.35, 1),
    opacity 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  .overview-item > *,
  .overview-item.is-out > * { transition: none; }
}

.overview-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
  padding-top: calc(var(--header-h) + var(--safe-top));
}

/* Contact sheet: a regular 4-column grid of small portrait thumbnails,
   each centered in its column, with a lot of air between rows
   and a tiny index number under the image's right corner */
/* « OVERVIEW » en tête de planche, assez grand mais fin ; le nombre de photos
   en exposant */
.overview-title {
  margin: 0;
  display: flex;
  align-items: flex-start;  /* le compteur en exposant, en haut du mot */
  padding: 9vh calc(var(--side-padding) + var(--safe-right)) 12vh calc(var(--side-padding) + var(--safe-left));
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.6vw, 5.6rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text);
}

/* à cette taille l'approche du O se voit : son trait se cale sur la grille */
.overview-title-text { margin-left: -0.052em; }

.overview-count {
  margin-left: 0.5em;
  margin-top: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--text-light);
}

/* Planche en mise en page libre : grille invisible de 12 colonnes, chaque
   photo y est placée par app.js (OVERVIEW_ROWS : position, largeur, format,
   décalage) ; la page défile */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 2vw;
  row-gap: 12vh;
  align-items: start;
  align-content: start;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) 12vh calc(var(--side-padding) + var(--safe-left));
}

.overview-item {
  min-width: 0;
  /* décalage vers le bas propre à chaque photo (gabarit) */
  margin-top: var(--ov-offset, 0);
  cursor: pointer;
  /* pas de will-change permanent : 53 grandes couches graphiques gardées en
     mémoire faisaient saccader le survol et le défilement */
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Survol (classes posées par app.js, plus léger que :has) : les autres photos
   s'estompent vite, la photo visée s'allume tout de suite. En traversant
   l'espace entre deux photos, app.js garde l'état un court instant : la
   planche ne clignote pas */
.overview-grid.is-dim .overview-item {
  opacity: 0.35;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.overview-grid.is-dim .overview-item.is-hot {
  opacity: 1;
  transition: opacity 0.18s ease-out;
}

/* Fixed 3:4 frame, the photo is cropped to fill it */
.ov-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--placeholder);
}

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

/* Légende : NOM DU PROJET (au survol) … ▶ 01 */
.overview-caption {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  min-height: 0.5rem;
  margin-top: 10px;
}

.ov-num {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  /* annule l'espacement après le dernier chiffre : il finit au bord de la photo */
  margin-right: -0.06em;
  color: var(--text);
}

.ov-title {
  min-width: 0;
  margin-right: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
}
.overview-item:hover .ov-title,
.overview-item.is-hot .ov-title { opacity: 1; }
@media (max-width: 700px) {
  .overview-title { padding-top: 12vh; padding-bottom: 4vh; font-size: 11vw; }
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8vw; row-gap: 8vh; }
  /* sur téléphone, grille simple : on ignore la mise en page libre */
  .overview-item { grid-row: auto !important; grid-column: auto !important; margin-top: 0; }
  .ov-frame { aspect-ratio: 3 / 4 !important; }
}

/* =============================================
   CAROUSEL OVERLAY — FROSTED GLASS / CONTACT SHEET
   ============================================= */

/* Blur background content when overlay is open */
main, header {
  transition: filter 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.is-tracing-open main,
.is-tracing-open header {
  filter: blur(10px) saturate(0.6);
  transform: scale(1.02);
  transform-origin: center center;
}

.carousel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  background: rgba(250, 250, 250, 0.55);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  opacity: 0;
  transform: scale(1.01);
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5),
              inset 0 0 80px rgba(255,255,255,0.25);
}

.carousel-overlay.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Grain texture */
.carousel-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}

/* Diagonal highlight */
.carousel-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0) 35%,
    rgba(255,255,255,0) 65%,
    rgba(255,255,255,0.08) 100%);
  pointer-events: none;
  z-index: 1;
}

.carousel-overlay > * { position: relative; z-index: 2; }

/* ---- Header ---- */
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.carousel-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 300;
  color: #1a1a1a;
}

.carousel-title-text {
  font-size: 15px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-counter {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #555;
  margin-top: 4px;
}

/* ---- Stage — slideshow ---- */
.carousel-stage {
  flex: 1;
  position: relative;
  min-height: 0;
  cursor: none;
  overflow: hidden;
}

/* Hide legacy carousel elements */
.carousel-zone,
.carousel-img-wrap,
.carousel-ph,
.carousel-mobile-nav {
  display: none !important;
}

/* Image & vidéo — superposées, centrées, format portrait 3:4 */
.carousel-slide,
.carousel-slide-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 3/4;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  user-select: none;
}

.carousel-slide { -webkit-user-drag: none; }

.carousel-slide.is-visible { opacity: 1; }

/* Placeholder "bientôt disponible" */
.carousel-slide-ph {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--text-light);
}

/* Curseur personnalisé */
.carousel-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 2000;
  display: none;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  transform: translate(-50%, -50%);
}

.carousel-cursor.is-active { display: flex; }
.cc-current { color: var(--text); }
.cc-total   { color: var(--text-light); }

/* ---- Footer ---- */
.carousel-footer {
  margin-top: 16px;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
}

.carousel-desc {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #555;
}

/* =============================================
   INTRO SCREEN
   ============================================= */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding-left: clamp(40px, 8vw, 120px);
  pointer-events: auto;
  cursor: pointer;
  animation: introOut 0.7s cubic-bezier(0.16, 1, 0.3, 1) 2.2s forwards;
}

.intro-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  animation: introNameIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.intro-subtitle {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(0.5rem, 1vw, 0.6rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-light);
  opacity: 0;
  animation: introNameIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

@keyframes introOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes introNameIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-screen { display: none; }
}

/* =============================================
   ANIMATIONS
   ============================================= */

/* =============================================
   RESPONSIVE — TABLET (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
  :root { --side-padding: 22px; }
  .project-item-title { font-size: clamp(0.76rem, 1.2vw, 0.82rem); }
}

/* =============================================
   RESPONSIVE — MOBILE (≤700px)
   ============================================= */
@media (max-width: 700px) {
  :root {
    --side-padding: 16px;
    --header-h: 52px;
  }

  .site-name { font-size: 0.88rem; }
  header .site-name { display: block; }
  .top-bar { display: none; }
  .header-right .header-link { display: none; }
  .menu-btn { display: block; }

  main { grid-template-columns: 1fr; }

  .list-col {
    padding: 6vh var(--side-padding);
    min-height: calc(100dvh - var(--header-h) - var(--safe-top));
  }

  .preview-col { display: none; }

  .bottom-bar {
    grid-template-columns: 1fr;
    padding-bottom: calc(4vh + var(--safe-bottom));
  }

  .list-about-link { display: none; }

  .project-item {
    display: flex;
    align-items: baseline;
    gap: 18px;
  }

  .project-item-title {
    font-size: clamp(0.95rem, 4.5vw, 1.2rem);
    transform: none !important;
  }

  .project-item-client,
  .project-item-location,
  .project-item-film {
    font-size: 0.55rem;
    margin-left: 0;
  }

  .carousel-overlay { padding: 20px 16px; }
  .carousel-stage { cursor: auto; }
}

/* =============================================
   SMALL MOBILE (≤380px)
   ============================================= */
@media (max-width: 380px) {
  :root { --side-padding: 12px; }
  .mobile-nav a { font-size: 1.4rem; }
}

/* =============================================
   LARGE SCREENS (≥1400px)
   ============================================= */
@media (min-width: 1400px) {
  :root { --side-padding: 40px; }
  .project-item-title { font-size: clamp(0.8rem, 0.9vw, 0.88rem); }
}

/* =============================================
   ULTRA WIDE (≥1800px)
   ============================================= */
@media (min-width: 1800px) {
  :root { --side-padding: 60px; }
}

/* =============================================
   LANDSCAPE MOBILE
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
  .carousel-img { max-height: 78%; max-width: 55%; }
  .mobile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 32px;
  }
  .mobile-nav a { font-size: 1.2rem; }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .project-item {
    opacity: 1;
    transform: none;
  }
}

/* =============================================
   PROJECT PAGE
   ============================================= */
.project-page header {
  align-items: flex-end;
  padding-bottom: 0;
}

.project-page header .site-name {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  line-height: 1;
}

.project-page .header-right {
  padding-bottom: 0;
}

/* Desktop: put "Arthur Vialle" / "Back" exactly where the home page's
   top bar sits (top edge on the header line), so nothing shifts between pages */
@media (min-width: 701px) {
  .project-page header {
    align-items: flex-start;
    height: auto;
    padding-top: calc(var(--header-h) + var(--safe-top));
    background: transparent;
  }

  .project-page header .site-name,
  .project-page .header-link {
    line-height: 1;
  }
}

/* Mobile: match the home page header (centered, same name size) */
@media (max-width: 700px) {
  .project-page header { align-items: center; }
  .project-page header .site-name { font-size: 0.88rem; letter-spacing: 0.08em; }
}

.project-main {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: calc(var(--header-h) + var(--safe-top));
  overflow: hidden;
}

.project-loading {
  padding: 20vh calc(var(--side-padding) + var(--safe-left));
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
}

.project-row {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 4vw;
  padding: 2vh calc(var(--side-padding) + var(--safe-right)) 2vh calc(var(--side-padding) + var(--safe-left));
}

.project-hero {
  position: relative;
  /* Strict 3:4 frame: full available height, narrowed on small/wide-short
     screens without ever breaking the ratio (no % max-width — the grid
     column is sized by the photo itself, so a % would always shave it) */
  width: min(calc((100dvh - var(--header-h) - var(--safe-top) - 4vh - 40px) * 3 / 4), 60vw);
  aspect-ratio: 3 / 4;
  justify-self: center;
}

/* Projet en fitWide : taille posée par project.js selon le format de
   l'image, le cadre glisse d'un format à l'autre */
.project-hero.is-fit {
  aspect-ratio: auto;
  max-width: none;
  transition:
    width 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
  .project-hero.is-fit { transition: none; }
}

.project-hero-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
}

.project-hero-zone-prev { left: 0; }
.project-hero-zone-next { right: 0; }

/* Round cursor on every page (mouse/trackpad only, see cursor.js) */
html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}

.project-cursor {
  position: fixed;
  top: -7px;
  left: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 10000;
}

.project-cursor.is-visible {
  opacity: 1;
}

/* Calques de la diapo : chaque nouvelle photo ou vidéo se pose par-dessus la
   précédente et apparaît en fondu une fois prête (cf. project.js) */
.project-hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.project-hero-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-hero-layer.is-active {
  opacity: 1;
}

.project-heading {
  grid-column: 1;
  justify-self: start;
  /* Taille du titre, partagée pour caler le crédit et la liste des films sur
     le trait de sa 1re lettre. --title-ink-ratio est mesuré par project.js
     (M de Syne par défaut : le trait commence à ~0.079em du bord) */
  --title-size: clamp(0.9rem, 1.3vw, 1.3rem);
  --title-ink: calc(var(--title-size) * var(--title-ink-ratio, 0.079));
}

.project-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--title-size);
  letter-spacing: 0.02em;
  color: var(--text);
}

/* Collaboration credit under the title: small and light grey, a footnote
   rather than a subtitle */
.project-credit {
  margin-top: 0.6em;
  /* le C de Josefin commence à ~0.066em : calé sur le trait du M du titre */
  margin-left: calc(var(--title-ink, 0px) - 0.68rem * 0.066);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--text-light);
}

.project-counter {
  grid-column: 3;
  justify-self: end;
  margin: 0;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

@media (max-width: 900px) {
  /* No-scroll layout only makes sense with room to spare — on small screens, allow scrolling */
  .project-main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .project-row {
    flex: none;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    row-gap: 3vh;
  }

  .project-heading { grid-column: 1; justify-self: center; }
  .project-counter { grid-column: 1; justify-self: center; }

  .project-hero {
    height: auto;
    width: 70vw;
    max-width: 70vw;
    aspect-ratio: 3 / 4;
  }
}


/* =============================================
   FILMS — repère dans la liste, boucles au survol, page projet, lecteur
   ============================================= */

/* Tactile : pas de survol. Seul le repère film reste affiché, en bout de ligne */
@media (hover: none) {
  .project-item-client,
  .project-item-location { display: none; }
  .project-item-film .meta-in { transform: none; opacity: 1; }
}

/* La boucle passe au-dessus des deux photos du fondu enchaîné */
.hover-video {
  z-index: 1;
}

.ov-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.ov-loop.is-active {
  opacity: 1;
}

.ov-film {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text);
}

/* "▶ Play film" : posé sur le bas de l'image, au-dessus des zones préc./suiv. */
.project-play {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 10px 14px;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}

.project-hero.is-film .project-play {
  opacity: 1;
  pointer-events: auto;
}

.project-hero.is-film .project-play:hover {
  opacity: 0.6;
}

/* Films sous le titre (film, teaser, capsules…) : nom à gauche, durée alignée
   en colonne à droite, dans la continuité du crédit */
.project-films {
  display: inline-grid;  /* largeur du plus long nom : les durées tombent en colonne */
  row-gap: 0.3em;
  margin-top: 1.1em;
  /* la petite flèche commence à ~0.066em de son bord (0.34rem) : calée sur le M */
  margin-left: calc(var(--title-ink, 0px) - 0.34rem * 0.066);
  list-style: none;
}

.project-film-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.8em;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  /* même voix que le crédit : fin, minuscules, gris — une note, pas un menu */
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--text-mid);
  transition: color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.project-film-link:hover { color: var(--text); }

.project-film-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
}

/* Petite flèche, discrète : environ la moitié de la hauteur du texte */
.project-film-arrow {
  font-size: 0.5em;
  position: relative;
  top: -0.15em;  /* recentrée sur la hauteur des minuscules */
}

.project-film-duration {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-right: -0.06em;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* Lecteur plein écran, fond noir */
html.film-open,
html.film-open body {
  overflow: hidden;
}

.film-player {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.film-player.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease;
}

.film-player-top {
  /* titre à gauche, Prev 01/03 Next au centre, Close à droite */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(14px + var(--safe-top)) calc(var(--side-padding) + var(--safe-right)) 14px calc(var(--side-padding) + var(--safe-left));
  pointer-events: none;
}

.film-player-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.film-player-nav {
  display: flex;
  align-items: center;
  gap: 1.6em;
  pointer-events: auto;
}

.film-player-nav[hidden] { display: none; }

.film-player-count {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.film-player-close {
  grid-column: 3;
  justify-self: end;
}

.film-player-btn {
  pointer-events: auto;
  padding: 8px 0;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  transition: opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.film-player-btn:hover { opacity: 0.4; }

.film-player-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(var(--side-padding) + var(--safe-right)) calc(4vh + var(--safe-bottom)) calc(var(--side-padding) + var(--safe-left));
  pointer-events: none;
}

.film-player-frame video,
.film-player-frame iframe {
  pointer-events: auto;
  display: block;
  border: 0;
  background: #000;
}

/* Fichier du site : format natif de la vidéo */
.film-player-frame video {
  max-width: 100%;
  max-height: 100%;
}

/* Vimeo / YouTube : le plus grand cadre au format du film qui tient à l'écran */
.film-player-frame.is-embed iframe {
  width: min(100%, calc((100dvh - 120px) * var(--film-ratio, 1.7778)));
  aspect-ratio: var(--film-ratio, 1.7778);
  height: auto;
}


/* =============================================
   PRINT
   ============================================= */
@media print {
  header, .mobile-nav, .overlay, .carousel-overlay, .hover-preview { display: none !important; }
  main { padding-top: 0; }
}

/* =============================================
   TEXTE DE SECOURS (référencement) — lisible sans JavaScript, remplacé par
   le site dès le chargement (cf. tools/build-seo.js)
   ============================================= */
.seo-fallback {
  max-width: 62ch;
  padding: 18vh calc(var(--side-padding) + var(--safe-left)) 10vh;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text);
}
.seo-fallback h1,
.seo-fallback h2 {
  margin: 0 0 1.2em;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seo-fallback h1 { font-size: 1.4rem; }
.seo-fallback h2 { font-size: 0.9rem; margin-top: 2.4em; }
.seo-fallback p, .seo-fallback ul { margin: 0 0 1.2em; }
.seo-fallback ul { padding-left: 1.2em; }
.seo-fallback a { color: inherit; }

/* JavaScript actif (js/early.js) : le texte de secours ne s'affiche pas,
   le site prend la place directement. Les robots lisent toujours le HTML. */
html.js .seo-fallback { display: none; }

/* =============================================
   MOBILE — même langage que l'ordinateur
   Accueil : les 4 liens en coin (Arthur Vialle / Overview en haut, Contact /
   About en bas) au lieu du menu ☰, la grande photo au-dessus de la liste en
   petites capitales grises ; la photo fait défiler les projets (app.js), le
   projet affiché passe en noir comme au survol.
   Page projet : la photo en grand, puis le titre à gauche et le compteur à
   droite, comme sur ordinateur.
   ============================================= */
@media (max-width: 700px) {
  /* ── Accueil ── */
  body:not(.project-page) > header,
  .mobile-nav { display: none !important; }

  .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
    height: calc(var(--header-h) + var(--safe-top));
    padding: var(--safe-top) calc(var(--side-padding) + var(--safe-right)) 0 calc(var(--side-padding) + var(--safe-left));
    background: var(--bg);
    z-index: 100;
  }
  .top-site-name { padding-left: 0; }
  .top-site-name,
  .list-overview-link,
  .list-contact-link,
  .list-about-link { align-self: center; }

  .bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px calc(var(--side-padding) + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(var(--side-padding) + var(--safe-left));
    background: var(--bg);
    z-index: 100;
  }
  .list-contact-link { padding-left: 0; }
  .list-about-link { display: inline-block; }

  main {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    padding-top: calc(var(--header-h) + var(--safe-top));
    padding-bottom: calc(60px + var(--safe-bottom));
  }

  /* la grande photo, au-dessus de la liste */
  .preview-col {
    display: flex;
    order: -1;
    position: relative;
    top: auto;
    height: 46svh;
    padding: 0 calc(var(--side-padding) + var(--safe-right)) 0 calc(var(--side-padding) + var(--safe-left));
  }

  .list-col {
    flex: 1;
    min-height: 0;
    padding: 4.5vh calc(var(--side-padding) + var(--safe-right)) 3vh calc(var(--side-padding) + var(--safe-left));
  }
  .project-list-wrap { justify-content: flex-start; }

  /* la liste comme sur ordinateur : petites capitales grises */
  .project-item { padding: 0.48rem 0; gap: 0; }
  .project-item-title { font-size: 0.8rem; }
  .project-item-client,
  .project-item-location { display: none; }
  .project-list.is-cycling .project-item { color: #c8c8c8; }
  .project-list .project-item.is-current { color: var(--text); }

  /* ── Page projet ── */
  .project-page .header-right .header-link { display: inline-block; }
}

@media (max-width: 900px) {
  .project-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "hero hero" "heading counter";
    justify-items: stretch;
    align-items: start;
    text-align: left;
    row-gap: 2.4vh;
    column-gap: 6vw;
    padding-top: 1vh;
    padding-bottom: 6vh;
  }
  .project-hero {
    grid-area: hero;
    justify-self: center;
    /* aussi grande que possible, sans dépasser la hauteur de l'écran */
    width: min(100%, calc((100svh - var(--header-h) - var(--safe-top) - 22vh) * 3 / 4));
    max-width: none;
  }
  .project-heading { grid-area: heading; justify-self: start; }
  .project-counter { grid-area: counter; justify-self: end; }
}

/* =============================================
   ÉCRANS TACTILES — réactivité et proportions
   ============================================= */
/* Pas d'attente du double-tap (zoom) avant qu'un toucher soit pris en compte */
html { touch-action: manipulation; }

/* Flèches ← → du compteur : seulement quand la mise en page est empilée */
.project-arrow {
  display: none;
  padding: 14px 12px;      /* zone de toucher généreuse… */
  margin: -14px 0;          /* …sans décaler la ligne */
  background: none;
  border: none;
  font: inherit;
  color: var(--text);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.project-arrow[hidden] { display: none !important; }

@media (hover: none) {
  /* le survol n'existe pas au doigt : sans ça, un projet touché restait
     « bloqué » en noir ou toute la liste grisée */
  .project-list .project-item { color: #c8c8c8 !important; }
  .project-list .project-item.is-current { color: var(--text) !important; }
  .project-item:hover .project-item-title { transform: none; }

  /* sorties de page plus courtes (cf. transitions.js) */
  .mask-inner.is-out {
    transition:
      transform 0.5s cubic-bezier(0.65, 0, 0.35, 1),
      opacity 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .preview-col .hover-preview.is-exiting,
  .project-row .project-hero.is-exiting {
    transition: opacity 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  }
}

@media (max-width: 700px) {
  /* Accueil : la photo occupe tout l'espace entre la barre du haut et la
     liste, quelle que soit la hauteur du téléphone */
  main { min-height: 100svh; }
  .preview-col { flex: 1 1 auto; height: auto; min-height: 30svh; }
  .list-col { flex: none; padding-top: 3.2vh; padding-bottom: 2.4vh; }
  .project-item { padding: 0.55rem 0; }   /* lignes plus faciles à toucher */
  /* coins : zone de toucher agrandie, sans bouger le texte */
  .top-site-name, .list-overview-link, .list-contact-link, .list-about-link {
    padding-top: 12px; padding-bottom: 12px; margin-top: -12px; margin-bottom: -12px;
  }
}

@media (max-width: 900px) {
  /* Page projet : l'ensemble est centré dans la hauteur de l'écran */
  .project-main { min-height: 100svh; }
  .project-row { margin: auto 0; }
  .project-arrow { display: inline-block; }
  .project-counter { display: flex; align-items: center; gap: 10px; }
}

/* Mobile, projet en fitWide : image en largeur entière dans le cadre fixe */
.project-hero.is-contain .project-hero-layer { object-fit: contain; }
@media (max-width: 900px) {
  .project-row { padding-bottom: 1vh; }   /* centrage vertical équilibré */
}

/* =============================================
   ACCUEIL TÉLÉPHONE — liste + photo flottante (sommaire de magazine)
   La liste occupe la page, centrée ; la photo 3:4 flotte à droite et glisse
   à la hauteur du projet affiché (--float-y, posé par app.js)
   ============================================= */
@media (max-width: 700px) {
  main { position: relative; }

  .list-col {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5vh calc(var(--side-padding) + var(--safe-right)) 5vh calc(var(--side-padding) + var(--safe-left));
  }
  .project-list-wrap { flex: none; justify-content: center; }
  .project-item { padding: 0.62rem 0; }
  .project-item-title { font-size: 0.82rem; letter-spacing: 0.04em; }

  .preview-col {
    position: absolute;
    order: 0;
    top: 0;
    left: auto;
    right: calc(var(--side-padding) + var(--safe-right));
    /* aussi large que possible sans toucher les noms les plus longs */
    width: clamp(90px, calc(100vw - 2 * var(--side-padding) - 210px), 230px);
    height: auto;
    min-height: 0;
    aspect-ratio: 3 / 4;
    flex: none;
    padding: 0;
    transform: translateY(var(--float-y, 38svh));
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .preview-col .hover-preview { flex: 1; height: 100%; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .preview-col { transition: none; }
}

/* Accueil téléphone — affinage : la liste remplit la hauteur, photo plus
   grande avec sa légende, trait de progression sous le projet affiché */
.preview-caption { display: none; }

@media (max-width: 700px) {
  /* lignes espacées selon la hauteur de l'écran : la liste occupe la page */
  .project-item { padding: clamp(0.6rem, 2.1svh, 1.15rem) 0; position: relative; }
  .project-item-title { flex: none; }

  /* photo : plus large, la légende en dessous */
  .preview-col {
    width: clamp(100px, calc(100vw - 2 * var(--side-padding) - 192px), 250px);
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
  }
  .preview-col .hover-preview { flex: none; width: 100%; height: auto; aspect-ratio: 3 / 4; }
  .preview-caption {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 9px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
  }
  .pc-meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pc-num { flex: none; color: var(--text); }

  /* trait de progression : se dessine sous le nom pendant l'affichage
     (même durée que le défilement, cf. CYCLE_MS dans app.js) */
  .project-list.is-timed .project-item.is-current .project-item-title { position: relative; }
  .project-list.is-timed .project-item.is-current .project-item-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -5px;
    height: 1px;
    background: currentColor;
    transform-origin: left center;
    transform: scaleX(0);
    animation: avs-progress 3.2s linear forwards;
  }
}
@keyframes avs-progress { to { transform: scaleX(1); } }

/* Accueil téléphone : pas d'indice vidéo (▶ et durée) dans la liste, et la
   page ne défile pas — tout tient dans l'écran (les panneaux Overview,
   About… gardent leur propre défilement) */
@media (max-width: 700px) {
  .project-list .project-item-film { display: none !important; }

  html:has(> body:not(.project-page)),
  body:not(.project-page) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body:not(.project-page) main {
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }
}

/* Accueil téléphone : photo sans légende, plus « flottante » — glissement
   plus lent et plus doux d'un projet à l'autre, et une légère ondulation au
   repos (sur la photo elle-même, pour ne pas gêner le glissement) */
@media (max-width: 700px) {
  .preview-caption { display: none !important; }
  .preview-col {
    transition: transform 1.3s cubic-bezier(0.25, 1, 0.3, 1);
  }
  .preview-col .hover-preview {
    animation: avs-float 6s ease-in-out infinite alternate;
  }
}
@keyframes avs-float {
  0%   { translate: 0 -5px; }
  50%  { translate: 0 4px; }
  100% { translate: 0 -3px; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .preview-col { transition: none; }
  .preview-col .hover-preview { animation: none; }
}

/* Flottement dans toutes les directions : un tracé lent et irrégulier
   (haut, bas, gauche, droite) + une très légère inclinaison sur un autre
   rythme, pour que le mouvement ne paraisse jamais en boucle */
@media (max-width: 700px) {
  .preview-col .hover-preview {
    animation:
      avs-drift 11s ease-in-out infinite alternate,
      avs-tilt 7.5s ease-in-out infinite alternate;
  }
}
@keyframes avs-drift {
  0%   { translate: 0 0; }
  20%  { translate: 4px -5px; }
  40%  { translate: -3px -2px; }
  60%  { translate: -5px 4px; }
  80%  { translate: 3px 5px; }
  100% { translate: 5px -1px; }
}
@keyframes avs-tilt {
  0%   { rotate: -0.6deg; }
  50%  { rotate: 0.4deg; }
  100% { rotate: 0.7deg; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .preview-col .hover-preview { animation: none; }
}

/* =============================================
   ACCUEIL TÉLÉPHONE — rythme : la hauteur entre la barre du haut et celle
   du bas est partagée en 10 tranches égales, une par projet, le nom centré
   dans la sienne. L'espace au-dessus du premier et sous le dernier suit le
   même rythme que l'espace entre les projets (et chaque ligne est une
   grande zone de toucher).
   ============================================= */
@media (max-width: 700px) {
  .list-col { padding-top: 1.5svh; padding-bottom: 1.5svh; justify-content: stretch; }
  .project-list-wrap { flex: 1 1 auto; display: flex; }
  .project-list { flex: 1 1 auto; display: flex; flex-direction: column; }
  .project-item { flex: 1 1 0; min-height: 0; align-items: center; padding: 0; }
}

/* =============================================
   ABOUT TÉLÉPHONE — même composition que l'ordinateur : l'accroche en
   grand, les clients à gauche du portrait (calés en bas), la bio dessous,
   Personal work en bas à droite
   ============================================= */
@media (max-width: 700px) {
  .about-overlay .about-body { padding-top: 4vh; padding-bottom: 2vh; }
  .about-headline {
    font-size: 7.6vw;
    line-height: 1.02;
    letter-spacing: -0.025em;
  }
  .about-bottom {
    margin-top: 7vh;
    padding-top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas: "clients photo" "bio bio";
    column-gap: 6vw;
    row-gap: 6vh;
    align-items: end;
  }
  .about-info { display: contents; }
  .about-col--clients { grid-area: clients; margin-bottom: -0.2em; }
  .about-col--bio { grid-area: bio; }
  .about-photo {
    grid-area: photo;
    justify-self: end;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }
  .about-clients { font-size: 0.8rem; line-height: 1.75; }
  .about-text { font-size: 0.86rem; line-height: 1.65; }
  .about-overlay .about-footer {
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding-top: 6vh;
  }
}

/* Ajustements : accroche About sans débordement, clients sur une ligne,
   accueil un peu plus resserré (les 10 tranches sur 82 % de la hauteur) */
@media (max-width: 700px) {
  .about-headline { font-size: 6.9vw; }
  .about-bottom { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 5vw; }
  .about-clients { font-size: 0.74rem; }
  .about-clients li { white-space: nowrap; }
  .list-col { padding-top: 6svh; padding-bottom: 6svh; }
}

/* =============================================
   ACCUEIL TÉLÉPHONE — design et transition entre projets
   • Sommaire numéroté 01–10 (mono gris, le numéro du projet affiché en noir)
   • Le nom affiché glisse légèrement vers la droite (comme le survol desktop)
   • La nouvelle photo se dévoile de bas en haut dans son cadre, par-dessus
     la précédente, en se posant d'un léger zoom — le même mouvement masqué
     que les textes du site
   ============================================= */
@media (max-width: 700px) {
  .project-list { counter-reset: proj; }
  .project-item { counter-increment: proj; }
  .project-item::before {
    content: counter(proj, decimal-leading-zero);
    flex: none;
    width: 2.6em;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 0.06em;
    color: #c8c8c8;
    transition: color 0.6s ease;
  }
  .project-list .project-item.is-current::before { color: var(--text); }

  .project-item .project-item-title {
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), color 0.6s ease;
  }
  .project-list .project-item.is-current .project-item-title { transform: translateX(10px) !important; }
  .project-list .project-item { transition: color 0.6s ease !important; }

  /* rideau : la photo active passe au-dessus et se dévoile vers le haut ;
     l'ancienne reste visible dessous le temps du dévoilement */
  .preview-col .hover-preview { overflow: hidden; }
  .preview-col .hover-img {
    opacity: 1;
    z-index: 1;
    clip-path: inset(100% 0 0 0);
    transform: scale(1.08);
    transition: clip-path 0s linear 1.1s, transform 0s linear 1.1s;
  }
  .preview-col .hover-img.is-active {
    z-index: 2;
    clip-path: inset(0 0 0 0);
    transform: scale(1);
    transition:
      clip-path 1.05s cubic-bezier(0.77, 0, 0.18, 1),
      transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .preview-col .hover-video.is-active { z-index: 3; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .preview-col .hover-img,
  .preview-col .hover-img.is-active { transition: none; transform: none; }
}

/* Accueil téléphone : sans numérotation ; les projets non affichés sont
   légèrement flous, seul le projet en cours est net (transition douce) */
@media (max-width: 700px) {
  .project-item::before { content: none !important; display: none !important; }
  .project-list.is-cycling .project-item .project-item-title {
    filter: blur(1.6px);
    transition: filter 0.9s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), color 0.6s ease;
  }
  .project-list.is-cycling .project-item.is-current .project-item-title { filter: none; }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .project-list.is-cycling .project-item .project-item-title { transition: none; }
}

/* flou adouci, gris un peu plus soutenu : les noms restent lisibles */
@media (max-width: 700px) {
  .project-list.is-cycling .project-item .project-item-title { filter: blur(1px); }
  .project-list.is-cycling .project-item.is-current .project-item-title { filter: none; }
  .project-list.is-cycling .project-item { color: #a9a9a9; }
  .project-list.is-cycling .project-item.is-current { color: var(--text); }
}
@media (max-width: 700px) and (hover: none) {
  .project-list .project-item { color: #a9a9a9 !important; }
  .project-list .project-item.is-current { color: var(--text) !important; }
}

/* Au doigt : la photo flottante est cliquable (ouvre le projet affiché) */
@media (max-width: 700px) and (hover: none) {
  .preview-col { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }
}

/* Changement de projet (téléphone) : plus de rideau — fondu « mise au point ».
   L'ancienne photo se dissout en se floutant, la nouvelle apparaît floue puis
   devient nette en se posant, les deux en même temps */
@media (max-width: 700px) {
  .preview-col .hover-img,
  .preview-col .hover-img.is-active {
    clip-path: none;
  }
  .preview-col .hover-img {
    opacity: 0;
    filter: blur(14px);
    transform: scale(1.05);
    transition:
      opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
      filter 1.1s cubic-bezier(0.4, 0, 0.2, 1),
      transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .preview-col .hover-img.is-active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    transition:
      opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
      filter 1.3s cubic-bezier(0.22, 1, 0.36, 1),
      transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .preview-col .hover-img,
  .preview-col .hover-img.is-active { transition: opacity 0.4s ease; filter: none; transform: none; }
}

/* =============================================
   OVERVIEW TÉLÉPHONE — disposition libre, comme sur ordinateur : tailles
   et colonnes variées, formats d'origine des gabarits (3:4, 4:5, 2:3,
   carré), décalages verticaux. Motif de 5 photos, en boucle :
     [ grande ··· | petite, plus bas ]
     [ · moyenne, décalée vers la droite · ]
     [ petite | grande, plus bas ]
   ============================================= */
@media (max-width: 700px) {
  .overview-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 5vw;
    row-gap: 7vh;
    align-items: start;
  }
  .overview-grid .overview-item { grid-row: auto !important; margin-top: 0; }
  .overview-grid .ov-frame { aspect-ratio: auto; }
  .overview-grid .overview-item .ov-frame { aspect-ratio: var(--ov-r, 3 / 4) !important; }

  .overview-grid .overview-item:nth-child(5n+1) { grid-column: 1 / span 4 !important; }
  .overview-grid .overview-item:nth-child(5n+2) { grid-column: 5 / span 2 !important; margin-top: 14vh; }
  .overview-grid .overview-item:nth-child(5n+3) { grid-column: 2 / span 4 !important; margin-top: 2vh; }
  .overview-grid .overview-item:nth-child(5n+4) { grid-column: 1 / span 2 !important; margin-top: 6vh; }
  .overview-grid .overview-item:nth-child(5n)   { grid-column: 3 / span 4 !important; margin-top: 16vh; }
}
