/* ==========================================================
   Portfolio — feuille de style
   Noir et blanc. Les couleurs sont dans les variables ci-dessous.
   ========================================================== */

:root {
  --paper: #FFFFFF;   /* fond */
  --ink:   #000000;   /* texte */
  --muted: #6B6B6B;   /* texte secondaire */
  --rule:  #E2E2E2;   /* filets */

  --serif: "Instrument Serif", "Times New Roman", Times, serif;
  --sans:  "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.75rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: clamp(1.5rem, 2.4vw, 2rem);
  --step-3: clamp(2rem, 4vw, 3.25rem);
  --step-index: clamp(2rem, 4.2vw, 3.75rem);
  --step-hero: clamp(2.5rem, 5vw, 4.5rem);

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-style: italic; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: .5rem 1rem; z-index: 10; text-decoration: none;
}
.skip:focus { top: .75rem; }

/* Petites mentions en exposant, comme (P,D) sur le moodboard */
sup {
  font-family: var(--sans);
  font-style: normal;
  font-size: .2em;
  font-size: max(.2em, 0.6875rem);
  letter-spacing: .02em;
  vertical-align: top;
  position: relative;
  top: .35em;
  margin-left: .35em;
  line-height: 1;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: var(--step--1);
}
.brand { font-weight: 500; text-decoration: none; }
.site-header ul { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Ouverture ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
}
.hero-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-hero);
  line-height: .95;
  letter-spacing: -0.02em;
}
.hero-name em { display: block; }
.hero-text {
  display: grid;
  grid-template-columns: minmax(0, 34rem) auto;
  justify-content: space-between; align-items: end;
  gap: 1.5rem 3rem;
  margin-top: clamp(1.5rem, 4vw, 3rem);
}
.hero-intro { font-size: var(--step-1); line-height: 1.45; }
.hero-status { color: var(--muted); font-size: var(--step--1); max-width: 20rem; }

/* ---------- Langue ---------- */
.lang { color: var(--muted); }
.lang span { color: var(--ink); }

/* ---------- Filtres par catégorie (sans JavaScript) ---------- */
.filters {
  max-width: var(--max); margin: 0 auto;
  padding: 1rem var(--gutter) 0;
  border: 0;
  display: flex; flex-wrap: wrap; gap: .5rem clamp(1.25rem, 3vw, 2.5rem);
  font-size: var(--step--1);
}
.filters::before {
  content: ""; flex-basis: 100%; height: 0;
  border-top: 1px solid var(--ink); margin-bottom: .25rem;
}
.filters input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filters label { cursor: pointer; color: var(--muted); padding: .25rem 0; }
.filters label:hover { color: var(--ink); }
.filters input:checked + label { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.filters input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 3px; }

body:has(#f-p:checked)  [data-cat]:not([data-cat~="p"]),
body:has(#f-da:checked) [data-cat]:not([data-cat~="da"]),
body:has(#f-c:checked)  [data-cat]:not([data-cat~="c"]) { display: none; }

/* ---------- Index des projets ---------- */
.index {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  position: relative;
}
.index-list li { position: static; }
.index-list a {
  display: inline-block;
  font-family: var(--serif);
  font-size: var(--step-index);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.index-list li:nth-child(odd) a { font-style: italic; }
.index-list a:hover, .index-list a:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }

/* Aperçu de l'image au survol (ordinateur uniquement) */
.index-list img {
  position: absolute;
  right: var(--gutter);
  top: clamp(2rem, 5vw, 4rem);
  width: min(34vw, 460px);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.index-list a:hover img, .index-list a:focus-visible img { opacity: 1; }
.index-legend { margin-top: 2rem; color: var(--muted); font-size: var(--step--1); }

/* ---------- Titres de section ---------- */
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

/* ---------- Projets ---------- */
.projects, .about {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) var(--gutter);
}
.project {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem var(--gutter);
  align-items: start;
  scroll-margin-top: 5rem;
}
.project + .project { margin-top: clamp(4rem, 9vw, 8rem); }
.project-media { grid-column: 1 / span 8; }
.project-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--rule); }
.project-text { grid-column: 9 / span 4; position: sticky; top: 5rem; }
.project:nth-of-type(even) .project-media { grid-column: 5 / span 8; grid-row: 1; }
.project:nth-of-type(even) .project-text { grid-column: 1 / span 4; grid-row: 1; }

.project h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.project:nth-of-type(odd) h3 { font-style: italic; }
.project-meta { border-top: 1px solid var(--rule); margin-bottom: 1.25rem; }
.project-meta div {
  display: grid; grid-template-columns: 5rem 1fr; gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step--1);
}
.project-meta dt { color: var(--muted); }
.project-text p { max-width: 34rem; }

.project-media { display: block; }
.project h3 a { text-decoration: none; }
.project h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.project-media:hover img { opacity: .88; }
.project-text .text-link { font-size: var(--step--1); }
.project-text p + p { margin-top: .75rem; }

/* ---------- Page projet ---------- */
.case { max-width: var(--max); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 7vw, 6rem); }
.case-back { font-size: var(--step--1); margin-bottom: clamp(2rem, 5vw, 4rem); }
.case-back a { text-decoration: none; color: var(--muted); }
.case-back a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.case-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.5rem var(--gutter); align-items: end;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}
.case-head h1 {
  grid-column: 1 / -1;
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: var(--step-index); line-height: 1;
}
.case-meta { grid-column: 1 / span 5; border-top: 1px solid var(--rule); }
.case-meta div {
  display: grid; grid-template-columns: 6rem 1fr; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step--1);
}
.case-meta dt { color: var(--muted); }
.case-lead { grid-column: 7 / span 6; font-size: var(--step-1); line-height: 1.45; max-width: 36rem; }
.case figure img { width: 100%; background: var(--rule); }
.case-wide { margin: clamp(2rem, 5vw, 4rem) 0; }
.case-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin: clamp(2rem, 5vw, 4rem) 0; }
.case-text {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem var(--gutter);
  margin: clamp(3rem, 7vw, 6rem) 0;
}
.case-text h2 { grid-column: 1 / span 4; font-family: var(--serif); font-weight: 400; font-size: var(--step-2); line-height: 1.05; }
.case-body { grid-column: 6 / span 6; max-width: 36rem; }
.case-body p + p { margin-top: 1em; }
.case-credits { color: var(--muted); font-size: var(--step--1); }
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem var(--gutter);
  padding-top: 1.5rem; border-top: 1px solid var(--ink);
  margin-top: clamp(3rem, 7vw, 6rem);
}
.pager a { font-family: var(--serif); font-size: var(--step-2); line-height: 1.05; text-decoration: none; }
.pager a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
.pager span { display: block; font-family: var(--sans); font-size: var(--step--1); color: var(--muted); margin-bottom: .4rem; }
.pager-next { text-align: right; }

/* ---------- À propos ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2.5rem var(--gutter);
}
.about-bio { grid-column: 1 / span 6; font-size: var(--step-1); line-height: 1.5; }
.about-bio p + p { margin-top: 1.1em; }
.about-lists { grid-column: 8 / span 5; display: grid; gap: 2.5rem; }
.about-lists h3 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: var(--step-1); margin-bottom: .5rem; }
.about-lists li { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.timeline span { display: block; color: var(--muted); font-size: var(--step--1); }
.text-link { text-underline-offset: 4px; }
.text-link:hover { text-decoration-thickness: 2px; }

/* ---------- Pied de page : contact discret ---------- */
.site-footer {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .75rem 2rem;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--ink);
  font-size: var(--step--1);
  scroll-margin-top: 4rem;
}
.footer-name { font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
.footer-links a, .footer-meta a { text-decoration: none; }
.footer-links a:hover, .footer-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-meta { color: var(--muted); display: flex; gap: 1.25rem; }

/* ---------- Page mentions légales ---------- */
.legal { max-width: 44rem; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) var(--gutter); }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: var(--step-3); line-height: 1; margin-bottom: 2rem; }
.legal h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: var(--step-1); margin: 2rem 0 .5rem; }
.legal p + p { margin-top: .75em; }

/* ---------- Tablette et mobile ---------- */
@media (max-width: 900px) {
  .hero-text { grid-template-columns: 1fr; }
  .index-list img { display: none; }
  .project-media,
  .project-text,
  .project:nth-of-type(even) .project-media,
  .project:nth-of-type(even) .project-text { grid-column: 1 / -1; grid-row: auto; }
  .project-text { position: static; }
  .about-bio, .about-lists { grid-column: 1 / -1; }
  .case-meta, .case-lead, .case-text h2, .case-body { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-header { flex-direction: column; gap: .4rem; }
  .site-footer { flex-direction: column; }
  .case-pair { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .index-list img { transition: none; }
}

/* ---------- Crédit photo, posé sur l'image ---------- */
.project-media, .case-photo { position: relative; }
.photo-credit {
  position: absolute; right: .75rem; bottom: .6rem;
  font-family: var(--sans); font-size: .6875rem; line-height: 1;
  color: #FFFFFF; opacity: .85;
  text-shadow: 0 0 4px rgba(0,0,0,.6);
}

/* ---------- Document (moodboard) : toujours entier et horizontal ---------- */
.case-doc img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: none;
  border: 1px solid var(--rule);
}
.case-doc figcaption {
  margin-top: .6rem;
  font-size: var(--step--1);
  display: flex; justify-content: space-between; gap: 1rem;
}
.case-doc figcaption span { color: var(--muted); font-size: .6875rem; }

/* ---------- Lien de téléchargement ---------- */
.case-download {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gutter);
  margin: clamp(2rem, 5vw, 4rem) 0 0;
}
.case-download a {
  grid-column: 6 / span 6;
  font-family: var(--serif); font-style: italic; font-size: var(--step-1);
  text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.case-download a:hover { text-decoration-thickness: 2px; }
.case-download span { font-family: var(--sans); font-style: normal; font-size: var(--step--1); color: var(--muted); }
@media (max-width: 900px) { .case-download a { grid-column: 1 / -1; } }

/* ---------- Trois images verticales ---------- */
.case-pair.case-trio { grid-template-columns: repeat(3, 1fr); gap: clamp(.75rem, 2vw, 1.5rem); }
@media (max-width: 520px) { .case-pair.case-trio { grid-template-columns: 1fr; } }

/* ==========================================================
   Galerie : grille fine, filets verticaux, légendes discrètes
   ========================================================== */
.gal {
  --gap: clamp(.75rem, 1.6vw, 1.5rem);
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 7vw, 6rem);
}
/* Trois filets verticaux qui découpent la page en quatre, comme sur la référence */
.gal::before {
  content: ""; position: absolute; inset: 0 var(--gutter); pointer-events: none;
  background:
    linear-gradient(var(--rule), var(--rule)) calc(25% - var(--gap) * .25) 0 / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) calc(75% + var(--gap) * .25) 0 / 1px 100% no-repeat;
}
.gal-top, .g-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: var(--gap);
}
.gal-top { row-gap: 1.5rem; margin-bottom: clamp(4rem, 12vw, 11rem); font-size: var(--step--1); }
.gal-head { grid-column: 1 / span 2; }
.gal-head .case-back { margin-bottom: 2.5rem; }
.gal-head h1 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: var(--step-3); line-height: 1; margin-bottom: 1rem; }
.gal-lead { color: var(--muted); max-width: 18rem; }

.gal-opt { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; }
.gal-opt legend { padding: 0; margin-bottom: .5rem; color: var(--muted); }
.gal-series { grid-column: 3 / span 2; margin-top: calc(2.5rem + 1.6em); }
.gal-view { grid-column: 5 / span 2; margin-top: calc(2.5rem + 1.6em); }
.gal-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gal-opt label { cursor: pointer; line-height: 1.45; padding-left: .9em; position: relative; }
.gal-opt label:hover { text-decoration: underline; text-underline-offset: 3px; }
.gal-opt input:checked + label::before { content: "▸"; position: absolute; left: 0; font-size: .8em; top: .1em; }
.gal-opt input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }

.g-grid { row-gap: clamp(2rem, 4vw, 3.5rem); list-style: none; }
.g-item { grid-column: span 1; display: grid; grid-template-columns: 1fr auto; column-gap: .5rem; align-content: start; }
.g-img { grid-column: 1 / -1; display: block; margin-bottom: .6rem; }
.g-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--rule); }
.g-cap { font-size: .6875rem; line-height: 1.35; letter-spacing: .02em; text-transform: uppercase; }
.g-cap span { display: block; }
.g-cap span + span { color: var(--muted); }
.g-see { align-self: end; font-size: .6875rem; text-transform: uppercase; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.g-see::before { content: "▸ "; font-size: .85em; }
.g-see:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Filtre par série */
body:has(#s-aless:checked)  .g-item:not([data-serie="aless"]),
body:has(#s-krisss:checked) .g-item:not([data-serie="krisss"]) { display: none; }

/* Affichage en liste */
body:has(#v-liste:checked) .g-grid { row-gap: 0; }
body:has(#v-liste:checked) .g-item {
  grid-column: 1 / -1;
  grid-template-columns: repeat(8, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: center; padding: .5rem 0; border-top: 1px solid var(--rule);
}
body:has(#v-liste:checked) .g-img { grid-column: 1; margin: 0; }
body:has(#v-liste:checked) .g-img img { width: 3.5rem; }
body:has(#v-liste:checked) .g-cap { grid-column: 3 / span 4; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
body:has(#v-liste:checked) .g-see { grid-column: 8; justify-self: end; align-self: center; }

/* Vignettes de la galerie sur l'accueil */
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.project .gallery-thumbs img { aspect-ratio: 4 / 5; }

@media (max-width: 900px) {
  .gal::before { background: linear-gradient(var(--rule), var(--rule)) 50% 0 / 1px 100% no-repeat; }
  .gal-top, .g-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gal-head { grid-column: 1 / -1; }
  .gal-series { grid-column: 1 / span 2; margin-top: 0; }
  .gal-view { grid-column: 3 / span 2; margin-top: 0; }
  body:has(#v-liste:checked) .g-item { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body:has(#v-liste:checked) .g-cap { grid-column: 2 / span 2; }
  body:has(#v-liste:checked) .g-see { grid-column: 4; }
}
@media (max-width: 520px) {
  .gal::before { display: none; }
  .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

body:has(#s-milla:checked) .g-item:not([data-serie="milla"]) { display: none; }

/* ---------- Photo en grand (sans JavaScript, via #ancre) ---------- */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 20;
  background: var(--paper);
  padding: 3.5rem var(--gutter) 3rem;
  grid-template-rows: 1fr auto; place-items: center;
}
.lightbox:target { display: grid; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); width: auto; height: auto; object-fit: contain; }
.lb-close { position: absolute; top: 1.1rem; right: var(--gutter); font-size: .6875rem; text-transform: uppercase; letter-spacing: .02em; text-decoration: none; }
.lb-close::before { content: "× "; }
.lb-close:hover, .lb-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lb-cap { position: absolute; left: var(--gutter); bottom: 1.25rem; font-size: .6875rem; text-transform: uppercase; letter-spacing: .02em; }
.lb-cap span + span { color: var(--muted); margin-left: .75rem; }
.lb-nav { position: absolute; right: var(--gutter); bottom: 1.25rem; display: flex; gap: 1.5rem; font-size: .6875rem; text-transform: uppercase; letter-spacing: .02em; }
.lb-nav a { text-decoration: none; }
body:has(.lightbox:target) { overflow: hidden; }
body:has(#s-laurelenn:checked) .g-item:not([data-serie="laurelenn"]) { display: none; }
body:has(#s-burnout:checked) .g-item:not([data-serie="burnout"]) { display: none; }
body:has(#s-andy:checked) .g-item:not([data-serie="andy"]) { display: none; }
body:has(#s-sarah:checked) .g-item:not([data-serie="sarah"]) { display: none; }

/* ---------- Échelle allégée ---------- */
.hero { padding-top: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: clamp(1.5rem, 3.5vw, 3rem); }
.index { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.projects, .about { padding-top: clamp(2.5rem, 5vw, 4.5rem); padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-title { margin-bottom: clamp(1.5rem, 3.5vw, 3rem); }
.project + .project { margin-top: clamp(3rem, 6vw, 5.5rem); }
@media (min-width: 901px) {
  .project-media { grid-column: 1 / span 7; }
  .project:nth-of-type(even) .project-media { grid-column: 6 / span 7; }
}
.case { max-width: 1200px; }
.case-text { margin: clamp(2.5rem, 5vw, 4.5rem) 0; }
.case-wide, .case-pair { margin: clamp(1.5rem, 3.5vw, 3rem) 0; }
.case-head { margin-bottom: clamp(1.5rem, 3.5vw, 3rem); }
.pager { margin-top: clamp(2.5rem, 5vw, 4.5rem); }
.filters::before { display: none; }
.case-doc img { border: 0; }
