/* ---------------------------------------------------------------------------
   Base — socle partagé par tous les thèmes.
   Ne contient aucune décision d'identité : uniquement la mécanique, les
   polices, les états et les surfaces du navigateur.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-100900-0.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("../assets/fonts/bricolage-200800-0.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../assets/fonts/spectral-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../assets/fonts/spectral-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-normal-1.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../assets/fonts/spectral-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../assets/fonts/spectral-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-italic-0.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Anton";
  src: url("../assets/fonts/anton-400-0.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Spline Mono";
  src: url("../assets/fonts/spline-mono-400-0.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Spline Mono";
  src: url("../assets/fonts/spline-mono-500-1.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Le rebond élastique reste, le tirer-pour-recharger s'arrête ici. */
  overscroll-behavior-y: contain;
}

body {
  margin: 0;
  min-height: 100svh;
  overscroll-behavior-y: contain;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

picture {
  display: contents;
}

/* Protection des photos : pas de menu d'enregistrement à l'appui long.
   Le texte reste sélectionnable (aucun user-select:none global). */
img,
picture {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--select-bg, currentColor);
  color: var(--select-ink, Canvas);
}

:focus-visible {
  outline: 2px solid var(--focus, currentColor);
  outline-offset: 3px;
  border-radius: 1px;
}

* {
  scrollbar-color: var(--bar, #777) transparent;
  scrollbar-width: thin;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--skip-bg, #111);
  color: var(--skip-ink, #fff);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus-visible {
  transform: none;
}

/* Conteneur d'image : le LQIP est porté par le parent, l'image le recouvre. */
.frame {
  position: relative;
  overflow: hidden;
  background-color: var(--tint, #1a1a1a);
  background-size: cover;
  background-position: center;
}
.frame img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
}

/* Révélation au défilement : visible par défaut, animée seulement si JS. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--delay, 0ms);
}
.js [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Réglages d'aperçu. */
.no-lightbox [data-lb] {
  cursor: default;
}


.no-intro .intro {
  display: none !important;
}

.no-captions figcaption,
.no-captions .lb-cap,
.no-captions .cap,
.no-captions .cap-no,
.no-captions .cap-row,
.no-captions .fr-cap,
.no-captions .shot-cap,
.no-captions .spread-caption,
.no-captions .tile-cap,
.no-captions .project-hero-cap,
.no-captions .shot figcaption,
.no-captions .plate figcaption,
.no-captions .fr figcaption {
  display: none !important;
}

/* Lightbox commune. */
dialog.lb {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--lb-bg, #0a0a0a);
  color: var(--lb-ink, #f2f2f2);
  overscroll-behavior: contain;
}
dialog.lb::backdrop {
  background: rgb(0 0 0 / 0.6);
}
.lb[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  font-size: 12px;
}
.lb-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 18px;
}
.lb-stage img {
  max-width: 100%;
  max-height: calc(100svh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.lb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px 22px;
  font-size: 12px;
}
.lb button {
  background: none;
  border: 1px solid currentColor;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.lb button:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}


/* Mur */
/* ---------------------------------------------------------------------------
   Mur — archive justifiée. Les images remplissent la largeur, sans carte.
--------------------------------------------------------------------------- */

:root {
  --bg: #111c31;
  --ink: #eae4d6;
  --muted: #9ba7be;
  --rule: color-mix(in srgb, var(--ink) 18%, transparent);
  --tile: #18253d;
  --focus: #eae4d6;
  --select-bg: #eae4d6;
  --select-ink: #111c31;
  --bar: #45536d;
  --note: "Spectral", Georgia, serif;
  --pad: clamp(16px, 2.6vw, 40px);
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Mono", ui-monospace, monospace;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  padding: 0 var(--pad);
}

/* --- Bandeau ------------------------------------------------------------ */

.top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}

.top-name {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.top-role,
.top-year {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.top-mail {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

.top-mail:hover {
  border-color: var(--ink);
}

/* --- Filtres ------------------------------------------------------------ */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: 0.2s ease;
}

.chip span {
  color: color-mix(in srgb, currentColor 60%, transparent);
  font-size: 8.5px;
}

.chip:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 40%, transparent);
}

.chip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip.is-on span {
  color: color-mix(in srgb, currentColor 75%, transparent);
}

.bar-count {
  margin: 0;
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* --- Mur ---------------------------------------------------------------- */

.wall {
  position: relative;
  margin: clamp(14px, 2vw, 24px) calc(var(--pad) * -1) 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.wall[data-laid] {
  display: block;
  height: 0;
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--tile);
  text-decoration: none;
  color: inherit;
}

.wall:not([data-laid]) .tile {
  height: 220px;
}

.wall[data-laid] .tile {
  position: absolute;
  top: 0;
  left: 0;
}

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

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.tile:hover img {
  transform: scale(1.025);
}

.tile-cap {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 2px;
  padding: 26px 10px 9px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.8), transparent);
  font-family: var(--note);
  font-size: 12.5px;
  line-height: 1.35;
  color: #fff;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.tile-cap span:first-child {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgb(255 255 255 / 0.7);
}

.tile:hover .tile-cap,
.tile:focus-visible .tile-cap {
  opacity: 1;
}

/* --- Page série --------------------------------------------------------- */

.serie-head {
  padding: clamp(30px, 5vw, 64px) 0 clamp(18px, 3vw, 32px);
}

.serie-head h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 6.4vw, 88px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.serie-meta {
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.serie-meta p {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.serie-sum {
  font-family: var(--sans) !important;
  font-size: 14.5px !important;
  line-height: 1.65 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: color-mix(in srgb, var(--ink) 82%, transparent) !important;
  max-width: 60ch;
}

.legends {
  margin-top: clamp(40px, 6vw, 70px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.legends h2 {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.legends ol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legends li {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  font-family: var(--note);
  font-size: 13px;
  line-height: 1.4;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}

.cap-no {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  flex: none;
  padding-top: 2px;
}

.next {
  margin-top: clamp(40px, 6vw, 70px);
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.next a {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.next span {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.next strong {
  font-size: clamp(26px, 4vw, 56px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.next a:hover strong {
  color: var(--muted);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(30px, 5vw, 60px);
  padding: 18px 0 26px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.foot p {
  margin: 0;
}

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

.foot a:hover {
  color: var(--ink);
}

/* --- Intro -------------------------------------------------------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  background: var(--bg);
  pointer-events: none;
  animation: intro-out 0.6s cubic-bezier(0.76, 0, 0.24, 1) 0.7s forwards;
}


@keyframes intro-line {
  from {
    transform: scaleX(0);
  }
}

@keyframes intro-out {
  to {
    transform: translateY(-101%);
  }
}

/* --- Adaptations -------------------------------------------------------- */

@media (max-width: 760px) {
  .top-role,
  .foot p:nth-child(2) {
    display: none;
  }

  .top {
    grid-template-columns: 1fr auto;
  }

  .legends ol {
    grid-template-columns: 1fr;
  }

  .serie-meta {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bar {
    gap: 10px;
  }

  .bar-count {
    display: none;
  }
}

/* --- Options du thème --- */

.no-filters .bar {
  display: none;
}

/* --- Mode clair / sombre --- */
html[data-mode="light"] {
  --bg: #ede8dd;
  --ink: #17140f;
  --muted: #5f594d;
  --rule: rgb(23 20 15 / 0.16);
  --tile: #dcd5c7;
  --focus: #17140f;
  --select-bg: #17140f;
  --select-ink: #ede8dd;
  --bar: #b8b1a2;
}

html[data-mode="light"] .tile-cap {
  background: linear-gradient(to top, rgb(23 20 15 / 0.82), transparent);
}

/* --- Intro (reprise) --------------------------------------------------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  color: var(--ink);
  pointer-events: none;
  animation: intro-out 0.65s cubic-bezier(0.76, 0, 0.24, 1) 1.2s forwards;
}

.intro-name {
  margin: 0;
  font-size: clamp(32px, 4.6vw, 62px);
  font-weight: 700;
  letter-spacing: -0.03em;
  animation: intro-rise 0.6s 0.1s both;
}

.intro-line {
  display: block;
  width: min(44vw, 380px);
  height: 1px;
  background: var(--ink);
  transform-origin: left;
  animation: intro-line 0.7s 0.3s both;
}

.intro-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  animation: intro-rise 0.6s 0.45s both;
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes intro-line {
  from {
    transform: scaleX(0);
  }
}

@keyframes intro-out {
  to {
    transform: translateY(-101%);
  }
}

/* --- Sortie d'intro : fondu flou --- */

/* Sortie : le mur se dissout. */
@keyframes intro-out {
  to {
    opacity: 0;
    filter: blur(18px);
  }
}

/* Trois tuiles au lieu d'un filet. */
.intro-line {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  background: var(--ink);
  animation: intro-tile 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.intro-line::before,
.intro-line::after {
  content: "";
  position: absolute;
  top: 0;
  width: 56px;
  height: 56px;
  background: var(--ink);
  animation: intro-tile 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-line::before {
  left: 64px;
  animation-delay: 0.4s;
}

.intro-line::after {
  left: 128px;
  animation-delay: 0.5s;
}

@keyframes intro-tile {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}


/* --- Palettes ----------------------------------------------------------- */



/* Palettes : variantes du mode opposé. */

/* --- Palettes ----------------------------------------------------------- */

html[data-palette="encre"][data-mode="light"] {
  --bg: #ecebe8;
  --tile: #dcdad4;
  --ink: #14130f;
  --muted: #5c594f;
  --rule: rgb(20 19 15 / 0.16);
  --bar: #b6b3a8;
  --select-bg: #14130f;
  --select-ink: #ecebe8;
  --focus: #14130f;
}

html[data-palette="encre"][data-mode="dark"] {
  --bg: #141312;
  --tile: #1e1c1a;
  --ink: #efe9dc;
  --muted: #a9a396;
  --bar: #4b4842;
  --select-bg: #efe9dc;
  --select-ink: #141312;
  --focus: #efe9dc;
}

html[data-palette="vert"][data-mode="light"] {
  --bg: #e6eee6;
  --tile: #d3ded3;
  --ink: #101a13;
  --muted: #4f5f52;
  --rule: rgb(16 26 19 / 0.16);
  --bar: #a2b5a6;
  --select-bg: #101a13;
  --select-ink: #e6eee6;
  --focus: #101a13;
}

html[data-palette="vert"][data-mode="dark"] {
  --bg: #0f1f1a;
  --tile: #16291f;
  --ink: #e8e4d4;
  --muted: #9fb0a2;
  --bar: #3f5a4c;
  --select-bg: #e8e4d4;
  --select-ink: #0f1f1a;
  --focus: #e8e4d4;
}
