/* ==========================================================================
   Site personnel — Romain Michaud

   Matériau : verre sur noir véritable. Le fond est #000, les surfaces sont
   translucides et floutées plutôt que grises, les séparateurs sont des
   filets blancs à faible opacité. Les coins sont généreux et concentriques
   (le rayon extérieur vaut le rayon intérieur plus la marge).

   Deux familles, deux rôles tenus strictement :
     Inter         texte, titres, navigation
     JetBrains Mono tout ce qui est chiffre ou donnée — dates, décomptes,
                   numéros de vue, raccourcis clavier

   Contrastes vérifiés sur noir : texte 19,3:1, secondaire 8,2:1,
   tertiaire 5,8:1, bleu 7,0:1.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/mono.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #000;

  /* Surfaces : de la lumière posée sur le noir, pas des gris opaques. */
  --fill-1: rgb(255 255 255 / 5%);
  --fill-2: rgb(255 255 255 / 9%);
  --fill-3: rgb(255 255 255 / 14%);
  --separator: rgb(255 255 255 / 11%);
  --glass: rgb(16 16 18 / 72%);

  --label:   #f5f5f7;
  --label-2: #a1a1a6;
  --label-3: #86868b;

  --blue:    #2997ff;
  --blue-up: #6cb6ff;
  --on-blue: #00142e;

  --danger: #ff6b6b;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;
  --text-lg:   1.0625rem;
  --text-xl:   1.3125rem;
  --text-2xl:  1.75rem;
  --text-3xl:  clamp(2rem, 1.4rem + 2.6vw, 3.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Rayons concentriques : --r-lg = --r-md + le padding qui les sépare. */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 980px;

  --container: 80rem;
  --measure:   38rem;
  --gutter:    clamp(1rem, 0.4rem + 2.4vw, 2.5rem);

  --fast: 0.18s;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);   /* courbe de sortie d'Apple */
}

/* --- Base ----------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: 1.6;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  margin: 0 0 var(--space-3);
  font-weight: 600;
  line-height: 1.07;
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); letter-spacing: -0.035em; font-weight: 650; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.025em; }
h3 { font-size: var(--text-lg); letter-spacing: -0.015em; }

p { margin: 0 0 1.15em; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--r-sm); }

::selection { background: var(--blue); color: #fff; }

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

/* Toute donnée chiffrée passe en mono : c'est la couche technique. */
.meta, .num, .album-card__meta, .year-group__count,
.carousel__counter, .photo-grid__item::after {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* --- Mise en page --------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--measure) + var(--gutter) * 2); }

main { padding-block: var(--space-7) var(--space-8); min-height: 60vh; }

.stack > * + * { margin-top: 1.1em; }

.full-bleed { width: 100vw; max-width: 100vw; margin-left: 50%; translate: -50% 0; }

hr.rule { border: 0; border-top: 1px solid var(--separator); margin-block: var(--space-7); }

/* --- En-tête : barre de verre --------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--separator);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  min-height: 52px;
  flex-wrap: wrap;
}

.brand {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--label);
}
.brand:hover { color: var(--label); text-decoration: none; }
.brand span { color: var(--blue); }

.nav { display: flex; gap: var(--space-1); flex-wrap: wrap; }

.nav a {
  color: var(--label-2);
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  transition: color var(--fast), background-color var(--fast);
}
.nav a:hover { color: var(--label); background: var(--fill-1); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--label); background: var(--fill-2); }

/* --- Pied de page --------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--separator);
  padding-block: var(--space-6);
  color: var(--label-3);
  font-size: var(--text-sm);
}
.site-footer__inner {
  display: flex; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
}

/* --- Texte ---------------------------------------------------------------- */

.page-head { margin-bottom: var(--space-6); }
.page-head p { color: var(--label-2); max-width: var(--measure); }
.page-head > *:last-child { margin-bottom: 0; }

.lede { font-size: var(--text-lg); color: var(--label-2); max-width: var(--measure); }

.eyebrow { font-size: var(--text-sm); margin-bottom: var(--space-3); }
.eyebrow a { color: var(--label-2); }
.eyebrow a:hover { color: var(--blue); text-decoration: none; }

.meta { color: var(--label-3); font-size: var(--text-sm); }

/* --- Accueil : la pellicule ------------------------------------------------
   Une bande de 35 mm, aux proportions réelles du format : sur 35 mm de haut,
   l'image en occupe 24, et il reste 5,5 mm de perforations de chaque côté.
   Tout est exprimé en fraction de --h, la hauteur de la bande, pour que la
   géométrie tienne à n'importe quelle taille.

       0 %  ┬ ─────────────────────  perforations   15,7 %
     15,7 % ┼ ─────────────────────  marquage de rive 2,5 %
     18,2 % ┼ ─────────────────────
            │        l'image                        63,6 %
     81,8 % ┼ ─────────────────────
            ┴ ─────────────────────  (symétrique)
   -------------------------------------------------------------------------- */

.pellicule {
  --h: clamp(15rem, 44vh, 25rem);
  --perf: 0.157;        /* hauteur d'une bande de perforations */
  --rive: 0.025;        /* bande de marquage, entre perfo et image */

  position: relative;
  height: var(--h);
  overflow: hidden;
  margin-top: var(--space-7);
  /* Les bords s'effacent : la bande vient de plus loin que l'écran. */
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.pellicule[hidden] { display: none; }

.pellicule__piste {
  /* Indispensable : sans lui, les perforations se calent sur le cadre visible
     et restent immobiles pendant que les images défilent. */
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  padding-block: calc(var(--h) * (var(--perf) + var(--rive)));
  gap: calc(var(--h) * 0.014);          /* l'interimage */
  background: #0c0c0e;
  animation: defile var(--duree, 600s) linear infinite;
}

@keyframes defile {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Les perforations, percées jusqu'au noir de la page. Le motif est un
   rectangle arrêté aux cotes du format : pas de 4,75 mm, trou de 1,98 × 2,79. */
.pellicule__piste::before,
.pellicule__piste::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: calc(var(--h) * var(--perf));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4.75' height='5.5'%3E%3Crect x='1.385' y='1.355' width='1.98' height='2.79' rx='.45' fill='%23000'/%3E%3C/svg%3E");
  background-size: calc(var(--h) * 0.1357) 100%;
  background-repeat: repeat-x;
}
.pellicule__piste::before { top: 0; }
.pellicule__piste::after  { bottom: 0; }

.vue {
  position: relative;
  flex: none;
  height: 100%;
  aspect-ratio: 3 / 2;                  /* 36 × 24 mm */
  background: #000;
  overflow: visible;
  text-decoration: none;
}
.vue img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* La bande au repos est en retrait ; le survol la révèle. */
  opacity: 0.62;
  transition: opacity 0.4s var(--ease), filter 0.4s var(--ease);
}
.vue:hover img,
.vue:focus-visible img { opacity: 1; }

/* Marquage de rive : numéro de vue à gauche, millésime à droite, dans la
   bande claire qui sépare l'image des perforations. */
.vue__rive {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + var(--h) * 0.004);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  /* Un marquage de rive est minuscule sur une vraie pellicule, mais il doit
     rester lisible sur un téléphone : plancher à 9 px. */
  font-size: max(0.5625rem, calc(var(--h) * 0.026));
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--blue);
  pointer-events: none;
}

.vue__nom {
  position: absolute;
  inset: auto 0 calc(100% + var(--h) * 0.03);
  font-size: var(--text-sm);
  color: var(--label);
  text-align: center;
  opacity: 0;
  transition: opacity var(--fast);
  pointer-events: none;
}
.vue:hover .vue__nom,
.vue:focus-visible .vue__nom { opacity: 1; }

/* La bande s'arrête sous le pointeur ou sous le focus : on la regarde. */
.pellicule:hover .pellicule__piste,
.pellicule.est-arretee .pellicule__piste { animation-play-state: paused; }

/* --- Accueil : le relevé --------------------------------------------------- */

.releve {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-5);
  margin-top: var(--space-6);
  padding-inline: var(--gutter);
}
.releve > * {
  padding-left: var(--space-5);
  border-left: 1px solid var(--separator);
}
.releve > *:first-child { padding-left: 0; border-left: 0; }

.releve b {
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--label);
}
.releve span { color: var(--label-3); font-size: var(--text-sm); }

.releve__lien { margin-left: auto; }

/* --- Galerie -------------------------------------------------------------- */

.year-group {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: var(--space-5);
  padding-block: var(--space-5);
  border-top: 1px solid var(--separator);
}
.year-group:first-child { border-top: 0; padding-top: 0; }

.year-group__title {
  position: sticky; top: 68px; align-self: start;
  margin: 0;
  font-family: var(--mono);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--label-2);
  letter-spacing: -0.02em;
}
.year-group__count {
  display: block;
  font-size: var(--text-xs);
  color: var(--label-3);
  margin-top: var(--space-1);
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-5) var(--space-4);
}

.album-card { display: block; color: inherit; }
.album-card:hover { color: inherit; text-decoration: none; }

.album-card__frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--fill-1);
  transition: transform var(--fast) var(--ease);
}
.album-card:hover .album-card__frame { transform: scale(1.02); }
.album-card__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.album-card:hover .album-card__img { transform: scale(1.05); }

.album-card__body { padding-top: var(--space-3); }
.album-card__title {
  font-size: var(--text-sm);
  font-weight: 590;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--label);
}
.album-card__meta { font-size: var(--text-xs); color: var(--label-3); margin-top: 2px; }

/* --- Album : planche-contact ---------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 1.6rem var(--space-2);
  counter-reset: vue;
}

.photo-grid__item {
  position: relative;
  padding: 0; border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--fill-1);
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  transition: transform var(--fast) var(--ease);
}
.photo-grid__item img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid__item:hover { transform: scale(1.04); z-index: 2; }

.photo-grid__item::after {
  counter-increment: vue;
  content: counter(vue);
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 2px;
  font-size: 0.6875rem;
  color: var(--label-3);
}
.photo-grid__item:hover::after { color: var(--blue); }

/* --- Galerie IA ----------------------------------------------------------- */

.ia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 28rem), 1fr));
  gap: var(--space-6) var(--space-5);
  align-items: start;
}
.ia-card { margin: 0; }

.ia-card__button {
  display: block; width: 100%; padding: 0; border: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--fill-1);
  cursor: zoom-in;
  transition: transform var(--fast) var(--ease);
}
.ia-card__button:hover { transform: scale(1.01); }
.ia-card__button img { width: 100%; height: 100%; object-fit: cover; }

.ia-card__caption {
  display: flex; align-items: baseline; gap: var(--space-3);
  flex-wrap: wrap; margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.ia-card__title { font-weight: 590; color: var(--label); letter-spacing: -0.012em; }

/* --- Étiquettes et boutons ------------------------------------------------ */

.tag {
  font-family: var(--mono);
  font-size: var(--text-xs);
  color: var(--label-3);
  padding: 2px var(--space-2);
  border-radius: var(--r-sm);
  background: var(--fill-1);
}
.tag-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

.tag-filter {
  display: flex; gap: var(--space-2); flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.tag-filter button {
  font: inherit; font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  border: 0; border-radius: var(--r-pill);
  background: var(--fill-1);
  color: var(--label-2);
  cursor: pointer;
  transition: background-color var(--fast), color var(--fast);
}
.tag-filter button:hover { background: var(--fill-2); color: var(--label); }
.tag-filter button[aria-pressed="true"] { background: var(--label); color: #000; }

.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  border: 0; border-radius: var(--r-pill);
  background: var(--fill-2);
  color: var(--label);
  font: inherit; font-size: var(--text-sm); font-weight: 500;
  cursor: pointer;
  transition: background-color var(--fast);
}
.btn:hover { background: var(--fill-3); text-decoration: none; }
.btn--accent { background: var(--blue); color: #fff; }
.btn--accent:hover { background: var(--blue-up); }
.btn-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }

.card {
  display: block;
  padding: var(--space-5);
  border-radius: var(--r-lg);
  background: var(--fill-1);
  color: inherit;
  transition: background-color var(--fast);
}
a.card:hover { background: var(--fill-2); text-decoration: none; color: inherit; }
.card h3 { color: var(--label); }
.card > *:last-child { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-4);
}

/* --- Portraits et carnet -------------------------------------------------- */

.portrait-photos { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-6); }
.portrait-photos img {
  height: 150px; width: auto;
  border-radius: var(--r-md);
  background: var(--fill-1);
}

.portrait-index, .note-list { list-style: none; padding: 0; margin: 0; }
.portrait-index li, .note-item {
  border-top: 1px solid var(--separator);
  padding: var(--space-4) 0;
}
/* Chaque entrée s'ouvre sur le visage dont on parle : vignette au format
   d'une photo d'identité, le nom, puis la date rejetée à droite. */
.portrait-index a {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--label-2);
}
.portrait-index a:hover { color: var(--label-2); text-decoration: none; }
.portrait-index b { font-weight: 590; color: var(--label); }
.portrait-index a:hover b { color: var(--blue); }

.portrait-index img {
  width: 100%;
  /* Sans height:auto, l'attribut height du HTML impose sa hauteur d'origine
     et le ratio ci-dessous n'a aucun effet. */
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;   /* garder le visage, rogner le menton */
  border-radius: var(--r-md);
  background: var(--fill-1);
  /* Ces photos de 2003 sont déjà très sombres : le gris les calme, mais
     les voiler davantage les rendrait illisibles. */
  filter: grayscale(1);
  opacity: 0.88;
  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease);
}
.portrait-index a:hover img,
.portrait-index a:focus-visible img { filter: none; opacity: 1; }

.note-item__title { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.note-item__title a { color: var(--label); }
.note-item__title a:hover { color: var(--blue); text-decoration: none; }
.note-item__summary { color: var(--label-2); margin: var(--space-2) 0; max-width: var(--measure); }

/* --- Article -------------------------------------------------------------- */

.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-7); }
.prose h3 { margin-top: var(--space-6); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: var(--space-2); }
.prose blockquote {
  margin: var(--space-5) 0; padding-left: var(--space-4);
  border-left: 2px solid var(--blue); color: var(--label-2);
}
.prose code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--fill-1); border-radius: var(--r-sm);
  padding: 0.12em 0.4em;
}
.prose pre {
  background: var(--fill-1); border-radius: var(--r-md);
  padding: var(--space-4); overflow-x: auto;
  font-size: var(--text-sm); line-height: 1.65;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

/* --- Visionneuse : barre de verre flottante -------------------------------- */

.carousel {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: 1fr auto;
  background: rgb(0 0 0 / 96%);
  backdrop-filter: blur(30px);
  touch-action: pan-y;
}
.carousel[hidden] { display: none; }

.carousel__bar {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--r-pill);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--separator);
  color: var(--label-2);
  font-size: var(--text-sm);
  max-width: calc(100vw - 2rem);
}
.carousel__title {
  font-weight: 590; color: var(--label);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carousel__counter { color: var(--label-3); white-space: nowrap; }

.carousel__stage {
  position: relative; display: grid; place-items: center;
  overflow: hidden; padding: var(--space-8) var(--space-4) var(--space-4);
  min-height: 0;
}
.carousel__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: var(--r-md);
  user-select: none; -webkit-user-drag: none;
  transition: opacity 0.1s linear;
}
.carousel__img.is-swapping { opacity: 0.25; }

.carousel__nav {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-pill);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--label);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  transition: background-color var(--fast), opacity var(--fast);
}
.carousel__nav:hover { background: var(--fill-3); }
.carousel__nav[disabled] { opacity: 0.2; cursor: default; }
.carousel__nav--prev { left: var(--space-4); }
.carousel__nav--next { right: var(--space-4); }

.carousel__close {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-pill);
  background: var(--fill-2);
  color: var(--label);
  cursor: pointer; font-size: 1.05rem; line-height: 1;
  flex-shrink: 0;
}
.carousel__close:hover { background: var(--fill-3); }

.carousel__filmstrip {
  display: flex; gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
  scrollbar-width: thin;
}
.carousel__thumb {
  flex: 0 0 auto;
  width: 64px; height: 64px;
  padding: 0; border: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--fill-1);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--fast), outline-color var(--fast);
  outline: 2px solid transparent; outline-offset: -2px;
}
.carousel__thumb img { width: 100%; height: 100%; object-fit: cover; }
.carousel__thumb:hover { opacity: 0.75; }
.carousel__thumb[aria-current="true"] { opacity: 1; outline-color: var(--blue); }

@media (max-width: 40rem) {
  .carousel__filmstrip { display: none; }
  .carousel__title { max-width: 40vw; }
}

/* --- Palette de commandes --------------------------------------------------
   Ouverte par ⌘K, Ctrl+K ou « / ». Panneau de verre centré, navigation au
   clavier seul. C'est la seule pièce volontairement démonstrative du site. */

.palette-hint {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  background: var(--fill-1);
  color: var(--label-3);
  font-size: var(--text-xs);
  cursor: pointer; border: 0;
  transition: background-color var(--fast), color var(--fast);
}
.palette-hint:hover { background: var(--fill-2); color: var(--label-2); }

kbd {
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--fill-2);
  color: var(--label-2);
}

.palette { position: fixed; inset: 0; z-index: 200; display: grid; }
.palette[hidden] { display: none; }

.palette__scrim {
  position: absolute; inset: 0;
  background: rgb(0 0 0 / 55%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 0; padding: 0;
  cursor: default;
}

.palette__panel {
  position: relative;
  justify-self: center;
  align-self: start;
  margin-top: min(16vh, 9rem);
  width: min(38rem, calc(100vw - 2rem));
  max-height: min(60vh, 32rem);
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  background: rgb(22 22 24 / 86%);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--separator);
  box-shadow: 0 24px 60px rgb(0 0 0 / 60%);
  overflow: hidden;
  animation: palette-in 0.2s var(--ease) both;
}

@keyframes palette-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
}

.palette__input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 0; border-bottom: 1px solid var(--separator);
  background: none;
  color: var(--label);
  font: inherit; font-size: var(--text-lg);
  letter-spacing: -0.015em;
}
.palette__input::placeholder { color: var(--label-3); }
.palette__input:focus { outline: 0; }

.palette__list {
  list-style: none; margin: 0;
  padding: var(--space-2);
  overflow-y: auto;
}

.palette__item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  color: var(--label);
  font-size: var(--text-sm);
  cursor: pointer;
}
.palette__item[aria-selected="true"] { background: var(--fill-2); }
.palette__item:hover { background: var(--fill-1); }

.palette__thumb {
  width: 34px; height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--fill-1);
  flex-shrink: 0;
}
.palette__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__side { font-family: var(--mono); font-size: var(--text-xs); color: var(--label-3); white-space: nowrap; }

.palette__empty { padding: var(--space-5); color: var(--label-3); font-size: var(--text-sm); }

.palette__footer {
  display: flex; gap: var(--space-4); flex-wrap: wrap;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--separator);
  color: var(--label-3);
  font-size: var(--text-xs);
}

/* --- États ---------------------------------------------------------------- */

.state { padding: var(--space-7) 0; color: var(--label-3); }
.state--error { color: var(--danger); }

.notice {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--r-md);
  background: var(--fill-1);
  color: var(--label-2);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  max-width: var(--measure);
}
.notice p { margin: 0; }

.todo {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  background: var(--fill-1);
  border-left: 2px solid var(--blue);
  color: var(--label-2);
  font-size: var(--text-sm);
}

/* --- Petits écrans et mouvement réduit ------------------------------------ */

@media (max-width: 42rem) {
  .year-group { grid-template-columns: 1fr; gap: var(--space-3); }
  .year-group__title { position: static; }
  .year-group__count { display: inline; margin-left: var(--space-2); }
  .pellicule { --h: clamp(11rem, 34vh, 15rem); }
  /* La date passe sous le nom plutôt que de comprimer la colonne du milieu. */
  .portrait-index a { grid-template-columns: 3.5rem 1fr; }
  .portrait-index .meta { grid-column: 2; }
  /* Le lien passe à la ligne : son filet de séparation n'a plus de sens. */
  .releve__lien { margin-left: 0; padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .photo-grid__item:hover,
  .album-card:hover .album-card__frame, .ia-card__button:hover { transform: none; }

  /* La bande ne défile plus d'elle-même : elle se fait défiler à la main. */
  .pellicule { overflow-x: auto; mask-image: none; }
  .pellicule__piste { animation: none !important; transform: none !important; }
  .vue img { opacity: 1; }
}
