/* FirstSI — film d'accueil (js/film.js). Toujours dans le thème du site : sombre par défaut, .ff-clair en thème clair. */
.ff { --ff-bas: clamp(56px, 9vh, 92px); --ff-fond: 10,16,31; --ff-texte: #F1F5F9; --ff-texte-2: #CBD5E1; --ff-vert: #4ADE80; --ff-rouge: #F87171; --ff-bord: rgba(148,163,184,.35);
  --ff-degrade: linear-gradient(135deg, #22C55E 0%, #10B981 50%, #14B8A6 100%);
  position: relative; overflow: hidden; background: rgb(var(--ff-fond)); color: var(--ff-texte);
  /* hauteur fixée ici (pas en JavaScript) : l'écran visible moins la barre de navigation (--ff-nav, posée par film.js) */
  height: calc(100vh - var(--ff-nav, 64px)); height: calc(100svh - var(--ff-nav, 64px)); min-height: 520px; max-height: 1100px; }
.ff.ff-clair { --ff-fond: 241,245,249; --ff-texte: #0F172A; --ff-texte-2: #475569; --ff-vert: #15803D; --ff-rouge: #DC2626; --ff-bord: #CBD5E1;
  --ff-degrade: linear-gradient(135deg, #15803D 0%, #047857 50%, #0F766E 100%); }
.ff canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ff-bords { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(var(--ff-fond)) 0%, rgba(var(--ff-fond),0) 9%, rgba(var(--ff-fond),0) 91%, rgb(var(--ff-fond)) 100%),
    linear-gradient(180deg, rgba(var(--ff-fond),0) 0%, rgba(var(--ff-fond),0) 70%, rgb(var(--ff-fond)) 100%); }
.ff-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* le texte du moment : sur-titre mono, grand titre gras, phrase en gris (comme le reste du site) */
.ff-mots { list-style: none; margin: 0; padding: 0; position: absolute; left: clamp(20px, 7vw, 100px); right: 84px; bottom: var(--ff-bas); pointer-events: none; }
.ff-mots li { position: absolute; left: 0; bottom: 0; max-width: 760px; opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .6s ease; }
.ff-mots li.on { opacity: 1; transform: none; }
.ff-sur { display: block; margin-bottom: clamp(10px, 1.8vh, 20px); font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500; font-size: clamp(11px, 1.05vw, 14px); letter-spacing: .3em; text-transform: uppercase; color: var(--ff-vert); }
.ff-pq .ff-sur { color: var(--ff-rouge); }
.ff-mots h2, .ff-final-titre { margin: 0; font-weight: 700; font-size: clamp(32px, 4.7vw, 68px); line-height: 1.03; letter-spacing: -0.045em; color: var(--ff-texte); }
.ff-pq h2 em { font-style: normal; color: var(--ff-rouge); }
.ff-sol h2 em, .ff-final-titre em { font-style: normal; background: var(--ff-degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ff-mots p, .ff-final-texte { margin: clamp(12px, 2.2vh, 24px) 0 0; font-size: clamp(15px, 1.4vw, 20px); line-height: 1.45; color: var(--ff-texte-2); max-width: 31em; }

/* signature (fin du film) */
.ff-signature { position: absolute; left: 0; right: 0; top: 60%; text-align: center; pointer-events: none; opacity: 0; transition: opacity .4s linear; }
.ff-signature.on { opacity: 1; }
.ff-signature b { display: block; font-size: clamp(30px, 4.4vw, 58px); font-weight: 700; letter-spacing: -0.03em; color: var(--ff-texte); line-height: 1.1; }
.ff-signature b em { font-style: normal; color: var(--ff-vert); }
.ff-signature small { display: block; margin-top: 12px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: clamp(11px, 1.2vw, 14px); letter-spacing: .26em; text-transform: uppercase; color: var(--ff-texte-2); }

/* écran final : titre de la page (h1), actions */
.ff-final { position: absolute; left: clamp(20px, 7vw, 100px); right: 24px; bottom: var(--ff-bas); max-width: 760px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .8s ease, transform .8s ease; }
.ff-final.on { opacity: 1; pointer-events: auto; transform: none; }
.ff-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(18px, 3vh, 30px); }
.ff-note { margin: 14px 0 0; color: var(--ff-texte-2); font-size: 13.5px; }
.ff-lien { margin-top: 12px; padding: 0; background: none; border: 0; color: var(--ff-texte-2); font: 500 13px 'DM Sans', sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ff-lien:hover { color: var(--ff-texte); }
.ff.ff-fini canvas { animation: ff-apparait .9s ease; }
/* écran final : voile à gauche, derrière le titre et les boutons */
.ff.ff-fini .ff-bords { background:
  linear-gradient(90deg, rgba(var(--ff-fond),.94) 0%, rgba(var(--ff-fond),.78) 34%, rgba(var(--ff-fond),0) 58%),
  linear-gradient(180deg, rgba(var(--ff-fond),0) 0%, rgba(var(--ff-fond),0) 70%, rgb(var(--ff-fond)) 100%); }
@media (max-width: 760px) { .ff.ff-fini .ff-bords { background: linear-gradient(180deg, rgba(var(--ff-fond),0) 0%, rgba(var(--ff-fond),0) 30%, rgba(var(--ff-fond),.92) 52%, rgb(var(--ff-fond)) 100%); } }
@keyframes ff-apparait { from { opacity: 0; } }
/* écran final sur écran étroit ou bas (téléphone, paysage) : la carte passe au second plan derrière le texte */
.ff.ff-fini.ff-etroit canvas { opacity: .38; }

/* commandes */
.ff-pause { position: absolute; right: 20px; bottom: var(--ff-bas);   /* au niveau de la dernière ligne du texte */ z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ff-bord); background: rgba(var(--ff-fond),.85);
  color: var(--ff-texte); cursor: pointer; display: grid; place-items: center; }
.ff-pause svg { width: 16px; height: 16px; }
.ff-pause[hidden] { display: none; }
/* barre de progression (un segment par chapitre), comme l'ancienne intro */
/* zone de clic de 16 px de haut, barre visible de 3 px (5 px au survol) collée en bas */
.ff-progression { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; z-index: 6; display: flex; align-items: flex-end; gap: 3px; cursor: pointer; transition: opacity .4s; }
.ff-progression span { flex: 1 1 0; height: 3px; background: rgba(51,65,85,.45); position: relative; overflow: hidden; transition: height .15s; }
.ff-progression:hover span, .ff-progression:focus-visible span { height: 6px; }
.ff-progression:focus-visible { outline: 2px solid var(--ff-vert); outline-offset: -2px; }
.ff-progression span i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #22C55E, #14B8A6); }
.ff.ff-clair .ff-progression span { background: rgba(15,23,42,.08); }
.ff.ff-fini .ff-progression { opacity: 0; pointer-events: none; }
.ff-defiler { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 500 11px 'JetBrains Mono', monospace; letter-spacing: .3em; text-transform: uppercase; color: var(--ff-texte-2); text-decoration: none; }
.ff-defiler svg { animation: ff-rebond 1.8s ease-in-out infinite; }
.ff-defiler:hover { color: var(--ff-texte); }
@keyframes ff-rebond { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.ff-pause:focus-visible, .ff-defiler:focus-visible, .ff-lien:focus-visible { outline: 2px solid var(--ff-vert); outline-offset: 3px; }

@media (max-width: 760px) {
  .ff { --ff-bas: 64px; }   /* place pour « Défiler » sous le texte */
  .ff-mots { left: 20px; right: 76px; }
  /* titres soutenus, donc plus longs : un peu plus petits, et la carte s'efface derrière le texte */
  .ff-mots h2 { font-size: clamp(26px, 7.2vw, 32px); }
  .ff-mots p { font-size: 14.5px; }
  .ff-bords { background: linear-gradient(180deg, rgba(var(--ff-fond),0) 0%, rgba(var(--ff-fond),0) 48%, rgba(var(--ff-fond),.88) 64%, rgb(var(--ff-fond)) 100%); }
  .ff-final { left: 20px; right: 20px; }
  .ff-defiler { bottom: 10px; }
  .ff-final .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .ff-defiler svg { animation: none; } .ff.ff-fini canvas { animation: none; } }
