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


/* Vitrine */
/* ---------------------------------------------------------------------------
   Vitrine — un écran, une image, une bande de vignettes.
--------------------------------------------------------------------------- */

:root {
  --paper: #f3f1ec;
  --ink: #14130f;
  --muted: #6d6a61;
  --rule: #d5d1c6;
  --mount: #fbfaf6;
  --photo-bg: #e5e1d6;
  --focus: #14130f;
  --select-bg: #14130f;
  --select-ink: #f3f1ec;
  --bar: #c4c0b3;
  --pad: clamp(16px, 3vw, 40px);
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --note: "Spectral", Georgia, 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(--paper);
  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: 16px 0;
  border-bottom: 1px solid var(--ink);
}

.top-name {
  font-size: 14px;
  font-weight: 600;
  font-stretch: 86%;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-decoration: none;
}

.top-role,
.top-mail {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  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 -------------------------------------------------------------- */

.showcase {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 16px 0;
}

.tabs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tab {
  border: 0;
  background: none;
  padding: 0 0 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.tab span {
  margin-left: 6px;
  color: color-mix(in srgb, currentColor 50%, transparent);
}

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

.tab.is-on {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

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

.panel-wrap {
  display: none;
  width: 100%;
  flex: 1;
  min-height: 0;
}

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

.panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
}

/* Grande fenêtre : toujours horizontale. La photo s'y recadre. */
.case {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: min(62svh, 660px);
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--mount);
  overflow: hidden;
}

/* La fenêtre en arche est fixe ; les photos glissent dedans. */
.case-window {
  position: absolute;
  inset: 14px;
  overflow: hidden;
  border-radius: 50% 50% 0 0 / 18% 18% 0 0;
  background: var(--photo-bg);
}

.hero {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--photo-bg);
}

.case-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
}

.case-cap {
  margin: 0;
  font-family: var(--note);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.case-count {
  margin: 0;
  flex: none;
  font-family: var(--note);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.case-count [data-index] {
  color: var(--ink);
}

.rail {
  display: flex;
  justify-content: safe center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

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

.thumb {
  flex: none;
  width: 74px;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

/* Vignettes uniformes : la photo est recadrée dans le carré. */
.thumb-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.thumb:hover {
  opacity: 0.85;
}

.thumb.is-on {
  opacity: 1;
  border-color: var(--ink);
}

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

.showcase--single {
  justify-content: flex-start;
  gap: 18px;
}

.single-head {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}

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

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

.showcase--single .panel {
  flex: 1;
}

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

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9px;
  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);
}

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

.intro {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--paper);
  pointer-events: none;
  animation: intro-out 0.55s cubic-bezier(0.76, 0, 0.24, 1) 0.5s 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;
  }

  .showcase {
    padding: 12px 0;
    gap: 10px;
    justify-content: flex-start;
  }

  .case {
    padding: 10px;
  }

  .panel {
    grid-template-rows: auto auto auto;
    align-content: start;
  }

  .case {
    height: min(62vw, 300px);
  }

  .thumb {
    width: 56px;
  }

  .case-cap {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .showcase--single .case {
    height: min(62vw, 300px);
  }
}

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

.no-thumbs .rail {
  display: none;
}


/* --- Mode clair / sombre --- */
html[data-mode="dark"] {
  --paper: #121311;
  --ink: #f0ece2;
  --muted: #a29c8e;
  --rule: #33342e;
  --mount: #1a1b18;
  --photo-bg: #24251f;
  --focus: #f0ece2;
  --select-bg: #f0ece2;
  --select-ink: #121311;
  --bar: #4a4a44;
}

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

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

.intro-name {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 58px);
  font-weight: 500;
  letter-spacing: -0.03em;
  animation: intro-rise 0.6s 0.1s both;
}

.intro-line {
  display: block;
  width: min(38vw, 320px);
  height: 1px;
  background: var(--ink);
  transform-origin: center;
  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 : iris qui se ferme --- */

/* Sortie : iris, comme une vitrine qu'on ferme. */
@keyframes intro-out {
  from {
    clip-path: circle(120% at 50% 50%);
  }
  to {
    clip-path: circle(0% at 50% 50%);
  }
}

/* Une arche pleine au lieu d'un filet. */
.intro-line {
  display: block;
  width: clamp(66px, 7vw, 96px);
  height: clamp(88px, 9vw, 128px);
  background: var(--ink);
  border-radius: 50% 50% 0 0 / 42% 42% 0 0;
  transform-origin: center bottom;
  animation: intro-arch 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes intro-arch {
  from {
    opacity: 0;
    transform: scaleY(0.15);
  }
}

/* --- Flèches de la grande vue ------------------------------------------- */

.case-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.case:hover .case-nav,
.case-nav:focus-visible {
  opacity: 1;
}

.case-nav:hover {
  background: var(--ink);
  color: var(--paper);
}

.case-nav--prev {
  left: 26px;
}

.case-nav--next {
  right: 26px;
}

/* --- Toutes les photos (index) ------------------------------------------ */

.showcase:has(.series) {
  justify-content: flex-start;
}

/* La page défile : le panneau grandit avec la série. */
.panel:has(.series) {
  height: auto;
  grid-template-rows: auto auto auto auto;
}

.panel-wrap:has(.series) {
  flex: none;
}

.panel-wrap,
.panel,
.series,
.series-grid,
.series-item {
  min-width: 0;
}

.series {
  margin-top: 28px;
  padding: 22px 0 8px;
  border-top: 1px solid var(--rule);
}

.series-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.series-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.series-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* Colonnes plutôt que grille : chaque photo garde son format entier, et une
   verticale ne laisse pas de trou sous une horizontale. */
.series-grid {
  columns: 3;
  column-gap: 14px;
}

.series-item {
  break-inside: avoid;
  margin: 0 0 18px;
}

.series-item button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

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

.series-item figcaption {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .series-grid {
    columns: 2;
  }
}

@media (max-width: 900px) {
  .series-grid {
    columns: 1;
  }
}

/* --- Glissement du diaporama -------------------------------------------- */

.hero--ghost {
  display: none;
  z-index: 1;
  pointer-events: none;
}

.hero--ghost.is-on {
  display: block;
}

/* --- Nom du projet sur le diaporama ------------------------------------- */

.case-label {
  position: absolute;
  bottom: 30px;
  left: 30px;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 10px 14px;
  background: rgb(18 18 16 / 0.72);
  color: #ffffff;
  text-decoration: none;
}

.case-label-name {
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.case-label-meta {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(255 255 255 / 0.72);
}

.case-label:hover .case-label-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .case-label {
    bottom: 14px;
    left: 14px;
    padding: 8px 11px;
  }
}


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



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

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

html[data-palette="sable"][data-mode="light"] {
  --paper: #efe7d7;
  --mount: #faf6ec;
  --photo-bg: #e2d8c4;
  --ink: #17140f;
  --muted: #6d6659;
  --rule: #d8d0bf;
}

html[data-palette="sable"][data-mode="dark"] {
  --paper: #191410;
  --mount: #241d15;
  --photo-bg: #2a251c;
  --ink: #f2ecdf;
  --muted: #b0a48f;
  --rule: #3a352b;
}

html[data-palette="ardoise"][data-mode="light"] {
  --paper: #e9e9e6;
  --mount: #f7f7f4;
  --photo-bg: #dcdcd6;
  --ink: #14130f;
  --muted: #646158;
  --rule: #d5d1c6;
}

html[data-palette="ardoise"][data-mode="dark"] {
  --paper: #12161a;
  --mount: #1b2026;
  --photo-bg: #24272a;
  --ink: #f0eee9;
  --muted: #a3a29c;
  --rule: #34363a;
}
