/* ============================================================================
   style.css — Portfolio Théo Germain
   ----------------------------------------------------------------------------
   Édition calme : tokens en tête (couleurs, typo, rythme), figures de montage,
   grilles fixes. Newsreader (variable, axe optique) + Instrument Sans.
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Couleurs — inchangées. Pas d'accent : l'accent, c'est l'italique et le filet. */
  --bg:     #f3f0e8;
  --fg:     #1c1916;
  --muted:  #8c8276;
  --hair:   rgba(28, 25, 22, 0.14);
  --header: rgba(243, 240, 232, 0.82);
  --tile:   rgba(128, 128, 128, 0.07);

  --lb-bg:  rgba(8, 7, 6, 0.97);
  --lb-fg:  #f3efe8;

  /* Typo */
  --serif: "Newsreader", Georgia, serif;
  --sans:  "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --t-display: clamp(42px, 8.5vw, 118px);  /* hero — lh .95, ls -.02em, w300 */
  --t-title:   clamp(36px, 5.5vw, 76px);   /* titres de page — lh 1.0, ls -.015em, w300 */
  --t-chapter: clamp(24px, 2.6vw, 38px);   /* têtes de chapitre — lh 1.15, w400 italique */
  --t-lead:    clamp(19px, 1.5vw, 25px);   /* chapeaux — lh 1.55, w400 */
  --t-body:    17px;                       /* lh 1.65 */
  --t-caption: 13px;                       /* sans, lh 1.45, muted */
  --t-meta:    12px;                       /* sans, capitales, ls .08em, muted */

  /* Rythme vertical */
  --s1: 8px;  --s2: 16px;  --s3: 24px;
  --s4: clamp(32px, 4vw, 48px);
  --s5: clamp(48px, 6vw, 80px);
  --s6: clamp(72px, 9vw, 128px);
  --s7: clamp(104px, 13vw, 192px);         /* le grand silence */

  --pad: clamp(18px, 3.4vw, 46px);
  --max: 1680px;                           /* borne de mise en page */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:#100f0d; --fg:#ece6dc; --muted:#8c857a;
    --hair:rgba(255,255,255,0.12); --header:rgba(16,15,13,0.78);
  }
}
:root[data-theme="dark"] {
  --bg:#100f0d; --fg:#ece6dc; --muted:#8c857a;
  --hair:rgba(255,255,255,0.12); --header:rgba(16,15,13,0.78);
}
:root[data-theme="light"] {
  --bg:#f3f0e8; --fg:#1c1916; --muted:#8c8276;
  --hair:rgba(28,25,22,0.14); --header:rgba(243,240,232,0.82);
}

/* ---- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.5s ease, color 0.5s ease;
  animation: fade-in 0.3s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
main { flex: 1 0 auto; width: 100%; }

::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, body { animation: none !important; transition: none !important; }
}

/* conteneur borné : le format de l'édition */
.wrap { max-width: var(--max); margin-inline: auto; }

/* ---- En-tête ---------------------------------------------------------------- */
.hd {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.hd__in {
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
}
.hd__brand { display: flex; flex-direction: column; gap: 2px; }
.hd__name { font-size: 19px; letter-spacing: 0.005em; }
.hd__sub {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.hd__right { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }

.nav {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.nav a { opacity: 0.58; transition: opacity 0.25s ease; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }

.theme-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: none;
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease;
}
.theme-toggle:hover { border-color: var(--fg); }


/* bouton menu (mobile) + panneau plein écran */
.hd__burger {
  display: none;
  background: none; border: 0; color: var(--fg);
  cursor: pointer; padding: 6px; line-height: 0;
}
.menu { display: none; }
.menu.is-open {
  display: flex;
  position: fixed; inset: 0; z-index: 90;
  flex-direction: column; justify-content: center;
  gap: 22px;
  padding: var(--pad);
  background: var(--bg);
}
.menu__close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: 0; color: var(--fg);
  cursor: pointer; padding: 6px; line-height: 0;
}
.menu__nav {
  display: flex; flex-direction: column; gap: 20px;
  font-family: var(--serif); font-size: clamp(30px, 9vw, 44px); font-weight: 300;
}
.menu__nav a { opacity: 1; }
.menu__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.menu .theme-toggle { width: 40px; height: 40px; margin-top: 8px; }
.menu__email {
  position: absolute; bottom: clamp(28px, 7vh, 56px); left: var(--pad);
  font-family: var(--sans); font-size: 15px;
  border-bottom: 1px solid var(--hair); padding-bottom: 3px;
}

@media (max-width: 720px) {
  .hd__sub { display: none; }
  .hd__right { display: none; }
  .hd__burger { display: inline-flex; }
}

/* ---- Héro (accueil) ---------------------------------------------------------- */
.hero {
  position: relative;
  height: 86vh;
  min-height: 460px;
  overflow: hidden;
  background: #0b0a09 center / cover no-repeat;
}
.hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(8,7,6,0.58) 0%, rgba(8,7,6,0.14) 34%, rgba(8,7,6,0) 62%);
}
.hero__caption {
  position: absolute;
  z-index: 2;
  left: var(--pad);
  right: var(--pad);
  bottom: clamp(26px, 6vh, 66px);
  color: #f3efe8;
  pointer-events: none;
}
.hero__title {
  margin: 0;
  font-weight: 300;
  font-size: var(--t-display);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero__title em { font-style: italic; font-weight: 300; }
.hero__sub {
  margin: 0.55em 0 0;
  font-family: var(--sans);
  font-size: clamp(11px, 1.4vw, 14px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.86;
}

/* ---- Accueil : manifeste + blocs projet -------------------------------------- */
.manifesto {
  padding-inline: var(--pad);
  margin-block: var(--s6);
}
.manifesto p {
  margin: 0 auto 1.4em;
  max-width: 44ch;
  font-weight: 300;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.4;
  letter-spacing: -0.008em;
  text-align: justify;
  hyphens: none;
}
.manifesto p:last-child { margin-bottom: 0; }

/* ---- Pages : titre + chapeau -------------------------------------------------- */
.series { padding: var(--s5) var(--pad) var(--s5); }
.series__title {
  margin: 0 0 var(--s4);
  font-weight: 300;
  font-size: var(--t-title);
  letter-spacing: -0.015em;
  line-height: 1;
}
.series__lead {
  max-width: 46ch;
  /* léger décalage à droite (rythme) */
  margin: 0 0 var(--s5) min(7vw, 130px);
  font-weight: 400;
  font-size: var(--t-lead);
  line-height: 1.55;
  text-align: justify;
  hyphens: none;
}
@media (max-width: 640px) {
  .series__lead { margin-left: 0; }
}
.series__empty {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Figures de montage (pages séquence) ---------------------------------------
   F1 pleine page · F2 duo · F3 respiration · F4 interlude texte.               */
.fig { margin: 0; }

.fig img { user-select: none; -webkit-user-drag: none; }
.fig__media { position: relative; }
/* calque transparent : décourage clic-droit / appui long */
.fig__media::after { content: ""; position: absolute; inset: 0; }

/* F1 — pleine page */
.fig--full { margin-block: var(--s6); }
.fig--full .fig__media img {
  width: auto;
  max-width: 100%;
  max-height: 86vh;
  margin-inline: auto;
}

/* F2 — duo : paire centrée qui se touche */
.fig--duo {
  margin-block: var(--s5);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--s3);
}
.fig--duo .fig__media { flex: 0 1 auto; max-width: calc(50% - (var(--s3) / 2)); }
.fig--duo .fig__media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72vh;
  margin-inline: auto;
}

/* F3 — respiration */
.fig--breath { margin-block: var(--s7); }
.fig--breath .fig__media { max-width: 62%; margin-inline: auto; }
.fig--breath.fig--off .fig__media { margin-right: calc(100% / 12); margin-left: auto; }

/* F4 — interlude texte */
.fig--text { margin-block: var(--s6); }
.fig--text h2 {
  margin: 0 0 0.6em;
  font-weight: 400;
  font-style: italic;
  font-size: var(--t-chapter);
  line-height: 1.15;
}
.fig--text p {
  margin: 0;
  max-width: 58ch;
  font-weight: 400;
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--muted);
  text-align: justify;
  hyphens: none;
}

/* légendes (F1 et F3 uniquement) */
.fig__cap {
  margin-top: var(--s1);
  font-family: var(--sans);
  font-size: var(--t-caption);
  line-height: 1.45;
  color: var(--muted);
}
.fig--breath .fig__cap { max-width: 62%; margin-inline: auto; }
.fig--breath.fig--off .fig__cap { margin-right: calc(100% / 12); margin-left: auto; }

/* mobile : F1 bord-à-bord, F2/F3 en retrait */
@media (max-width: 640px) {
  .fig--full { margin-inline: calc(-1 * var(--pad)); }
  .fig--full .fig__media img { max-height: none; width: 100%; }
  .fig--full .fig__cap { padding-inline: var(--pad); }
  .fig--duo { flex-direction: column; gap: var(--s3); }
  .fig--duo .fig__media { max-width: 100%; }
  .fig--duo .fig__media img { max-height: none; width: 100%; }
  .fig--breath .fig__media { max-width: 76%; }
}

/* ---- Grille index (Events, Mode) ------------------------------------------------
   2 colonnes fixes, ordre = ordre du HTML, ratios natifs, visionneuse au clic.  */
.igrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5) var(--s3);
  align-items: start;
}
.igrid__item {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  position: relative;
}
.igrid__item::after { content: ""; position: absolute; inset: 0; }
.igrid__item img { width: 100%; user-select: none; -webkit-user-drag: none; }
@media (max-width: 640px) {
  .igrid { grid-template-columns: 1fr; gap: var(--s4); }
}

/* ---- Réalisations (vidéos) ----------------------------------------------------- */
.videos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s5) var(--s3);
}
.video { margin: 0; }
.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--tile);
  overflow: hidden;
}
.video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__cap {
  margin-top: var(--s1);
  font-family: var(--sans);
  font-size: var(--t-caption);
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 640px) {
  .videos { grid-template-columns: 1fr; gap: var(--s4); }
}

/* ---- À propos ------------------------------------------------------------------ */
.about {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--s6) var(--pad) var(--s5);
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

.about__portrait { margin: 0; }
.about__portrait img { width: 100%; user-select: none; -webkit-user-drag: none; }
.about__portrait.is-missing { aspect-ratio: 4 / 5; background: var(--tile); border: 1px solid var(--hair); }

.about .about__lead {
  margin: 0 0 1.4em;
  font-weight: 300;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.45;
  letter-spacing: -0.008em;
  color: var(--fg);
  text-align: justify;
  hyphens: none;
}
.about__text p {
  margin: 0 0 1.8em;
  font-weight: 400;
  font-size: var(--t-lead);
  line-height: 1.6;
  color: var(--muted);
  max-width: 58ch;
  text-align: justify;
  hyphens: none;
}
.about__contact { border-top: 1px solid var(--hair); padding-top: 1.8em; }
.about__email {
  display: inline-block;
  font-size: clamp(20px, 2.6vw, 30px);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 3px;
  transition: border-color 0.2s ease;
}
.about__email:hover { border-color: var(--fg); }
.about__social {
  display: flex;
  gap: 24px;
  margin-top: 1.6em;
  font-family: var(--sans);
  font-size: var(--t-caption);
  letter-spacing: 0.03em;
}
.about__social a { opacity: 0.58; transition: opacity 0.25s ease; }
.about__social a:hover { opacity: 1; }

/* ---- Pied de page ---------------------------------------------------------------- */
.ft { flex-shrink: 0; border-top: 1px solid var(--hair); }
.ft__in {
  max-width: var(--max);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px 32px;
  padding: clamp(28px, 4vw, 56px) var(--pad);
}
.ft__email {
  font-size: clamp(16px, 1.8vw, 21px);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 3px;
}
.ft__nav {
  display: flex;
  gap: 24px;
  font-family: var(--sans);
  font-size: var(--t-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ft__nav a { color: var(--muted); transition: color 0.25s ease; }
.ft__nav a:hover { color: var(--fg); }
.ft__copy {
  width: 100%;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---- Visionneuse (pages index uniquement) ------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lb-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__stage {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox__guard { position: absolute; inset: 0; }

.lightbox__btn {
  position: absolute;
  z-index: 2;
  background: none;
  border: 0;
  color: var(--lb-fg);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s ease;
  line-height: 0;
  padding: 12px;
}
.lightbox__btn:hover { opacity: 1; }
.lightbox__btn svg { display: block; }
.lightbox__close { top: 16px; right: 18px; }
.lightbox__prev  { left: 10px;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 10px; top: 50%; transform: translateY(-50%); }

.lightbox__counter {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(243, 239, 232, 0.62);
}
.lightbox__cap {
  position: absolute;
  z-index: 2;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: var(--t-caption);
  color: var(--lb-fg);
}

body.is-locked { overflow: hidden; }

/* ---- noscript ------------------------------------------------------------------------ */
.noscript { padding: 40px var(--pad); color: var(--muted); font-family: var(--sans); font-size: 14px; }
