/* Kermess Films — feuille de style unique
   Toutes les variables ci-dessous sont pilotees par editeur.html, qui les
   ecrit dans assets/config.js. Trois jeux : accueil, fiche film, mentions
   legales, chacun en version ordinateur et version telephone.
   Ne les modifie pas a la main ici. */

:root {
  --ink: #ffffff;
  --bg: #000000;
  --grey: #8d8d8d;            /* couleur de survol, commune a tout le site */

  /* ---- accueil ---- */
  --pad-top:        6.5vh;
  --gap-brand:      4.3vh;
  --actions-bottom: 21vh;
  --pad-bottom:     3.4vh;
  --icon:           6.6vw;
  --wordmark:      41.7vw;
  --measure:         61vw;
  --action-w:      12.1vw;
  --action-gap:     3.5vw;
  --fs-bio:        1.16vw;
  --fs-action:     1.08vw;
  --fs-footer:     0.80vw;
  --text-shadow:     0.30;

  /* ---- fiche film ---- */
  --film-pad-top:      6.5vh;
  --film-head:         0.60;   /* echelle de l'en-tete par rapport a l'accueil */
  --film-gap-head:      8vh;
  --film-width:        72vw;
  --film-poster-w:     24vw;
  --film-poster-max:   62vh;
  --film-col-gap:       4vw;
  --film-credit-gap:    2.0em;
  --film-fs-title:    2.10vw;
  --film-fs-meta:     0.90vw;
  --film-fs-text:     1.00vw;

  /* ---- mentions legales ---- */
  --legal-pad-top:     6.0vh;
  --legal-head:        0.60;
  --legal-gap-head:     7vh;
  --legal-width:       51vw;
  --legal-fs:        1.02vw;
  --legal-line:        2.05;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.home { overflow: hidden; }

/* ---------- fond video ---------- */

.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000 center/cover no-repeat; }
.backdrop video, .backdrop img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}

/* ---------- accueil ---------- */

.stage {
  position: relative; z-index: 1;
  height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--pad-top) 24px var(--pad-bottom);
  text-align: center;
}

.brand { display: flex; flex-direction: column; align-items: center; gap: var(--gap-brand); flex: 0 0 auto; }
.brand .icon { width: var(--icon); height: auto; display: block; }
.brand .wordmark { width: var(--wordmark); max-width: 88vw; height: auto; display: block; }
a.brand-link { display: block; line-height: 0; }

.middle { flex: 1 1 auto; position: relative; width: 100%; min-height: 0; padding: 2vh 0; }

/* Chaque panneau est promu sur son propre calque : sans cela WebKit fusionne
   une partie du texte avec la video en dessous et le fondu se fait par
   morceaux au lieu d'un effacement propre. */
.layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; pointer-events: none;
  will-change: opacity; backface-visibility: hidden;
  transition: opacity 0.45s ease;
}
.layer.is-open { opacity: 1; pointer-events: auto; }
.layer::-webkit-scrollbar { width: 0; height: 0; }

.bio {
  max-width: var(--measure);
  font-size: var(--fs-bio);
  line-height: 1.8; letter-spacing: 0.05em; margin: 0;
  text-shadow: 0 1px 16px rgba(0,0,0,var(--text-shadow));
}
.bio p { margin: 0; }
.bio p + p { margin-top: 1.4em; }
.bio strong { font-weight: 600; }
.bio a { color: inherit; text-decoration: none; transition: color .1s linear; }
.bio a:hover { color: var(--grey); }

/* ---------- liste des films ---------- */

.films {
  list-style: none; margin: 0; padding: 0;
  max-width: var(--measure); width: 100%;
  text-shadow: 0 1px 16px rgba(0,0,0,var(--text-shadow));
}
.film + .film { margin-top: 2em; }

.film-link { display: block; color: inherit; text-decoration: none; padding: 0.35em 0; transition: color .1s linear; }
.film-link:hover { color: var(--grey); }

.film-title { font-size: var(--fs-bio); font-weight: 600; letter-spacing: 0.09em; line-height: 1.4; margin: 0; }
.film-meta {
  margin: 0.5em 0 0; font-size: calc(var(--fs-bio) * 0.8);
  font-weight: 300; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.film-link:hover .film-meta { color: inherit; }
.film-meta .dot { opacity: 0.5; margin: 0 0.5em; }

/* ---------- boutons FILMS / ABOUT / CONTACT ---------- */

.actions { display: flex; gap: var(--action-gap); margin-bottom: var(--actions-bottom); flex: 0 0 auto; }

.action {
  appearance: none; background: none; border: 0;
  border-top: 1px solid rgba(255,255,255,0.9);
  color: var(--ink); font: inherit;
  font-size: var(--fs-action); font-weight: 300;
  letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none;
  display: block; width: var(--action-w);
  padding: 0.95em 0 0; text-indent: 0.2em; cursor: pointer;
  text-shadow: 0 1px 16px rgba(0,0,0,var(--text-shadow));
  transition: color .1s linear, border-color .1s linear;
}
.action:hover, .action[aria-expanded="true"] { color: var(--grey); border-top-color: var(--grey); }

/* ---------- pied de page ---------- */

.footer {
  font-size: var(--fs-footer); font-weight: 300; letter-spacing: 0.15em;
  display: flex; align-items: center; gap: 1.5em; flex: 0 0 auto;
  text-shadow: 0 1px 16px rgba(0,0,0,var(--text-shadow));
}
.footer a { color: inherit; text-decoration: none; transition: color .1s linear; }
.footer a:hover { color: var(--grey); }
.footer .sep { color: var(--grey); }

.langs { display: flex; gap: 1.2em; }
.langs a { color: var(--grey); }
.langs a.is-current { color: var(--ink); font-weight: 600; }
.langs a:hover { color: #c9c9c9; }

/* ================= pages interieures ================= */

body.inner { background: #000; }

.inner-page {
  position: relative; z-index: 1; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  --text-shadow: 0;
}

/* L'en-tete des pages interieures reprend les valeurs de l'accueil multipliees
   par l'echelle de la page. Le calcul doit rester ici, sur les elements eux
   memes : place dans :root il serait resolu avant que --head-scale existe, et
   l'echelle serait ignoree. */
.inner-page .brand { gap: calc(var(--gap-brand) * var(--head-scale, 1)); }
.inner-page .brand .icon { width: calc(var(--icon) * var(--head-scale, 1)); }
.inner-page .brand .wordmark { width: calc(var(--wordmark) * var(--head-scale, 1)); }

.inner-page .footer { margin-top: auto; padding-top: 7vh; }

/* ---------- fiche film ---------- */

.page-film {
  --head-scale: var(--film-head);
  padding: var(--film-pad-top) 24px 8vh;
}

.film-page {
  width: var(--film-width); max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, var(--film-poster-w)) minmax(0, 1fr);
  gap: var(--film-col-gap);
  margin-top: var(--film-gap-head);
  align-items: start;
}

/* L'affiche garde le rapport exact du fichier fourni. La largeur est fixee
   par le reglage, la hauteur suit, et un plafond evite qu'une affiche tres
   verticale ne pousse la page. */
.poster { width: 100%; display: flex; justify-content: center; }
.poster img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: var(--film-poster-max);
  border: 1px solid rgba(255,255,255,.14);
}
.poster .none {
  width: 100%; aspect-ratio: 1 / 1.4142;
  border: 1px solid rgba(255,255,255,.14); background: #0d0d0d;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.28);
}

.sheet { min-width: 0; }
.sheet h1 { margin: 0; font-size: var(--film-fs-title); font-weight: 600; letter-spacing: 0.06em; line-height: 1.25; }

/* Deux colonnes reelles : la premiere s'ajuste au libelle le plus long, donc
   aucun chevauchement possible quelle que soit la taille du texte. */
.sheet .credits {
  margin: 1.5em 0 0; font-size: var(--film-fs-meta);
  letter-spacing: 0.17em; text-transform: uppercase; line-height: 2.2;
  color: rgba(255,255,255,.72);
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  column-gap: var(--film-credit-gap);
}
.sheet .credits .k { color: rgba(255,255,255,.42); }
.sheet .credits .v { color: inherit; }

.sheet h2 {
  margin: 3.2em 0 1.2em; font-size: calc(var(--film-fs-meta) * 0.88); font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase; color: rgba(255,255,255,.42);
}

.sheet .prose { margin: 0; font-size: var(--film-fs-text); line-height: 2; letter-spacing: 0.035em; }
.sheet .crew {
  margin: 0; font-family: inherit; font-size: calc(var(--film-fs-text) * 0.92);
  line-height: 2.15; letter-spacing: 0.05em; white-space: pre-wrap; color: rgba(255,255,255,.8);
}

.sheet .links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 3.2em; }

.link-btn {
  display: inline-block; color: inherit; text-decoration: none;
  border: 1px solid rgba(255,255,255,.55);
  font-size: calc(var(--film-fs-meta) * 0.88);
  letter-spacing: 0.2em; text-transform: uppercase;
  padding: 1.1em 2em; transition: .12s linear;
}
.link-btn:hover { background: #fff; color: #000; border-color: #fff; }

/* ---------- mentions legales ---------- */

.page-legal {
  --head-scale: var(--legal-head);
  padding: var(--legal-pad-top) 24px 8vh;
}

.legal-switch {
  margin: calc(var(--legal-gap-head) * 0.45) 0 var(--legal-gap-head);
  display: flex; gap: 26px;
  font-size: calc(var(--legal-fs) * 1.05); letter-spacing: 0.06em;
}
.legal-switch a { color: var(--grey); text-decoration: none; transition: color .1s linear; }
.legal-switch a:hover { color: #c9c9c9; }
.legal-switch a.is-current { color: var(--ink); font-weight: 500; }

.legal-body {
  width: var(--legal-width); max-width: 100%;
  font-size: var(--legal-fs); line-height: var(--legal-line); letter-spacing: 0.02em;
  text-align: justify; text-justify: inter-word; hyphens: none;
}
.legal-body h2 { font-size: 1em; font-weight: 500; letter-spacing: 0.06em; margin: 0 0 2.1em; text-align: left; }
.legal-body p { margin: 0 0 2em; }
.legal-body a { color: inherit; text-decoration: none; transition: color .1s linear; }
.legal-body a:hover { color: var(--grey); }
.legal-body hr { border: 0; border-top: 1px solid rgba(255,255,255,.85); margin: 4.6em 0 5em; }

/* ================= telephone =================
   Valeurs par defaut. L'editeur les remplace via les blocs "mobile" de
   config.js, appliques en dessous de 781px seulement. */

@media (max-width: 780px) {
  :root {
    --pad-top: 5vh;
    --gap-brand: 3vh;
    --actions-bottom: 13vh;
    --pad-bottom: 3vh;
    --icon: 13vw;
    --wordmark: 66vw;
    --measure: 86vw;
    --action-w: 27vw;
    --action-gap: 4vw;
    --fs-bio: 3.3vw;
    --fs-action: 2.7vw;
    --fs-footer: 2.4vw;
    --text-shadow: 0.30;

    --film-pad-top: 5vh;
    --film-head: 1;
    --film-gap-head: 5vh;
    --film-width: 88vw;
    --film-poster-w: 62vw;
    --film-poster-max: 52vh;
    --film-col-gap: 7vw;
    --film-credit-gap: 1.6em;
    --film-fs-title: 6vw;
    --film-fs-meta: 2.7vw;
    --film-fs-text: 3.3vw;

    --legal-pad-top: 5vh;
    --legal-head: 1;
    --legal-gap-head: 5vh;
    --legal-width: 88vw;
    --legal-fs: 3.1vw;
    --legal-line: 1.95;
  }

}

/* Structure du telephone. Repetee pour la classe force-mobile : l'apercu de
   l'editeur est une maquette mise a l'echelle, aucune media query ne s'y
   declenche, il faut donc pouvoir imposer ces regles a la main. */

@media (max-width: 780px) {
  .stage { padding-left: 16px; padding-right: 16px; }
  .action { letter-spacing: 0.12em; text-indent: 0.12em; }
  .film-meta { letter-spacing: 0.13em; }
  .film-page { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .poster { justify-content: center; }
  .sheet { width: 100%; }
  .legal-body { text-align: left; }
}

.force-mobile .stage { padding-left: 16px; padding-right: 16px; }
.force-mobile .action { letter-spacing: 0.12em; text-indent: 0.12em; }
.force-mobile .film-meta { letter-spacing: 0.13em; }
.force-mobile .film-page { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.force-mobile .poster { justify-content: center; }
.force-mobile .sheet { width: 100%; }
.force-mobile .legal-body { text-align: left; }

/* ---------- accessibilite ---------- */

:focus-visible { outline: 1px solid #fff; outline-offset: 6px; }

@media (prefers-reduced-motion: reduce) {
  .layer { transition-duration: 0.01ms; }
  .backdrop video { display: none; }
}
