/* ---------------------------------------------------------------------------
   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;
  }
}


/* Mosaïque */
/* ---------------------------------------------------------------------------
   Mosaïque — une composition plein écran, recomposée selon le nombre d'images.
--------------------------------------------------------------------------- */

:root {
  --sage: #d8ddd2;
  --ink: #12140f;
  --muted: #4e5548;
  --rule: #b4bca9;
  --tile: #c7cdbe;
  --focus: #12140f;
  --select-bg: #12140f;
  --select-ink: #d8ddd2;
  --bar: #99a28d;
  --pad: clamp(14px, 2.4vw, 36px);
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Mono", ui-monospace, monospace;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  padding: 0 var(--pad);
  background: var(--sage);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

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

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

.top-name {
  font-size: 13.5px;
  font-weight: 600;
  font-stretch: 84%;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
}

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

.top-mail {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}

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

/* --- Scène -------------------------------------------------------------- */

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}

.stage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 46px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.meta {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.projects {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

.proj {
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: none;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  cursor: pointer;
}

.proj span {
  margin-left: 5px;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
}

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

.proj.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sage);
}

.panels {
  flex: 1;
  min-height: 0;
}

.panel {
  display: none;
  height: 100%;
  min-height: 0;
}

.panel.is-on {
  display: block;
}

/* --- Mosaïque ----------------------------------------------------------- */

.mosaic {
  height: 100%;
  min-height: 0;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
}

.mosaic[data-count="2"] {
  grid-template-columns: 1fr 1fr;
}

.mosaic[data-count="3"] {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mosaic[data-count="3"] .tile:first-child {
  grid-row: 1 / span 2;
}

.mosaic[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mosaic[data-count="5"] {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mosaic[data-count="5"] .tile:first-child {
  grid-row: 1 / span 2;
}

.mosaic[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--tile);
  text-decoration: none;
  box-shadow: 10px 14px 34px rgb(0 0 0 / 0.16);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.tile:nth-child(3n + 1) {
  --tilt: -1.1deg;
}

.tile:nth-child(3n + 2) {
  --tilt: 0.7deg;
}

.tile:nth-child(3n) {
  --tilt: 1.4deg;
}

.tile:hover {
  transform: rotate(0deg) scale(1.01);
}

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

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

.tile-no {
  position: absolute;
  left: 8px;
  top: 7px;
  padding: 2px 4px;
  background: rgb(0 0 0 / 0.45);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  color: #fff;
}

.cap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.cap {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 1.45em;
}

.more {
  flex: none;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

.more[hidden] {
  display: none;
}

/* --- Pied --------------------------------------------------------------- */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.foot p {
  margin: 0;
}

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

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

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

.serie {
  padding: clamp(28px, 4vw, 56px) 0 clamp(30px, 5vw, 60px);
}

.serie-head {
  max-width: 980px;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.serie-head h1 {
  margin: 0 0 10px;
  font-size: clamp(36px, 6vw, 82px);
  font-weight: 600;
  font-stretch: 76%;
  line-height: 0.9;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.serie-meta {
  margin: 0 0 16px;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.serie-sum {
  margin: 0;
  max-width: 58ch;
  font-size: 14.5px;
  line-height: 1.65;
}

/* Colonnes plutôt que grille : avec des verticales et des horizontales
   mélangées, une grille laisserait de grands vides sous les images courtes. */
.plates {
  columns: 2;
  column-gap: clamp(12px, 1.6vw, 20px);
}

.plate {
  break-inside: avoid;
  margin: 0 0 clamp(16px, 2.4vw, 30px);
}

.plate-img {
  display: block;
  aspect-ratio: var(--ar);
}

.plate-link {
  display: block;
}

.plate-link:hover .plate-img {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.plate figcaption {
  display: flex;
  gap: 8px;
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
  color: var(--muted);
}

.plate-no {
  color: var(--ink);
  flex: none;
}

.next {
  margin-top: clamp(30px, 5vw, 60px);
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

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

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

.next strong {
  font-size: clamp(24px, 3.6vw, 48px);
  font-weight: 600;
  font-stretch: 78%;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

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

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

.intro {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--sage);
  pointer-events: none;
  animation: intro-out 0.55s cubic-bezier(0.76, 0, 0.24, 1) 0.45s forwards;
}


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

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

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

@media (max-width: 760px) {
  .top {
    grid-template-columns: 1fr auto;
  }

  .top-role {
    display: none;
  }

  .stage-head {
    gap: 10px;
  }

  .projects {
    gap: 10px;
  }

  .mosaic,
  .mosaic[data-count="3"],
  .mosaic[data-count="5"],
  .mosaic[data-count="6"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
  }

  .mosaic[data-count="1"] {
    grid-template-rows: 1fr;
  }

  .mosaic[data-count="2"] {
    grid-template-rows: 1fr;
  }

  .mosaic[data-count="3"] .tile:first-child,
  .mosaic[data-count="5"] .tile:first-child {
    grid-row: auto;
  }

  .mosaic[data-count="3"] .tile:nth-child(3),
  .mosaic[data-count="5"] .tile:nth-child(5) {
    grid-column: 1 / -1;
  }

  .plates {
    columns: 1;
  }

  .cap-row {
    flex-direction: column;
    gap: 6px;
  }
}

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

.no-projects .projects {
  display: none;
}

.no-legend .cap {
  display: none;
}

/* --- Mode clair / sombre --- */
html[data-mode="dark"] {
  --sage: #14170f;
  --ink: #e9ebdd;
  --muted: #9aa18c;
  --rule: #2e3326;
  --tile: #1d2117;
  --focus: #e9ebdd;
  --select-bg: #e9ebdd;
  --select-ink: #14170f;
  --bar: #4a4f3f;
}

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

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

.intro-squares {
  display: flex;
  gap: 6px;
}

.intro-squares span {
  width: clamp(24px, 3.4vw, 42px);
  aspect-ratio: 1;
  background: var(--ink);
  animation: intro-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.intro-squares span:nth-child(2) {
  animation-delay: 0.08s;
}

.intro-squares span:nth-child(3) {
  animation-delay: 0.16s;
}

.intro-name {
  margin: 0;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  animation: intro-rise 0.6s 0.3s both;
}

@keyframes intro-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

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

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

/* --- Sortie d'intro : fondu qui s'éloigne --- */

/* Sortie : la composition se dissout en s'éloignant. */
@keyframes intro-out {
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}


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



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

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

html[data-palette="sable"][data-mode="light"] {
  --sage: #ded7c7;
  --tile: #cec4b0;
  --ink: #15130e;
  --muted: #55503f;
  --rule: #bcb29c;
}

html[data-palette="sable"][data-mode="dark"] {
  --sage: #1c150c;
  --tile: #282016;
  --ink: #ede6d6;
  --muted: #a89a83;
  --rule: #38301f;
}

html[data-palette="ciel"][data-mode="light"] {
  --sage: #d4dde3;
  --tile: #c3cfd8;
  --ink: #10151a;
  --muted: #4a5560;
  --rule: #b2bfc9;
}

html[data-palette="ciel"][data-mode="dark"] {
  --sage: #0f1620;
  --tile: #182230;
  --ink: #e4ecf2;
  --muted: #8fa0ad;
  --rule: #26313a;
}
