/* =========================================================
   PORTFOLIO — VICTOR RANSON, MONTEUR VIDÉO
   Style global : blanc, minimal, typo sans + mono

   Les blocs marqués « html.opt-… » ne s'appliquent que si le réglage
   du même nom est activé dans assets/js/reglages.js.
   ========================================================= */

/* ---------- Polices, hébergées sur le site (dossier assets/fonts) ----------
   Aucune connexion à Google pour les afficher. Licence libre SIL OFL (fichiers OFL-*.txt).
   « latin » couvre le français ; « latin-ext » ne se charge que si un caractère rare apparaît. */
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/inter-tight-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #707070; /* gris lisible : contraste 4,9:1 sur blanc */
  --line: #e6e6e4;
  --soft: #f1f1ef;
  --hover-line: #b9b9b6;

  /* grain de pellicule : points sombres sur fond clair */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: 0.075;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(16px, 2vw, 28px);
  /* marges latérales : évitent l'encoche d'un téléphone tenu à l'horizontale */
  --gl: max(var(--gutter), env(safe-area-inset-left, 0px));
  --gr: max(var(--gutter), env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --header-h: 52px;

  /* courbes de mouvement */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* réponse à une action : départ vif, arrivée douce */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* déplacement à l'écran */
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; /* pas de flash gris au toucher (le site a ses propres retours) */
}
/* accueil : pas de « tirer pour rafraîchir » ni d'effet élastique pendant qu'on fait tourner le carrousel */
html:has(.page-home) { overscroll-behavior: none; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
/* un seul fondu d'entrée par page (pas sur <body>, sinon la fusion de l'en-tête ne marche plus) */
main,
.site-footer { animation: page-in 0.7s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Grain de pellicule ----------
   Très léger, il scintille environ 9 fois par seconde comme une vraie pellicule.
   Intensité : --grain-opacity (en haut du fichier). */
body::after {
  content: "";
  position: fixed;
  inset: -120px;
  z-index: 70;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 220px 220px;
  opacity: var(--grain-opacity);
  animation: grain 0.9s steps(1) infinite;
}
html.q-min body::after { animation: none; } /* appareil très lent : grain fixe */
@keyframes grain {
  0% { transform: translate(0, 0); }
  12% { transform: translate(-48px, 30px); }
  25% { transform: translate(36px, -62px); }
  37% { transform: translate(-80px, -20px); }
  50% { transform: translate(64px, 44px); }
  62% { transform: translate(-22px, 76px); }
  75% { transform: translate(90px, -10px); }
  87% { transform: translate(-56px, -86px); }
}

/* ---------- Transitions entre les pages (navigateurs récents) ----------
   Fondu court entre les pages, et la vignette cliquée qui devient le lecteur. */
@view-transition { navigation: auto; }
@supports (view-transition-name: none) {
  main,
  .site-footer { animation: none; } /* le fondu entre pages prend le relais */
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
  animation-timing-function: var(--ease);
}
::view-transition-group(media) {
  animation-duration: 0.85s;
  animation-timing-function: cubic-bezier(0.62, 0, 0.2, 1);
}
::view-transition-old(media),
::view-transition-new(media) {
  animation-duration: 0.85s;
  height: 100%;
  object-fit: cover;
}
.stage > .player { view-transition-name: media; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
a, button { touch-action: manipulation; } /* pas d'attente « double toucher pour zoomer » sur les liens */
img, video, iframe { display: block; max-width: 100%; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

/* les commandes ne se sélectionnent pas comme du texte quand on appuie longtemps */
button,
.nav a,
.site-footer a {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.5;
}
.muted { color: var(--muted); }
.sep { color: var(--muted); padding: 0 6px; }

/* ---------- En-tête ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 80; /* au-dessus du lecteur vidéo et du grain */
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gr) 0 var(--gl);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #fff;
  mix-blend-mode: difference; /* reste lisible sur fond blanc comme sur une image */
}
.site-header :focus-visible { outline-color: #fff; } /* visible malgré la fusion des couleurs */
.nav { display: flex; gap: 14px; }
.nav a,
.nav button {
  position: relative;
  font-weight: 600;
  letter-spacing: -0.025em;
  transition: opacity 0.2s;
}
/* zone de toucher agrandie (au moins 44 px de haut) sans changer la mise en page */
.brand { position: relative; }
.brand::after,
.nav a::after,
.nav button::after,
.site-footer a::after {
  content: "";
  position: absolute;
  inset: -15px -6px;
}
.nav a:active,
.nav button:active { opacity: 0.55; } /* retour immédiat à l'appui */
.nav [aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.nav .play { display: inline-flex; align-items: center; gap: 6px; }
.nav .play::before {
  content: "";
  width: 0; height: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

/* ---------- Pied de page ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gr) calc(14px + var(--safe-b)) var(--gl);
  color: var(--muted);
}
.site-footer { flex-wrap: wrap; row-gap: 8px; } /* sur petit écran, passe sur deux lignes au lieu de déborder */
.site-footer .sep { padding: 0 8px; }
.site-footer a[aria-current="page"] { color: var(--muted); }
.site-footer nav { display: flex; gap: 14px; }
.site-footer a { position: relative; color: var(--fg); transition: opacity 0.2s; }
.site-footer a:active { opacity: 0.55; }

/* ---------- Cadre image / vidéo 16:9 ---------- */
.ph {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: var(--soft);
}
.ph img,
.ph iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
/* le lecteur YouTube reste caché (image visible) jusqu'à ce que la vidéo démarre :
   pas d'écran noir pendant le chargement */
.player iframe { opacity: 0; transition: opacity 0.5s var(--ease); }
.player.is-live iframe { opacity: 1; }

/* Extrait vidéo posé sur une vignette : fondu à l'apparition */
.ring-preview,
.ph canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  pointer-events: none;
}
.ring-preview { opacity: 0; transition: opacity 0.6s var(--ease); }
.ring-preview.is-on { opacity: 1; }


/* =========================================================
   ACCUEIL — carrousel courbé
   ========================================================= */
.page-home { height: 100svh; overflow: hidden; }
.page-home .site-footer { position: fixed; inset: auto 0 0 0; z-index: 40; }

.home { position: relative; flex: 1; height: 100svh; overflow: hidden; }

.ring {
  position: absolute;
  inset: 0;
  perspective: var(--persp, 1100px);
  perspective-origin: 50% 46%;
  touch-action: pinch-zoom; /* le carrousel gère le glisser ; le zoom à deux doigts reste possible */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.ring.is-dragging { cursor: grabbing; }

.ring-stage {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0; height: 0;
  transform-style: preserve-3d;
}

.ring-card {
  position: absolute;
  width: var(--cw);
  left: calc(var(--cw) / -2);
  top: calc(var(--ch) / -2);
  backface-visibility: hidden;
  will-change: transform, opacity;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.ring-card .ph { background: transparent; transition: transform 0.16s var(--ease-out); }
/* la vignette centrale s'enfonce légèrement quand on appuie dessus */
.ring-card.is-active:active .ph { transform: scale(0.985); }

/* Les vignettes « respirent » : zoom très lent (Ken Burns) sur la vignette centrale,
   en pause dès que le carrousel bouge (elles se figent sans à-coup). */
.ring-card .ph img {
  transform-origin: var(--drift-origin, 50% 50%);
  animation: drift 16s ease-in-out var(--drift-delay, 0s) infinite alternate;
  animation-play-state: paused;
}
.ring-card.is-active .ph img { animation-play-state: running; }
.ring.is-moving .ring-card .ph img { animation-play-state: paused; }
@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.055); }
}
.ring:not(.is-dragging) .ring-card.is-active { cursor: pointer; }

/* l'extrait disparaît immédiatement dès que le carrousel bouge */
.ring.is-moving .ring-preview { opacity: 0; transition: none; }

/* ---- Vignettage de l'accueil ---- */
.ring-fade,
.ring-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none; /* laisse passer clics et glisser */
}
.ring-fade {
  left: 0;
  right: 0;
  z-index: 3;
  opacity: 0.45;
  background: linear-gradient(to right,
    #fff 0%, rgba(255, 255, 255, 0) 16%,
    rgba(255, 255, 255, 0) 84%, #fff 100%);
}
/* flou progressif : 4 couches, de plus en plus floues vers le bord */
.ring-edge { z-index: 2; width: 16%; }
.ring-edge--left { left: 0; }
.ring-edge--right { right: 0; }
.ring-edge i {
  position: absolute;
  top: 0;
  bottom: 0;
  backdrop-filter: blur(var(--b));
  -webkit-backdrop-filter: blur(var(--b));
}
.ring-edge--left i { left: 0; -webkit-mask-image: linear-gradient(to left, transparent, #000); mask-image: linear-gradient(to left, transparent, #000); }
.ring-edge--right i { right: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000); mask-image: linear-gradient(to right, transparent, #000); }
.ring-edge i:nth-child(1) { width: 100%; --b: 0.3px; }
.ring-edge i:nth-child(2) { width: 75%; --b: 0.6px; }
.ring-edge i:nth-child(3) { width: 50%; --b: 0.9px; }
.ring-edge i:nth-child(4) { width: 25%; --b: 1.2px; }
/* ce flou des bords coûte cher pour un effet à peine visible : retiré sur les écrans
   tactiles, et dès que l'appareil a du mal à suivre */
html.q-low .ring-edge { display: none; }
@media (pointer: coarse) {
  .ring-edge { display: none; }
}

/* ---- Légende sous le carrousel ---- */
.ring-caption {
  position: absolute;
  left: 0; right: 0;
  top: calc(46% + var(--ch) / 2 + 26px);
  padding: 0 var(--gr) 0 var(--gl);
  text-align: center;
  pointer-events: none;
}
.ring-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  /* le titre monte de derrière un cache à chaque changement de projet */
  overflow: hidden;
  padding-bottom: 0.14em;
  text-wrap: balance;
}
.ring-title > span { display: inline-block; transition: transform 0.7s var(--ease-out); }
.ring-meta {
  margin-top: 4px;
  color: #555;
  transition: opacity 0.35s 0.12s;
}
html.opt-charteGraphique .ring-meta { color: var(--muted); } /* gris de la palette (charte graphique) */
.ring-caption.is-swapping .ring-title > span { transform: translateY(118%); transition: transform 0.16s var(--ease-out); }
.ring-caption.is-swapping .ring-meta { opacity: 0; transition: opacity 0.12s; }

html.opt-legendeGrande .ring-caption { top: calc(46% + var(--ch) / 2 + 30px); }
html.opt-legendeGrande .ring-title {
  font-size: clamp(21px, 2.3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
}
html.opt-legendeGrande .ring-meta { margin-top: 8px; }

.home-intro,
.ring-count,
.ring-caption,
.ring-hint { z-index: 5; } /* au-dessus du vignettage */

/* ---- Entrée en scène de l'accueil ---- */
.home-intro,
.ring-count,
.ring-caption { transition: opacity 0.8s var(--ease); }
.home-intro,
.ring-count { transition-delay: 0.2s; }
.home.is-intro .home-intro,
.home.is-intro .ring-count,
.home.is-intro .ring-caption,
.home.is-intro .ring-hint,
.home.is-intro .tl { opacity: 0; }
.home.is-intro .ring { animation: ring-in 0.6s var(--ease) both; }
@keyframes ring-in { from { opacity: 0; } }

/* ---- Accroche en haut à gauche ---- */
.home-intro {
  position: absolute;
  top: calc(var(--header-h) + 6px);
  left: var(--gl);
  max-width: 300px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  pointer-events: none; /* on peut attraper le carrousel même à travers le texte */
}
.home-role,
.home-fields { display: block; }
.home-role {
  font-family: var(--mono);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
html.opt-accrocheGrande .home-intro { top: calc(var(--header-h) + 16px); max-width: none; }
html.opt-accrocheGrande .home-role {
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: clamp(30px, 3.6vw, 58px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-transform: none;
  color: var(--fg);
}

.ring-count {
  position: absolute;
  right: var(--gr);
  top: calc(var(--header-h) + 6px);
  color: var(--muted);
  pointer-events: none;
}
html.opt-accrocheGrande .ring-count { top: calc(var(--header-h) + 18px); }
.ring-count b { color: var(--fg); font-weight: 500; }
.ring-hint {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(52px + var(--safe-b));
  text-align: center;
  color: var(--muted);
  transition: opacity 0.6s;
}
.ring-hint.is-hidden { opacity: 0; }
html.opt-timeline .ring-hint { display: none; }

/* ---- Timeline : règle de montage en bas de l'accueil ----
   Un grand trait par projet, des petits entre deux ; la tête de lecture suit le carrousel.
   Cliquer sur un segment amène son projet au centre. */
.tl {
  position: absolute;
  left: var(--gl);
  right: var(--gr);
  bottom: calc(46px + var(--safe-b));
  z-index: 6;
  display: flex;
  justify-content: center;
  transition: opacity 0.8s var(--ease) 0.3s;
}
.tl-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr));
  width: min(100%, 1320px);
}
.tl-track::before { /* ligne de base */
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 18px;
  height: 1px;
  background: var(--line);
}
.tl-track::after { /* trait de fin */
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  width: 1px;
  height: 10px;
  background: var(--fg);
}
.tl-seg {
  position: relative;
  height: 44px;
  user-select: none;
  -webkit-user-select: none;
}
.tl-seg::before { /* graduations */
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 8px;
  height: 10px;
  background:
    linear-gradient(var(--fg), var(--fg)) 0 0 / 1px 100% no-repeat,
    repeating-linear-gradient(90deg, var(--hover-line) 0 1px, transparent 1px 20%) 0 100% / 100% 5px no-repeat;
}
.tl-label {
  position: absolute;
  left: 0;
  top: 24px;
  font-size: 10px;
  white-space: nowrap;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s, color 0.3s;
}
.tl-seg[aria-current="true"] .tl-label { opacity: 1; color: var(--fg); }
.tl-head { /* tête de lecture */
  position: absolute;
  left: 0;
  top: 3px;
  width: 1px;
  height: 16px;
  background: var(--fg);
  pointer-events: none;
  will-change: transform;
}
.tl-head::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -2px;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 6px solid var(--fg);
}
@media (min-width: 1400px) {
  .tl-label { opacity: 1; } /* écran large : tous les noms sont affichés */
}

/* =========================================================
   PAGES INTÉRIEURES
   ========================================================= */
.page {
  flex: 1;
  width: 100%;
  padding: calc(var(--header-h) + clamp(56px, 10vw, 120px)) var(--gr) clamp(64px, 9vw, 120px) var(--gl);
}

.display {
  font-size: clamp(48px, 8.4vw, 124px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

/* titres en générique : chaque mot sort de derrière un cache */
.reveal .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* marge intérieure pour ne couper ni les accents (À) ni les jambages (p, j) */
  padding: 0.14em 0.02em 0.16em;
  margin: -0.14em -0.02em -0.16em;
}
.reveal .w > span {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 1.1s cubic-bezier(0.19, 0.8, 0.12, 1);
  transition-delay: calc(var(--i, 0) * 85ms + 60ms);
}
.reveal.is-in .w > span { transform: none; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.page-head .mono { margin-top: 0.6em; }

.label { color: var(--muted); margin-bottom: 14px; }

/* filets qui se tracent de gauche à droite à l'apparition (réglage traitsAnimes) */
.rule { position: relative; border-top-color: transparent !important; }
.rule::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -1px;
  height: 1px;
  background: var(--rule-color, var(--line));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.3s var(--ease-in-out);
}
.rule.is-drawn::before { transform: none; }

/* ---------- Projets ---------- */
.group + .group { margin-top: clamp(72px, 10vw, 140px); }
.group-head {
  --rule-color: var(--fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: baseline;
  padding-top: 14px;
  margin-bottom: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--fg);
}
.group-title {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* Filtres par type de travail (réglage projetsParType) : de grands mots, sous un filet.
   Le type choisi est en noir, les autres en gris ; le petit chiffre = nombre de projets. */
.filters {
  --rule-color: var(--fg);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px clamp(18px, 2.6vw, 40px);
  padding-top: 12px;
  margin-bottom: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--fg);
}
.filter {
  position: relative;
  padding: 4px 0;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--muted);
  transition: color 0.2s, transform 0.16s var(--ease-out);
}
.filter::after { content: ""; position: absolute; inset: -5px -8px; } /* zone de toucher */
.filter[aria-pressed="true"] { color: var(--fg); }
.filter:active { transform: scale(0.97); }
.filter sup {
  position: relative;
  top: 0.5em;
  margin-left: 4px;
  vertical-align: top;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 64px) var(--gutter);
}

.work { display: block; }
.work[hidden] { display: none; } /* projet masqué par le filtre */
/* changement de filtre : les vignettes qui restent glissent à leur nouvelle place */
html.is-filtering::view-transition-group(*) {
  animation-duration: 0.55s;
  animation-timing-function: var(--ease-in-out);
}
html.is-filtering::view-transition-old(*),
html.is-filtering::view-transition-new(*) { animation-duration: 0.3s; }
.work-media { overflow: hidden; border-radius: 2px; transition: transform 0.16s var(--ease-out); }
.work:active .work-media { transform: scale(0.985); } /* retour à l'appui */
.work .ph { transition: transform 0.9s var(--ease); }
.work-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  margin-top: 12px;
}
.work-title { font-weight: 600; letter-spacing: -0.025em; }

/* ---------- Page projet ---------- */
.back {
  position: relative;
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  transition: color 0.2s;
}
.back::after { content: ""; position: absolute; inset: -14px -8px; } /* zone de toucher */

.project-client { margin-top: 18px; font-size: 20px; letter-spacing: -0.02em; color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px var(--gutter);
  margin: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.facts dt { color: var(--muted); }
.facts dd { color: var(--fg); margin-top: 2px; }

/* le lecteur tient toujours dans la hauteur de l'écran */
.stage { max-width: min(100%, calc((100svh - var(--header-h) - 48px) * 16 / 9)); }

/* sous le lecteur : vidéo en cours + timecode qui suit la lecture */
.stage-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  max-width: min(100%, calc((100svh - var(--header-h) - 48px) * 16 / 9));
  margin-top: 10px;
  color: var(--muted);
}
.timecode {
  font-variant-numeric: tabular-nums; /* chiffres de largeur fixe : le timecode ne tremble pas */
  white-space: nowrap;
}
.timecode b { color: var(--fg); font-weight: 500; }

/* ---------- Pages projet : « salle de projection » ----------
   Le reste du site est une galerie blanche ; en ouvrant un projet,
   on entre dans le noir et la vidéo prend toute la place. */
body.screening,
html.opt-page404Noire body.notfound { /* page 404 : « écran noir » (réglage page404Noire) */
  --bg: #000000;
  --fg: #f2f2f2;
  --muted: #8f8f8f;
  --line: #262626;
  --soft: #141414;
  --hover-line: #5a5a5a;
  /* grain : points clairs sur fond noir */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.6 0 0 0 -0.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: 0.085;
  color-scheme: dark;
}
/* le grain ne passe pas sur les vidéos */
.stage { position: relative; z-index: 71; }

.playlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--gutter);
  margin-top: 18px;
}
.pl-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 0.2s, transform 0.16s var(--ease-out);
}
.pl-item:active { transform: scale(0.98); }
.pl-item[aria-current="true"] { border-color: var(--fg); }
.pl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-title { font-weight: 600; letter-spacing: -0.02em; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
  margin-top: clamp(48px, 7vw, 96px);
}
.prose { max-width: 560px; font-size: 18px; line-height: 1.5; letter-spacing: -0.015em; }
.prose p + p { margin-top: 1em; }

/* projet suivant : titre, et image du projet si le réglage projetSuivantImage est actif */
.next {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gutter);
  align-items: end;
  margin-top: clamp(72px, 10vw, 140px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.next-text { display: block; min-width: 0; }
.next .display {
  display: block;
  margin-top: 10px;
  font-size: clamp(40px, 6.4vw, 96px);
  transition: opacity 0.3s;
}
.next-client { display: block; margin-top: 12px; }
.next-media { display: block; overflow: hidden; border-radius: 2px; }
.next-media:empty { display: none; }
.next-media .ph { transition: transform 0.9s var(--ease); }
.next:has(.next-media:not(:empty)) { grid-template-columns: minmax(0, 1fr) minmax(0, 34%); }

/* appel à te contacter, en bas des pages (réglage appelContact) */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px var(--gutter);
  align-items: end;
  margin-top: clamp(72px, 10vw, 140px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.cta-title {
  justify-self: start;
  font-size: clamp(30px, 4.4vw, 64px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: opacity 0.2s;
}
.cta-mail {
  justify-self: start;
  font-size: clamp(17px, 1.6vw, 22px);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  transition: opacity 0.2s;
}
.cta-title:active,
.cta-mail:active { opacity: 0.55; }

/* ---------- À propos ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}
.about-photo {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  width: min(100%, 380px);
}
.about-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 2px;
  background: var(--soft);
}
.about-body > section + section { margin-top: clamp(48px, 6vw, 80px); }
/* ta phrase de présentation en grand (réglage aProposGrand) */
html.opt-aProposGrand .about-body > section:first-child .prose {
  max-width: 21em;
  font-size: clamp(22px, 2.5vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.04em;
}
/* appel à l'action sous le texte : un bouton plein + un lien vers la bande-démo */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: clamp(24px, 3vw, 36px);
}
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 2px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: inset 0 0 0 1px var(--fg); /* bord gardé quand le fond s'efface au survol */
  font-weight: 600;
  letter-spacing: -0.02em;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.2s, color 0.2s, transform 0.16s var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}
.btn-text::before { /* triangle « lecture » */
  content: "";
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.btn-text:active { opacity: 0.55; }

/* logiciels : une ligne par outil, séparées par des filets */
.tools li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.tools li:last-child { border-bottom: 1px solid var(--line); }
.tool-name {
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

/* ---- Marques et artistes ----
   Sans le réglage referencesDefilantes : une simple liste sur plusieurs lignes.
   Avec : une seule ligne qui défile sur toute la largeur de l'écran. */
.refs { margin-top: clamp(64px, 9vw, 120px); }
.marquee-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  list-style: none;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.marquee-track li:not(:last-child)::after { content: ","; margin-right: 0.3em; }
.marquee-track a { transition: opacity 0.2s; }
.marquee-track a:active { opacity: 0.55; }

.marquee.is-live,
.marquee.is-scroll {
  display: flex;
  margin: 0 calc(var(--gr) * -1) 0 calc(var(--gl) * -1); /* jusqu'aux bords de l'écran */
  overflow: hidden;
  overflow: clip;
  /* les noms s'estompent aux deux bords, comme les vignettes de l'accueil */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.marquee.is-live .marquee-track,
.marquee.is-scroll .marquee-track {
  flex: none;
  flex-wrap: nowrap;
  gap: 0;
  white-space: nowrap;
  font-size: clamp(34px, 5.2vw, 76px);
  letter-spacing: -0.045em;
  line-height: 1.25;
}
.marquee.is-live .marquee-track li::after,
.marquee.is-scroll .marquee-track li::after {
  content: "/";
  margin: 0 0.38em;
  font-weight: 400;
  color: var(--hover-line);
}
.marquee.is-live .marquee-track {
  animation: marquee var(--marquee-time, 70s) linear infinite; /* vitesse constante */
  will-change: transform;
}
@keyframes marquee { to { transform: translateX(-100%); } }
/* au clavier : le défilement s'arrête et la ligne devient une liste qu'on parcourt */
.marquee.is-live:focus-within { overflow-x: auto; scrollbar-width: none; }
.marquee.is-live:focus-within .marquee-track { animation: none; }
/* « réduire les animations » : pas de défilement, on fait glisser la ligne soi-même */
.marquee.is-scroll { overflow-x: auto; scrollbar-width: none; }
.marquee.is-scroll .marquee-track { padding: 0 var(--gr) 0 var(--gl); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px var(--gutter);
}
.contact-grid a { transition: opacity 0.2s; overflow-wrap: anywhere; }
.contact-grid a:active { opacity: 0.55; }

/* ---------- Contact ---------- */
.big-mail {
  display: inline-block;
  margin-top: clamp(28px, 5vw, 56px);
  /* sur très petit écran (< 350 px), le texte rétrécit juste assez pour tenir sur une ligne
     (l'adresse mesure 11,7 fois la taille du texte) */
  font-size: min(clamp(26px, 5vw, 76px), calc((100vw - var(--gl) - var(--gr)) / 12.2));
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  border-bottom: 1px solid currentColor;
  transition: opacity 0.2s;
  overflow-wrap: anywhere;
}
.big-mail:active { opacity: 0.55; }
.copy {
  position: relative;
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  transition: color 0.2s, transform 0.16s var(--ease-out);
}
.copy::after { content: ""; position: absolute; inset: -12px -8px; } /* zone de toucher */
.copy:active { transform: scale(0.97); }
.contact-page .contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(56px, 9vw, 120px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- Mentions légales ----------
   Une rubrique par ligne : titre à gauche, texte à droite (empilés sur téléphone). */
.legal section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 8px var(--gutter);
  padding: 14px 0 clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.legal .prose { font-size: 16px; }
.legal .prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hover-line); }
.legal strong { font-weight: 600; }
/* informations encore à remplir : bien visibles tant qu'elles ne sont pas remplacées */
.todo { background: #fff3a8; color: #000; padding: 0 4px; border-radius: 2px; }
@media (max-width: 720px) {
  .legal section { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Page introuvable (404) ---------- */
.notfound-page {
  display: flex;
  flex-direction: column;
  justify-content: center; /* centré dans la hauteur restante, le pied de page reste visible */
}
.notfound-code { margin-bottom: 18px; }
.notfound-page .prose { margin-top: clamp(20px, 3vw, 32px); }
.btn-text--plain::before { content: none; } /* sans le triangle « lecture » */

/* ---------- Bande-démo (fenêtre plein écran) ----------
   Elle s'ouvre en fondu avec un léger grossissement, et se referme plus vite
   qu'elle ne s'ouvre. Les navigateurs plus anciens l'ouvrent simplement sans animation. */
.reel {
  width: min(1200px, 92vw);
  max-width: none;
  max-height: none;
  margin: auto;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity 0.2s var(--ease-out),
    transform 0.2s var(--ease-out),
    overlay 0.2s allow-discrete,
    display 0.2s allow-discrete;
}
.reel[open] {
  opacity: 1;
  transform: none;
  transition-duration: 0.45s;
}
.reel::backdrop {
  background: rgba(0, 0, 0, 0);
  transition:
    background-color 0.2s,
    overlay 0.2s allow-discrete,
    display 0.2s allow-discrete;
}
.reel[open]::backdrop { background: rgba(0, 0, 0, 0.92); transition-duration: 0.45s; }
@starting-style {
  .reel[open] { opacity: 0; transform: scale(0.97); }
  .reel[open]::backdrop { background: rgba(0, 0, 0, 0); }
}
/* ouverte depuis le carrousel : 20 % plus grande (1440 px au lieu de 1200),
   sans jamais dépasser l'écran en largeur ni en hauteur */
.reel.is-large { width: min(1440px, 96vw, calc((100svh - 80px) * 16 / 9)); }
.reel .ph { background: #111; }
/* plein écran : la vidéo occupe tout l'écran, sur fond noir */
.reel .ph:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; border-radius: 0; background: #000; }
.reel-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.65);
}
.reel-tools { display: flex; gap: 22px; }
/* repli quand le navigateur refuse le vrai plein écran : la vidéo occupe toute la fenêtre */
.reel.is-full {
  width: 100vw;
  height: 100svh;
  margin: 0;
  inset: 0;
  background: #000;
}
.reel.is-full .reel-bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  margin: 0;
  padding: 14px var(--gr) 24px var(--gl);
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  background: linear-gradient(rgba(0, 0, 0, 0.6), transparent);
}
.reel.is-full .ph {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #000;
}
.reel-bar button { position: relative; color: #fff; transition: opacity 0.2s; }
.reel-bar button::after { content: ""; position: absolute; inset: -14px -10px; } /* zone de toucher */
.reel-bar button:active { opacity: 0.55; }

/* =========================================================
   SURVOL — uniquement avec une souris
   (sur un écran tactile, un effet de survol resterait « collé » après le toucher)
   ========================================================= */
@media (hover: hover) and (pointer: fine) {
  .nav a:hover,
  .nav button:hover,
  .site-footer a:hover,
  .contact-grid a:hover,
  .cta-mail:hover,
  .btn-text:hover,
  .marquee-track a:hover { opacity: 0.5; }
  .btn:hover { background: transparent; color: var(--fg); }
  /* le bandeau s'arrête sous la souris : on peut lire et cliquer tranquillement */
  .marquee.is-live:hover .marquee-track { animation-play-state: paused; }
  .work:hover .ph,
  .next:hover .next-media .ph { transform: scale(1.02); }
  .back:hover,
  .copy:hover { color: var(--fg); }
  .pl-item:hover { border-color: var(--hover-line); }
  .next:hover .display,
  .big-mail:hover,
  .cta-title:hover { opacity: 0.45; }
  .reel-bar button:hover { opacity: 0.6; }
  .tl-seg:hover .tl-label { opacity: 1; color: var(--fg); }
  .filter:hover { color: var(--fg); }

  /* liens animés : le soulignement se dessine depuis la gauche, et repart vers la droite */
  html.opt-liensAnimes .nav a:hover,
  html.opt-liensAnimes .nav button:hover,
  html.opt-liensAnimes .site-footer a:hover,
  html.opt-liensAnimes .contact-grid a:hover,
  html.opt-liensAnimes .cta-mail:hover,
  html.opt-liensAnimes .btn-text:hover,
  html.opt-liensAnimes .marquee-track a:hover { opacity: 1; }
  html.opt-liensAnimes .nav a:hover,
  html.opt-liensAnimes .nav .play:hover span,
  html.opt-liensAnimes .site-footer a:hover,
  html.opt-liensAnimes .contact-grid a:hover,
  html.opt-liensAnimes .cta-mail:hover,
  html.opt-liensAnimes .btn-text:hover span,
  html.opt-liensAnimes .back:hover {
    background-size: 100% 1px;
    background-position: 0 100%;
  }
  html.opt-liensAnimes .marquee-track a:hover {
    background-size: 100% 0.04em; /* trait proportionnel à la taille des lettres */
    background-position: 0 92%;
  }
}
html.opt-liensAnimes .nav a,
html.opt-liensAnimes .nav .play span,
html.opt-liensAnimes .site-footer a,
html.opt-liensAnimes .contact-grid a,
html.opt-liensAnimes .cta-mail,
html.opt-liensAnimes .btn-text span,
html.opt-liensAnimes .back {
  background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease-out), opacity 0.2s, color 0.2s;
}
html.opt-liensAnimes .marquee-track a {
  background: linear-gradient(currentColor, currentColor) 100% 92% / 0 0.04em no-repeat;
  transition: background-size 0.5s var(--ease-out), opacity 0.2s;
}
html.opt-liensAnimes .nav [aria-current="page"] {
  text-decoration: none;
  background-size: 100% 1px;
  background-position: 0 100%;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 860px) {
  .split,
  .about,
  .group-head,
  .cta,
  .next:has(.next-media:not(:empty)) { grid-template-columns: minmax(0, 1fr); }
  .group-head { gap: 6px; }
  .about-photo { position: static; width: min(100%, 300px); }
  .contact-page .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-label { display: none; } /* la légende sous le carrousel suffit */
}

@media (max-width: 640px) {
  .nav { gap: 10px; font-size: 15px; }
  .nav .play span { display: none; }
  .nav .play::after { inset: -15px -6px -15px -30px; } /* le petit triangle seul : zone de toucher élargie */
  .grid { grid-template-columns: 1fr; }
  .home-intro { max-width: 200px; }
  html.opt-accrocheGrande .home-intro { max-width: none; }
  .contact-page .contact-grid { grid-template-columns: 1fr; }
  .ring-count .tc-total { display: none; } /* place limitée sur téléphone */
  .tl { bottom: calc(48px + var(--safe-b)); }
  .foot-name { display: none; } /* pied de page sur une ligne : ton nom est déjà en haut de la page */
}
@media (max-width: 359px) {
  .tl { bottom: calc(76px + var(--safe-b)); } /* très petit écran : le pied de page tient sur 2 lignes, la timeline remonte */

  /* page projet : la vidéo passe avant la fiche technique (elle est visible dès l'arrivée) */
  #project { display: flex; flex-direction: column; }
  #project > .back { align-self: flex-start; }
  #project > .stage { margin-top: 22px; }
  #project > .facts { order: 1; margin-top: 28px; margin-bottom: 0; }
  #project > .split { order: 2; }
  #project > .next { order: 3; }
  #project > .cta { order: 4; }
}

@media (max-width: 360px) {
  .nav { gap: 8px; font-size: 14px; }
  .site-header { font-size: 15px; }
}

/* téléphone tenu à l'horizontale : on ne garde que l'essentiel autour du carrousel */
@media (max-height: 480px) {
  .home-fields,
  .tl,
  .ring-hint { display: none; }
  html.opt-accrocheGrande .home-role { font-size: 20px; margin-bottom: 0; }
  html.opt-accrocheGrande .home-intro,
  html.opt-accrocheGrande .ring-count { top: calc(var(--header-h) + 2px); }
  html.opt-legendeGrande .ring-caption { top: calc(46% + var(--ch) / 2 + 12px); }
  html.opt-legendeGrande .ring-title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
