/* =============================================================================
   MARC LEPILLEUR — feuille de style unique
   -----------------------------------------------------------------------------
   Pour changer une couleur ou une police, modifiez uniquement les variables
   de la partie 1 : tout le site suit automatiquement.

   1. Variables (couleurs, polices, espacements)
   2. Polices (fichiers hébergés sur le site, aucun appel à Google)
   3. Base
   4. En-tête et pied de page
   5. Éléments communs (liens, boutons, formulaires)
   6. Accueil
   7. Works : index des années, sections, grille
   8. Visionneuse (photo en grand)
   9. Exhibitions & press
   10. Contact
   11. Pages simples (mentions légales, 404)
   12. Mouvement réduit, impression
   ============================================================================= */


/* ---------- 1. VARIABLES ---------------------------------------------------- */

:root {
  /* Les 3 couleurs du site */
  --paper:  #F2F3F1;   /* neutre : blanc froid, comme un verre dépoli */
  --ink:    #1E2120;   /* principale : graphite (textes, boutons) */
  --accent: #2F5B4C;   /* accent discret : vert bouteille (liens actifs, focus) */

  /* Nuances dérivées des 3 couleurs (ne pas multiplier) */
  --ink-2:  #5C625F;   /* texte secondaire */
  --ink-3:  #959B97;   /* bordures des champs */
  --rule:   #D7DAD6;   /* filets */
  --night:  #070808;   /* fond de la visionneuse : le noir des photos d'atelier */
  --night-rule: #222524;
  --on-night:   #E7E9E6;
  --on-night-2: #9BA19D;
  --accent-on-night: #93BBAB;

  /* Polices */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans:  "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Mise en page */
  --max: 1440px;
  --gutter: clamp(16px, 4vw, 56px);
  --row-h: 250px;              /* hauteur de référence des photos dans la grille */
  --gap: 28px;
  --bar-h: 52px;               /* hauteur de la barre des années */
  --radius: 2px;
}

@media (max-width: 1100px) { :root { --row-h: 210px; --gap: 22px; } }
@media (max-width: 760px)  { :root { --row-h: 150px; --gap: 14px; --bar-h: 48px; } }


/* ---------- 2. POLICES ------------------------------------------------------ */

@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}


/* ---------- 3. BASE --------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { flex: 1 0 auto; }

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

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

h1, h2, h3 { font-weight: 400; line-height: 1.1; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .9375rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }


/* ---------- 4. EN-TÊTE ET PIED DE PAGE -------------------------------------- */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 28px 24px;
}

.brand {
  font-size: 1.375rem;
  font-weight: 420;
  letter-spacing: .005em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}

.site-nav a {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink);
  text-decoration: none;
  padding-block: 4px;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--rule);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 28px 40px;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-2);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--accent); }


/* ---------- 5. ÉLÉMENTS COMMUNS --------------------------------------------- */

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }

.text-link {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 6px;
}
.text-link:hover { color: var(--accent); text-decoration-color: currentColor; }

.page-head {
  padding-block: 40px 48px;
}
.page-head h1 {
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 330;
  letter-spacing: -.012em;
}
.page-head p {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}

.button {
  display: inline-block;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.button[disabled] { opacity: .55; cursor: progress; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 22px; }
.field label {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--ink-2);
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}
.field textarea { min-height: 180px; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #8E2F23; }

/* champ piège anti-robots : invisible pour les visiteurs */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}


/* ---------- 6. ACCUEIL ------------------------------------------------------ */

.home-hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 var(--gap);
  padding-block: 24px 0;
}

.home-intro {
  grid-column: 1 / 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 36px;
}

.home-intro h1 {
  font-size: clamp(3.25rem, 6.6vw, 6.75rem);
  font-weight: 280;
  line-height: .94;
  letter-spacing: -.025em;
}
.home-intro h1 span { display: block; }

.home-intro .lede {
  max-width: 30ch;
  font-size: 1.25rem;
  line-height: 1.5;
}
.home-intro .lede + .text-link { display: inline-block; margin-top: 20px; }

.home-photo { grid-column: 5 / 13; }
.home-photo a { display: block; color: inherit; text-decoration: none; }
.home-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #1a1b1a;
}
.home-photo figcaption,
.caption {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-2);
}
.home-photo figcaption i,
.caption i { font-family: var(--serif); font-size: 1rem; color: var(--ink); }

.home-recent { margin-top: 112px; }
.home-recent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.home-recent-head h2 { font-size: 1.5rem; font-weight: 400; }


/* ---------- 7. WORKS -------------------------------------------------------- */

/* Barre des années (reste en haut de l'écran pendant le défilement) */
.year-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.year-bar ol {
  display: flex;
  gap: 4px 22px;
  height: var(--bar-h);
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.year-bar ol::-webkit-scrollbar { display: none; }
.year-bar a {
  font-family: var(--sans);
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 6px;
}
.year-bar a:hover { color: var(--ink); }
.year-bar a[aria-current="true"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* Une section par année : grand millésime à gauche, pièces à droite */
.year-section {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 0 var(--gap);
  padding-block: 56px 72px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: var(--bar-h);
}
.year-section:last-child { border-bottom: 0; }

.year-label {
  position: sticky;
  top: calc(var(--bar-h) + 24px);
  align-self: start;
  font-size: clamp(3.5rem, 7.4vw, 7rem);
  font-weight: 240;
  line-height: .9;
  letter-spacing: -.035em;
}
.year-label small {
  display: block;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-2);
}
.year-label.is-text { font-size: clamp(2.25rem, 4.4vw, 4rem); letter-spacing: -.02em; }

/* Grille « justifiée » : chaque rangée remplit la largeur sans recadrer les photos */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 36px var(--gap);
}
.grid::after { content: ""; flex: 1000 1 0; }

.work {
  flex: var(--r) 1 calc(var(--r) * var(--row-h));
  min-width: 0;
}
.work a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.frame {
  position: relative;
  aspect-ratio: var(--r);
  overflow: hidden;
  background: var(--rule);
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
}
.frame img.is-loaded { opacity: 1; }

.work-title {
  display: block;
  margin-top: 12px;
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.3;
}
.work-views {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-2);
}
.work a:hover .work-title { color: var(--accent); }
.work a:focus-visible { outline-offset: 6px; }

.empty {
  padding-block: 48px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}


/* ---------- 8. VISIONNEUSE -------------------------------------------------- */

.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--night);
  color: var(--on-night);
  overflow: hidden;
}
.viewer::backdrop { background: var(--night); }
.viewer:focus { outline: none; }
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 360px; animation: viewer-in .2s ease; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }

.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 40px 76px;
  touch-action: pan-y pinch-zoom;
}
.viewer-stage picture { display: contents; }
.viewer-stage img {
  max-width: 100%;
  max-height: calc(100dvh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity .18s ease;
}
.viewer-stage img.is-swapping { opacity: 0; }

.viewer-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 56px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-night-2);
}
.viewer-arrow:hover { color: var(--on-night); }
.viewer-arrow[hidden] { display: none; }
.viewer-arrow svg { width: 22px; height: 40px; }
.viewer-prev { left: 12px; }
.viewer-next { right: 12px; }

.viewer-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 0;
  padding: 28px 32px 32px;
  border-left: 1px solid var(--night-rule);
  overflow-y: auto;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--on-night-2);
}

.viewer-close {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--on-night);
  font-family: var(--sans);
  font-size: .9375rem;
}
.viewer-close svg { width: 14px; height: 14px; }
.viewer-close:hover { color: var(--accent-on-night); }

.viewer-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  font-weight: 360;
  line-height: 1.12;
  color: var(--on-night);
}
.viewer-year { margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.viewer-facts { margin-top: 14px; display: grid; gap: 2px; }
.viewer-comment {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--on-night);
}
.viewer-credit { margin-top: 14px; font-size: .8125rem; }

.viewer-count { color: var(--on-night); font-variant-numeric: tabular-nums; }

.viewer-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.viewer-thumbs button {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: var(--night-rule);
  opacity: .55;
  outline-offset: 2px;
  transition: opacity .15s ease;
}
.viewer-thumbs button:hover { opacity: .85; }
.viewer-thumbs button[aria-current="true"] { opacity: 1; outline: 1px solid var(--on-night); }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.viewer a { color: var(--on-night); text-decoration-color: var(--on-night-2); }
.viewer a:hover { color: var(--accent-on-night); }
.viewer :focus-visible { outline-color: var(--accent-on-night); }

.viewer-nav {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--night-rule);
}
.viewer-nav button {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--on-night-2);
  font-size: .8125rem;
}
.viewer-nav button + button { text-align: right; }
.viewer-nav button i {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--on-night);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-nav button:hover i { color: var(--accent-on-night); }
.viewer-nav button[disabled] { visibility: hidden; }

body.has-viewer { overflow: hidden; }


/* ---------- 9. EXHIBITIONS & PRESS ------------------------------------------ */

.cv-section {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: 0 var(--gap);
  padding-block: 48px 64px;
  border-top: 1px solid var(--rule);
}
.cv-section h2 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); font-weight: 340; }

.cv-list li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 4px 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
}
.cv-list li:first-child { padding-top: 6px; }
.cv-year { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cv-main { font-size: 1.1875rem; line-height: 1.35; }
.cv-main i { font-style: italic; }
.cv-sub {
  margin-top: 4px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}
.cv-sub a { color: var(--ink-2); }
.cv-sub a:hover { color: var(--accent); }


/* ---------- 10. CONTACT ----------------------------------------------------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px calc(var(--gap) * 2);
  padding-top: 8px;
}
.contact-intro .lede { max-width: 32ch; font-size: 1.25rem; }
.contact-details {
  margin-top: 40px;
  display: grid;
  gap: 18px;
}
.contact-details dt {
  font-family: var(--sans);
  font-size: .8125rem;
  color: var(--ink-2);
}
.contact-details dd { font-size: 1.125rem; }

.contact-form { max-width: 620px; }
.contact-form .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 28px;
}
.form-status { min-height: 1.5em; margin-top: 18px; }
.form-status.is-ok { color: var(--accent); }
.form-status.is-error { color: #8E2F23; }


/* ---------- 11. PAGES SIMPLES ----------------------------------------------- */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 40px; font-size: 1.5rem; }
.prose p, .prose ul { margin-top: 12px; }
.prose ul { padding-left: 1.2em; list-style: disc; }


/* ---------- RESPONSIVE ------------------------------------------------------ */

@media (max-width: 1100px) {
  .home-intro { grid-column: 1 / 6; }
  .home-photo { grid-column: 6 / 13; }
  .viewer[open] { grid-template-columns: minmax(0, 1fr) 300px; }
  .viewer-stage { padding: 32px 60px; }
}

@media (max-width: 860px) {
  .home-hero { display: block; }
  .home-intro { gap: 28px; padding-bottom: 28px; }
  .home-photo { margin-top: 0; }
  .home-recent { margin-top: 72px; }

  .year-section,
  .cv-section,
  .contact { grid-template-columns: minmax(0, 1fr); }

  .year-section { padding-block: 0 48px; }
  .year-label {
    top: var(--bar-h);
    z-index: 5;
    margin-inline: calc(var(--gutter) * -1);
    padding: 20px var(--gutter) 16px;
    background: var(--paper);
    font-size: 3rem;
    display: flex;
    align-items: baseline;
    gap: 16px;
  }
  .year-label.is-text { font-size: 2.25rem; }
  .year-label small { margin-top: 0; }
  .cv-section h2 { margin-bottom: 20px; }

  .viewer[open] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 62dvh) auto;
    overflow-y: auto;
  }
  .viewer-stage { padding: 52px 8px 12px; }
  .viewer-stage img { max-height: calc(62dvh - 64px); }
  .viewer-arrow { width: 44px; }
  .viewer-prev { left: 0; }
  .viewer-next { right: 0; }
  .viewer-panel { border-left: 0; border-top: 1px solid var(--night-rule); overflow: visible; padding: 20px var(--gutter) 32px; }
  .viewer-close {
    position: fixed;
    top: 10px;
    right: var(--gutter);
    z-index: 2;
    padding: 8px 12px;
    background: var(--night);
  }
}

@media (max-width: 520px) {
  .site-header .wrap { padding-block: 20px 16px; }
  .grid { row-gap: 24px; }
  .work-title { font-size: 1rem; }
  .cv-list li { grid-template-columns: 4rem minmax(0, 1fr); gap: 4px 14px; }
}


/* ---------- 12. MOUVEMENT RÉDUIT, IMPRESSION -------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header nav, .year-bar, .site-footer, .viewer { display: none !important; }
  .frame img { opacity: 1 !important; }
  .year-label { position: static; }
}

/* Accueil : la rangée « Recent work » occupe toute la largeur */
.home-recent .grid::after { display: none; }

/* Page Contact : coordonnées sur toute la largeur de la colonne de droite */
.contact-list { margin-top: 0; gap: 22px; align-self: start; align-content: start; }
.contact-list dd { font-size: 1.25rem; }
/* Photo et coordonnées alignées en haut */
.contact { align-items: start; }
.contact-photo { margin: 0; max-width: 400px; }
.contact-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--rule); }
.contact-list { padding-top: 4px; }
