/*
 * Beyla — le site. DA de l'app (tokens.ts) : Cormorant Garamond + DM Sans,
 * les DEUX ciels de l'app (Aube violette / Nuit violette), rien d'inventé.
 *
 * LE FILM DU GESTE, base propre : une scène épinglée, CINQ ACTES pilotés par
 * le défilement — le scan, le réveil, le geste, la carte, la collection qui
 * se déploie. Chaque acte est SA PROPRE COMPOSITION (le texte et le visuel
 * partagent une grille : le chevauchement est impossible par construction,
 * et les visuels prennent la place qu'ils méritent). Les actes se fondent
 * l'un dans l'autre comme des plans de cinéma ; le ciel, le soleil et la
 * lune sont des couches continues par-dessous.
 * Sans JS ou en mouvement réduit : les actes se déplient en scènes posées.
 */

:root {
  --nuit-ink: #efeaf6;
  --nuit-ink2: #f6f2fb;
  --nuit-muted: #b4a7ca;
  --nuit-card: #221b33;
  --nuit-card2: #2a2240;
  --nuit-line: #3a2f52;
  --nuit-accent: #c0a8f0;
  --champagne: #e0cfa2;

  --jour-ink: #332d3e;
  --jour-ink2: #241f30;
  --jour-muted: #675f75;

  --accent: #5e4e9e;
  --accent-ink: #f5f2fc;
  --cta1: #6e5cb2;
  --cta2: #544390;
  --cta-glow: rgba(84, 67, 144, 0.35);
  --ok-nuit: #9cc79c;
  --socle-jour: rgba(94, 78, 158, 0.35);
  --socle-nuit: rgba(192, 168, 240, 0.35);
  --ombre-noire: rgba(4, 2, 10, 0.5);

  /* thème adaptatif des pages textes (CGU, confidentialité, support) */
  --bg: #e9e4f0;
  --page-1: #e3dff1;
  --page-2: #f1e6de;
  --page-3: #f6e9d8;
  --card: #fdfcfb;
  --card2: #f4f0f3;
  --line: #ded6e4;
  --ink: #332d3e;
  --ink2: #241f30;
  --muted: #6f677e;
  --warn-ink: #a8512c;
  --ok: #4e7f5b;
  --shadow: rgba(100, 85, 140, 0.22);

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14101f;
    --page-1: #110d1c;
    --page-2: #1d1830;
    --page-3: #2a1e33;
    --card: #221b33;
    --card2: #251e38;
    --line: #3a2f52;
    --ink: #efeaf6;
    --ink2: #f6f2fb;
    --muted: #a99bc0;
    --warn-ink: #e59a90;
    --shadow: rgba(8, 4, 16, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--nuit-ink);
  background-color: #14101f;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.page-texte-corps {
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(172deg, var(--page-1) 0%, var(--page-2) 55%, var(--page-3) 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--nuit-ink2);
  line-height: 1.12;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

.page-texte-corps h1,
.page-texte-corps h2,
.page-texte-corps h3 {
  color: var(--ink2);
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.8rem, 4.2vw, 2.6rem);
}

p {
  margin: 0 0 1em;
  max-width: 62ch;
  text-wrap: pretty;
}

a {
  color: var(--nuit-accent);
}

.page-texte-corps a {
  color: var(--accent);
}

/* La règle de lien ci-dessus écrasait la couleur du bouton d'en-tête sur les
   pages texte : violet sur violet, illisible. Le bouton garde son encre. */
.page-texte-corps a.cta {
  color: var(--accent-ink);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
}

.enveloppe {
  width: min(1080px, 100% - 2.5rem);
  margin-inline: auto;
}

section {
  padding-block: clamp(3.5rem, 9vw, 6.5rem);
}

/* ---------- ciels des sections d'après-film (raccord Nuit violette) ---------- */

.ciel-confiance {
  background: linear-gradient(180deg, #2a1e33, #221b33);
}

.ciel-cortege {
  background: linear-gradient(180deg, #221b33, #1d1633);
}

.ciel-beta {
  background: linear-gradient(180deg, #1d1633, #171126);
}

.ciel-fin {
  background: linear-gradient(180deg, #171126, #14101f);
}

/* étoiles */
.etoilee {
  position: relative;
}

.etoilee > .enveloppe {
  position: relative;
  z-index: 1;
}

.etoilee::before,
.etoilee::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.etoilee::before {
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, rgba(220, 200, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 26%, rgba(220, 200, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 31%, rgba(220, 200, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 31% 64%, rgba(220, 200, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 78%, rgba(220, 200, 255, 0.55) 50%, transparent 51%);
}

.etoilee::after {
  background-image: radial-gradient(1px 1px at 78% 9%, rgba(220, 200, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 42%, rgba(220, 200, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 42% 88%, rgba(220, 200, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 84%, rgba(220, 200, 255, 0.45) 50%, transparent 51%);
}

@media (prefers-reduced-motion: no-preference) {
  .etoilee::before {
    animation: scintiller 7s ease-in-out infinite;
  }

  .etoilee::after {
    animation: scintiller 9s ease-in-out infinite reverse;
  }

  @keyframes scintiller {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.45;
    }
  }
}

/* ---------- barre haute ---------- */

.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.4rem;
}

/* La marque = le LETTRAGE du logo (décision d'Alc, 2026-08-26 : la même
   écriture que le compte Insta, source maquettes/logos-beyla/ajout-point-v58,
   extraite en deux encres). L'encre du jour par défaut, la crème sur la nuit. */
.marque {
  display: inline-flex;
  align-items: center;
}

.marque img {
  display: block;
  height: 1.7rem;
  width: auto;
}

.marque .marque-nuit {
  display: none;
}

/* le pied de page vit toujours dans la nuit */
.ciel-fin .marque .marque-jour {
  display: none;
}

.ciel-fin .marque .marque-nuit {
  display: block;
}

/* les pages textes suivent le thème du visiteur */
@media (prefers-color-scheme: dark) {
  .page-texte-corps .marque .marque-jour {
    display: none;
  }

  .page-texte-corps .marque .marque-nuit {
    display: block;
  }
}

/* ---------- boutons ---------- */

.cta {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--accent-ink);
  background: linear-gradient(160deg, var(--cta1), var(--cta2));
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--cta-glow);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--cta-glow);
}

.cta:active {
  transform: translateY(0);
}

.cta-discret {
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
}

/* ============================================================
   LE FILM DU GESTE
   ============================================================ */

body.cine .film {
  height: 680vh;
}

.film-scene {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, #e3dff1 0%, #f1e6de 60%, #f6e9d8 100%);
}

body.cine .film-scene {
  position: sticky;
  top: 0;
  height: 100svh;
}

/* ---- les couches continues : ciels, vignette, astres ---- */

.ciels,
.ciels .ciel {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ciels .ciel {
  opacity: 0;
  transition: opacity 1.6s ease;
}

/* l'Aube violette de l'app, exacte */
.ciels .c-jour {
  opacity: 1;
  background: linear-gradient(180deg, #e3dff1 0%, #f1e6de 60%, #f6e9d8 100%);
}

/* la Nuit violette de l'app, exacte, étoilée */
.ciels .c-nuit {
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, rgba(220, 200, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 12%, rgba(220, 200, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 24%, rgba(220, 200, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 62%, rgba(220, 200, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 76%, rgba(220, 200, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 58%, rgba(220, 200, 255, 0.4) 50%, transparent 51%),
    linear-gradient(180deg, #110d1c 0%, #1d1830 55%, #2a1e33 100%);
}

.nuit .ciels .c-jour {
  opacity: 0;
}

.nuit .ciels .c-nuit {
  opacity: 1;
}

/* la vignette caméra du premier acte */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 92% at 50% 45%, transparent 55%, rgba(24, 14, 46, 0.16) 100%);
  opacity: 0;
  transition: opacity 0.9s;
}

.a1 .vignette {
  opacity: 1;
}

/* le soleil et la lune, déplacés par le défilement (JS, transform seul) */
.astre {
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -30px;
  width: 60px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s;
  will-change: transform;
}

.soleil {
  background: radial-gradient(circle at 42% 40%, #fff3da, #ffdda0 62%, #f4c176);
  box-shadow: 0 0 44px 14px rgba(255, 214, 150, 0.4), 0 0 110px 44px rgba(255, 214, 150, 0.16);
}

.lune-film {
  background: radial-gradient(circle at 40% 38%, #f8f2e4, #e9dcc2 62%, #d6c4a0);
  box-shadow: 0 0 34px 10px rgba(240, 228, 200, 0.16), 0 0 90px 34px rgba(240, 228, 200, 0.07);
}

body:not(.cine) .astre,
body:not(.cine) .vignette {
  display: none;
}

/* ---- la barre, les actes, l'indice ---- */

.film-scene .barre {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding-inline: max(1.25rem, calc((100vw - 1080px) / 2));
}

/* dans le film, la marque suit la lumière : encre le jour, crème la nuit */
.nuit .marque .marque-jour {
  display: none;
}

.nuit .marque .marque-nuit {
  display: block;
}

.actes {
  position: absolute;
  right: clamp(0.9rem, 2.2vw, 1.7rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}

.actes span {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: rgba(36, 31, 48, 0.3);
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s;
}

.nuit .actes span {
  background: rgba(239, 234, 246, 0.35);
}

.a1 .actes span:nth-child(1),
.a2 .actes span:nth-child(2),
.a3 .actes span:nth-child(3) {
  height: 22px;
  background: var(--jour-ink2);
}

.a4 .actes span:nth-child(4),
.a5 .actes span:nth-child(5) {
  height: 22px;
  background: var(--nuit-ink2);
}

body:not(.cine) .actes {
  display: none;
}

.film-indice {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--jour-muted);
  font-size: 0.88rem;
  transition: opacity 0.5s;
  z-index: 5;
}

.film-indice svg {
  animation: descendre 2.2s ease-in-out infinite;
}

@keyframes descendre {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-indice svg {
    animation: none;
  }
}

.a5 .film-indice {
  opacity: 0;
}

body:not(.cine) .film-indice {
  display: none;
}

/* ---- LES ACTES : chaque acte est sa propre composition ---- */

.acte {
  position: absolute;
  inset: 0;
  padding: clamp(4.2rem, 10svh, 6rem) clamp(1.25rem, 4vw, 3.5rem) clamp(1.8rem, 5svh, 3rem);
  display: grid;
  opacity: 0;
  visibility: hidden;
  transform: translateY(26px);
  transition: opacity 0.75s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.85s;
  pointer-events: none;
}

.acte.actif {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* le texte des actes */
.carton .surtitre {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7em;
}

.carton .titre {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.1;
  color: var(--jour-ink2);
  margin: 0 0 0.35em;
  text-wrap: balance;
}

.carton .sous {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--jour-ink);
  margin: 0;
  max-width: 44ch;
  text-wrap: pretty;
}

.carton .parole {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--jour-ink);
}

.carton .signature {
  display: block;
  margin-top: 0.55em;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.acte-nuit .carton .titre {
  color: var(--nuit-ink2);
}

.acte-nuit .carton .sous,
.acte-nuit .carton .parole {
  color: var(--nuit-ink);
}

.acte-nuit .carton .surtitre,
.acte-nuit .carton .signature {
  color: var(--champagne);
}

/* -- actes centrés (1 et 2) : le visuel au-dessus, le carton en dessous -- */

.acte-centre {
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  text-align: center;
  row-gap: clamp(1rem, 3svh, 2rem);
}

.acte-centre .carton {
  align-self: end;
}

.acte-centre .carton .sous,
.acte-centre .carton .parole {
  margin-inline: auto;
}

/* -- actes scindés (3 et 4) : carton à gauche, GRAND visuel à droite -- */

.acte-scinde {
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  column-gap: clamp(1.5rem, 4vw, 4rem);
  width: min(1180px, 100%);
  margin-inline: auto;
}

.acte-scinde .carton {
  justify-self: end;
  max-width: 40ch;
}

.acte-scinde .visuel {
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

@media (max-width: 899px) {
  .acte-scinde {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    text-align: center;
    row-gap: clamp(1rem, 3svh, 1.8rem);
  }

  .acte-scinde .carton {
    justify-self: center;
    order: 2;
  }

  .acte-scinde .carton .sous,
  .acte-scinde .carton .parole {
    margin-inline: auto;
  }

  .acte-scinde .visuel {
    justify-self: center;
    order: 1;
    align-self: center;
  }
}

/* ---- acte 1 : le scan ---- */

.viseur {
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  width: min(78vw, 560px);
  height: 100%;
  max-height: min(58svh, 560px);
}

.viseur .coin {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 3px solid var(--accent);
  opacity: 0.85;
}

.viseur .coin:nth-child(1) {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  border-top-left-radius: 12px;
}

.viseur .coin:nth-child(2) {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  border-top-right-radius: 12px;
}

.viseur .coin:nth-child(3) {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  border-bottom-left-radius: 12px;
}

.viseur .coin:nth-child(4) {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  border-bottom-right-radius: 12px;
}

/* la silhouette s'éclaire à mesure que le scan avance (--t1 suit le scroll) */
.viseur img {
  height: min(44svh, 420px);
  width: auto;
  filter: brightness(calc(0.02 + var(--t1, 0) * 0.4)) saturate(calc(0.4 + var(--t1, 0) * 0.45));
  transition: filter 0.2s linear;
}

/* la puce de reconnaissance, comme dans l'app, en fin de scan */
.puce-scan {
  position: absolute;
  bottom: -1.1rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #fdfcfb;
  border: 1px solid rgba(94, 78, 158, 0.4);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--jour-ink2);
  box-shadow: 0 10px 24px rgba(70, 48, 100, 0.18);
  opacity: 0;
  transition: opacity 0.45s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.puce-scan .coche {
  color: var(--ok);
  font-weight: 700;
}

.reconnu .puce-scan {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body:not(.cine) .puce-scan {
  opacity: 1;
  transform: translateX(-50%);
}

.balayage {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(94, 78, 158, 0.65), transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .balayage {
    animation: balayer 2.8s ease-in-out infinite alternate;
  }

  @keyframes balayer {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(min(48svh, 460px));
    }
  }
}

/* ---- acte 2 : le réveil ---- */

.perso-vivant {
  position: relative;
  align-self: center;
  display: grid;
  justify-items: center;
}

.perso-vivant img {
  height: min(52svh, 500px);
  width: auto;
  filter: drop-shadow(0 8px 14px rgba(70, 48, 100, 0.25));
}

.perso-vivant .socle {
  width: 62%;
  height: clamp(18px, 3svh, 30px);
  margin-top: -1.2rem;
  border: 1.5px dashed var(--socle-jour);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 48, 100, 0.3), rgba(70, 48, 100, 0) 100%);
}

@media (prefers-reduced-motion: no-preference) {
  .a2 .perso-vivant img {
    animation: reveil 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes reveil {
    0% {
      transform: scale(1, 1);
    }
    35% {
      transform: scale(1.05, 0.93) translateY(3px);
    }
    70% {
      transform: scale(0.97, 1.04) translateY(-8px);
    }
    100% {
      transform: scale(1, 1);
    }
  }
}

/* ---- acte 3 : le geste, téléphone plein cadre ---- */

.cadre {
  position: relative;
  border-radius: clamp(28px, 4.4svh, 42px);
  padding: clamp(7px, 1.1svh, 10px);
  background: #0e0a19;
  box-shadow: 0 14px 30px rgba(50, 32, 90, 0.28), 0 36px 72px rgba(50, 32, 90, 0.18),
    inset 0 0 0 2px #3a2f52;
}

.cadre::before {
  content: "";
  position: absolute;
  top: clamp(13px, 2svh, 19px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(52px, 8svh, 72px);
  height: clamp(15px, 2.3svh, 21px);
  border-radius: 12px;
  background: #0e0a19;
  z-index: 1;
}

.cadre img {
  display: block;
  border-radius: clamp(21px, 3.4svh, 32px);
  height: min(66svh, 640px);
  width: auto;
}

/* le second écran du geste : la fiche laisse place à l'étape guidée */
.cadre .ecran-2 {
  position: absolute;
  inset: clamp(7px, 1.1svh, 10px);
  height: auto;
  width: calc(100% - 2 * clamp(7px, 1.1svh, 10px));
  opacity: 0;
  transition: opacity 0.6s ease;
}

.guide .cadre .ecran-2 {
  opacity: 1;
}

body:not(.cine) .cadre .ecran-2 {
  display: none;
}

.acte-geste .compagnon {
  position: absolute;
  left: clamp(-4.5rem, -6vw, -3rem);
  bottom: -0.6rem;
  height: min(24svh, 220px);
  width: auto;
  filter: drop-shadow(0 6px 10px rgba(70, 48, 100, 0.3));
}

.acte-geste .visuel {
  position: relative;
}

@media (max-width: 899px) {
  .cadre img {
    height: min(48svh, 480px);
  }

  .acte-geste .compagnon {
    height: min(17svh, 150px);
    left: -3.2rem;
  }
}

/* ---- acte 4 : la cérémonie de la carte, fidèle à l'app ----
   Le DOS apparaît et frissonne, puis la carte SE RETOURNE au fil du
   défilement (--flip suit le scroll : reculer la retourne à l'envers). */

.carte-3d {
  position: relative;
  perspective: 1100px;
  opacity: min(1, calc(var(--t4, 1) * 4));
}

.carte-3d .tourneur {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--flip, 1) * 180deg));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* le frisson d'avant l'ouverture, coupé dès que la rotation commence */
@media (prefers-reduced-motion: no-preference) {
  .a4 .carte-3d {
    animation: frisson 1.5s ease-in-out infinite;
  }

  .a4.tourne .carte-3d {
    animation: none;
  }

  @keyframes frisson {
    0%,
    100% {
      transform: rotate(0deg);
    }
    25% {
      transform: rotate(0.9deg) translateY(-2px);
    }
    75% {
      transform: rotate(-0.9deg) translateY(1px);
    }
  }
}

.carte-3d .face {
  display: block;
  height: min(62svh, 600px);
  width: auto;
  border-radius: clamp(12px, 2svh, 18px);
  box-shadow: 0 26px 54px var(--ombre-noire), 0 0 54px rgba(150, 110, 220, 0.24);
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

.carte-3d .dos {
  position: absolute;
  inset: 0;
  border-radius: clamp(12px, 2svh, 18px);
  background: linear-gradient(165deg, #262040 0%, #1c1533 55%, #241b3d 100%);
  border: 1.5px solid #3a2f52;
  box-shadow: 0 26px 54px var(--ombre-noire);
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}

.carte-3d .dos .etoiles {
  font-size: clamp(1.5rem, 3.6svh, 2.1rem);
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  color: #e8d7a8;
}

@media (max-width: 899px) {
  .carte-3d .face {
    height: min(46svh, 440px);
  }
}

body:not(.cine) .carte-3d .dos {
  display: none;
}

/* les éclats champagne de la cérémonie */
.eclat {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #e8d7a8;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .celebre .eclat {
    animation: eclater 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  @keyframes eclater {
    0% {
      opacity: 0;
      transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
    }
    25% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(45deg) scale(1);
    }
  }
}

/* ---- acte 5 : la collection se déploie ---- */

.acte-collection .deploiement {
  position: relative;
  align-self: center;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

/* l'éventail s'ouvre PROPORTIONNELLEMENT au défilement (--t5) : les cartes
   partent empilées derrière la carte maîtresse et s'écartent sous le doigt */
.deploiement img {
  position: absolute;
  height: min(40svh, 400px);
  width: auto;
  border-radius: 12px;
  box-shadow: 0 20px 44px var(--ombre-noire), 0 0 38px rgba(150, 110, 220, 0.18);
  --fx: 0px;
  --fy: 0px;
  --fr: 0deg;
  transform: translate(calc(var(--t5, 1) * var(--fx)), calc(12px + var(--t5, 1) * var(--fy)))
    rotate(calc(var(--t5, 1) * var(--fr)));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.deploiement img:nth-child(3) {
  z-index: 2;
  height: min(46svh, 450px);
}

.deploiement img:nth-child(1) {
  --fx: calc(-1 * clamp(150px, 22vw, 330px));
  --fy: 14px;
  --fr: -14deg;
}

.deploiement img:nth-child(2) {
  --fx: calc(-1 * clamp(80px, 11.5vw, 175px));
  --fy: -4px;
  --fr: -7deg;
}

.deploiement img:nth-child(4) {
  --fx: clamp(80px, 11.5vw, 175px);
  --fy: -4px;
  --fr: 7deg;
}

.deploiement img:nth-child(5) {
  --fx: clamp(150px, 22vw, 330px);
  --fy: 14px;
  --fr: 14deg;
}

@media (max-width: 899px) {
  .deploiement img {
    height: min(30svh, 300px);
  }

  .deploiement img:nth-child(3) {
    height: min(35svh, 340px);
  }

  .deploiement img:nth-child(1) {
    --fx: -31vw;
    --fy: 10px;
  }

  .deploiement img:nth-child(2) {
    --fx: -16vw;
    --fy: -5px;
  }

  .deploiement img:nth-child(4) {
    --fx: 16vw;
    --fy: -5px;
  }

  .deploiement img:nth-child(5) {
    --fx: 31vw;
    --fy: 10px;
  }
}

.acte-collection .carton .cta {
  margin-top: 1.3rem;
}

.acte-collection .note-beta {
  font-size: 0.88rem;
  color: var(--nuit-muted);
  margin: 0.8em 0 0;
}

/* ---- repli sans JS ou en mouvement réduit : cinq scènes posées ---- */

body:not(.cine) .film-scene {
  min-height: auto;
  padding-top: 4.6rem;
  background: linear-gradient(180deg, #e3dff1 0%, #f1e6de 34%, #f6e9d8 55%, #6d5590 76%, #2a1e33 100%);
}

body:not(.cine) .ciels {
  display: none;
}

body:not(.cine) .acte {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  min-height: auto;
  padding-block: 2.6rem;
}

body:not(.cine) .viseur {
  height: auto;
  max-height: none;
}

body:not(.cine) .viseur img {
  filter: none;
}

body:not(.cine) .balayage {
  display: none;
}

body:not(.cine) .carte-heros img {
  opacity: 1;
  transform: none;
}

body:not(.cine) .deploiement {
  height: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

body:not(.cine) .deploiement img {
  position: static;
  opacity: 1;
  transform: none;
  height: 200px;
}

/* ============================================================ */

/* ---------- LA CONFIANCE ---------- */

/* l'atterrissage après le film : resserré */
#confiance,
#testeurs {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.confiance {
  text-align: center;
}

.confiance h2 {
  margin-inline: auto;
}

.confiance .parole-plan {
  margin-inline: auto;
  max-width: 52ch;
}

.filet {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.9rem 0;
  margin: 2.2rem auto 0;
  padding: 1.1rem 0;
  border-top: 1px solid var(--nuit-line);
  border-bottom: 1px solid var(--nuit-line);
  max-width: 880px;
}

.filet span {
  font-size: 0.85rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--champagne);
  padding-inline: 1.6rem;
}

.filet span + span {
  border-left: 1px solid var(--nuit-line);
}

.confiance .chiffres {
  margin: 1.8rem auto 0;
  font-size: 0.98rem;
  color: var(--nuit-muted);
  max-width: 60ch;
}

.confiance .chiffres strong {
  color: var(--nuit-ink2);
  font-weight: 500;
}

/* ---------- LE CORTÈGE ---------- */

.cortege-section {
  overflow: hidden;
  text-align: center;
}

.cortege-section .parade-tete p {
  margin-inline: auto;
}

.parade {
  position: relative;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.parade-piste {
  display: flex;
  align-items: flex-end;
  gap: clamp(2rem, 5vw, 4rem);
  width: max-content;
}

@media (prefers-reduced-motion: no-preference) {
  .parade-piste {
    animation: defiler 46s linear infinite;
  }

  .parade:hover .parade-piste {
    animation-play-state: paused;
  }

  @keyframes defiler {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(-50%);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .parade {
    overflow-x: auto;
  }
}

.parade-piste img {
  height: clamp(96px, 14vw, 150px);
  width: auto;
  filter: drop-shadow(0 10px 14px var(--ombre-noire));
}

/* ---------- INSCRIPTION ---------- */

.inscription {
  background: var(--nuit-card);
  border: 1px solid var(--nuit-line);
  border-radius: 18px;
  padding: clamp(1.75rem, 4vw, 3rem);
  box-shadow: 0 20px 50px var(--ombre-noire);
  max-width: 620px;
  margin-inline: auto;
}

.inscription h2 {
  margin-bottom: 0.35em;
}

.champ {
  margin-top: 1.2rem;
}

.champ label,
.champ-legende {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.champ input[type="email"],
.champ textarea {
  width: 100%;
  font: inherit;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: var(--nuit-ink2);
  background: var(--nuit-card2);
  border: 1px solid var(--nuit-line);
}

.champ ::placeholder {
  color: var(--nuit-muted);
  opacity: 1;
}

.page-texte-corps .champ input[type="email"],
.page-texte-corps .champ textarea {
  color: var(--ink2);
  background: var(--card2);
  border: 1px solid var(--line);
}

.page-texte-corps .champ ::placeholder {
  color: var(--muted);
}

.champ input:focus-visible,
.champ textarea:focus-visible,
.plateformes label:has(input:focus-visible) {
  outline: 2px solid var(--nuit-accent);
  outline-offset: 2px;
}

.page-texte-corps .champ input:focus-visible,
.page-texte-corps .champ textarea:focus-visible {
  outline-color: var(--accent);
}

.plateformes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.plateformes label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  background: var(--nuit-card2);
  border: 1px solid var(--nuit-line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.plateformes label:has(input:checked) {
  border-color: var(--nuit-accent);
  background: rgba(192, 168, 240, 0.14);
  color: var(--nuit-ink2);
}

.plateformes input {
  accent-color: var(--nuit-accent);
  margin: 0;
}

.inscription .cta {
  margin-top: 1.5rem;
  width: 100%;
  text-align: center;
}

.inscription .cta[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.note-donnees {
  font-size: 0.85rem;
  color: var(--nuit-muted);
  margin: 1rem 0 0;
}

.form-retour {
  margin-top: 1rem;
  font-size: 0.98rem;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  display: none;
}

.form-retour.ok {
  display: block;
  color: var(--ok-nuit);
  background: rgba(156, 199, 156, 0.12);
}

.page-texte-corps .form-retour.ok {
  color: var(--ok);
  background: rgba(78, 127, 91, 0.12);
}

.form-retour.erreur {
  display: block;
  color: #e59a90;
  background: rgba(229, 154, 144, 0.12);
}

.page-texte-corps .form-retour.erreur {
  color: var(--warn-ink);
  background: rgba(168, 81, 44, 0.1);
}

/* le pot de miel reste hors de vue sans être display:none */
.champ-lointain {
  position: absolute;
  left: -6000px;
  top: 0;
}

/* ---------- pages textes ---------- */

.page-texte {
  padding-block: 2.5rem 5rem;
}

.page-texte .contenu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 16px 40px var(--shadow);
  max-width: 760px;
  margin-inline: auto;
}

.page-texte h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
}

.page-texte h2 {
  font-size: 1.35rem;
  margin-top: 1.8em;
}

.page-texte .maj {
  font-size: 0.88rem;
  color: var(--muted);
}

.a-completer {
  background: rgba(194, 101, 60, 0.12);
  color: var(--warn-ink);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  font-size: 0.92em;
}

/* ---------- apparitions au défilement ---------- */

@media (prefers-reduced-motion: no-preference) {
  .apparait.joue {
    animation: apparaitre 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes apparaitre {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ---------- pied ---------- */

footer {
  padding-block: 2.2rem 2.8rem;
  border-top: 1px solid var(--nuit-line);
}

.page-texte-corps footer {
  border-top: 1px solid var(--line);
}

.pied {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.pied .devise {
  font-size: 0.95rem;
  margin: 0.3em 0 0;
  color: var(--nuit-muted);
}

.page-texte-corps .pied .devise {
  color: var(--muted);
}

.pied nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-size: 0.95rem;
}

.pied a {
  text-decoration: none;
  color: var(--nuit-muted);
}

.page-texte-corps .pied a {
  color: var(--muted);
}

.pied a:hover {
  text-decoration: underline;
}
