/* Elsa & Julien - 4 septembre 2026
   Charte reprise au millimetre du collage Canva d'Elsa : scrapbook noir &
   blanc sur papier beige, polaroids, enveloppe, trombone, titres manuscrits.

   Toutes les valeurs geometriques et typographiques viennent du document
   Canva publie (grille source 1366x768). Chaque ecran est un .stage ; ses
   enfants .g sont places en unites de cette grille via des variables CSS
   posees en HTML (--x/--y/--w/--h/--r/--fs/--lh). Les enfants utilisent
   cqw = % de la largeur du .stage, donc le rendu reste fidele au pixel
   pres a n'importe quelle largeur d'ecran. */

@font-face {
  font-family: "Beautifully Delicious Script";
  src: url("fonts/beautifully-delicious-script.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("fonts/courier-prime.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper:  #e6e4dd;
  --cream:  #f5edd9;
  --ink:    #000000;
  --tan:    #d2cab6;
  --accent: #304254;

  --script: "Beautifully Delicious Script", "Segoe Script", cursive;
  --mono:   "Courier Prime", "Courier New", Courier, monospace;

  --shadow-soft: 0 2px 3px rgba(0, 0, 0, 0.06), 0 24px 48px -28px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

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

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Le grain du papier, sur toute la page et non par section : dans Canva
   chaque ecran porte la meme texture a 50% par-dessus le beige. En fixe,
   pas de raccord visible entre les sections quand on scrolle. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("assets/paper.jpg") center / cover no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

::selection { background: var(--ink); color: var(--cream); }

.wrap {
  max-width: 1366px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

/* -------------------------------------------------------------------- */
/* Grille : --sh = hauteur de l'ecran dans la grille source (768 par defaut) */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1366 / var(--sh, 768);
  container-type: inline-size;
}

.stage--clip { overflow: hidden; }

.g {
  position: absolute;
  left:   calc(var(--x) * 100cqw / 1366);
  top:    calc(var(--y) * 100cqw / 1366);
  width:  calc(var(--w) * 100cqw / 1366);
  height: calc(var(--h) * 100cqw / 1366);
  transform: rotate(calc(var(--r, 0) * 1deg));
  margin: 0;
}

.g--auto { height: auto; }

.g--text {
  font-size: calc(var(--fs) * 100cqw / 1366);
  line-height: var(--lh, 1.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

/* word-spacing : evite que la queue cursive d'un mot (le "z" de "croyez",
   par ex.) se fonde dans le paraphe d'entree du mot suivant. */
/* font-weight:700 = le seul poids que contient le fichier (voir @font-face
   plus haut) ; le declarer explicitement evite toute tentative de faux-gras
   du navigateur qui epaissirait ou amincirait les traits par rapport a
   Canva (fidelite des titres deja calee au pixel pres). */
.g--script { font-family: var(--script); font-weight: 700; text-align: center; align-items: center; }

/* Uniquement le titre du quiz (texte ajoute, absent du Canva) : la queue du
   "z" de "croyez" a besoin d'air avant le mot suivant pour rester lisible. */
.quiz .g--script { word-spacing: 0.3em; }
.g--mono   { font-family: var(--mono);   font-weight: 400; }

.g--start  { text-align: left; align-items: flex-start; }
.g--center { text-align: center; align-items: center; }
.g--end    { text-align: right; align-items: flex-end; }
.g--upper  { text-transform: uppercase; }

/* Bloc ancre en haut a gauche : en flux normal, pas en flex. Le flex
   recalait la 1re ligne sur la largeur du contenu et decalait les lignes
   suivantes (visible sur les questions de la FAQ). */
.g--top { display: block; }

/* Les retours a la ligne sont ceux du Canva, pas un reflow du navigateur. */
.g--nowrap { white-space: nowrap; }

/* max-width du reset annule ici : certaines photos depassent volontairement
   leur fenetre (recadrage Canva), sinon elles seraient bridees a 100%. */
.g img { width: 100%; height: 100%; max-width: none; display: block; }
.g--fill img  { object-fit: fill; }
.g--cover img { object-fit: cover; }

/* Le trait de pinceau : Canva l'etire dans sa boite (ratio 15.09), donc fill. */
.scribble { object-fit: fill; }

/* -------------------------------------------------------------------- */
/* Cadres polaroid : le cadre en fond, la photo dans sa fenetre decoupee.
   Les retraits viennent du trace de decoupe Canva, pas d'un arrondi. */

.frame {
  /* cover plutot que 100% 100% : le grain du papier garde son ratio */
  background: url("assets/polaroid.png") center / cover no-repeat;
  box-shadow: var(--shadow-soft);
}
.frame__win { position: absolute; overflow: hidden; }
.frame__win img { position: absolute; display: block; }

/* Hero : fenetre 5.24/5.31/6.36/5.50 %, photo 100% x 134.64% calee en haut */
.win--hero { inset: 5.241% 5.313% 6.356% 5.498%; }
.win--hero img { left: 0; top: -0.570%; width: 100%; height: 134.644%; object-fit: cover; }

/* Faire-part : ici Canva dessine le cadre PAR-DESSUS la photo (contrairement au
   hero ou la photo est au-dessus). Le PNG de ce cadre paysage n'est plus
   telechargeable, donc sa fenetre reelle est reconstruite depuis le rendu de
   reference : elle rogne la zone de detourage de ~7 a 11px cote ecran. */
.win--invit { inset: 7.957% 6.150% 9.199% 6.333%; }
.win--invit img { left: -15.422%; top: -89.750%; width: 155.499%; height: 304.148%; object-fit: cover; }

/* Remerciements : pas de cadre dans le Canva, photo simplement detouree */
.merci__photo { overflow: hidden; }
.merci__photo img { position: absolute; left: 0; top: -5.484%; width: 100%; height: 133.5%; object-fit: cover; }

/* -------------------------------------------------------------------- */
/* Blocs pleins repris du Canva (rectangles, pas de rayon) */

.card  { background: var(--cream); box-shadow: var(--shadow-soft); }

/* Regroupe ce qui vit sur une carte creme. Sur desktop le conteneur ne
   genere aucune boite : ses enfants restent positionnes sur la grille du
   .stage, chacun avec sa rotation. Sur mobile il redevient la carte. */
.cardtexts { display: contents; }

/* Idem pour l'enveloppe + le polaroid pose dessus (ecran 2) : neutre sur
   desktop, redevient un conteneur relatif sur mobile (voir media query). */
.envelope-group { display: contents; }
.pill  {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tan);
  color: var(--ink);
  font-family: var(--mono);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-transform: uppercase;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.pill:hover, .pill:focus-visible { background: var(--ink); color: var(--cream); }

/* -------------------------------------------------------------------- */
/* Ecran 4 - Remerciements : le QR remplit son cadre blanc a 1.44% pres */

.merci__qr { background: #fff; box-shadow: var(--shadow-soft); }
/* Canva : cadre 103.5, QR 100.52 centre dedans -> 1.44% de marge */
.merci__qr img { position: absolute; left: 1.44%; top: 1.44%; width: 97.12%; height: 97.12%; }

.merci__clip { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28)); }

/* -------------------------------------------------------------------- */
/* Programme : chaque etape est un bloc a la position Canva ; le bouton et
   l'adresse sont cales dessous, en unites de la meme grille. */

.step { display: block; }
.step__head {
  font-family: var(--mono);
  font-size: calc(22.6669 * 100cqw / 1366);
  line-height: 1.09em;
  text-transform: uppercase;
  margin: 0;
}
.step__text {
  font-family: var(--mono);
  font-size: calc(14.6667 * 100cqw / 1366);
  line-height: 1.5em;
  letter-spacing: 0.015em;
  /* Canva : le paragraphe demarre a y=41.93 du bloc, le titre fait 24.71 de haut */
  margin: calc(17.22 * 100cqw / 1366) 0 0;
}
/* Canva utilise 16px pour les etapes 3 et 4, 14.6667px pour les etapes 1 et 2 */
.step__text--16 { font-size: calc(16 * 100cqw / 1366); }
/* Lieu + horaire : avant le bouton, et assez lisibles pour etre utiles.
   L'heure est mise en avant, l'adresse suit en retrait leger. */
.step__addr {
  font-family: var(--mono);
  font-size: calc(13.4 * 100cqw / 1366);
  line-height: 1.5em;
  margin: calc(11 * 100cqw / 1366) 0 0;
  color: var(--ink);
  opacity: 0.88;
}
.step__addr b {
  font-weight: 400;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  padding-bottom: 1px;
}

.step__pill {
  display: inline-flex;
  width:  calc(149.14 * 100cqw / 1366);
  height: calc(25.42 * 100cqw / 1366);
  margin-top: calc(13 * 100cqw / 1366);
  font-size: calc(12.0003 * 100cqw / 1366);
  letter-spacing: 0.02em;
}

/* -------------------------------------------------------------------- */
/* FAQ */

.faq__q { font-family: var(--mono); font-size: calc(20.0002 * 100cqw / 1366); line-height: 1.4em; margin: 0; }
.faq__a { font-family: var(--mono); font-size: calc(16.0002 * 100cqw / 1366); line-height: 1.4em; margin: 0; }

/* -------------------------------------------------------------------- */
/* Compte a rebours : hors Canva, meme langage que la ligne date/lieu */

.countdown { text-align: center; padding: clamp(36px, 5.5vw, 66px) 20px clamp(40px, 5.5vw, 70px); }
.countdown__intro {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.66);
  margin: 0 0 20px;
}
.countdown__row { display: flex; justify-content: center; align-items: baseline; gap: clamp(22px, 4vw, 48px); }
.countdown__item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.countdown__num { font-family: var(--mono); font-size: clamp(2.4rem, 6.4vw, 3.5rem); line-height: 1; }
.countdown__unit { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.62; }
.countdown__sep { font-family: var(--mono); font-size: clamp(1.5rem, 3.6vw, 2.1rem); opacity: 0.32; }
.countdown__sep::before { content: "\00b7"; }
.countdown__message { font-family: var(--script); font-size: clamp(1.9rem, 5vw, 2.7rem); margin: 0; }

/* Entree au chargement : chaque bloc monte legerement, en cascade. */
.countdown__intro,
.countdown__item,
.countdown__sep { opacity: 0; }
.countdown.is-ready .countdown__intro,
.countdown.is-ready .countdown__item,
.countdown.is-ready .countdown__sep { animation: cdIn 0.62s var(--ease) both; }
.countdown.is-ready .countdown__intro   { animation-delay: 0ms; }
.countdown.is-ready .countdown__item:nth-of-type(1) { animation-delay: 120ms; }
.countdown.is-ready .countdown__sep:nth-of-type(1)  { animation-delay: 200ms; }
.countdown.is-ready .countdown__item:nth-of-type(2) { animation-delay: 240ms; }
.countdown.is-ready .countdown__sep:nth-of-type(2)  { animation-delay: 320ms; }
.countdown.is-ready .countdown__item:nth-of-type(3) { animation-delay: 360ms; }
@keyframes cdIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------- */
/* Vos photos : hors Canva */

.photos-cta {
  text-align: center;
  padding: clamp(30px, 4.5vw, 56px) 20px clamp(58px, 7.5vw, 92px);
}
.sec-icon {
  width: clamp(52px, 6vw, 68px);
  height: auto;
  margin: 0 auto clamp(12px, 1.6vw, 18px);
  opacity: 0.9;
}
.sec-label {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0 0 6px;
}
/* Meme echelle que les titres du Canva : 133.361px sur la grille 1366,
   soit 9.76vw, avec un plancher proche du rendu mobile de ces titres. */
.sec-title {
  font-family: var(--script);
  font-size: clamp(4.4rem, 9.76vw, 8.4rem);
  line-height: 0.9;
  margin: 0;
}
/* meme trait de pinceau que les titres de section */
.sec-rule {
  display: block;
  width: clamp(200px, 23vw, 340px);
  height: auto;
  margin: clamp(0px, 0.4vw, 6px) auto clamp(20px, 2.6vw, 32px);
}
.sec-intro {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  max-width: 44ch;
  margin: 0 auto clamp(22px, 2.6vw, 30px);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tan);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  border: none;
  cursor: pointer;
  padding: 15px 34px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover, .btn:focus-visible { background: var(--ink); color: var(--cream); }

/* -------------------------------------------------------------------- */
/* Quiz : hors Canva, meme vocabulaire (carte creme, trombone, rectangles) */

.quiz { padding: clamp(26px, 4vw, 48px) 0 clamp(54px, 7vw, 90px); }
.quiz__head { text-align: center; }
.quiz__intro {
  margin: clamp(16px, 2.6vw, 30px) auto clamp(26px, 3.4vw, 40px);
  max-width: 52ch;
}

.quiz__panel {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
  background: var(--cream);
  box-shadow: var(--shadow-soft);
  padding: clamp(30px, 5vw, 46px) clamp(24px, 5vw, 42px) clamp(30px, 5vw, 42px);
  transform: rotate(-1.4deg);
}

/* Trombone en haut a droite : a gauche il passait sur le label du champ.
   Le PNG est dessine en diagonale (~47 deg), -40 deg le remet presque droit. */
.quiz__paperclip {
  position: absolute;
  top: -30px;
  right: 9%;
  width: clamp(46px, 7vw, 62px);
  transform: rotate(-40deg);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.quiz__field { display: block; margin-bottom: 18px; }
.quiz__fieldLabel {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  margin-bottom: 9px;
  opacity: 0.62;
}
.quiz__input {
  width: 100%;
  font-family: var(--mono);
  font-size: 1rem;
  padding: 11px 14px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
}
.quiz__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.quiz__error { font-family: var(--mono); color: #7a1f1f; font-size: 0.76rem; min-height: 1.2em; margin: 6px 0 0; }

.quiz__next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  padding: 14px 20px;
  transition: opacity 0.2s var(--ease);
}
.quiz__next:disabled { opacity: 0.32; cursor: not-allowed; }

.quiz__meter { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.quiz__count { font-family: var(--mono); font-size: 0.7rem; white-space: nowrap; opacity: 0.6; }
.quiz__track { flex: 1; height: 2px; background: rgba(0, 0, 0, 0.16); position: relative; }
.quiz__fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); width: 0%; transition: width 0.3s var(--ease); }

.quiz__num { display: block; font-family: var(--script); font-size: clamp(2.6rem, 8vw, 3.6rem); line-height: 1; margin: 12px 0 2px; }

.quiz__stage { transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.quiz__stage--out { opacity: 0; transform: translateY(6px); }
.quiz__stage--in  { opacity: 0; transform: translateY(-6px); animation: quizIn 0.26s var(--ease) forwards; }
@keyframes quizIn { to { opacity: 1; transform: translateY(0); } }

.quiz__question { font-family: var(--mono); font-size: clamp(1rem, 2.6vw, 1.22rem); line-height: 1.45; margin: 0 0 20px; font-weight: 400; }

.quiz__options { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 9px; }
.opt {
  width: 100%;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.45;
  background: var(--tan);
  color: var(--ink);
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.opt.is-picked { background: var(--ink); color: var(--cream); }

.quiz__doneTitle { font-family: var(--script); font-size: clamp(1.9rem, 5vw, 2.5rem); text-align: center; margin: 0 0 14px; }
.quiz__score { display: flex; align-items: baseline; justify-content: center; gap: 9px; margin-bottom: 16px; }
.quiz__scoreNum { font-family: var(--mono); font-size: 2.3rem; }
.quiz__scoreTotal { font-family: var(--mono); font-size: 0.76rem; max-width: 12ch; opacity: 0.7; }
.quiz__doneText { font-family: var(--mono); text-align: center; font-size: 0.83rem; line-height: 1.6; opacity: 0.85; }

/* Confettis du sans-faute : plein ecran, au-dessus de tout, jamais cliquable.
   Le canvas est cree puis retire par quiz.js, il n'existe que le temps de la
   salve. */
.confettis {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* -------------------------------------------------------------------- */
/* Depot de photos (photos.html) */

/* Page de depot : une colonne centree, meme vocabulaire que le quiz */
.up {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 84px) clamp(20px, 5vw, 32px) clamp(48px, 8vw, 96px);
}
.up__head { text-align: center; margin-bottom: clamp(28px, 4vw, 44px); }
.up__panel {
  position: relative;
  background: var(--cream);
  box-shadow: var(--shadow-soft);
  padding: clamp(30px, 5vw, 46px) clamp(24px, 5vw, 40px) clamp(30px, 5vw, 40px);
  transform: rotate(-1.2deg);
}
.up__backWrap { text-align: center; margin-top: clamp(26px, 4vw, 40px); }

.up__picker { text-align: center; margin: 22px 0 18px; }
.up__pickBtn { display: flex; width: 100%; }
.up__hint { font-family: var(--mono); font-size: 0.76rem; line-height: 1.6; opacity: 0.72; text-align: center; margin: 0; }
.up__list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 9px; }
.up__item { display: flex; align-items: center; gap: 12px; background: #fff; padding: 8px 12px; }
.up__thumb { width: 42px; height: 42px; object-fit: cover; flex-shrink: 0; background: var(--tan); }
.up__meta { flex: 1; min-width: 0; }
.up__name { display: block; font-family: var(--mono); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up__status { display: block; font-family: var(--mono); font-size: 0.66rem; opacity: 0.6; }
.up__status--error { color: #7a1f1f; opacity: 1; }
.up__status--done { color: #2f5133; opacity: 1; }
.up__retry { font-family: var(--mono); font-size: 0.7rem; background: var(--tan); border: none; padding: 6px 12px; cursor: pointer; flex-shrink: 0; }
.up__summary { font-family: var(--mono); font-size: 0.83rem; text-align: center; margin-top: 18px; }
.up__back { font-family: var(--mono); font-size: 0.83rem; color: var(--ink); }

/* -------------------------------------------------------------------- */
/* Signature de fin */

.signoff { text-align: center; padding: clamp(40px, 7vw, 84px) 20px clamp(52px, 8vw, 96px); }
.signoff__line {
  font-family: var(--script);
  /* vw pur (pas de plancher/plafond en rem) : la taille suit la largeur de
     l'ecran pour que la phrase tienne sur une seule ligne partout. */
  font-size: 5.6vw;
  white-space: nowrap;
  margin: 0;
}

/* -------------------------------------------------------------------- */
/* Reveal au scroll */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .quiz__stage, .quiz__stage--out, .quiz__stage--in { transition: none; animation: none; opacity: 1; transform: none; }
  .btn, .pill, .opt, .quiz__next { transition: none; }
}

/* -------------------------------------------------------------------- */
/* Bascule mobile : les scenes figees repassent en flux vertical */

@media (max-width: 1100px) {
  .stage {
    aspect-ratio: auto;
    height: auto;
    padding: 30px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .stage--clip { overflow: visible; }

  /* Le titre du quiz repasse sur plusieurs lignes ("croyez" et "nous" ne se
     touchent plus) : l'espacement ajoute pour le desktop n'a plus lieu
     d'etre et etirait chaque ligne de facon disgracieuse. */
  .quiz .g--script { word-spacing: normal; }

  .stage .g {
    position: static;
    width: 100% !important;
    max-width: 460px;
    height: auto !important;
    margin: 0 auto 16px;
    transform: rotate(calc(var(--r, 0) * 0.3deg));
    text-align: center;
    align-items: center;
  }

  .stage .g--text {
    font-size: calc(var(--fs) * 0.6px);
    line-height: var(--lh, 1.4);
  }
  /* Les textes courants (Courier) descendaient jusqu'a 8px avec le facteur
     0.6 : illisible. Echelle plus douce, avec un plancher. */
  .stage .g--text.g--mono {
    font-size: max(calc(var(--fs) * 0.85px), 13.5px);
  }
  /* Les titres manuscrits passent sur 2 lignes en mobile : l'interligne
     serre du Canva (0.5em) les faisait se chevaucher. */
  .stage .g--text.g--script { line-height: 0.95em; }

  .g--nowrap { white-space: normal; }

  /* Traits et fioritures : ramenes a une largeur lisible */
  .stage img.scribble.g,
  .stage img.squiggle.g {
    width: min(58vw, 230px) !important;
    height: auto !important;
    margin: 22px auto 22px;
  }

  /* Photos et cadres : ratio conserve, largeur contrainte. .frame doit
     garder une hauteur definie (via aspect-ratio) sinon sa fenetre interne
     (frame__win, positionnee en % dans .frame) n'a plus de repere et le
     cadre polaroid disparait, ne laissant que la photo brute (cas du
     polaroid du hero). */
  .stage .g.frame,
  .stage .g.merci__photo,
  .stage .g.g--photo {
    aspect-ratio: var(--w) / var(--h);
    width: min(78vw, 380px) !important;
  }
  .stage .g.frame .frame__win { position: absolute; }

  /* Enveloppe + polaroid : le conteneur reprend le ratio de l'enveloppe,
     le polaroid est repositionne dessus aux memes proportions qu'en desktop
     (offsets calcules depuis les coordonnees Canva des deux elements). */
  .stage .envelope-group {
    display: block;
    position: relative;
    width: min(78vw, 380px);
    aspect-ratio: 421.5 / 530.2;
    margin: 0 auto 22px;
  }
  .stage .envelope-group .g {
    position: static;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    margin: 0;
  }
  .stage .envelope-group .g.frame {
    position: absolute !important;
    left: -3.8%;
    top: 14.6%;
    width: 97% !important;
    height: 55.5% !important;
  }

  /* Faire-part : on garde la superposition du desktop plutot que d'empiler
     les 3 elements. La photo devient le fond de la section, l'enveloppe se
     pose dessus, la carte creme chevauche le bas de l'enveloppe. */
  .stage.invitation {
    display: block;
    position: relative;
    overflow: hidden;
    padding: 0;
  }
  .stage.invitation .g.invitation__bg {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: auto;
    margin: 0;
    transform: none;
    z-index: 0;
  }
  .stage.invitation .envelope-group {
    z-index: 1;
    margin: clamp(40px, 11vw, 70px) auto 0;
  }
  .stage.invitation .cardtexts--invit {
    position: relative;
    z-index: 2;
    margin: clamp(-96px, -22vw, -60px) auto clamp(40px, 11vw, 70px);
    transform: rotate(3.2deg);
  }

  /* Photo plein-cadre des Remerciements : pensee pour vivre derriere la
     carte creme (desktop uniquement). Sur mobile, en pleine largeur avant
     la carte, elle n'apporte rien et alourdit l'ecran : on la retire. */
  .stage .g.merci__bleed { display: none; }

  /* La carte vide disparait : c'est .cardtexts qui la remplace en flux. */
  .stage .g.card { display: none; }

  .stage .cardtexts {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(86vw, 400px);
    margin: 0 auto 18px;
    padding: 30px 22px 34px;
    background: var(--cream);
    box-shadow: var(--shadow-soft);
  }

  /* Carte du faire-part : format portrait du desktop (273 x 426), pas la
     bande large que donnait la largeur commune. */
  .stage .cardtexts--invit {
    width: min(64vw, 268px);
    aspect-ratio: 273.34 / 425.94;
    justify-content: center;
    gap: clamp(16px, 5vw, 26px);
    padding: 26px 18px;
  }

  /* Carte des remerciements : au contraire plus large, pour laisser
     respirer le texte agrandi. */
  .stage .cardtexts--merci {
    position: relative;
    width: min(92vw, 430px);
    padding: 42px 24px 38px;
  }
  .stage .cardtexts--merci .g--text.g--mono { font-size: 14.5px; }
  .stage .cardtexts--merci .g--text.g--script { font-size: 46px; }

  /* Trombone cale sur le coin de la carte, comme en desktop */
  .stage .cardtexts--merci .g.merci__clip {
    position: absolute;
    top: -34px;
    left: 16px;
    width: 62px !important;
    height: auto !important;
    margin: 0;
    transform: rotate(-45deg);
    z-index: 2;
  }
  .stage .cardtexts > .g {
    position: static;
    width: 100% !important;
    height: auto !important;
    max-width: none;
    margin: 0;
    transform: none;
    text-align: center;
    align-items: center;
  }

  .stage .g.merci__qr { width: 160px !important; aspect-ratio: 1; padding: 10px; }
  .stage .g.merci__qr img { position: static; width: 100%; height: auto; }

  /* Programme : les etapes s'empilent, bouton et adresse reviennent au flux */
  .stage .g.step { text-align: left; align-items: flex-start; margin-bottom: 34px; }
  .step__head { font-size: 1.12rem; }
  .step__text { font-size: 0.88rem; margin-top: 8px; }
  .step__pill {
    position: static;
    display: inline-flex;
    width: auto !important;
    height: auto !important;
    font-size: 0.72rem;
    padding: 10px 22px;
    margin-top: 14px;
  }
  .step__addr { position: static; font-size: 0.76rem; margin-top: 10px; opacity: 0.7; }

  /* FAQ : question puis reponse, pleine largeur */
  .stage .g.faq__q { text-align: left; align-items: flex-start; font-size: 1.05rem; margin-bottom: 8px; }
  .stage .g.faq__a { text-align: left; align-items: flex-start; font-size: 0.88rem; margin-bottom: 26px; }

  .quiz__panel { transform: none; margin: 0 16px; }

  /* Signature de fin : sur une seule ligne le vw pur la rendait minuscule.
     On la laisse passer sur deux lignes pour gagner en taille. */
  .signoff__line {
    white-space: normal;
    font-size: clamp(1.5rem, 7.4vw, 2.4rem);
    line-height: 1.15;
    max-width: 24ch;
    margin: 0 auto;
  }
}
