/* ==========================================================
   Jules Grange — Portfolio
   Palette sobre, typographie fine, alignements stricts.
   ========================================================== */

:root {
  --bg: #f4f1ea;
  --bg-soft: #ece8df;
  --ink: #2c2b29;
  --muted: #86827a;
  --line: #d8d3c8;

  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;

  --max: 1440px;
  --pad: clamp(20px, 4.5vw, 64px);      /* marges latérales */
  --gap: clamp(12px, 1.4vw, 20px);      /* espace entre images */
  --col-gap: clamp(24px, 4vw, 64px);    /* espace entre colonnes */
  --header-h: 84px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

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

/* Petites capitales espacées, utilisées pour la navigation et les libellés */
.brand, .nav a, .eyebrow, .label, .filter, .card-title, .facts dt,
.btn, .project-nav span, .pn-all,
.entry-years, .skills h3, .tri h3, .site-footer, .lb-close, .lb-count, .credit {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 241, 234, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 500; letter-spacing: .24em; font-size: 13px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav a { position: relative; padding-block: 6px; color: var(--ink); transition: color .3s var(--ease); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav .lang { color: var(--muted); padding-left: clamp(18px, 3vw, 40px); border-left: 1px solid var(--line); }
.nav .lang::after { display: none; }
.nav .lang:hover { color: var(--ink); }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: clamp(96px, 12vw, 160px); color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 32px 40px; border-top: 1px solid var(--line); }
.site-footer a { text-transform: none; letter-spacing: .04em; font-size: 13px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Accueil ---------- */
.intro { padding-top: clamp(72px, 11vw, 160px); padding-bottom: clamp(64px, 8vw, 120px); }
.intro-name {
  font-weight: 300; font-size: clamp(13px, 1vw, 14px); letter-spacing: .24em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 28px;
}
.intro-text {
  font-weight: 300; font-size: clamp(26px, 3.2vw, 44px); line-height: 1.25; letter-spacing: -.005em;
  max-width: 24em;
}
.intro-loc { margin-top: 32px; color: var(--muted); font-size: 15px; }

.filters { display: flex; gap: 32px; padding-bottom: 20px; margin-bottom: clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--line); }
.filter { color: var(--muted); padding-block: 4px; transition: color .3s var(--ease); }
.filter:hover, .filter.is-active { color: var(--ink); }
.filter.is-active { text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: clamp(56px, 6vw, 96px); }
.card[hidden] { display: none; }
.card a { display: block; }
.card-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .6s var(--ease); }
.card a:hover .card-media img { transform: scale(1.025); }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 20px; }
.card-title { font-weight: 500; }
.card-year { color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.card-sub { margin-top: 6px; color: var(--muted); font-size: 15px; }

/* ---------- Page projet ---------- */
.project-head { padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(36px, 4vw, 56px); }
.eyebrow { color: var(--muted); margin-bottom: 20px; }
.project-title { font-weight: 300; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -.01em; }
.project-sub { margin-top: 16px; color: var(--muted); font-size: 17px; }

.project-hero .zoom { display: block; width: 100%; aspect-ratio: var(--r); background: var(--bg-soft); }
.project-hero img { width: 100%; height: 100%; object-fit: cover; }

/* Projet dont les visuels définitifs arrivent : voile sombre léger + mention discrète */
.is-pending { position: relative; }
.is-pending .zoom { position: relative; }
.card-media.is-pending::after, .project-hero.is-pending .zoom::after {
  content: ""; position: absolute; inset: 0; background: rgba(28, 27, 25, .38); pointer-events: none;
}
.soon {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #fff; font-family: var(--sans); font-size: 12px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase;
  white-space: nowrap; padding: 12px 22px; border: 1px solid rgba(255, 255, 255, .7); pointer-events: none;
}

.project-body {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  padding-top: clamp(56px, 7vw, 104px); padding-bottom: clamp(56px, 7vw, 104px);
}
.facts { grid-column: 1 / span 4; align-self: start; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); padding-top: 3px; }
.facts dd { font-size: 15px; line-height: 1.5; }
.prose { grid-column: 6 / span 7; }
.prose p { font-family: var(--serif); font-size: clamp(18px, 1.35vw, 20px); line-height: 1.62; hyphens: auto; }
.prose p + p { margin-top: 1.1em; }

.gallery { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: var(--gap); }
.shot { flex: var(--r) 1 0; min-width: 0; }
.shot .zoom, .project-hero .zoom { cursor: zoom-in; overflow: hidden; }
.shot .zoom { display: block; width: 100%; aspect-ratio: var(--r); background: var(--bg-soft); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
/* Une image seule occupe toute la largeur sans jamais dépasser la hauteur de l'écran */
.project-hero .zoom, .row:not(.row-multi) .zoom { max-height: calc(100vh - var(--header-h) - 56px); max-height: calc(100svh - var(--header-h) - 56px); }
.fit-contain .zoom { background: #fff; }
.fit-contain img { object-fit: contain; }
/* PNG détouré (axonométrie) : posé directement sur le fond, jamais coupé */
.fit-clear .zoom { background: none; }
.fit-clear img { object-fit: contain; }

/* Textes explicatifs intercalés dans la galerie, alignés sur la grille du descriptif */
.note {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(16px, 2vw, 28px);
}
.gallery > .note:first-child { padding-top: 0; }
.note-label { grid-column: 1 / span 4; align-self: start; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--line); }
.note-text { grid-column: 6 / span 7; padding-top: 9px; } /* 1re ligne alignée sur le libellé */
.note-text p { font-family: var(--serif); font-size: clamp(17px, 1.2vw, 19px); line-height: 1.62; hyphens: auto; }
.note-text p + p { margin-top: 1em; }
.credit { margin-top: 20px; color: var(--muted); text-align: right; font-size: 11px; }

.project-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 24px;
  margin-top: clamp(80px, 10vw, 144px); padding-top: 32px; border-top: 1px solid var(--line);
}
.project-nav a { font-size: 17px; transition: color .3s var(--ease); }
.project-nav a:hover { color: var(--muted); }
.project-nav span { display: block; color: var(--muted); margin-bottom: 8px; }
.pn-next { text-align: right; }
.pn-all { color: var(--muted); }

/* ---------- Visionneuse ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: 72px 1fr 72px; align-items: center; justify-items: center;
  opacity: 0; transition: opacity .35s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lb-img { grid-column: 2; grid-row: 2; max-width: 100%; max-height: calc(100vh - 144px); max-height: calc(100dvh - 144px); width: auto; height: auto; object-fit: contain; }
.lb-close { grid-column: 3; grid-row: 1; justify-self: end; margin-right: var(--pad); }
.lb-prev, .lb-next { grid-row: 2; font-size: 22px; width: 56px; height: 56px; color: var(--muted); transition: color .3s; }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-prev:hover, .lb-next:hover { color: var(--ink); }
.lb-count { grid-column: 2; grid-row: 3; color: var(--muted); }
.lightbox { grid-template-columns: max(72px, var(--pad)) 1fr max(72px, var(--pad)); }
/* « Fermer » aligné sur la marge du site, à la place du sélecteur de langue */
.lb-close {
  position: absolute; top: 0; height: 72px; margin: 0;
  right: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  transition: color .3s;
}
.lb-close:hover { color: var(--muted); }
body.lb-lock { overflow: hidden; }

/* ---------- Profil ---------- */
.profile-intro {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  padding-top: clamp(56px, 8vw, 120px);
}
.portrait { grid-column: 1 / span 4; align-self: start; aspect-ratio: 2 / 3; overflow: hidden; background: var(--bg-soft); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.profile-text { grid-column: 6 / span 7; align-self: start; padding-top: 8px; }
.profile-name { font-weight: 300; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.08; letter-spacing: -.01em; }
.profile-role { margin-top: 14px; color: var(--muted); font-size: 17px; margin-bottom: clamp(32px, 4vw, 48px); }
.profile-text .prose { grid-column: auto; }

.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px;
  background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }

.cv-block {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  margin-top: clamp(72px, 9vw, 128px);
}
.cv-block > .label { grid-column: 1 / span 3; color: var(--muted); padding-top: 28px; border-top: 1px solid var(--ink); }
.cv-block > :not(.label) { grid-column: 4 / span 9; border-top: 1px solid var(--line); }

.entry { display: grid; grid-template-columns: 12em 1fr; gap: var(--col-gap); padding-block: 28px; border-bottom: 1px solid var(--line); }
.entry-years { color: var(--muted); padding-top: 4px; }
.entry h3 { font-weight: 400; font-size: 19px; line-height: 1.35; }
.entry-place { color: var(--muted); font-size: 15px; margin-top: 4px; }
.entry p:not(.entry-place) { margin-top: 12px; font-family: var(--serif); font-size: 18px; line-height: 1.55; max-width: 40em; }

/* Compétences, logiciels, langues : une catégorie par ligne, contenu à droite */
.row-cols, .row-inline { padding-block: 24px; }
.entry .row-cols .entry-years, .row-cols h3.entry-years, .row-inline h3.entry-years { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.6; padding-top: 5px; }
.items { font-size: 18px; line-height: 1.45; }
.row-cols .items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 10px; }
.row-inline .items { display: flex; flex-wrap: wrap; row-gap: 6px; }
.row-inline .items li + li::before { content: "·"; color: var(--muted); padding-inline: .7em; }

/* Contact : l'adresse e-mail est l'action principale, ouverte dans la messagerie du visiteur */
.contact-main { padding-top: 28px; }
.contact-lead { font-family: var(--serif); font-size: 20px; line-height: 1.55; max-width: 30em; }
.contact-mail {
  display: inline-flex; align-items: baseline; gap: .45em; margin-top: 28px;
  font-weight: 300; font-size: clamp(26px, 3.4vw, 46px); line-height: 1.15; letter-spacing: -.01em;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink); overflow-wrap: anywhere;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.contact-mail .arrow { font-size: .7em; transition: transform .4s var(--ease); }
.contact-mail:hover { color: var(--muted); border-color: var(--muted); }
.contact-mail:hover .arrow { transform: translateX(6px); }
.contact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 44px; }
.contact-meta .btn { background: transparent; color: var(--ink); }
.contact-meta .btn:hover { background: var(--ink); color: var(--bg); }
.contact-loc { color: var(--muted); font-size: 15px; }

/* ---------- Apparition douce au défilement ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
  .facts { grid-column: 1 / -1; margin-bottom: 48px; }
  .prose { grid-column: 1 / -1; max-width: 42em; }
  .note-label { grid-column: 1 / -1; margin-bottom: 20px; }
  .note-text { grid-column: 1 / -1; max-width: 42em; }
  .portrait { grid-column: 1 / span 5; }
  .profile-text { grid-column: 6 / span 7; }
  .cv-block > .label { grid-column: 1 / -1; padding-top: 20px; padding-bottom: 8px; border-top: 0; }
  .cv-block > :not(.label) { grid-column: 1 / -1; border-top: 1px solid var(--ink); }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  :root { --header-h: 64px; }
  body { font-size: 15px; }
  .brand { font-size: 12px; letter-spacing: .2em; }
  .nav { gap: 16px; }
  .nav a:nth-child(3) { display: none; } /* « Contact » : accessible depuis la page Profil */
  .nav .lang { padding-left: 16px; }
  .grid { grid-template-columns: 1fr; }
  .filters { gap: 24px; }
  .row { flex-direction: column; }
  .shot { flex: none; }
  .facts > div { grid-template-columns: 7em 1fr; }
  .profile-intro { display: block; }
  .portrait { max-width: 420px; margin-bottom: 40px; }
  .entry { grid-template-columns: 1fr; gap: 8px; }
  .row-cols .items { grid-template-columns: 1fr; }
  .project-nav { grid-template-columns: 1fr 1fr; }
  .pn-all { display: none; }
  .footer-inner { flex-direction: column; }
  .lightbox { grid-template-columns: 48px 1fr 48px; }
  .lb-prev, .lb-next { width: 44px; }
}
