:root {
  --nuit: #050d0a;
  --sous-bois: #0a1712;
  --texte: #efeadf;
  --doux: rgba(239, 234, 223, 0.7);
  --gris: rgba(239, 234, 223, 0.48);
  --or: #e7b04a;
  --filet: rgba(239, 234, 223, 0.14);
  --marge: clamp(20px, 5vw, 72px);
  --courbe: cubic-bezier(0.22, 0.61, 0.36, 1);
  --titre: "Instrument Serif", "Times New Roman", serif;
  --corps: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--nuit); color: var(--texte); font-family: var(--corps); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, p, figure, ol { margin: 0; }
em { font-style: italic; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--texte); color: var(--nuit); border-radius: 999px; font-size: 14px; text-decoration: none; }
.evitement:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }

.sur-titre { font-size: 12.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--or); }
.titre-section { font-family: var(--titre); font-weight: 400; font-size: clamp(42px, 6.4vw, 96px); line-height: 0.98; letter-spacing: -0.01em; margin-top: 14px; text-wrap: balance; }
.texte { margin-top: 18px; max-width: 34em; color: var(--doux); font-size: clamp(16px, 1.3vw, 19px); text-wrap: pretty; }
.num { font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--or); font-variant-numeric: tabular-nums; }

/* ---- L'en-tête ---- */
.tete { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(10px, env(safe-area-inset-top)) var(--marge) 10px; transition: opacity 0.5s var(--courbe), visibility 0s 0.5s; }
.tete::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(5, 13, 10, 0.78), rgba(5, 13, 10, 0)); pointer-events: none; }
.marque { font-family: var(--titre); font-size: 28px; line-height: 1; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.menu { display: flex; gap: clamp(14px, 2.6vw, 32px); }
.menu a { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--doux); transition: color 0.2s var(--courbe); }
@media (hover: hover) and (pointer: fine) { .menu a:hover { color: var(--texte); } }
@media (max-width: 400px) { .menu .menu-perso { display: none; } }
html[data-fx-etat="absent"] .tete, html[data-fx-etat="dessous"] .tete { opacity: 0; visibility: hidden; }
html[data-fx-etat="libre"] .tete { transition-delay: 0s; }

/* ---- Le film ---- */
.film { position: relative; }
.film-scene { position: relative; display: flex; flex-direction: column; }
.film-affiche { order: -1; display: block; position: relative; width: 100%; height: 72vh; height: 72svh; background: var(--nuit); }
.film-affiche img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.film-toile, .film-passer { display: none; }
.ouverture { position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 72vh; height: 72svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--marge) clamp(28px, 6vh, 64px); background: linear-gradient(to top, rgba(5, 13, 10, 0.62), rgba(5, 13, 10, 0) 46%); pointer-events: none; }
.titre-film { font-family: var(--titre); font-weight: 400; font-size: clamp(96px, 21vw, 320px); line-height: 0.82; letter-spacing: -0.02em; margin-top: 8px; text-shadow: 0 6px 60px rgba(0, 0, 0, 0.35); }
.indice { display: none; }

.carton { display: grid; align-content: center; justify-items: start; min-height: 100vh; min-height: 100svh; padding: 120px var(--marge) 72px; background: var(--sous-bois); }
.carton-titre { font-family: var(--titre); font-weight: 400; font-size: clamp(46px, 8.2vw, 128px); line-height: 0.96; letter-spacing: -0.015em; max-width: 12em; margin-top: 18px; text-wrap: balance; outline: none; }
.carton-titre em { color: var(--or); }
.carton-sous { margin-top: 26px; font-size: clamp(16px, 1.4vw, 20px); color: var(--doux); }
.lien-fleche { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 22px; font-size: 15px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--filet); transition: border-color 0.25s var(--courbe); }
.lien-fleche::after { content: ""; width: 18px; height: 1px; background: currentColor; }
@media (hover: hover) and (pointer: fine) { .lien-fleche:hover { border-color: var(--or); } }

/* Avec le script : la scène collée à l'écran, le film au défilement. */
.fx-actif .film-scene { position: sticky; top: 0; min-height: 100vh; min-height: 100lvh; background: var(--nuit); }
.fx-actif .film-affiche, .fx-actif .film-toile { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; }
.fx-actif .film-affiche { z-index: 2; }
.fx-actif .film-toile { display: block; z-index: 3; pointer-events: none; }
.fx-actif .carton { position: relative; z-index: 1; visibility: hidden; }
.fx-actif[data-fx-etat="dessous"] .film-scene, .fx-actif[data-fx-etat="libre"] .film-scene { background: none; }
.fx-actif[data-fx-etat="dessous"] .carton, .fx-actif[data-fx-etat="libre"] .carton { visibility: visible; }
.fx-actif[data-fx-etat="dessous"] .film-affiche, .fx-actif[data-fx-etat="libre"] .film-affiche, .fx-actif.fx-sans-affiche .film-affiche { visibility: hidden; }
.fx-actif .ouverture { height: 100vh; height: 100svh; opacity: calc(1 - var(--fx-debut, 0) * 2.2); }
.fx-actif:not([data-fx-etat="absent"]) .ouverture { visibility: hidden; }
.fx-actif .indice { display: flex; align-items: center; gap: 14px; margin-top: clamp(20px, 4vh, 36px); font-size: 14px; font-weight: 500; color: var(--doux); }
.fx-actif .indice::after { content: ""; width: 48px; height: 1px; background: currentColor; transform-origin: left; animation: indice 2.4s var(--courbe) infinite; }
@keyframes indice { 0% { transform: scaleX(0); opacity: 1; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.fx-actif:not(.fx-pret) .indice { opacity: 0; }
.fx-actif .film-passer { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; position: absolute; z-index: 5; right: max(10px, env(safe-area-inset-right)); top: calc(100vh - 62px); top: calc(100svh - 62px - env(safe-area-inset-bottom)); font-size: 14px; color: var(--doux); text-decoration: none; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); opacity: calc(1 - var(--fx-eclat, 0) * 5); }
.fx-actif:not([data-fx-etat="absent"]) .film-passer { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .film-passer:hover { color: var(--texte); } }

/* ---- L'univers ---- */
.univers { padding-top: clamp(96px, 16vh, 180px); }
.intro { padding: 0 var(--marge) clamp(48px, 8vh, 96px); }
.univers-scene { position: relative; display: grid; gap: 4px; }
.vue img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.legendes { display: none; }
.anime .univers-scene { display: block; height: 100vh; height: 100lvh; overflow: hidden; }
.anime .vue { position: absolute; inset: 0; will-change: clip-path; }
.anime .vue img { height: 100%; aspect-ratio: auto; will-change: transform; }
.anime .vue::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5, 13, 10, 0.72), rgba(5, 13, 10, 0) 44%); pointer-events: none; }
.anime .legendes { display: block; position: absolute; z-index: 2; left: var(--marge); right: var(--marge); bottom: clamp(32px, 8vh, 80px); }
.legende { position: absolute; left: 0; bottom: 0; }
.legende + .legende { opacity: 0; visibility: hidden; }
.legende-titre { font-family: var(--titre); font-size: clamp(44px, 6vw, 92px); line-height: 0.95; margin-top: 10px; }
.legende-texte { margin-top: 10px; color: var(--doux); }

/* ---- Le personnage ---- */
.personnage { margin-top: clamp(4px, 1vh, 8px); }
.perso-scene { position: relative; height: 100vh; height: 100svh; overflow: hidden; display: grid; align-items: center; }
.perso-image { position: absolute; inset: 0; }
.perso-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; will-change: transform; }
.perso-voile { position: absolute; inset: 0; background: rgba(5, 13, 10, 0.62); }
.perso-texte { position: relative; padding: 0 var(--marge); }
.ligne { font-family: var(--titre); font-size: clamp(52px, 9vw, 150px); line-height: 0.98; letter-spacing: -0.015em; margin-top: 6px; }
.ligne:first-of-type { margin-top: 18px; }
.ligne em { color: var(--or); }

/* ---- Les plans ---- */
.plans { padding-top: clamp(96px, 16vh, 180px); }
.plans-tete { padding: 0 var(--marge); }
.piste { list-style: none; padding: clamp(36px, 6vh, 64px) var(--marge) 0; display: flex; gap: clamp(14px, 2vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.piste::-webkit-scrollbar { display: none; }
.plan { flex: 0 0 min(78vw, 980px); scroll-snap-align: start; }
.plan-cadre { overflow: hidden; aspect-ratio: 16 / 9; background: var(--sous-bois); }
.plan-cadre img { width: 100%; height: 100%; object-fit: cover; }
.plan-nom { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; font-family: var(--titre); font-size: clamp(26px, 2.6vw, 40px); line-height: 1; }
.anime .plans-scene { height: 100vh; height: 100lvh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.anime .piste { overflow: visible; scroll-snap-type: none; width: max-content; padding-right: var(--marge); will-change: transform; }
.anime .plan { flex-basis: min(58vw, 860px); }
.anime .plan-cadre img { width: 116%; max-width: none; margin-left: -8%; will-change: transform; }
@media (max-aspect-ratio: 82/100) {
  .plan, .anime .plan { flex-basis: min(64vw, 380px); }
  .plan-cadre { aspect-ratio: 9 / 13; }
  .anime .plans-tete .texte { display: none; }
  .vue img { aspect-ratio: 9 / 14; }
}

/* ---- La fin ---- */
.fin { padding: clamp(120px, 22vh, 260px) var(--marge) clamp(64px, 12vh, 140px); text-align: center; }
.fin-titre { font-family: var(--titre); font-size: clamp(110px, 26vw, 420px); line-height: 0.8; letter-spacing: -0.02em; }
.fin-sous { margin-top: clamp(16px, 3vh, 32px); font-family: var(--titre); font-size: clamp(30px, 3.4vw, 52px); color: var(--or); }
.pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin: 0 var(--marge); padding: 22px 0 calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--filet); font-size: 13.5px; color: var(--gris); }
@media (max-width: 600px) { .pied { justify-content: center; text-align: center; } }

@media (prefers-reduced-motion: reduce) {
  .fx-actif .indice::after { animation: none; }
}
