/* ════════════════════════════════════════════════════════════════════════
   Bar Mitsva de Solal — feuille de style
   Blocs blancs posés à plat sur le cannage, filet gris, angles droits.
   ════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────── Polices du projet ────────────────────────────
   Auto-hébergées et sous-ensemblées au jeu français : aucune requête vers
   un tiers, et 61 Ko au total. Fraunces est figée à opsz 144 / SOFT 100
   (empattements doux, contraste marqué), seule la graisse reste variable. */
@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/Fraunces.woff2") format("woff2-variations");
  font-weight: 500 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-300.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../assets/fonts/Poppins-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Frank Ruhl Libre";
  src: url("../assets/fonts/FrankRuhl-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ───────────────────────────── Design system ──────────────────────────── */
:root {
  --gris-fonce:  #4E5251;   /* titres, prénom, texte fort */
  --gris-moyen:  #7C807F;   /* corps de texte */
  --gris-clair:  #A8ACAB;   /* texte secondaire, mentions */
  --gris-filet:  #C4C7C6;   /* encadrés et séparateurs */
  --blanc:       #FFFFFF;   /* blocs de contenu */

  /* Une seule déclaration de police : si la famille du modèle est fournie
     plus tard, elle se substitue ici et nulle part ailleurs. */
  --font-titre: "Fraunces", "Cormorant Garamond", Didot, Georgia, serif;
  --font-texte: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-he:    "Frank Ruhl Libre", "Narkisim", "David", "Times New Roman", serif;

  /* nuances de papier de l'enveloppe : c'est ce qui dessine les plis */
  --env-flap:   #F4F4F4;
  --env-front:  #F1F1F1;
  --env-side-l: #ECECEC;
  --env-side-r: #E6E6E6;
  --env-back:   #E1E1E1;

  --cane: 92px;                     /* pas du motif cannage */
  --wrap: 560px;                    /* colonne centrale */
  --gap:  clamp(26px, 7vw, 44px);   /* respiration entre les blocs */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur:  600ms;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* une cible d'ancre ne doit jamais coller au bord haut de l'écran */
.block { scroll-margin-top: var(--gap); }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: transparent;
  font-family: var(--font-texte);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: .015em;
  color: var(--gris-moyen);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Le scroll n’est libéré qu’une fois l’enveloppe ouverte. */
body.is-sealed { overflow: hidden; height: 100svh; }

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

button, input, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

a { color: inherit; }

/* détails : la sélection et le curseur de saisie restent dans la palette */
::selection { background: var(--gris-filet); color: var(--gris-fonce); }
input, textarea { caret-color: var(--gris-filet); }

:focus-visible { outline: 2px solid var(--gris-filet); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.noscript {
  padding: 4rem 1.5rem;
  text-align: center;
  background: var(--blanc);
}

/* ── Fine ligne dorée : progression de lecture, en haut de l'écran ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 15;
  width: 100%;
  height: 2px;
  background: var(--gris-filet);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
body:not(.is-sealed) .scroll-progress { opacity: .85; }

/* ─────────────────────── Fond cannage (parallaxe) ─────────────────────── */
.pattern {
  position: fixed;
  inset: -25vh 0;
  z-index: -1;
  background-color: #FFFFFF;
  background-image: image-set(
    url("../assets/canage@2x.webp") 2x,
    url("../assets/canage.webp")    1x);
  background-image: -webkit-image-set(
    url("../assets/canage@2x.webp") 2x,
    url("../assets/canage.webp")    1x);
  background-repeat: repeat;
  background-size: var(--cane) var(--cane);
  transform: translate3d(0, 0, 0);
}

/* ══════════════════════════════════════════════════════════════════════
   VUE A — L’ENVELOPPE
   ══════════════════════════════════════════════════════════════════════ */
.envelope-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem
           max(1.5rem, env(safe-area-inset-bottom));
  transition: opacity .5s ease;
}
.envelope-view.is-gone { opacity: 0; pointer-events: none; }

.envelope-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 6vh, 2.75rem);
  width: 100%;
  max-width: 30rem;
  perspective: 1200px;
  opacity: 0;
  transition: opacity .5s ease;
}
html.fonts-ready .envelope-stage { opacity: 1; }

.envelope__kicker {
  font-size: clamp(11px, 3vw, 12px);
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  color: var(--gris-fonce);
  text-align: center;
  transition: opacity .3s ease;
}

.envelope {
  --w: min(84vw, 21rem);
  --h: calc(var(--w) * .68);
  position: relative;
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
  filter: drop-shadow(0 2px 4px rgba(78, 82, 81, .10));
  transition: transform .5s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .envelope:hover { transform: translateY(-4px); } }
.envelope.is-open {
  cursor: default;
  filter: drop-shadow(0 3px 6px rgba(78, 82, 81, .12));
  transition: transform .5s var(--ease), filter .9s var(--ease);
}
.envelope.is-expanding { filter: none; }

.envelope__back {
  position: absolute; inset: 0; z-index: 1;
  background: var(--env-back);
  border-radius: 0;
}

/* les trois volets pavent le rectangle : la carte n’est jamais à nu */
.envelope__pocket {
  position: absolute; inset: 0; z-index: 3;
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
}
.envelope__side  { position: absolute; top: 0; width: 52%; height: 100%; }
.envelope__side--l {
  left: 0;
  background: var(--env-side-l);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.envelope__side--r {
  right: 0;
  background: var(--env-side-r);
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
}
.envelope__bottom {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 58%;
  background: var(--env-front);
  clip-path: polygon(0 100%, 100% 100%, 50% 0);

}

.envelope__flap {
  position: absolute; left: 0; top: 0; z-index: 5;
  width: 100%; height: 58%;
  transform-origin: top center;
  transform: rotateX(0deg);
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.34, .01, .2, 1);
  pointer-events: none;
}
/* Une seule face : en tournant au-delà de 90°, le navigateur affiche son
   dos — c'est-à-dire le vrai miroir du papier, pointe vers le haut. Une
   seconde face « dos » annulerait cette rotation et retournerait le triangle. */
.envelope__flap-face {
  position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--env-flap);
}

.envelope__seal {
  position: absolute; left: 50%; top: 15%;
  width: 24%; min-width: 52px;
  transform: translateX(-50%);
  opacity: .78;
  transition: opacity .3s ease;
}
/* il disparaît avant que le papier ne se retourne : jamais de monogramme à l'envers */
.envelope.is-open .envelope__seal { opacity: 0; transition-duration: .25s; }

/* le rabat ne repasse derrière la carte qu’à mi-rotation, quand il a
   quitté la face de l’enveloppe — sinon il disparaîtrait d’un coup */
.envelope.is-open .envelope__flap {
  transform: rotateX(-180deg);
  z-index: 0;
  transition: transform .9s cubic-bezier(.34, .01, .2, 1), z-index 0s linear .45s;
}

.envelope__card {
  position: absolute; left: 6%; bottom: 6%; z-index: 2;
  width: 88%; height: 82%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35em;
  background: var(--blanc);
  border-radius: 0;
  box-shadow: 0 2px 5px rgba(78, 82, 81, .12);
  transform: translateY(0) rotate(0deg);
  transition: transform .9s var(--ease) .3s;
  will-change: transform;
}
.envelope__card-title,
.envelope__card-name {
  font-weight: 400;
  color: var(--gris-moyen);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-indent: .1em;
  line-height: 1.15;
  opacity: 0;
  transition: opacity .5s ease;
}
.envelope__card-title { font-size: clamp(17px, 5vw, 22px); }
.envelope__card-name  { font-size: clamp(23px, 6.6vw, 30px); }

/* la carte glisse hors de l’enveloppe avec une légère bascule */
.envelope.is-open .envelope__card { transform: translateY(-62%) rotate(-1.2deg); }
.envelope.is-open .envelope__card-title,
.envelope.is-open .envelope__card-name { opacity: 1; transition-delay: .85s; }

/* phase finale : la carte grandit seule et couvre l’écran */
.envelope.is-expanding .envelope__back,
.envelope.is-expanding .envelope__pocket,
.envelope.is-expanding .envelope__flap {
  opacity: 0;
  transition: opacity .28s ease;
}
.envelope.is-expanding .envelope__card {
  transform: translateY(-62%) rotate(0deg) scale(7);
  border-radius: 0;
  box-shadow: none;
  transition: transform .7s cubic-bezier(.55, .06, .68, .19);
}
.envelope.is-expanding .envelope__card-title,
.envelope.is-expanding .envelope__card-name {
  opacity: 0;
  transition: opacity .22s ease;
}

.envelope__hint {
  font-size: clamp(11px, 3.2vw, 12px);
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  color: var(--gris-fonce);
  text-align: center;
  animation: breathe 2.8s var(--ease) infinite;
  transition: opacity .3s ease;
}
@keyframes breathe { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.envelope-view.is-opening .envelope__kicker,
.envelope-view.is-opening .envelope__hint {
  opacity: 0;
  animation: none;
}

/* ══════════════════════════════════════════════════════════════════════
   MUSIQUE D'AMBIANCE
   ══════════════════════════════════════════════════════════════════════ */
.son {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 18;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--gris-filet);
  background: var(--blanc);
  color: var(--gris-fonce);
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s ease, transform .5s var(--ease),
              border-color .3s ease, color .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.son[hidden] { display: none; }
.son.is-visible { opacity: 1; transform: none; }
@media (hover: hover) { .son:hover { border-color: var(--gris-fonce); } }
.son:active { transform: scale(.94); }

.son__icone { width: 19px; height: 19px; }

/* la barre oblique n'apparaît que lorsque le son est coupé */
.son__barre {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset .3s var(--ease);
}
.son[aria-pressed="false"] { color: var(--gris-clair); }
.son[aria-pressed="false"] .son__barre { stroke-dashoffset: 0; }

/* ══════════════════════════════════════════════════════════════════════
   VUE B — STRUCTURE
   ══════════════════════════════════════════════════════════════════════ */
.invitation { display: block; padding: var(--gap) 0; }
.invitation[hidden] { display: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 20px);
}

/* Bloc blanc + filet doré en cadre intérieur. Le cannage respire entre eux. */
.block {
  background: var(--blanc);
  padding: clamp(8px, 2.4vw, 11px);
  border-radius: 0;
  margin-bottom: var(--gap);
}
.block:last-child { margin-bottom: 0; }

.block__inner {
  position: relative;
  padding: clamp(24px, 7vw, 40px) clamp(18px, 6vw, 34px);
  /* rythme vertical unique : --sp pilote l'espacement de chaque bloc */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp, 18px);
  text-align: center;
}
/* Le cadre doré se TRACE depuis le centre : les deux filets horizontaux
   s'étirent pendant que les deux verticaux montent, les angles se referment
   en dernier. Deux pseudo-éléments, deux axes, aucune reprise de layout. */
.block__inner::before,
.block__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: transform .85s var(--ease) .18s;
}
.block__inner::before {
  border-top: 1px solid var(--gris-filet);
  border-bottom: 1px solid var(--gris-filet);
  transform: scaleX(0);
}
.block__inner::after {
  border-left: 1px solid var(--gris-filet);
  border-right: 1px solid var(--gris-filet);
  transform: scaleY(0);
}
.reveal.is-in .block__inner::before { transform: scaleX(1); }
.reveal.is-in .block__inner::after  { transform: scaleY(1); }

/* ─────────────────────────── Typographie ──────────────────────────────── */
/* Titres : serif display, empattements doux, graisse forte. */
.t-hero, .t-section, .t-event, .t-nom {
  font-family: var(--font-titre);
  font-weight: 700;
  color: var(--gris-fonce);
  margin: 0;
}
.t-hero    { font-size: clamp(46px, 14vw, 60px);  line-height: 1.02; }
.t-section { font-size: clamp(32px, 9vw, 40px);   line-height: 1.1; }
.t-event   { font-size: clamp(30px, 8.4vw, 38px); line-height: 1.1; }

/* Le prénom est partout le point focal. */
.t-nom { font-size: clamp(48px, 15vw, 66px); line-height: 1.02; }

/* Second niveau de titre, décalé sous le premier (« Bar Mitsvah »). */
.t-event__second {
  display: block;
  margin-top: 6px;
  margin-left: .55em;        /* le léger décalage du modèle */
  font-size: .52em;
  font-weight: 600;
  letter-spacing: .01em;
}

.t-body { font-size: 16px; line-height: 1.75; font-weight: 300; color: var(--gris-moyen); }
.t-soft { color: var(--gris-clair); }

.t-label {
  display: block;
  font-family: var(--font-texte);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gris-clair);
}
.t-label--indent { text-indent: .18em; }

.center { text-align: center; }

/* filet gris court, centré — il se dessine à l'apparition */
.rule {
  display: block;
  width: 56px; height: 1px;
  margin: 0 auto;
  background: var(--gris-filet);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .7s var(--ease) .25s;
}
.is-in .rule { transform: scaleX(1); }


/* ───────────────────────── Carte de garde ─────────────────────────────── */
.cover .block__inner {
  min-height: calc(100svh - 2 * var(--gap) - 22px);
  justify-content: center;
  padding-block: clamp(36px, 9vw, 56px);
}
/* La garde recule légèrement à mesure qu'on la quitte : effet de profondeur. */
.cover > .block__inner > *:not(::before) { will-change: auto; }
.cover.is-receding .block__inner {
  opacity: var(--recede-o, 1);
  transform: scale(var(--recede-s, 1));
  transform-origin: 50% 30%;
}

.cover__mono {
  width: clamp(84px, 24vw, 104px);
  margin: 0 auto;
  opacity: 0;
  transform: scale(.92);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.is-in .cover__mono { opacity: 1; transform: scale(1); }

.cover__intro { max-width: 24ch; }
.cover__dates { font-size: clamp(18px, 5vw, 21px); color: var(--gris-fonce); }

/* indice de scroll */
.scroll-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--gris-clair);
  transition: opacity .4s ease, color .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.scroll-hint.is-hidden { opacity: 0; pointer-events: none; }
.scroll-hint__arrow {
  width: 14px; height: 22px;
  stroke: var(--gris-filet);
  stroke-width: 1.4;
  fill: none;
  animation: bob 2.4s var(--ease) infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50%      { transform: translateY(5px); opacity: 1; }
}
@media (hover: hover) { .scroll-hint:hover { color: var(--gris-moyen); } }

/* ───────────────────── Bandeau de titre de section ────────────────────── */
.head .block__inner { padding-block: clamp(28px, 7vw, 38px); }

/* ────────────────────────── Cartes-événements ─────────────────────────── */
/* Contenu entièrement centré : plus de badge, plus d'alignement à gauche. */
.event .block__inner { padding-inline: clamp(18px, 6vw, 40px); }

.event__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  text-align: center;
}
.event__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  min-width: 0;
}

/* Chaque groupe de lignes forme un paragraphe compact ; l'espacement
   entre groupes vient de `--saut`, ce qui reproduit la trame au mot près. */
.ev-lignes {
  margin: 0;
  font-family: var(--font-texte);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.85;
  color: var(--gris-moyen);
  max-width: 34ch;
}
.ev-lignes--fort { color: var(--gris-fonce); font-weight: 400; }

.event__body > * + *      { margin-top: 18px; }
.event__body > .t-event + * { margin-top: 26px; }   /* le titre respire davantage */
.event__body > .ev-saut { margin-top: 0; height: 34px; }   /* respiration demandée */

/* Date hébraïque et ligne en hébreu */
.ev-he {
  margin: 0;
  direction: rtl;
  unicode-bidi: isolate;
  font-family: var(--font-he);
  font-size: 19px;
  line-height: 1.6;
  color: var(--gris-fonce);
}
.ev-date-he {
  margin: 0;
  direction: rtl;
  unicode-bidi: isolate;
  font-family: var(--font-he);
  font-size: 17px;
  line-height: 1.6;
  color: var(--gris-moyen);
}

/* Citation traduite + source */
.ev-citation {
  margin: 0;
  font-family: var(--font-texte);
  font-weight: 300;
  font-style: italic;
  font-size: 15px;
  line-height: 1.7;
  color: var(--gris-moyen);
  max-width: 32ch;
}
.ev-source {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: .12em;
  text-indent: .12em;
  text-transform: uppercase;
  color: var(--gris-clair);
}

/* Lien d'itinéraire : plus d'encadré, un simple lien en petites capitales */
.event__actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}
.lien-itineraire {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 44px;
  padding: 4px 2px;
  font-family: var(--font-texte);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gris-fonce);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, color .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.lien-itineraire svg { width: 15px; height: 15px; flex: none; }
.lien-itineraire svg:last-child { width: 14px; height: 14px; }
@media (hover: hover) {
  .lien-itineraire:hover { border-bottom-color: var(--gris-filet); }
}
.lien-itineraire:active { color: var(--gris-moyen); }

/* ── Respiration entre deux blocs : le cannage se voit, sans texte.
   Hauteur calée sur celle du bandeau de titre qu'elle remplace. ── */
.section-espace { height: 119px; }
@media (min-width: 768px) { .section-espace { height: 148px; } }

/* ══════════════════════════════════════════════════════════════════════
   BLOCS D'ADRESSE
   ══════════════════════════════════════════════════════════════════════ */
.venue .block__inner { padding-block: clamp(24px, 6.5vw, 32px); }
.venue__name {
  margin: 0;
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: clamp(22px, 6vw, 26px);
  line-height: 1.25;
  color: var(--gris-fonce);
}
.venue__address {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--gris-moyen);
}

.venue__chip {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--gris-filet);
  font-size: 11px;
  letter-spacing: .14em;
  text-indent: .14em;
  text-transform: uppercase;
  color: var(--gris-moyen);
}

.maps { display: flex; justify-content: center; gap: 16px; }

/* Tuiles d'application. Les logos gardent leurs couleurs de marque :
   ce sont des repères de reconnaissance, pas des éléments de décor. */
.map-btn {
  display: block;
  width: 52px; height: 52px;
  overflow: hidden;
  background: var(--blanc);
  border: 1px solid var(--gris-filet);
  transition: border-color .3s ease, transform .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.map-btn img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) {
  .map-btn:hover { border-color: var(--gris-fonce); transform: translateY(-2px); }
}
.map-btn:active { transform: scale(.95); }

/* ──────────────────────────── Boutons ─────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 44px;
  padding: .7em 1.2em;
  border: 1px solid var(--gris-filet);
  border-radius: 0;
  background: transparent;
  color: var(--gris-fonce);
  font-size: 12px;
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: color .3s ease, transform .12s ease, opacity .3s ease;
  -webkit-tap-highlight-color: transparent;
}
/* remplissage doré qui monte depuis le bas */
.btn::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--gris-filet);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .34s var(--ease);
}
@media (hover: hover) {
  .btn:hover { color: var(--blanc); }
  .btn:hover::before { transform: scaleY(1); }
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:active { transform: none; }

.btn--solid {
  background: var(--gris-fonce);
  border-color: var(--gris-fonce);
  color: var(--blanc);
}
.btn--solid::before { background: var(--gris-filet); }
@media (hover: hover) { .btn--solid:hover { color: var(--blanc); } }

.btn--ghost {
  border-color: rgba(140, 145, 143, .5);
  color: var(--gris-clair);
}

.btn__icon { width: 1.05em; height: 1.05em; flex: none; }

/* ───────────────────────── Compte à rebours ───────────────────────────── */
.countdown .block__inner { padding-block: clamp(22px, 6vw, 30px); }
.countdown__row { width: 100%; }

.countdown__row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}
.countdown__cell {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px;
  text-align: center;
}
.countdown__cell + .countdown__cell { border-left: 1px solid var(--gris-filet); }
.countdown__value {
  display: block;
  font-size: clamp(30px, 9vw, 38px);
  line-height: 1.1;
  color: var(--gris-fonce);
  font-variant-numeric: tabular-nums;
}
/* fondu vertical court à chaque changement de valeur */
.countdown__value.is-tick { animation: tick .32s var(--ease); }
@keyframes tick {
  0%   { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.countdown__done {
  font-size: clamp(26px, 7.5vw, 32px);
  color: var(--gris-fonce);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════
   FORMULAIRE RSVP
   ══════════════════════════════════════════════════════════════════════ */
.rsvp__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.rsvp .block__inner { --sp: 26px; }
.rsvp__form { width: 100%; }

.progress {
  position: relative;
  height: 2px;
  margin-bottom: 26px;
  background: rgba(140, 145, 143, .22);
}
.progress__bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 33.33%;
  background: var(--gris-filet);
  transition: width .45s var(--ease);
}

.steps { position: relative; text-align: left; }

.step {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border: 0; margin: 0; padding: 0;
  min-width: 0;
  text-align: left;
}
.step[hidden] { display: none; }
.step.is-out { animation: step-out .22s var(--ease) both; }
.step.is-in-anim { animation: step-in .38s var(--ease) both; }
@keyframes step-in  { from { opacity: 0; transform: translateX(24px); }  to { opacity: 1; transform: none; } }
@keyframes step-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-24px); } }

.field { display: flex; flex-direction: column; gap: 2px; }

.field__label {
  font-size: 15px;
  line-height: 1.45;
  color: var(--gris-moyen);
}
.field__opt { color: var(--gris-clair); }

.field__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid rgba(140, 145, 143, .55);
  border-radius: 0;
  background: transparent;
  font-size: 16px;              /* ≥16px : pas de zoom automatique sur iOS */
  font-weight: 300;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .3s ease;
}
.field__input:focus { outline: none; border-bottom-color: var(--gris-filet); }
.field__input--area { min-height: 92px; resize: vertical; line-height: 1.6; }
.field__input[aria-invalid="true"] { border-bottom-color: var(--gris-fonce); }

.question {
  font-size: 17px;
  line-height: 1.5;
  text-align: center;
  color: var(--gris-moyen);
}
.question__note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gris-clair);
  text-align: center;
}

.error {
  font-size: 13px;
  line-height: 1.45;
  /* pas de rouge : l'erreur se signale par le contraste et la graisse */
  color: var(--gris-fonce);
  font-weight: 400;
  text-align: center;
}
.error[hidden] { display: none; }

/* ──────────────────── Cartes de choix (radio masqué) ──────────────────── */
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice:active .choice__box { transform: scale(.985); }
.choice input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice__box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid rgba(140, 145, 143, .5);
  border-radius: 0;
  background: transparent;
  transition: border-color .28s ease, background-color .28s ease,
              box-shadow .28s ease, transform .14s var(--ease);
}
@media (hover: hover) { .choice:hover .choice__box { border-color: var(--gris-filet); } }

.choice__check {
  flex: none;
  width: 20px; height: 20px;
  stroke: var(--gris-filet);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.choice__check path {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  transition: stroke-dashoffset .4s var(--ease);
}
.choice__ring { stroke: rgba(140, 145, 143, .5); transition: stroke .28s ease; }

.choice__text { display: flex; flex-direction: column; gap: 2px; }
.choice__title { font-size: 16px; line-height: 1.35; color: var(--gris-fonce); }
.choice__sub   { font-size: 13px; line-height: 1.35; color: var(--gris-clair); }

.choice input:checked + .choice__box {
  border-color: var(--gris-filet);
  background: var(--gris-filet);
  box-shadow: inset 0 0 0 1px var(--gris-filet);
}
.choice input:checked + .choice__box .choice__check path { stroke-dashoffset: 0; }
.choice input:checked + .choice__box .choice__ring { stroke: var(--gris-filet); }
.choice input:focus-visible + .choice__box {
  outline: 2px solid var(--gris-filet);
  outline-offset: 3px;
}

/* ── Marqueur de champ obligatoire ── */
.field__label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0; }
.field__req { color: var(--gris-filet); margin-left: .1em; }
.field__opt { margin-left: .45em; }
.field__input::placeholder { color: var(--gris-clair); opacity: .6; }

/* ══════════════════════════════════════════════════════════════════════
   PRÉSENCE PAR ÉVÉNEMENT
   ══════════════════════════════════════════════════════════════════════ */
.moments { display: flex; flex-direction: column; gap: 14px; }
.step > .question { margin-bottom: -6px; }

.moment {
  border: 1px solid rgba(140, 145, 143, .45);
  border-radius: 0;
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.moment.is-on {
  border-color: var(--gris-filet);
}
.moment.is-off { border-color: rgba(140, 145, 143, .28); }
.moment.is-off .moment__head { opacity: .55; }

/* bandeau : nom du moment puis date et heure */
.moment__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 14px;
  background: rgba(196, 199, 198, .38);
  border-bottom: 1px solid rgba(140, 145, 143, .35);
  text-align: center;
  transition: background-color .3s ease;
}
.moment.is-on .moment__head { background: var(--gris-filet); }

.moment__titre {
  font-size: 12px;
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
  color: var(--gris-fonce);
}
.moment__quand {
  font-size: 13px;
  font-style: italic;
  line-height: 1.35;
  color: var(--color-ink-mid, var(--gris-clair));
}

.moment__body { padding: 12px 14px 14px; }

.moment__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.moment__label { font-size: 16px; }

/* ── Bascule Oui / Non ── */
.segmented {
  display: flex;
  flex: none;
  border: 1px solid rgba(140, 145, 143, .55);
  border-radius: 0;
  overflow: hidden;
}
.segmented__opt { display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.segmented__opt + .segmented__opt { border-left: 1px solid rgba(140, 145, 143, .55); }
.segmented__opt input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.segmented--sm span { min-width: 0 !important; font-size: 14px; padding: 0 14px !important; }
.segmented--sm { flex: 1 1 auto; }
.segmented--sm .segmented__opt { flex: 1 1 0; }

.segmented__opt span {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 44px;
  padding: 0 10px;
  font-size: 15px;
  color: var(--gris-moyen);
  transition: background-color .28s ease, color .28s ease;
}
.segmented__opt input:checked + span {
  background: var(--gris-fonce);
  color: var(--blanc);
}
.segmented__opt input:focus-visible + span {
  outline: 2px solid var(--gris-filet);
  outline-offset: -3px;
}
@media (hover: hover) {
  .segmented__opt:hover input:not(:checked) + span { background: rgba(140, 145, 143, .12); }
}

/* ── Le détail se replie tant que la présence n'est pas confirmée ── */
.moment__collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s var(--ease), opacity .3s ease;
  opacity: 0;
}
.moment__collapse > * { overflow: hidden; min-height: 0; }
.moment.is-on .moment__collapse { grid-template-rows: 1fr; opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════
   LISTE DES PERSONNES (étape 2)
   ══════════════════════════════════════════════════════════════════════ */
.guests { display: flex; flex-direction: column; gap: 12px; }

.guest {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(140, 145, 143, .4);
  border-radius: 0;
}
.guest__nom { min-height: 40px; padding: 6px 2px; }
.guest__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest__del {
  flex: none;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--gris-clair);
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.guest__del svg { width: 17px; height: 17px; }
@media (hover: hover) {
  .guest__del:hover { color: var(--gris-fonce); background: rgba(78, 82, 81, .07); }
}
.guest__del:active { transform: scale(.9); }

/* bouton d'ajout, en pointillé pour se distinguer des actions d'étape */
.btn--add {
  border-style: dashed;
  border-color: rgba(140, 145, 143, .6);
  color: var(--gris-moyen);
  gap: .5em;
  align-self: stretch;
}
.btn--add[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   QUI VIENT À QUEL MOMENT (étape 3)
   ══════════════════════════════════════════════════════════════════════ */
.attendees {
  display: flex;
  flex-direction: column;
  padding-top: 6px;
}

.attendee {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.attendee + .attendee { border-top: 1px solid rgba(140, 145, 143, .22); }
.attendee input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attendee__box {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid rgba(140, 145, 143, .65);
  border-radius: 0;
  color: var(--blanc);
  transition: background-color .25s ease, border-color .25s ease;
}
.attendee__box svg { width: 15px; height: 15px; }
.attendee__box svg path {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset .3s var(--ease);
}
.attendee input:checked + .attendee__box {
  background: var(--gris-fonce);
  border-color: var(--gris-fonce);
}
.attendee input:checked + .attendee__box svg path { stroke-dashoffset: 0; }
.attendee input:focus-visible + .attendee__box {
  outline: 2px solid var(--gris-filet);
  outline-offset: 2px;
}
.attendee input:disabled ~ * { opacity: .5; }

.attendee__nom {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  line-height: 1.3;
  color: var(--gris-fonce);
  overflow-wrap: anywhere;
}
.attendee__type {
  flex: none;
  font-size: 11px;
  letter-spacing: .12em;
  text-indent: .12em;
  text-transform: uppercase;
  color: var(--gris-clair);
}

/* ─────────────────────────── Actions du formulaire ────────────────────── */
.step__actions {
  display: flex;
  flex-direction: column-reverse;   /* action principale en premier */
  align-items: stretch;
  gap: 10px;
  margin-top: 2px;
}
@media (min-width: 420px) {
  .step__actions { flex-direction: row; justify-content: center; }
  .step__actions .btn { flex: 0 1 auto; }
}

.thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
  animation: step-in .45s var(--ease) both;
}
.thanks[hidden] { display: none; }
.thanks__mono { width: clamp(72px, 20vw, 92px); }
.thanks p { max-width: 26ch; }

/* ─────────────────────────── Pied de page ─────────────────────────────── */
.closing__mono { width: clamp(76px, 21vw, 96px); margin: 0 auto; }
.closing__contacts { display: flex; flex-direction: column; gap: 4px; }
.closing__contact { font-size: 15px; color: var(--gris-moyen); }
.closing__contact a { text-decoration: none; border-bottom: 1px solid var(--gris-filet); }

/* Signature de l'agence : discrète, mais cliquable et bien identifiable. */
.credit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;          /* zone tactile confortable */
  padding: 0 6px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  color: var(--gris-moyen);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .3s ease, border-color .3s ease;
}
@media (hover: hover) {
  .credit:hover { color: var(--gris-fonce); border-bottom-color: var(--gris-filet); }
}

/* ══════════════════════════════════════════════════════════════════════
   APPARITION AU SCROLL
   ══════════════════════════════════════════════════════════════════════ */
/* Les grands titres montent derrière un cache plutôt que de simplement fondre. */
.reveal .t-hero,
.reveal .t-section {
  clip-path: inset(0 0 106% 0);
  transition: clip-path .9s var(--ease) var(--d, 0ms);
}
.reveal.is-in .t-hero,
.reveal.is-in .t-section { clip-path: inset(-35% -35% -35% -35%); }

.reveal > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur) var(--ease) var(--d, 0ms),
              transform var(--dur) var(--ease) var(--d, 0ms);
}
.reveal.is-in > * { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════════════════════════════
   GRANDS ÉCRANS
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root { --cane: 116px; }
  .envelope { --w: min(42vw, 27rem); }
  .envelope-stage { max-width: 34rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   MOUVEMENT RÉDUIT — tout devient un simple fondu, rien ne casse
   ══════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .pattern { transform: none !important; }

  .envelope__flap,
  .envelope__card,
  .envelope.is-open .envelope__card { transition-duration: .2s; transition-delay: 0s; }
  .envelope.is-open .envelope__card { transform: translateY(-62%) rotate(0deg); }
  .envelope.is-open .envelope__card-title,
  .envelope.is-open .envelope__card-name { transition-delay: .2s; }
  .envelope.is-expanding .envelope__card { transition-duration: .2s; }
  .envelope__hint { animation: none; opacity: .8; }
  .scroll-hint__arrow { animation: none; }

  .reveal > *,
  .cover__mono {
    transform: none !important;
    transition: opacity .2s ease var(--d, 0ms) !important;
  }
  .rule { transform: scaleX(1) !important; transition: opacity .2s ease !important; }

  .step.is-in-anim,
  .step.is-out,
  .thanks { animation-duration: .2s; }
  .step.is-in-anim { animation-name: fade-only; }
  .step.is-out { animation-name: fade-out-only; }
  @keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }
  @keyframes fade-out-only { from { opacity: 1; } to { opacity: 0; } }

  .countdown__value.is-tick { animation: none; }
  .moment__collapse { transition: opacity .2s ease; }
  .attendee__box svg path { transition: none; }
  .map-btn:hover, .map-btn:active { transform: none; }
  .son { transition: opacity .2s ease; transform: none !important; }
  .son__barre { transition: none; }

  /* Les nouveaux effets tombent aussi à de simples fondus. */
  .block__inner::before,
  .block__inner::after { transform: none !important; transition: none; }
  .reveal .t-hero,
  .reveal .t-section { clip-path: none !important; transition: opacity .2s ease !important; }
  .cover .block__inner { opacity: 1 !important; transform: none !important; }
  .choice:active .choice__box { transform: none; }
  .scroll-progress { transition: none; }
  .btn::before { transition: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   IMPRESSION — version papier lisible, sans décor ni animation
   ══════════════════════════════════════════════════════════════════════ */
@media print {
  .pattern, .scroll-progress, .envelope-view, .son,
  .scroll-hint, .rsvp__form, .thanks, .countdown { display: none !important; }

  body { background: #FFFFFF; color: #000000; font-size: 12pt; }
  .invitation[hidden] { display: block !important; }

  .block {
    box-shadow: none;
    margin-bottom: 14pt;
    padding: 0;
    break-inside: avoid;
  }
  .block__inner { border: 1pt solid #999999; padding: 16pt; }
  .block__inner::before,
  .block__inner::after { display: none; }
  .cover .block__inner { min-height: 0; }

  .reveal > *,
  .reveal .t-hero,
  .reveal .t-section {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .rule { transform: scaleX(1) !important; }

  /* l'adresse d'un lien vaut mieux qu'un bouton mort sur papier */
  .event__actions, .maps { display: none !important; }
}
