@font-face {
  font-family: 'Higuen';
  src: url('../assets/fonts/higuen.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #fbf6ee;
  --cream-deep: #f3eadd;
  --sage: #b4c7ad;
  --sage-deep: #6f8a6a;
  --rose: #efcfca;
  --rose-deep: #c99592;
  --ink: #4d4844;
  --ink-soft: #7d746d;

  --font-display: 'Higuen', 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Pinyon Script', cursive;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Jost', system-ui, sans-serif;

  /* Hauteurs d'écran (1 % chacune) : petite = barre du navigateur affichée, grande = barre repliée.
     Les écrans épinglés prennent la grande hauteur (aucune bande découverte quand la barre se replie)
     et gardent leur contenu dans la petite ; --bar = l'écart entre les deux (0 sur ordinateur). */
  --svh: 1vh;
  --lvh: 1vh;
  --bar: calc((var(--lvh) - var(--svh)) * 100);
}

@supports (height: 1svh) {
  :root {
    --svh: 1svh;
    --lvh: 1lvh;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  background: var(--cream);
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.is-locked {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

/* Préchargeur : ses styles sont dans index.html (affiché avant le chargement de cette feuille) */

/* ---------- Ouverture ---------- */

.hero {
  position: relative;
  background: var(--cream);
  height: calc(var(--lvh) * 100);
  min-height: 540px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 0 16px var(--bar);
  grid-template-rows: 1fr auto 1fr; /* contenu au centre ; la rangée du bas accueille le petit cœur */
  --hint-bottom: max(22px, env(safe-area-inset-bottom)); /* hauteur de « Faites défiler » au-dessus du bas */
  --hint-size: 40px; /* place prise par « Faites défiler » et son petit cœur */
}

.hero__wash {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(40% 32% at 18% 22%, rgba(180, 199, 173, 0.35), transparent 70%),
    radial-gradient(36% 30% at 84% 78%, rgba(239, 207, 202, 0.55), transparent 70%),
    radial-gradient(30% 26% at 80% 18%, rgba(239, 207, 202, 0.35), transparent 70%),
    radial-gradient(34% 28% at 16% 84%, rgba(180, 199, 173, 0.28), transparent 70%);
  filter: blur(6px);
}

/* pétales de rose qui tombent derrière la photo et les prénoms */
.hero__petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__content {
  grid-row: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 1.4s ease, transform 1.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero.is-revealed .hero__content {
  opacity: 1;
  transform: none;
}

.hero__photo {
  position: relative;
  width: min(58vw, 290px, 42svh);
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 14px 14px;
  margin-bottom: 1.8rem;
}

.hero__photo::after {
  content: '';
  position: absolute;
  inset: -9px;
  border: 1px solid var(--sage);
  border-radius: 999px 999px 20px 20px;
}

.hero__photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: 50% 42%;
  background: linear-gradient(160deg, #f6e2de, #e9eee4);
}

.hero__kicker {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.hero__names {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  line-height: 1.1;
  color: var(--ink);
  margin-top: 0.6rem;
}

.hero__names .amp {
  font-family: var(--font-script);
  font-size: 1.15em;
  color: var(--rose-deep);
  padding: 0 0.08em;
}

/* petit cœur qui bat doucement, centré entre les prénoms et « Faites défiler » : la rangée sous le contenu,
   moins la place de « Faites défiler » (posé en bas) */
.hero__below {
  grid-row: 3;
  align-self: stretch;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: calc(var(--hint-bottom) + var(--hint-size));
}

.hero__heart {
  width: 18px;
  height: 18px;
  fill: var(--rose-deep);
  opacity: 0;
  transition: opacity 1.4s ease 1.2s;
  animation: battement 2.6s ease-in-out infinite;
}

.hero.is-revealed .hero__heart {
  opacity: 1;
}

@keyframes battement {
  0%, 55%, 100% { transform: scale(1); }
  12% { transform: scale(1.2); }
  24% { transform: scale(0.95); }
  36% { transform: scale(1.12); }
}

.hero__scroll {
  position: absolute;
  bottom: calc(var(--bar) + var(--hint-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 1s ease 2.2s;
}

.hero.is-revealed .hero__scroll {
  opacity: 1;
}

/* petit cœur qui descend, comme pour inviter à faire défiler */
.hero__scroll svg {
  width: 13px;
  height: 13px;
  fill: var(--rose-deep);
  animation: descend 2.2s ease-in-out infinite;
}

/* Téléphone : « Faites défiler » plus lisible (plus grand, plus foncé) et remonté, loin de la barre du navigateur */
@media (max-width: 767px) {
  .hero {
    --hint-bottom: max(9svh, calc(env(safe-area-inset-bottom) + 44px));
    --hint-size: 48px;
    /* sous les prénoms, toujours la place du cœur (et de l'air autour) et de « Faites défiler » :
       sur un écran court, le contenu remonte plutôt que de tout serrer */
    grid-template-rows: 1fr auto minmax(calc(var(--hint-bottom) + var(--hint-size) + clamp(48px, 10svh, 70px)), 1fr);
  }

  /* écran court : photo un peu plus petite */
  .hero__photo {
    width: min(58vw, 290px, 30svh);
  }

  .hero__scroll {
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.26em;
    color: var(--ink);
  }

  .hero__scroll svg {
    width: 15px;
    height: 15px;
  }
}

@keyframes descend {
  0% { transform: translateY(-6px); opacity: 0; }
  30% { opacity: 1; }
  70% { transform: translateY(10px); opacity: 1; }
  100% { transform: translateY(16px); opacity: 0; }
}

/* ---------- Rideau ---------- */

.curtain {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: pointer;
}

.curtain.is-open {
  cursor: default;
  pointer-events: none;
}

.curtain__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.curtain__invite {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 0 16px var(--bar);
  background: none;
  border: 0;
  color: #fffaf6;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.7s ease, transform 1.2s ease;
}

.curtain__invite:focus-visible {
  outline: none;
}

.curtain__invite:focus-visible .curtain__cta {
  outline: 2px solid #fffaf6;
  outline-offset: 4px;
}

/* rose framboise (comme « Grattez ici ») sur une pastille crème : bien lisible sur le rideau rose */
.curtain__cta {
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.74rem;
  padding: 0.95rem 1.6rem 0.95rem 1.9rem;
  color: #b3305a;
  border: 1px solid rgba(255, 250, 246, 0.9);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  animation: breathe 2.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 250, 246, 0.35); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(255, 250, 246, 0); }
}

.curtain.is-open .curtain__invite {
  opacity: 0;
  transform: scale(1.05);
}

/* planche d'icônes SVG (symboles) : jamais affichée elle-même */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Rideau sorti de l'écran : plus rien à peindre */
.curtain.is-gone {
  visibility: hidden;
}

/* Rideau en CSS : affiché dès le premier rendu, le temps que le rideau 3D arrive (et en secours sans WebGL) */
.curtain::before,
.curtain::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: 51%;
  pointer-events: none;
  background:
    linear-gradient(rgba(120, 70, 70, 0.16), transparent 28%, transparent 72%, rgba(120, 70, 70, 0.2)),
    repeating-linear-gradient(90deg, rgba(150, 90, 90, 0.22) 0, rgba(255, 240, 236, 0.28) 2.6rem, rgba(150, 90, 90, 0.22) 5.2rem),
    #e9c1bc;
  transition: transform 2.2s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s ease;
}

.curtain::before { left: 0; }
.curtain::after { right: 0; }

/* le rideau 3D a pris le relais */
.curtain.is-ready::before,
.curtain.is-ready::after {
  opacity: 0;
}

.curtain.is-fallback.is-open::before { transform: translateX(-100%); }
.curtain.is-fallback.is-open::after { transform: translateX(100%); }

/* ---------- Éléments communs ---------- */

.section {
  position: relative;
  padding: clamp(84px, 14vw, 140px) 16px;
  text-align: center;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(30% 22% at 8% 12%, rgba(180, 199, 173, 0.22), transparent 70%),
    radial-gradient(28% 20% at 94% 88%, rgba(239, 207, 202, 0.4), transparent 70%);
}

.section > * {
  position: relative;
}

.container {
  max-width: 620px;
  margin: 0 auto;
}

.title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(2rem, 8vw, 3.3rem);
  line-height: 1.1;
  color: var(--ink);
}

.title .heart {
  font-family: var(--font-serif);
  color: var(--rose-deep);
}

.subtitle {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  line-height: 1.3;
  margin-top: 0.6rem;
}

.lead {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 4.6vw, 1.55rem);
  line-height: 1.45;
  color: var(--ink);
}

.body-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.6;
  margin-top: 1rem;
  color: var(--ink);
}

.small-note {
  margin-top: 1.6rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.amp {
  font-family: var(--font-script);
  color: var(--rose-deep);
}

/* branche de gypsophile aquarelle sous les titres */
.brin {
  display: block;
  width: 170px;
  height: auto;
  margin: 1rem auto 1.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 1rem 1.8rem;
  border: 1px solid var(--sage-deep);
  border-radius: 999px;
  background: transparent;
  color: var(--sage-deep);
  font: 400 0.78rem/1 var(--font-sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.btn:hover {
  background: var(--sage-deep);
  color: var(--cream);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--sage-deep);
  color: var(--cream);
  width: 100%;
  padding: 1.15rem 1.8rem;
}

.btn--primary:hover {
  background: #5d7759;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0.4rem;
  font: 400 0.8rem var(--font-sans);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.card {
  background: rgba(255, 252, 247, 0.85);
  border: 1px solid rgba(180, 199, 173, 0.6);
  border-radius: 24px;
  padding: clamp(22px, 6vw, 40px);
  box-shadow: 0 18px 40px -28px rgba(110, 80, 70, 0.35);
}

.photo-ph {
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(239, 207, 202, 0.55), transparent 70%),
    radial-gradient(60% 50% at 75% 75%, rgba(180, 199, 173, 0.5), transparent 70%),
    var(--cream-deep);
  border: 1px dashed rgba(111, 138, 106, 0.45);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.4;
}

/* Apparition au défilement */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Survol du Domaine (drone) au défilement ---------- */

.film {
  position: relative;
  height: 230vh;
  height: 230svh;
  background: #3e4636;
}

.film__stage {
  position: sticky;
  top: 0;
  height: calc(var(--lvh) * 100);
  overflow: hidden;
}

.film__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* léger voile en haut (logo) et plus marqué en bas (nom) : lisibles sur les arbres */
.film__stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(30, 24, 20, 0.32), transparent 30%, transparent 58%, rgba(30, 24, 20, 0.5));
}

.film__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--bar) + max(var(--svh) * 11, env(safe-area-inset-bottom) + 48px));
  z-index: 1;
  padding: 0 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 4.4rem);
  line-height: 1.1;
  color: #fffaf4;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
}

/* blason du Domaine, en haut, légèrement transparent (opacité posée par js/film.js) */
.film__logo {
  position: absolute;
  left: 50%;
  top: max(8%, calc(env(safe-area-inset-top) + 28px));
  z-index: 1;
  width: clamp(84px, 11vw, 148px);
  height: auto;
  transform: translateX(-50%);
  opacity: 0;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.35));
}

/* Téléphone : à la fin de la vidéo, elle reste en place et Save the Place monte par-dessus comme une carte
   (empilement, comme les services de digistylze.ch). La section remonte d'un écran sur la vidéo,
   qui garde un écran de plus pour rester collée pendant que la carte passe. */
@media (max-width: 767px) {
  .film {
    height: 330vh;
    height: 330svh;
  }

  .film + .duo {
    position: relative;
    margin-top: calc(var(--lvh) * -100);
  }

  .film + .duo > .lieu {
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -26px 60px -30px rgba(0, 0, 0, 0.45);
  }
}

/* Téléphone et tablette (pile allégée, sans retenue en JS) : Save the Place s'arrête une fois entièrement à l'écran
   (son bas au bas de l'écran : --lieu-top posé par main.js), reste en place le temps d'une pause, puis la section
   suivante glisse par-dessus. L'épinglage est borné par .duo. */
@media (max-width: 767px), (pointer: coarse) {
  .duo > .lieu {
    position: sticky;
    top: var(--lieu-top, 0px);
    min-height: calc(var(--lvh) * 100);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* marges resserrées : la section entière (titre compris) tient dans l'écran pendant la pause */
    padding-top: clamp(28px, 6svh, 84px);
    padding-bottom: calc(clamp(24px, 5svh, 84px) + var(--bar));
  }

  .duo > .lieu + script + .loisirs,
  .duo > .lieu + .loisirs {
    margin-top: 40vh;
    margin-top: 40svh; /* la pause */
  }

  /* posé en haut de l'écran : angles droits (rien ne se voit derrière ses coins), et quand la section suivante
     arrive, il recule vers le haut de l'écran (comme sur ordinateur) plutôt que vers son bas : son bord haut ne
     bouge pas. L'origine prime sur celle que pose l'effet pile. */
  .duo > .lieu {
    transition: border-radius 0.35s ease;
    transform-origin: 50% calc(-1 * var(--lieu-top, 0px)) !important;
  }

  .film + .duo > .lieu.is-stuck {
    border-radius: 0;
  }

  /* la vidéo, entièrement sous Save the Place posé, n'est plus peinte */
  .film.is-covered .film__stage {
    visibility: hidden;
  }
}

/* écran court : photo un peu moins haute, pour que tout Save the Place reste visible */
@media (max-width: 767px) and (max-height: 760px), (pointer: coarse) and (max-height: 760px) {
  .duo > .lieu .lieu__photo {
    aspect-ratio: 16 / 10;
  }
}

/* la section suivante (pile) passe toujours au-dessus de Save the Place */
.loisirs {
  z-index: 3;
}

/* mouvement réduit : une seule image, sans épinglage */
.film.is-static {
  height: auto;
}

.film.is-static .film__stage {
  position: relative;
}

/* ---------- Ouverture + Save the Date superposés, transition dissolution ---------- */

.opening {
  position: relative;
  --fx-glow: #d1878e;          /* contours et étincelles de la dissolution */
  --fx-shade: #f7efe4;         /* l'écran s'éteint vers le crème */
}

.opening__stage {
  position: sticky;
  top: 0;
}

.opening .hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.opening__fx {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 100%;
  height: calc(var(--lvh) * 100);
  min-height: 540px;
  pointer-events: none;
  visibility: hidden;
}

.opening__spacer {
  height: 75vh;
  height: 75svh;
}

.date {
  min-height: calc(var(--lvh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fond photo du Save the Date, sous un voile chaud : textes en crème.
   isolation : les couches internes (photo, voile, contenu) restent sous l'écran d'ouverture posé au-dessus */
.opening .date {
  z-index: 1;
  isolation: isolate;
}

.date > .date__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.date__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.date::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(42, 31, 26, 0.58), rgba(42, 31, 26, 0.38) 45%, rgba(42, 31, 26, 0.62));
}

.date > .date__inner {
  z-index: 2;
}

.date .title {
  color: #fffaf4;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.date .scratch {
  box-shadow: 0 0 0 1px rgba(255, 250, 244, 0.4), 0 24px 50px -20px rgba(0, 0, 0, 0.55);
}

.date .scratch__reveal {
  color: rgba(255, 250, 244, 0.85);
}

.date .date__day,
.date .countdown__unit span {
  color: #fffaf4;
}

.date .date__time,
.date .countdown__label,
.date .countdown__unit small {
  color: rgba(255, 250, 244, 0.82);
}

.date .countdown__sep {
  color: var(--rose);
}

/* Date révélée : « Découvrez la suite » et le petit cœur qui descend (comme « Faites défiler » sur l'ouverture),
   pour qu'on ne croie pas que tout s'arrête à la date. Posé en bas de l'écran ; la marge du bas s'élargit
   en même temps que la date se déplie, le contenu ne passe jamais dessous */
.date {
  --date-hint-bottom: clamp(12px, 2svh, 28px);
  --date-hint-size: 40px; /* place prise par le texte et le cœur */
}

.date__scroll {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--bar) + var(--date-hint-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fffaf4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 2px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.date.is-revealed .date__scroll {
  opacity: 1;
  transition-delay: 1.4s; /* une fois la date dépliée */
}

.date__scroll svg {
  width: 16px;
  height: 16px;
  fill: var(--rose);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
  animation: descend 2.2s ease-in-out infinite;
}

/* Téléphone : un peu plus grand et plus haut, loin de la barre du navigateur (comme « Faites défiler ») */
@media (max-width: 767px) {
  .date {
    --date-hint-bottom: max(4svh, calc(env(safe-area-inset-bottom) + 16px));
    --date-hint-size: 46px;
  }

  .date__scroll {
    font-size: 0.8rem;
    letter-spacing: 0.24em;
  }

  .date__scroll svg {
    width: 18px;
    height: 18px;
  }
}

.date__inner {
  width: 100%;
  opacity: 0; /* révélé par la transition (js/opening.js) */
  will-change: opacity, transform;
}

/* Sans WebGL ou en mouvement réduit : les deux écrans l'un sous l'autre */
.opening.is-static .opening__stage,
.opening.is-static .hero {
  position: relative;
}

.opening.is-static .opening__fx,
.opening.is-static .opening__spacer {
  display: none;
}

.opening.is-static .date__inner {
  opacity: 1;
}

/* ---------- Save the Date → survol : la première image du drone monte sur la date (js/montee.js) ---------- */

/* marges réduites : la date doit tenir dans l'écran pour rester épinglée pendant la montée */
.opening .date {
  padding-top: clamp(16px, 4svh, 96px);
  padding-bottom: calc(clamp(16px, 4svh, 96px) + var(--bar)); /* contenu centré dans la petite hauteur */
  transition: padding-bottom 1.2s ease; /* au rythme de la date qui se déplie */
}

/* date révélée : place pour « Découvrez la suite » sous le compte à rebours */
.opening .date.is-revealed {
  padding-bottom: calc(var(--bar) + var(--date-hint-bottom) + var(--date-hint-size) + 8px);
}

/* défilement ajouté à la fin de l'ouverture : la date reste en place pendant que l'image monte */
.opening__course {
  display: none;
  height: 70vh;
  height: 70svh;
}

.opening.has-montee {
  z-index: 1; /* au-dessus de la vidéo, qui remonte sous la date (marge négative posée par js/montee.js) */
}

.opening.has-montee .opening__course {
  display: block;
}

/* date entièrement recouverte : la vidéo, épinglée dessous, montre la même image */
.opening.is-covered .opening__stage {
  visibility: hidden;
}

.montee {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 6;
  width: 100%;
  height: calc(var(--lvh) * 100);
  pointer-events: none;
  visibility: hidden;
}

.montee.is-on {
  visibility: visible;
}

/* ---------- Save the date ---------- */

.fin__names .amp {
  font-size: 1.15em;
  padding: 0 0.06em;
}

/* Zone à gratter : la date est dessous, la couche rose s'efface au doigt */
.scratch {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 2.6 / 1;
  margin: 2rem auto 0;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: #fffaf4;
  box-shadow: inset 0 0 0 1px rgba(201, 149, 146, 0.35), 0 18px 36px -24px rgba(160, 90, 90, 0.55);
}

.scratch::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(201, 149, 146, 0.55);
  border-radius: 20px;
  pointer-events: none;
}

.scratch__date {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 12vw, 4.6rem);
  letter-spacing: 0.05em;
  color: var(--ink);
  transform: translateY(0.04em);
}

.scratch canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scratch.is-scratched canvas {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.scratch__reveal {
  margin-top: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}

.scratch__reveal.is-shown {
  opacity: 1;
  pointer-events: auto;
}

.date.is-revealed .scratch__reveal {
  opacity: 0;
  pointer-events: none;
}

.date__full {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 1.2s ease, opacity 1.2s ease 0.3s, margin-top 1.2s ease;
}

/* le bouton « Révéler la date », effacé, garde sa place : la date dépliée remonte dans ce vide
   (la place gagnée revient à « Découvrez la suite », en bas de l'écran) */
.date.is-revealed .date__full {
  max-height: 480px;
  opacity: 1;
  margin-top: -1.4rem;
}

.date__day {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5.6vw, 2.1rem);
}

.date__time {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.countdown {
  margin-top: 2.2rem;
}

.countdown__label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
}

.countdown__grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(10px, 3vw, 22px);
  margin-top: 0.8rem;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.countdown__unit span {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  line-height: 1;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}

.countdown__unit small {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.countdown__sep {
  color: var(--rose-deep);
  font-family: var(--font-serif);
  font-size: 1.6rem;
  line-height: clamp(2.2rem, 9vw, 3.4rem);
}

/* ---------- Save the place ---------- */

.lieu {
  background: var(--cream-deep);
}

.lieu__photo {
  aspect-ratio: 4 / 3;
  margin: 0.6rem 0 2rem;
}

.lieu__address {
  font-style: normal;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.6;
}

.lieu__address strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 5.4vw, 1.9rem);
  margin-bottom: 0.4rem;
}

.lieu__parking {
  margin-top: 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.route {
  margin-top: 2rem;
}

.route__choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 1rem;
}

.route__choices[hidden] {
  display: none;
}

.route__choices a {
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  background: #fffaf4;
  border: 1px solid rgba(180, 199, 173, 0.8);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
}

/* Visite virtuelle : carte d'aperçu puis plein écran */
.tour-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: var(--cream);
  box-shadow: 0 24px 50px -34px rgba(110, 80, 70, 0.6);
}

.tour-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tour-card:hover img {
  transform: scale(1.04);
}

.tour-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(60, 40, 35, 0.4));
  pointer-events: none;
}

.tour-card:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 4px;
}

.tour-card__badge {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 1;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.94);
  color: var(--sage-deep);
  font: 400 0.74rem/1 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(60, 40, 35, 0.5);
}

.tour-card__badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.tour {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  background: rgba(40, 34, 30, 0.92);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tour[hidden] {
  display: none;
}

.tour.is-open {
  opacity: 1;
}

.tour__frame {
  flex: 1;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.tour__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
  background: #2a2420;
}

.tour__close {
  position: absolute;
  top: max(24px, calc(env(safe-area-inset-top) + 12px));
  right: max(24px, calc(env(safe-area-inset-right) + 12px));
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.94);
  color: var(--ink);
  font: 400 0.78rem/1 var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
}

.tour-open,
.tour-open body {
  overflow: hidden;
}

/* ---------- Indispensables ---------- */

.loisirs .lead {
  color: var(--ink-soft);
}

.loisirs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 2.4rem;
}

.loisir {
  background: #fffaf4;
  border-radius: 24px;
  padding: 18px 18px 22px;
  box-shadow: 0 18px 40px -30px rgba(110, 80, 70, 0.4);
}

.loisir img {
  width: 100%;
  height: auto;
  display: block;
}

.loisir figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.loisir:nth-child(2) {
  transition-delay: 0.15s;
}

/* ---------- Programme ---------- */

.programme {
  background: var(--cream-deep);
}

.timeline {
  position: relative;
  margin: 1rem auto 0;
  max-width: 460px;
  text-align: left;
  padding-left: 64px;
}

.timeline__track {
  position: absolute;
  left: 23px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  margin-left: -0.5px;
  border-radius: 2px;
  background: rgba(111, 138, 106, 0.16);
}

/* partie remplie : suit le défilement (--fill, en px, posé par js/scroll.js) */
.timeline__track i {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--fill, 0px);
  border-radius: inherit;
  background: linear-gradient(var(--sage), var(--sage-deep));
}

/* repère rose au bout du trait */
.timeline__track b {
  position: absolute;
  left: 50%;
  top: var(--fill, 0px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose-deep);
  box-shadow: 0 0 0 5px rgba(201, 149, 146, 0.25);
  transform: translate(-50%, -50%);
  opacity: var(--marker, 0);
  transition: opacity 0.4s ease;
}

.timeline__day {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin: 1.6rem 0 1.2rem;
}

.timeline__day::before {
  content: '';
  position: absolute;
  left: -46px;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--rose-deep);
  background: var(--cream-deep);
  transform: translateY(-50%);
  transition: background 0.4s ease;
}

.timeline__day.is-active::before {
  background: var(--rose-deep);
}

.timeline__list {
  list-style: none;
  padding: 0;
}

.tl {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0 1.6rem;
  min-height: 48px;
  opacity: 0.42;
  transition: opacity 0.5s ease;
}

.tl > :not(.tl__icon) {
  transform: translateX(-6px);
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tl.is-active {
  opacity: 1;
}

.tl.is-active > :not(.tl__icon) {
  transform: none;
}

.tl__icon {
  position: absolute;
  left: -64px;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fffaf4;
  border: 1px solid rgba(180, 199, 173, 0.9);
  display: grid;
  place-items: center;
  color: var(--sage-deep);
  transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}

.tl.is-active .tl__icon {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--cream);
  transform: scale(1.06);
  box-shadow: 0 0 0 6px rgba(180, 199, 173, 0.35);
}

.tl__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl__time {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-deep);
}

.tl__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  line-height: 1.3;
  margin-top: 0.15rem;
}

.tl__note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 0.4rem;
}

.timeline__sep {
  position: relative;
  color: var(--rose-deep);
  font-size: 1.1rem;
  padding: 0.4rem 0;
  opacity: 0.42;
  transition: opacity 0.5s ease;
}

.timeline__sep.is-active {
  opacity: 1;
}

/* petite mention sous le titre */
.programme__soon {
  margin: -0.6rem 0 2.2rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ---------- Hébergement ---------- */

.rooms {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.6rem max(16px, calc((100vw - 900px) / 2)) 1.6rem;
  margin: 0 -16px 1.4rem;
  scrollbar-width: none;
}

.rooms::-webkit-scrollbar {
  display: none;
}

.room {
  flex: 0 0 min(82vw, 380px);
  aspect-ratio: 3 / 2;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--cream-deep);
  box-shadow: 0 18px 36px -26px rgba(110, 80, 70, 0.55);
}

.room img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sur ordinateur : grille de 2 × 2, photos entières au format 3:2 */
@media (min-width: 900px) {
  .rooms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 1000px;
    margin: 0 auto 1.6rem;
    padding: 0.6rem 16px 1.6rem;
    overflow: visible;
  }
}

.price {
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 9vw, 3rem);
  color: var(--sage-deep);
}

.price small {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.5em;
  color: var(--ink-soft);
}

/* Hébergement complet : petite étiquette, puis l'encart pour ceux qui ont demandé une chambre */
.complet {
  margin: 0.4rem 0 1.1rem;
}

.complet span {
  display: inline-block;
  padding: 0.45em 1.3em 0.4em;
  border: 1px solid var(--rose-deep);
  border-radius: 999px;
  background: rgba(239, 207, 202, 0.45);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #a86f6d;
}

.lodging-info {
  margin-top: 1.8rem;
}

.lodging-info .body-text {
  margin-top: 0;
}

.lodging-info .price {
  margin-top: 1rem;
}

/* formulaire : rappel d'une chambre demandée avant le « complet » */
.field__note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--sage-deep);
}

.card__q {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.card__link {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--sage-deep);
  text-underline-offset: 4px;
}

/* ---------- Formulaire ---------- */

.rsvp {
  background: var(--cream-deep);
}

.rsvp-form,
.rsvp-thanks {
  margin-top: 1rem;
  text-align: left;
}

/* date limite de réponse, à titre indicatif, en tête de l'encart */
.rsvp-form__deadline {
  margin: 0 0 1.8rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(180, 199, 173, 0.45);
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.rsvp-form__deadline strong {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
}

.field {
  border: 0;
  padding: 0;
  margin: 0 0 2rem;
  min-width: 0;
}

.field__label {
  display: block;
  padding: 0;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 0.7rem;
}

.field__q {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.45;
  margin-bottom: 0.9rem;
}

.input {
  width: 100%;
  border: 1px solid rgba(111, 138, 106, 0.35);
  border-radius: 14px;
  background: #fffdf9;
  padding: 0.95rem 1rem;
  font: 400 1.05rem var(--font-sans);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 3px rgba(180, 199, 173, 0.35);
}

textarea.input {
  resize: vertical;
}

.options {
  display: grid;
  gap: 10px;
}

.options--inline {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.option {
  position: relative;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(111, 138, 106, 0.35);
  background: #fffdf9;
  font-size: 0.98rem;
  line-height: 1.35;
  text-align: center;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.option input:checked + span {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--cream);
}

.option input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(180, 199, 173, 0.6);
}

.sub {
  margin-top: 1.1rem;
  animation: sub-in 0.45s ease;
}

.sub[hidden] {
  display: none;
}

@keyframes sub-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.sub__label {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(111, 138, 106, 0.35);
  border-radius: 999px;
  background: #fffdf9;
  padding: 4px;
}

.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(180, 199, 173, 0.3);
  color: var(--sage-deep);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.stepper button:hover:not(:disabled) {
  background: rgba(180, 199, 173, 0.6);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper output {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.rsvp-form__more[hidden] {
  display: none;
}

.form-error {
  margin: -0.6rem 0 1rem;
  color: #b0605d;
  font-size: 0.92rem;
}

.rsvp-thanks {
  text-align: center;
}

.rsvp-thanks__title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.rsvp-thanks .lead {
  margin: 0.8rem 0 1rem;
}

/* ---------- Fin ---------- */

.fin__photo {
  border-radius: 999px 999px 24px 24px;
  overflow: hidden;
  aspect-ratio: 6 / 5; /* arche plus large que haute : la photo (paysage) est moins recadrée, on voit les deux */
  max-width: 480px;
  margin: 0 auto 2.6rem;
  box-shadow: 0 30px 60px -40px rgba(110, 80, 70, 0.6);
}

.fin__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 50%; /* visages centrés, mains et bagues dans l'arche */
  display: block;
}

.fin__line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 4.8vw, 1.6rem);
  line-height: 1.5;
}

.fin__line--accent {
  margin-top: 0.4rem;
  color: var(--rose-deep);
}

.fin__names {
  margin-top: 2.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 3.6rem);
}

.fin__date {
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  letter-spacing: 0.4em;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* la page s'arrête juste après le crédit photo */
.section.fin {
  padding-bottom: clamp(36px, 5vw, 56px);
}

.credits {
  margin-top: 3rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  opacity: 0.8;
}

/* ---------- Transition « portail » (effects-library, copie de vanilla/effect.css) ---------- */

/* section-transition-portail : styles de l'effet, tous scopés à [data-fx="section-transition-portail"].
   Thème partagé (contrat v3 §2) : la PAGE fournit les rôles communs, l'effet ne fait que les LIRE.
   Aucune mise en page de contenu ici : le root est la section d'arrivée (ou son cadre), qui garde sa boîte. */
[data-fx="section-transition-portail"] {
  /* fond de la section d'arrivée : --fx-portail-arrivee l'impose ; sinon celui que init() lit sur le root ; sinon le thème */
  --fx-portail-vers: var(--fx-portail-arrivee, var(--fx-portail-lu-arrivee, var(--fx-fg, #16171a)));

  position: relative;
  isolation: isolate; /* le calque (z-index -1) passe sur le fond du root, sous son contenu */
}
/* Calque posé : le root ne doit pas rogner ce qui dépasse sa boîte (le calque monte d'un écran au-dessus de lui).
   content-visibility: auto (cadre de section, [data-sx-frame]) active le paint containment : levé tant que le calque
   existe. Spécificité (0,2,0) : passe devant [data-sx-frame] quel que soit l'ordre des feuilles. */
[data-fx="section-transition-portail"]:has(> [data-fx-portail]) {
  content-visibility: visible;
}

/* Calque créé par init() (absent sans JS, sans source et en mouvement réduit) : un écran au-dessus du root, puis le
   root ; aucune hauteur ajoutée à la page. */
[data-fx="section-transition-portail"] > [data-fx-portail] {
  position: absolute;
  inset: -100lvh 0 0;
  z-index: -1;
  pointer-events: none;
}
/* Plan collant d'un écran : il couvre l'écran pendant la course, puis reste derrière le contenu du root jusqu'à son bas */
[data-fx="section-transition-portail"] [data-fx-portail-plan] {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
}
/* Fenêtre : la boîte de la source qui s'ouvre jusqu'à l'écran entier (clip-path posé par init() à chaque pas) */
[data-fx="section-transition-portail"] [data-fx-portail-fenetre] {
  position: absolute;
  inset: 0;
  clip-path: inset(50%);
}
/* Image à ses proportions (taille « cover » de l'écran posée par init()), placée et réduite par transform */
[data-fx="section-transition-portail"] [data-fx-portail-image] {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
}
/* Voile de la couleur d'arrivée sur l'image devenue fond (opacité posée par init() : 0 → option voile) */
[data-fx="section-transition-portail"] [data-fx-portail-voile] {
  position: absolute;
  inset: 0;
  background-color: var(--fx-portail-vers);
  opacity: 0;
}
/* Aplat (type aplat, et mot en version allégée) : la couleur d'arrivée */
[data-fx="section-transition-portail"][data-fx-portail-rendu="aplat"] [data-fx-portail-fenetre] {
  background-color: var(--fx-portail-vers);
}
/* Double du mot : même boîte et même texte que la source (propriétés recopiées par init()), zoomé par transform */
[data-fx="section-transition-portail"] [data-fx-portail-mot] {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  margin: 0;
  overflow: visible;
}
[data-fx="section-transition-portail"] [data-fx-portail-sonde] {
  display: inline-block;
  width: 0;
  height: 0;
}
[data-fx="section-transition-portail"][data-fx-portail-rendu="aplat"] [data-fx-portail-mot],
[data-fx="section-transition-portail"][data-fx-portail-plein] [data-fx-portail-mot] {
  display: none;
}
/* Bout de la course du mot : l'écran est dans la lettre, le plan prend la couleur d'arrivée (le double n'est plus peint) */
[data-fx="section-transition-portail"][data-fx-portail-plein] [data-fx-portail-plan] {
  background-color: var(--fx-portail-vers);
}
/* Avant la course : rien n'est peint */
[data-fx="section-transition-portail"][data-fx-portail-repos] > [data-fx-portail] {
  visibility: hidden;
}

[data-fx="section-transition-portail"] :focus-visible {
  outline: 2px solid var(--fx-focus, currentColor);
  outline-offset: 3px;
}

/* Pause hors écran / onglet caché (posé par l'IO de init), sans !important ; aucune animation CSS propre */
[data-fx="section-transition-portail"][data-fx-idle] * {
  animation-play-state: paused;
}

@media (max-width: 767px) {
  [data-fx="section-transition-portail"] * { will-change: auto; }
}

/* Mouvement réduit : changement franc (le JS ne crée pas le calque ; s'il existe encore, il est caché).
   Couleurs forcées : changement franc aussi. */
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  [data-fx="section-transition-portail"] > [data-fx-portail] { display: none; }
}

/* Ordinateur (portail actif) : le contenu de Save the Place sur un panneau crème givré, lisible sur l'image */
.lieu[data-fx-portail-type] > .container {
  padding: clamp(32px, 4vw, 48px) clamp(24px, 4vw, 48px) clamp(36px, 4vw, 52px);
  border-radius: 28px;
  background: rgba(251, 246, 238, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px -40px rgba(60, 40, 30, 0.55);
}

/* Réglages du faire-part : la section d'arrivée laisse dépasser le calque, la source reste invisible sur la vidéo */
.lieu[data-fx="section-transition-portail"] {
  overflow: visible;
}

.film__last img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Transition « pile de sections » (effects-library, copie de vanilla/effect.css) ---------- */

/* section-transition-pile-sections : styles de l'effet, tous scopés à [data-fx="section-transition-pile-sections"].
   Thème partagé (contrat v3 §2) : la PAGE fournit les rôles communs, l'effet ne fait que les LIRE.
   Aucune mise en page de contenu ici : le root est la section d'arrivée (ou son cadre), qui garde sa boîte. */
[data-fx="section-transition-pile-sections"] {
  /* fond de la pile, découvert sur les côtés quand la section de dessous recule : celui de la section précédente
     (lu par init()), assombri ; --fx-pile-fond l'impose */
  --fx-pile-fond-calc: var(--fx-pile-fond, color-mix(in srgb, var(--fx-pile-voisin-de, var(--fx-bg, #f6f5f1)) 72%, #000));
  /* fond de la carte qui arrive, quand la section n'en a pas en propre (fond de la page, lu par init()) */
  --fx-pile-carte: var(--fx-pile-vers, var(--fx-pile-voisin-vers, var(--fx-bg-2, #ebe8e1)));
  --fx-pile-voile-c: #000;
  --fx-pile-ombre-h: clamp(1.25rem, 4vw, 3rem);
  --fx-pile-ombre-c: rgb(0 0 0 / 0.22);

  position: relative; /* au-dessus de la section précédente, retenue sous elle pendant la course */
  isolation: isolate;
}
/* Calque posé : le root ne doit pas rogner ce qui dépasse sa boîte (le calque monte d'un écran au-dessus de lui).
   content-visibility: auto (cadre de section, [data-sx-frame]) active le paint containment : levé tant que le calque
   existe. Spécificité (0,2,0) : passe devant [data-sx-frame] quel que soit l'ordre des feuilles. */
[data-fx="section-transition-pile-sections"]:has(> [data-fx-pile]) {
  content-visibility: visible;
}

/* Calque créé par init() (absent sans JS et en mouvement réduit) : un écran de haut, juste au-dessus du root, sur la
   section précédente ; jamais de hauteur ajoutée à la page. */
[data-fx="section-transition-pile-sections"] > [data-fx-pile] {
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 100lvh;
  z-index: 1;
  pointer-events: none;
}
/* Couture du bord haut de la carte : le bord du root et celui de la section de dessous tombent sur la même rangée
   anticrénelée (le fond de la page passerait) ; un trait de 2 px à la couleur de la carte, à cheval sur le bord, peint
   après les bandes, le voile et l'ombre : la carte paraît d'un seul tenant, sans filet de voile */
[data-fx="section-transition-pile-sections"] > [data-fx-pile]::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  block-size: 2px;
  background-color: var(--fx-pile-carte);
}
[data-fx="section-transition-pile-sections"] [data-fx-pile] > * {
  position: absolute;
  pointer-events: none;
}
/* Bandes latérales : moitié de la largeur chacune, ouvertes depuis le bord (scaleX posé par GSAP) */
[data-fx="section-transition-pile-sections"] [data-fx-pile-bande] {
  inset-block: 0;
  inline-size: 50%;
  background-color: var(--fx-pile-fond-calc);
}
[data-fx="section-transition-pile-sections"] [data-fx-pile-bande="gauche"] { left: 0; transform-origin: 0 50%; }
[data-fx="section-transition-pile-sections"] [data-fx-pile-bande="droite"] { right: 0; transform-origin: 100% 50%; }
[data-fx="section-transition-pile-sections"] [data-fx-pile-voile] {
  inset: 0;
  background-color: var(--fx-pile-voile-c);
}
/* Ombre portée par le bord haut de la carte qui arrive */
[data-fx="section-transition-pile-sections"] [data-fx-pile-ombre] {
  inset-inline: 0;
  bottom: 0;
  block-size: var(--fx-pile-ombre-h);
  background: linear-gradient(to top, var(--fx-pile-ombre-c), transparent);
}
[data-fx="section-transition-pile-sections"]:not([data-fx-ombre]) [data-fx-pile-ombre] { display: none; }

/* Fond de la carte qui arrive, quand la section n'en a pas : sous le contenu, dans la section */
[data-fx="section-transition-pile-sections"] > [data-fx-pile-fond] {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--fx-pile-carte);
}

[data-fx="section-transition-pile-sections"] :focus-visible {
  outline: 2px solid var(--fx-focus, currentColor);
  outline-offset: 3px;
}

/* Pause hors écran / onglet caché (posé par l'IO de init), sans !important ; aucune animation CSS propre */
[data-fx="section-transition-pile-sections"][data-fx-idle] * {
  animation-play-state: paused;
}

@media (max-width: 767px) {
  [data-fx="section-transition-pile-sections"] * { will-change: auto; }
}

/* Mouvement réduit : changement franc (le JS ne crée pas le calque ; s'il existe encore, il est caché).
   Couleurs forcées : voile et bandes prendraient la couleur système du fond, sans rien signifier. */
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  [data-fx="section-transition-pile-sections"] > [data-fx-pile] { display: none; }
}

/* Réglages du faire-part : voile brun chaud plutôt que noir, la section d'arrivée laisse dépasser le calque */
.loisirs[data-fx="section-transition-pile-sections"] {
  --fx-pile-voile-c: #3b302c;
  overflow: visible;
}

/* ---------- Défilement fluide (Lenis) ---------- */

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* Captures de test (?debug&solo=…) */
.no-anim *,
.no-anim *::before {
  transition: none !important;
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .curtain__cta,
  .hero__scroll i,
  .date__scroll svg {
    animation: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
