/* Page de visionnage du film Camille : les jetons de l'app (mur, encre, nuit), Spectral pour ce
   qui se dit, Atkinson Hyperlegible Next pour l'interface, le rouge de Takeda pour l'action. */
@font-face { font-family: "Spectral"; font-weight: 300; font-display: swap;
  src: url("/commun/polices/spectral-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 400; font-display: swap;
  src: url("/commun/polices/spectral-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-display: swap;
  src: url("/commun/polices/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 600; font-display: swap;
  src: url("/commun/polices/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); }

:root {
  --mur: #e7eaed;
  --papier: #f6f7f8;
  --encre: #15223a;
  --texte-secondaire: #5e6a7d;
  --filet: rgb(102 114 133 / 25%);
  --nuit: #0e1828;
  --nuit-texte: #e7eaed;
  --takeda: #bd120a;
  --takeda-profond: #891515;
  --vermillon: #ea5532;
  --serif: "Spectral", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --elev-lecteur: 0 1px 2px rgb(21 34 58 / 6%), 0 2.4rem 4rem -2rem rgb(21 34 58 / 38%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --marge: clamp(16px, 6vw, 96px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--mur);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--takeda); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--takeda); outline-offset: 3px; }
.chiffres { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

.marque { margin: 0; font-family: var(--serif); font-weight: 300; letter-spacing: 0.005em; }
.pied {
  padding: 32px var(--marge) 40px;
  color: var(--texte-secondaire);
  font-size: 14px;
}

/* Porte (mot de passe) */
.porte { display: grid; grid-template-rows: 1fr auto; }
.porte .pied { text-align: center; }
.porte-carte {
  align-self: center;
  justify-self: center;
  width: min(100% - 32px, 440px);
  padding: 48px 0;
  animation: monter 700ms var(--ease) both;
}
.porte .marque { font-size: clamp(56px, 12vw, 88px); line-height: 1; }
.porte-titre { margin: 12px 0 0; font-family: var(--serif); font-size: 24px; }
.porte-sous { margin: 6px 0 40px; font-family: var(--serif); font-size: 21px; color: var(--texte-secondaire); }
.porte-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.porte-champ { display: flex; gap: 8px; }
.porte-champ input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--filet);
  border-radius: 8px;
  background: var(--papier);
  color: var(--encre);
  font: inherit;
  font-size: 17px;
}
.porte-champ input:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px rgb(21 34 58 / 10%); }
.porte-champ button, .lancer-disque {
  border: 0;
  background: var(--takeda);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}
.porte-champ button { height: 48px; padding: 0 20px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.porte-champ button:hover { background: var(--takeda-profond); }
.porte-champ button:active { transform: scale(0.98); }
.porte-erreur { margin: 12px 0 0; color: var(--takeda); font-size: 15px; }

/* Film */
.film { display: grid; grid-template-rows: auto 1fr auto; }
.tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--marge) 0;
}
.film .marque { font-size: 30px; line-height: 1.15; font-weight: 300; }
.marque-titre { color: var(--texte-secondaire); }
.pour { display: flex; align-items: center; gap: 12px; margin: 0; font-family: var(--serif); font-size: 19px; }
.takeda { display: block; height: 26px; width: auto; overflow: visible; }

.scene {
  width: min(100% - 2 * var(--marge), 1280px);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 56px) 0 0;
  animation: monter 800ms var(--ease) both;
}
.lecteur {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--mur); /* même ton que l'image : pas de liseré quand la largeur tombe entre deux pixels */
  box-shadow: var(--elev-lecteur);
  isolation: isolate;
}
.lecteur video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--mur); }
.lecteur:fullscreen video { object-fit: contain; background: var(--nuit); }
.lecteur:fullscreen { border-radius: 0; box-shadow: none; background: var(--nuit); }
.lecteur[data-etat="lecture"][data-calme] { cursor: none; }

.lancer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 14px;
  padding: clamp(14px, 3.2%, 36px);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 240ms var(--ease);
}
.lancer-disque {
  display: grid;
  place-items: center;
  width: clamp(52px, 6vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 18px 36px -16px rgb(137 21 21 / 60%);
}
.lancer-disque svg { width: 42%; fill: currentColor; transform: translateX(6%); }
.lancer:hover .lancer-disque { background: var(--takeda-profond); transform: scale(1.04); }
.lancer-texte {
  margin-bottom: clamp(8px, 1.1vw, 18px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgb(14 24 40 / 72%);
  color: var(--nuit-texte);
  font-size: 15px;
  font-weight: 600;
}
.lancer-texte .chiffres { margin-left: 6px; font-weight: 400; opacity: 0.8; }
.lecteur:not([data-etat="attente"]):not([data-etat="fin"]) .lancer { opacity: 0; pointer-events: none; }

.sous-titre {
  position: absolute;
  left: 50%;
  bottom: 9%;
  translate: -50% 0;
  max-width: 86%;
  margin: 0;
  padding: 0.3em 0.7em;
  border-radius: 6px;
  background: rgb(14 24 40 / 78%);
  color: #fff;
  font-size: clamp(14px, 2.1vw, 30px);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  transition: bottom 240ms var(--ease);
}
.lecteur:not([data-etat="attente"])[data-commandes] .sous-titre { bottom: calc(9% + 44px); }

.commandes {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgb(14 24 40 / 74%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--nuit-texte);
  opacity: 0;
  translate: 0 8px;
  pointer-events: none;
  transition: opacity 220ms var(--ease), translate 220ms var(--ease);
}
.lecteur:not([data-etat="attente"])[data-commandes] .commandes { opacity: 1; translate: 0 0; pointer-events: auto; }
.bouton {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.bouton:hover { background: rgb(231 234 237 / 12%); }
.bouton svg { width: 22px; height: 22px; fill: currentColor; }
.bouton-texte { width: auto; padding: 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; }
.bouton-texte[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--vermillon); }
.icone-pause { display: none; }
.lecteur[data-etat="lecture"] .icone-pause { display: block; }
.lecteur[data-etat="lecture"] .icone-lire { display: none; }
.temps { margin: 0 8px 0 2px; font-size: 15px; white-space: nowrap; }
.barre {
  position: relative;
  flex: 1;
  height: 28px;
  cursor: pointer;
  touch-action: none;
}
.barre::before, .barre-charge, .barre-lue {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  translate: 0 -50%;
  border-radius: 2px;
}
.barre::before { right: 0; background: rgb(231 234 237 / 18%); }
.barre-charge { width: 0; background: rgb(231 234 237 / 30%); }
.barre-lue { width: 0; background: var(--vermillon); }
.barre:hover .barre-lue, .barre:hover::before, .barre:hover .barre-charge { height: 6px; }
.choix-st { position: relative; }
.menu-st {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 8px;
  background: rgb(14 24 40 / 94%);
  box-shadow: 0 16px 32px -16px rgb(0 0 0 / 60%);
}
.menu-st button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}
.menu-st button:hover { background: rgb(231 234 237 / 10%); }
.menu-st button[aria-checked="true"]::after { content: "✓"; float: right; color: var(--vermillon); }

.legende {
  display: grid;
  gap: 6px;
  padding: clamp(28px, 4vh, 44px) 0 0;
}
.legende p.resume {
  max-width: 46ch;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.4;
  text-wrap: pretty;
}
.legende .meta { margin: 0; color: var(--texte-secondaire); font-size: 15px; }

@keyframes monter { from { opacity: 0; translate: 0 14px; } }

.conseil {
  position: absolute;
  top: 12px;
  left: 50%;
  translate: -50% 0;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(14 24 40 / 78%);
  color: var(--nuit-texte);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: monter 400ms var(--ease) both;
}

/* Écrans tactiles : cibles d'au moins 44 px, barre de lecture plus épaisse. */
@media (pointer: coarse) {
  .bouton { width: 44px; height: 44px; }
  .bouton svg { width: 24px; height: 24px; }
  .barre { height: 44px; }
  .barre::before, .barre-charge, .barre-lue { height: 6px; }
  .menu-st button { padding: 12px 12px; font-size: 16px; }
}

/* Téléphone en portrait : film bord à bord, titre sur deux lignes. */
@media (max-width: 640px) {
  .tete { padding: max(18px, env(safe-area-inset-top)) var(--marge) 0; align-items: flex-start; gap: 16px; }
  .film .marque { font-size: 26px; line-height: 1.1; }
  .marque-titre { display: block; margin-top: 4px; font-size: 16px; line-height: 1.3; }
  .virgule { display: none; }
  .pour { font-size: 15px; gap: 8px; margin-top: 4px; }
  .takeda { height: 18px; }
  .scene { width: 100%; padding-top: 20px; }
  .lecteur { border-radius: 0; box-shadow: none; }
  .legende { padding: 22px var(--marge) 0; }
  .legende p.resume { font-size: 19px; }
  .commandes { padding: 2px 4px; gap: 0; }
  .temps { font-size: 13px; margin: 0 4px; }
  .lancer-texte { display: none; }
  .lancer-disque { width: 60px; }
  .sous-titre { font-size: 14px; bottom: 6%; max-width: 92%; }
  .porte-champ { flex-direction: column; }
  .porte-champ button { height: 52px; }
  .pied { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}

/* Téléphone en paysage : le film prend tout l'écran, sans passer par le plein écran. */
@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .film { background: var(--nuit); }
  .film .tete, .film .legende, .film .pied { display: none; }
  .film .scene { width: 100%; padding: 0; animation: none; }
  .film .lecteur {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: none;
    background: var(--nuit);
  }
  .film .lecteur video { object-fit: contain; background: var(--nuit); }
  .film .commandes { padding: 4px max(12px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .film .lancer { padding-left: max(24px, env(safe-area-inset-left)); }
  .film .sous-titre { font-size: 17px; }
  .film .lancer-texte { display: none; }
  .conseil { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Vues du film (/stats) */
.stats { display: block; }
.stats .porte-carte { margin: 12vh auto 0; }
.stats .porte .marque, .stats .porte-carte .marque { font-size: 64px; line-height: 1; }
.stats-cadre { width: min(100% - 2 * var(--marge), 1100px); margin: 0 auto; padding: 48px 0 64px; }
.stats-cadre .marque { font-size: 30px; }
.stats-cadre h1 { margin: 6px 0 32px; font-family: var(--serif); font-weight: 300; font-size: clamp(36px, 5vw, 56px); line-height: 1.1; }
.stats-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 32px; }
.stats-chiffres div { padding: 18px 20px; border-radius: 10px; background: var(--papier); box-shadow: 0 1px 2px rgb(21 34 58 / 6%); }
.stats-chiffres dt { color: var(--texte-secondaire); font-size: 14px; }
.stats-chiffres dd { margin: 4px 0 0; font-size: 44px; line-height: 1; }
.stats-table { overflow-x: auto; margin-bottom: 20px; }
.stats table { width: 100%; border-collapse: collapse; font-size: 15px; }
.stats th { padding: 8px 10px; border-bottom: 1px solid var(--filet); color: var(--texte-secondaire); font-weight: 600; text-align: left; white-space: nowrap; }
.stats td { padding: 10px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.stats .meta { max-width: 70ch; color: var(--texte-secondaire); font-size: 14px; }
