@font-face {
  font-family: "Antic Didone";
  src: url("../fonts/antic-didone-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --sage: #E4E7D8;
  --ink: #22301F;
  --muted: #56634A;
  --moss: #5E6F47;
  --lavender: #6A61B0;
  --lavender-soft: #C9C3EC;
  --ochre: #D8B35C;
  --deep: #22301F;
  --on-deep: #E8EBDD;
  --on-deep-muted: #AEB79F;
  --on-accent: #FFFFFF;
  --line: rgba(34, 48, 31, .18);
  --header-h: 3.5rem;
  --display: "Antic Didone", "Didot", "Bodoni 72", Georgia, serif;
  --text: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sage);
  color: var(--ink);
  font-family: var(--text);
  font-weight: 300;
  font-size: clamp(1.0625rem, .98rem + .3vw, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -.01em; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 4px; border-radius: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--text); font-weight: 500; font-size: 1rem;
  padding: .95em 1.6em;
  background: var(--lavender); color: var(--on-accent);
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 1em; height: 1em; }


/* En-tête discret */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) clamp(1.5rem, 6vw, 6rem) 0;
  display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 2.5rem);
  color: #F4F2EA;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: color-mix(in srgb, var(--sage) 90%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--ink); border-bottom-color: var(--line);
}
.brand {
  font-family: var(--display); font-size: 1.25rem; text-decoration: none; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.site-header.is-solid .brand { opacity: 1; pointer-events: auto; }
.site-nav { opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
.site-header.is-solid .site-nav { opacity: 1; visibility: visible; transition: opacity .35s ease, visibility 0s; }
.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 2.5vw, 2rem); margin: 0; padding: 0; }
.site-nav a {
  font-size: .9375rem; text-decoration: none; opacity: .78;
  padding: .3rem 0; border-bottom: 1px solid transparent;
  transition: opacity .2s ease, border-color .2s ease;
}
.site-nav a:hover { opacity: 1; }
.site-nav a[aria-current="true"] { opacity: 1; border-bottom-color: currentColor; }
.lang { margin-left: auto; display: flex; align-items: center; gap: .15rem; font-size: .875rem; }
.lang a {
  color: inherit; text-decoration: none;
  padding: .35rem .45rem; opacity: .6; border-radius: 4px;
}
.lang a:hover { opacity: 1; }
.lang a[aria-current="page"] { opacity: 1; font-weight: 500; text-decoration: underline; text-underline-offset: .3em; }
.lang span { opacity: .4; }
@media (max-width: 720px) { .site-nav { display: none; } }

/* 1. Ouverture */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden; color: #F4F2EA; isolation: isolate;
}
.hero__img {
  position: absolute; inset: -6% 0 auto 0; width: 100%; height: 112%;
  object-fit: cover; object-position: 60% 40%;
  z-index: -2; will-change: transform;
  animation: settle 2.4s cubic-bezier(.2,.7,.2,1) both;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(20, 28, 18, .45) 0%, rgba(20, 28, 18, 0) 16%),
    radial-gradient(ellipse 70% 60% at 15% 85%, rgba(20, 28, 18, .55), rgba(20, 28, 18, 0) 70%),
    linear-gradient(to top, rgba(20, 28, 18, .85) 0%, rgba(20, 28, 18, .4) 40%, rgba(20, 28, 18, 0) 65%),
    rgba(20, 28, 18, var(--dim, 0));
}
.hero__content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 clamp(1.5rem, 6vw, 6rem) calc(clamp(3rem, 9vh, 6rem) + env(safe-area-inset-bottom, 0px));
  max-width: 64rem;
}
.hero h1 {
  text-shadow: 0 2px 30px rgba(20, 28, 18, .45);
  font-size: clamp(3.5rem, 2rem + 8vw, 9.5rem);
  line-height: .9;
  animation: rise 1.4s .5s cubic-bezier(.2,.7,.2,1) both;
}
.hero__baseline {
  margin: 1.1rem 0 2.2rem; max-width: 30rem;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.4rem); line-height: 1.45;
  color: rgba(244, 242, 234, .88);
  animation: rise 1.4s .8s cubic-bezier(.2,.7,.2,1) both;
}
.hero .btn { animation: rise 1.4s 1.05s cubic-bezier(.2,.7,.2,1) both; }
@keyframes settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* 2. Concept : frise qui avance au scroll */
.concept {
  display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(5rem, 12vh, 9rem) clamp(1.5rem, 6vw, 6rem);
  max-width: 82rem; margin: 0 auto;
}
.chrono { position: sticky; top: calc(var(--header-h) + 8vh + env(safe-area-inset-top, 0px)); align-self: start; }
.chrono h2 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); line-height: 1.05; margin-bottom: clamp(2rem, 6vh, 3.5rem); }
.year {
  font-family: var(--display); line-height: .85;
  font-size: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--moss);
  display: flex; align-items: baseline; gap: .25em;
}
.eras { list-style: none; margin: 2rem 0 0; padding: 0; border-left: 1px solid var(--line); }
.eras li {
  position: relative; padding: .35rem 0 .35rem 1.1rem;
  color: var(--muted); transition: color .3s ease;
}
.eras li::before {
  content: ""; position: absolute; left: -4px; top: calc(.35rem + .8em); width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--sage); border: 1px solid var(--line);
  transition: background-color .3s ease, border-color .3s ease;
}
.eras li.is-past::before { background: var(--moss); border-color: var(--moss); }
.eras li.is-active { color: var(--ink); font-weight: 500; }
.eras li.is-active::before { background: var(--lavender); border-color: var(--lavender); }

.chapters { padding-bottom: 8vh; }
.chapter {
  min-height: 62vh; display: flex; align-items: center;
  max-width: 34rem;
  transition: opacity .5s ease;
}
.js .chapter { opacity: .32; }
.js .chapter.is-active { opacity: 1; }
.chapters .chapter:first-of-type { min-height: 92vh; }
.chapter p { margin: 0; font-size: clamp(1.25rem, 1.05rem + .7vw, 1.6rem); line-height: 1.5; }

/* 3. Galerie */
.gallery {
  background: var(--deep); color: var(--on-deep);
  padding: clamp(5rem, 12vh, 8rem) 0;
}
.gallery__head {
  display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap;
  padding: 0 clamp(1.5rem, 6vw, 6rem); margin-bottom: 2.5rem;
  max-width: 82rem; margin-inline: auto;
}
.gallery h2 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem); line-height: 1.05; }
.gallery__head p { margin: .75rem 0 0; color: var(--on-deep-muted); max-width: 32rem; }
.nav { display: flex; gap: .6rem; }
.nav button {
  flex: 0 0 auto; width: 3rem; height: 3rem; aspect-ratio: 1; padding: 0; border-radius: 50%;
  border: 1px solid rgba(232, 235, 221, .35); background: transparent; color: var(--on-deep);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.nav button:hover:not(:disabled) { background: rgba(232, 235, 221, .1); }
.nav button:disabled { opacity: .3; cursor: default; }
.nav svg { width: 1.1rem; height: 1.1rem; }

.track {
  display: flex; gap: clamp(1rem, 2vw, 1.75rem);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  --edge: calc(max(0px, (100% - 82rem) / 2) + clamp(1.5rem, 6vw, 6rem));
  padding: 0 var(--edge) 1rem;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
/* Cadre fixe : toutes les vignettes ont la même taille, l'image est recadrée si besoin */
.slide { flex: 0 0 auto; width: min(80vw, 36rem); min-width: 0; scroll-snap-align: start; margin: 0; }
.slide button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 6px; overflow: hidden;
}
.slide img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.slide button:hover img { transform: scale(1.03); }
.slide figcaption { margin-top: .9rem; color: var(--on-deep-muted); font-size: 1rem; }

/* Agrandissement */
.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100vh; height: 100dvh;
  overflow: hidden; overscroll-behavior: contain; touch-action: pan-y pinch-zoom;
  background: #0E130C; color: var(--on-deep);
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; animation: fade .25s ease; }
.lightbox::backdrop { background: #0E130C; }
.lightbox__bar {
  display: flex; justify-content: flex-end;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem 0;
}
.lightbox__stage {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(.5rem, 2vh, 1.5rem) clamp(3.5rem, 8vw, 6rem);
  min-height: 0; overflow: hidden;
}
/* L'image entière tient toujours dans l'écran, avec une marge autour */
.lightbox__stage img {
  width: auto; height: auto;
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  max-height: calc(100dvh - 12rem);
  object-fit: contain; border-radius: 4px;
}
.lightbox__foot {
  display: flex; justify-content: center; align-items: center; gap: clamp(.75rem, 3vw, 1.5rem);
  padding: 0 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
}
.lightbox__text { flex: 0 1 28rem; min-width: 0; text-align: center; }
/* Page figée derrière l'image agrandie : pas de défilement ni d'étirement latéral */
html.lightbox-open, html.lightbox-open body { overflow: hidden; overscroll-behavior: none; }
.lightbox:focus { outline: none; }
@media (max-width: 600px) { .lightbox__stage { padding-inline: 1rem; } }
.lightbox__text p { margin: 0; color: var(--on-deep); }
.lightbox__text .credit { margin-top: .2rem; font-size: .875rem; color: var(--on-deep-muted); }
.lightbox .nav button { border-color: rgba(232, 235, 221, .35); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 4. Développement */
.dev {
  padding: clamp(6rem, 16vh, 11rem) clamp(1.5rem, 6vw, 6rem);
  max-width: 82rem; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 7rem);
  align-items: end;
}
.dev h2 { font-size: clamp(2.75rem, 1.8rem + 3.6vw, 5rem); line-height: 1; }
.dev p { margin: 0; max-width: 30rem; font-size: clamp(1.25rem, 1.05rem + .7vw, 1.6rem); line-height: 1.5; }

footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem clamp(1.5rem, 6vw, 6rem) calc(1.5rem + env(safe-area-inset-bottom, 0px));
  font-size: .9rem; color: var(--muted);
  max-width: 82rem; margin: 0 auto;
}

@media (max-width: 800px) {
  .concept { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .chrono {
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 2; margin: 0 calc(-1 * clamp(1.5rem, 6vw, 6rem));
    padding: .9rem clamp(1.5rem, 6vw, 6rem);
    background: var(--sage); border-bottom: 1px solid var(--line);
  }
  .chrono h2 { display: none; }
  .chrono .era-name { display: inline; }
  .year { font-size: 2.75rem; }
  .eras { display: flex; gap: .4rem; margin-top: .7rem; border: 0; }
  .eras li { flex: 1; padding: 0; height: 3px; background: var(--line); border-radius: 2px; font-size: 0; }
  .eras li::before { display: none; }
  .eras li.is-past { background: var(--moss); }
  .eras li.is-active { background: var(--lavender); }
  .concept-title-mobile { display: block !important; }
  .chapter { min-height: 40vh; align-items: flex-start; padding-top: 1.75rem; }
  .chapters .chapter:first-of-type { min-height: 55vh; }
  .dev { grid-template-columns: 1fr; align-items: start; }
}
.era-name { display: none; margin-left: auto; font-family: var(--text); font-size: 1rem; font-weight: 500; color: var(--ink); }
.concept-title-mobile { display: none; font-size: 2.25rem; line-height: 1.05; margin: 2.5rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  .hero__img, .hero h1, .hero__baseline, .hero .btn { animation: none; }
  .chapter, .eras li, .slide img { transition: none; }
}

/* Bandeau cookies : accepter et refuser ont exactement le même poids (exigence CNIL) */
.consent {
  position: fixed; z-index: 30;
  right: clamp(1rem, 3vw, 2rem); bottom: calc(clamp(1rem, 3vw, 2rem) + env(safe-area-inset-bottom, 0px));
  max-width: 26rem; padding: 1.25rem 1.4rem;
  background: var(--deep); color: var(--on-deep);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(20, 28, 18, .35);
  font-size: .95rem; line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 1rem; }
.consent__actions { display: flex; gap: .6rem; }
.consent__btn {
  flex: 1; font: inherit; font-weight: 500; cursor: pointer;
  padding: .7em 1em; border-radius: 999px;
  background: transparent; color: var(--on-deep);
  border: 1px solid rgba(232, 235, 221, .55);
  transition: background-color .2s ease;
}
.consent__btn:hover { background: rgba(232, 235, 221, .12); }
.consent-link {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  margin-left: 1.5rem; text-decoration: underline; text-underline-offset: .2em;
}
@media (max-width: 520px) {
  .consent { left: 1rem; right: 1rem; max-width: none; }
}
