/* Polices auto-hébergées, sous-ensemble latin */
@font-face { font-family: "Jost"; src: url("/fonts/jost.woff2") format("woff2"); font-weight: 300 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --noir: #0c0a09;
  --texte: #f2ede6;
  --texte-doux: rgba(242, 237, 230, .78);
  --cuivre: #c58a5a;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Futura", system-ui, sans-serif;
  --marge: clamp(20px, 4vw, 56px);
  /* Bord des pages intérieures : le contenu ne dépasse pas 1680 px sur les très grands écrans */
  --bord: max(var(--marge), calc((100vw - 1680px) / 2));
  --duree-fondu: 1.2s;
  --duree-diapo: 7s;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--noir); color: var(--texte); font: 300 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
body.accueil { overflow: hidden; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 1px solid var(--cuivre); outline-offset: 4px; }

/* Petites majuscules espacées, partagées par le menu, les étiquettes et le compteur */
.majuscules { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; }

/* En-tête */
.entete { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 26px var(--marge); }
.entete::before { content: ""; position: absolute; inset: 0 0 -40px; background: linear-gradient(rgba(12,10,9,.45), rgba(12,10,9,0)); pointer-events: none; z-index: -1; }
.logo img { height: 34px; width: auto; }
.menu { display: flex; gap: clamp(20px, 3vw, 44px); list-style: none; margin: 0; padding: 0; }
.menu a, .entete-tel { text-decoration: none; color: var(--texte-doux); transition: color .3s; }
.menu a:hover, .entete-tel:hover { color: var(--texte); }
.entete-tel { white-space: nowrap; }
.menu-bouton { display: none; }

/* Scène et diapositives */
.scene { position: fixed; inset: 0; height: 100svh; overflow: hidden; }
.diapo { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity var(--duree-fondu) ease, visibility 0s linear var(--duree-fondu); }
.diapo.est-active { opacity: 1; visibility: visible; transition: opacity var(--duree-fondu) ease, visibility 0s; z-index: 1; }
.diapo picture, .diapo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.diapo img { object-fit: cover; object-position: var(--cadrage, 50% 50%); transform: scale(1); will-change: transform; }
.diapo.est-active img { animation: zoom 9s linear forwards; }
@keyframes zoom { from { transform: scale(1); } to { transform: scale(1.06); } }
/* Voile sombre, sans teinte, derrière la légende */
.diapo::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 0% 100%, rgba(8,7,6,.72) 0%, rgba(8,7,6,.38) 45%, rgba(8,7,6,0) 75%), linear-gradient(to top, rgba(8,7,6,.35), rgba(8,7,6,0) 35%); }

/* Grain très léger */
.grain { position: fixed; inset: 0; z-index: 5; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Légende en bas à gauche */
.legende { position: absolute; z-index: 2; left: calc(var(--marge) + 40px); bottom: clamp(64px, 9vh, 100px); max-width: min(92vw, 980px); }
.legende { text-shadow: 0 1px 14px rgba(8,7,6,.45); }
.legende .majuscules { color: var(--texte); margin: 0 0 18px; }
.legende h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 8vw, 7rem); line-height: .92; text-shadow: 0 2px 40px rgba(8,7,6,.4); letter-spacing: -0.01em; margin: 0; }
.legende p.sous-titre { font-size: clamp(15px, 1.25vw, 18px); color: var(--texte-doux); max-width: 44ch; margin: 22px 0 26px; }
.liens { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.lien-serie, .bouton-video { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.lien-serie::after { content: ""; width: 40px; height: 1px; background: currentColor; transition: width .4s ease; }
.lien-serie:hover::after { width: 64px; }
.bouton-video svg { width: 12px; height: 12px; fill: currentColor; }
.lien-serie::after { background: var(--cuivre); }
.bouton-video:hover, .lien-serie:hover { color: var(--cuivre); }

/* Commandes */
.fleche { position: absolute; z-index: 10; top: 50%; transform: translateY(-50%); width: 64px; height: 96px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--texte-doux); transition: color .3s; }
.fleche:hover { color: var(--texte); }
.fleche svg { width: 20px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1; }
.fleche-prec { left: 8px; }
.fleche-suiv { right: 8px; }
.pied { position: absolute; z-index: 10; right: var(--marge); bottom: 34px; display: flex; align-items: center; gap: 18px; color: var(--texte-doux); }
.compteur { font-variant-numeric: tabular-nums; }
.compteur b { font-weight: 400; color: var(--texte); }
.pause { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--texte-doux); }
.pause:hover { color: var(--texte); }
.pause svg { width: 12px; height: 12px; fill: currentColor; }
.pause .icone-lecture, .scene.en-pause .pause .icone-pause { display: none; }
.scene.en-pause .pause .icone-lecture { display: block; }
.progression { position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(242,237,230,.12); }
.progression span { display: block; height: 100%; background: var(--cuivre); transform-origin: left; transform: scaleX(0); }
.progression span.en-cours { animation: progression var(--duree-diapo) linear forwards; }
.scene.en-pause .progression span { animation-play-state: paused; }
@keyframes progression { to { transform: scaleX(1); } }

/* Fenêtre vidéo */
.fenetre-video { width: min(92vw, 1280px); padding: 0; border: 0; background: #000; color: var(--texte); }
.fenetre-video::backdrop { background: rgba(8,7,6,.92); }
.fenetre-video .cadre { position: relative; aspect-ratio: 16 / 9; }
.fenetre-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fermer { position: absolute; right: 0; top: -52px; min-height: 44px; background: none; border: 0; cursor: pointer; color: var(--texte-doux); }
.fermer:hover { color: var(--texte); }
.fenetre-video[open] { overflow: visible; }

/* Menu plein écran (mobile) */
.menu-plein { position: fixed; inset: 0; z-index: 40; background: var(--noir); display: none; flex-direction: column; justify-content: center; padding: var(--marge); }
.menu-plein.ouvert { display: flex; }
.menu-plein ul { list-style: none; margin: 0 0 48px; padding: 0; }
.menu-plein li a { display: block; font-family: var(--serif); font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1.15; text-decoration: none; padding: 6px 0; }
.menu-plein .fermer { top: 22px; right: var(--marge); }

/* Pages intérieures */
.page .entete { background: rgba(12,10,9,.9); backdrop-filter: blur(10px); }
.page .entete::before { display: none; }
.menu a[aria-current="page"] { color: var(--texte); box-shadow: 0 1px 0 var(--cuivre); }
.evitement { position: absolute; left: var(--marge); top: -60px; z-index: 50; background: var(--texte); color: var(--noir); padding: 10px 14px; text-decoration: none; }
.evitement:focus { top: 12px; }
.page-tete { padding: clamp(120px, 17vh, 168px) var(--bord) clamp(28px, 4vh, 44px); }
.page-tete .majuscules { color: var(--cuivre); margin: 0 0 14px; }
.page-tete h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2.5rem, 5.6vw, 5.2rem); line-height: 1; margin: 0; text-wrap: balance; max-width: 16ch; }
.page-intro { font-size: clamp(16px, 1.3vw, 18px); color: var(--texte-doux); max-width: 62ch; margin: 18px 0 0; }
.page-tete-seule { min-height: 72svh; padding-bottom: clamp(56px, 8vh, 96px); }
.page-tete-seule .appel-liens { margin-top: 32px; }

/* Grille de photos : uniforme, format 3:2, compacte */
.grille-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, .8vw, 12px); padding: 0 var(--bord); }
.grille-photos a.photo { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #1a1714; cursor: zoom-in; }
.grille-photos picture, .grille-photos img { display: block; width: 100%; height: 100%; }
.grille-photos img { object-fit: cover; transition: transform .8s ease, opacity .4s; }
.grille-photos a.photo:hover img { transform: scale(1.04); }
.grille-photos a.photo:focus-visible { outline-offset: 2px; }

/* Texte de la page (référencement) */
.texte-page { padding: clamp(56px, 8vw, 104px) var(--bord) 0; display: grid; gap: clamp(40px, 5vw, 64px); }
.texte-page > .bloc { max-width: 1200px; }
.bloc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(16px, 4vw, 64px); border-top: 1px solid rgba(242,237,230,.14); padding-top: 24px; }
.bloc h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.1; margin: 0; text-wrap: balance; }
.bloc-corps { color: var(--texte-doux); font-size: 17px; max-width: 62ch; }
.bloc-corps p { margin: 0 0 14px; }
.bloc-corps a { color: var(--texte); text-decoration-color: var(--cuivre); text-underline-offset: 3px; }
.bloc-corps a:hover { color: var(--cuivre); }
.liste { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; }
.liste li { padding-left: 18px; position: relative; color: var(--texte); }
.liste li::before { content: ""; position: absolute; left: 0; top: .78em; width: 8px; height: 1px; background: var(--cuivre); }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.etapes .majuscules { color: var(--texte); font-size: 11px; }
.etapes p { margin: 6px 0 0; }

/* Appel à l'action */
.appel { margin: clamp(64px, 9vw, 120px) var(--bord) clamp(64px, 8vw, 104px); padding: clamp(32px, 5vw, 64px); border: 1px solid rgba(197,138,90,.45); }
.appel h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; margin: 0; }
.appel p { color: var(--texte-doux); font-size: 17px; max-width: 52ch; margin: 14px 0 28px; }
.appel-liens { display: flex; gap: 12px; flex-wrap: wrap; }
.bouton { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; background: var(--texte); color: var(--noir); text-decoration: none; font-weight: 400; letter-spacing: .02em; transition: background .3s, color .3s; }
.bouton:hover { background: var(--cuivre); color: var(--noir); }
.bouton-contour { background: transparent; color: var(--texte); box-shadow: inset 0 0 0 1px rgba(242,237,230,.4); }
.bouton-contour:hover { background: transparent; color: var(--cuivre); box-shadow: inset 0 0 0 1px var(--cuivre); }

/* Pied de page */
.pied-page { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; padding: 36px var(--bord) 40px; border-top: 1px solid rgba(242,237,230,.14); color: var(--texte-doux); font-size: 15px; }
.pied-coord { display: flex; flex-direction: column; gap: 4px; }
.pied-coord p { margin: 0; }
.pied-coord .majuscules { color: var(--texte); margin-bottom: 4px; }
.pied-coord:nth-child(2) { align-items: flex-end; }
.pied-page a { text-decoration: none; }
.pied-page a:hover { color: var(--cuivre); }
.pied-droits { grid-column: 1 / -1; margin: 12px 0 0; font-size: 11px; color: rgba(242,237,230,.5); }

@media (max-width: 1100px) {
  .grille-photos { grid-template-columns: repeat(3, 1fr); }
}

/* Visionneuse */
.visionneuse { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(8,7,6,.97); color: var(--texte); }
.visionneuse::backdrop { background: rgba(8,7,6,.97); }
.visionneuse[open] { display: grid; place-items: center; }
.visionneuse figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.visionneuse img { max-width: calc(100vw - 160px); max-height: calc(100svh - 140px); width: auto; height: auto; object-fit: contain; }
.visionneuse figcaption { display: flex; gap: 24px; justify-content: space-between; width: 100%; margin-top: 16px; color: var(--texte-doux); font-size: 11px; }
.visionneuse .fermer { top: 18px; right: var(--marge); }

/* Mobile : pensé à part */
@media (max-width: 760px) {
  .entete { padding: 18px var(--marge); }
  .logo img { height: 26px; }
  .menu, .entete-tel { display: none; }
  .menu-bouton { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer; }
  .menu-bouton svg { width: 24px; height: 12px; stroke: var(--texte); stroke-width: 1.2; }
  .diapo img { object-position: var(--cadrage-mobile, var(--cadrage, 50% 50%)); }
  .legende { left: var(--marge); bottom: 104px; right: var(--marge); }
  .legende .majuscules { margin-bottom: 12px; font-size: 11px; }
  .legende p.sous-titre { margin: 14px 0 16px; }
  .fleche { top: auto; bottom: 22px; transform: none; width: 44px; height: 52px; }
  .fleche svg { width: 14px; height: 28px; }
  .fleche-prec { left: calc(var(--marge) - 12px); }
  .fleche-suiv { right: auto; left: calc(var(--marge) + 32px); }
  .pied { bottom: 26px; }
  .grille-photos { grid-template-columns: repeat(2, 1fr); }
  .bloc, .liste, .etapes, .pied-page { grid-template-columns: 1fr; }
  .pied-coord:nth-child(2) { align-items: flex-start; }
  .bloc-corps, .appel p { font-size: 16px; }
  .visionneuse img { max-width: 100vw; max-height: calc(100svh - 160px); }
  .visionneuse figcaption { padding: 0 var(--marge); }
  .visionneuse .fleche { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .diapo.est-active img { animation: none; }
  .diapo, .diapo.est-active { transition-duration: .01s; }
  .progression, .pause { display: none; }
}
