/* ==========================================================================
   Kenza & Hector — Site de mariage
   Mobile first : les styles de base ciblent les téléphones,
   les media queries enrichissent l'affichage sur les écrans plus larges.
   ========================================================================== */

:root {
  /* Palette « Santorini Sunset » */
  --cloud: #CDD0DB;
  --cloud-light: #E4E6EC;
  --azul: #9197AA;
  --mimosa: #F7B557;
  --orange: #E27921;
  --aperol: #C1521E;
  --aperol-dark: #A3441A;
  --ink: #2B2B2B;
  --paper: #FBFAF7;

  /* Touches printanières pastel */
  --lilac: #C3B4E0;
  --violet: #5F4A8B;      /* violet foncé, lisible pour du texte */
  --butter: #F6E27F;
  --blush: #F2B5AE;

  --font-title: "Playfair Display", Georgia, serif;
  --font-body: "Quicksand", system-ui, sans-serif;

  --radius: 12px;
  --radius-small: 8px;
  --shadow: 0 6px 24px rgba(43, 43, 43, 0.08);
  --shadow-photo: 0 18px 40px rgba(43, 43, 43, 0.16);
  --gutter: 1.25rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.2, 1);
  --ease-out-soft: cubic-bezier(0.16, 1, 0.3, 1);

  /* Grain de papier (bruit SVG) pour l'enveloppe */
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0.22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.09' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Les photos qui débordent de l'écran ne créent pas de scroll horizontal */
main {
  overflow-x: clip;
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.15;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

.container {
  --cw: 64rem;
  width: 100%;
  max-width: var(--cw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  --cw: 40rem;
  text-align: center;
}

.eyebrow {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
}

.amp {
  font-style: italic;
  color: var(--aperol);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  padding: 0.95rem 2rem;
  border: 1.5px solid var(--aperol);
  border-radius: 999px;
  background: var(--aperol);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover {
  background: var(--aperol-dark);
  border-color: var(--aperol-dark);
  transform: translateY(-2px);
}

.btn--small {
  padding: 0.7rem 1.4rem;
  font-size: 0.95rem;
}

.btn--ghost {
  border-color: var(--violet);
  background: transparent;
  color: var(--violet);
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: var(--violet);
  background: var(--violet);
  color: #fff;
}

/* ---------- Enveloppe d'accueil ----------
   L'écran entier est le dos de l'enveloppe : quatre rabats qui se rejoignent
   au centre, fermés par le sceau. À l'ouverture, chaque rabat bascule vers
   l'extérieur en s'effaçant, et la page apparaît derrière. */

/* Sans JavaScript, l'enveloppe n'apparaît pas et le site reste accessible */
.envelope-screen {
  display: none;
}

.is-locked,
.is-locked body {
  overflow: hidden;
}

.js .envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  overflow: hidden;
  perspective: 2000px;
  transition: visibility 0s linear 3.2s;
}

/* Intérieur de l'enveloppe, visible un instant entre les rabats */
.envelope-screen__inside {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(247, 181, 87, 0.45), transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(195, 180, 224, 0.55), transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(242, 181, 174, 0.5), transparent 55%),
    var(--cloud);
  transition: opacity 1.4s var(--ease-soft) 1s;
}

/* Les rabats couvrent l'écran ; leurs pointes dessinent une enveloppe bien
   plus large que haute (4000 x 2400 px), centrée sur le sceau, dont on ne
   voit que le milieu. */
.flap {
  --cy: 46%;
  position: absolute;
  inset: 0;
  transition: transform 1.8s var(--ease-soft), opacity 1.5s var(--ease-soft);
}

.flap__face {
  position: absolute;
  inset: 0;
}

.flap--left {
  transform-origin: left center;
}

.flap--left .flap__face {
  background: var(--paper-grain), var(--paper-fibers), linear-gradient(90deg, #EEE8DC, #DBD1BF);
  clip-path: polygon(calc(50% - 2000px) calc(var(--cy) - 1200px), calc(50% + 120px) var(--cy), calc(50% - 2000px) calc(var(--cy) + 1200px));
}

.flap--right {
  transform-origin: right center;
}

.flap--right .flap__face {
  background: var(--paper-grain), var(--paper-fibers), linear-gradient(270deg, #EEE8DC, #DBD1BF);
  clip-path: polygon(calc(50% + 2000px) calc(var(--cy) - 1200px), calc(50% - 120px) var(--cy), calc(50% + 2000px) calc(var(--cy) + 1200px));
}

.flap--bottom {
  transform-origin: center bottom;
}

.flap--bottom .flap__face {
  background: var(--paper-grain), var(--paper-fibers), linear-gradient(0deg, #F6F1E9, #E6DED1);
  clip-path: polygon(calc(50% - 2000px) calc(var(--cy) + 1200px), 50% calc(var(--cy) - 80px), calc(50% + 2000px) calc(var(--cy) + 1200px));
}

/* Seul le rabat du haut projette une ombre sur les autres */
.flap--top {
  transform-origin: center top;
  filter: drop-shadow(0 6px 16px rgba(80, 64, 40, 0.22));
}

.flap--top .flap__face {
  background: var(--paper-grain), var(--paper-fibers), linear-gradient(180deg, #F7F3EC 40%, #E9E2D5);
  clip-path: polygon(calc(50% - 2000px) calc(var(--cy) - 1200px), calc(50% + 2000px) calc(var(--cy) - 1200px), 50% calc(var(--cy) + 90px));
}

/* Sceau de cire (photo détourée), à la pointe du rabat du haut */
.seal {
  position: absolute;
  top: calc(46% + 90px);
  left: 50%;
  z-index: 5;
  width: 7.5rem;
  aspect-ratio: 420 / 411;
  padding: 0;
  border: 0;
  background: url("../assets/img/sceau-dore.webp") center / contain no-repeat;
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(-6deg);
  transition: transform 0.7s var(--ease-soft), opacity 0.7s var(--ease-soft);
  animation: seal-pulse 2.4s ease-out infinite;
}

.seal:hover {
  transform: translate(-50%, -50%) rotate(-6deg) scale(1.06);
}

/* Ombre portée de la cire + halo mimosa qui invite à appuyer */
@keyframes seal-pulse {
  0% {
    filter: drop-shadow(0 8px 12px rgba(80, 60, 30, 0.35)) drop-shadow(0 0 0 rgba(247, 181, 87, 0.7));
  }
  70%,
  100% {
    filter: drop-shadow(0 8px 12px rgba(80, 60, 30, 0.35)) drop-shadow(0 0 20px rgba(247, 181, 87, 0));
  }
}

@media (min-width: 900px) {
  .seal {
    width: 8.5rem;
  }
}

.envelope-screen__hint {
  position: absolute;
  top: calc(46% + 90px + 5.5rem);
  right: 0;
  left: 0;
  z-index: 5;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  transition: opacity 0.5s var(--ease);
}

/* Ouverture */
.envelope-screen.is-open {
  visibility: hidden;
  pointer-events: none;
}

.is-open .seal {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-6deg) scale(0.6);
  animation: none;
}

.is-open .envelope-screen__hint {
  opacity: 0;
}

.is-open .envelope-screen__inside {
  opacity: 0;
}

.is-open .flap {
  filter: none;
  opacity: 0;
}

.is-open .flap--top {
  transform: rotateX(115deg);
  transition-delay: 0.35s;
}

.is-open .flap--left {
  transform: rotateY(-115deg);
  transition-delay: 0.7s;
}

.is-open .flap--right {
  transform: rotateY(115deg);
  transition-delay: 0.7s;
}

.is-open .flap--bottom {
  transform: rotateX(-115deg);
  transition-delay: 0.9s;
}

/* ---------- Hero ----------
   --hero (0 à 1) est mis à jour en JS : le texte s'estompe en quittant le bloc. */

.hero {
  --hero: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  text-align: center;
}

/* Sur mobile, la photo occupe tout l'écran derrière le texte */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  transform: scale(calc(1.04 + var(--hero) * 0.08));
}

/* Fondu vers le bleu ciel en haut et en bas pour la lisibilité */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(205, 208, 219, 0.92) 0%,
    rgba(205, 208, 219, 0.55) 22%,
    rgba(205, 208, 219, 0) 40%,
    rgba(205, 208, 219, 0) 62%,
    rgba(205, 208, 219, 0.75) 82%,
    var(--cloud) 100%
  );
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 3.5rem var(--gutter) 2.5rem;
  opacity: calc(1 - var(--hero) * 1.2);
  transform: translateY(calc(var(--hero) * -60px));
}

/* Entrée du hero pendant l'ouverture de l'enveloppe */
.hero__intro > *,
.hero__actions > * {
  transition: opacity 1.2s var(--ease-out-soft), transform 1.2s var(--ease-out-soft);
}

.hero__intro > :nth-child(2) { transition-delay: 0.12s; }
.hero__intro > :nth-child(3) { transition-delay: 0.24s; }
.hero__intro > :nth-child(4) { transition-delay: 0.36s; }
.hero__actions > :nth-child(1) { transition-delay: 0.5s; }
.hero__actions > :nth-child(2) { transition-delay: 0.65s; }

.is-locked .hero__intro > *,
.is-locked .hero__actions > * {
  opacity: 0;
  transform: translateY(24px);
}

/* Prénoms écrits à la plume : chaque lettre trace son contour puis se
   remplit d'encre, l'une après l'autre (lettres séparées en JS). */
.hero__names {
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.names {
  display: block;
  width: min(100%, 22rem);
  margin: 0 auto;
  overflow: visible;
}

.names__line,
.names__char {
  font-family: "Great Vibes", "Playfair Display", cursive;
  font-size: 128px;
  fill: var(--ink);
}

.names__amp,
.names__char--amp {
  fill: var(--mimosa);
}

/* En attendant que les lettres soient séparées, rien n'est affiché */
.js .names__line {
  fill-opacity: 0;
}

.js .names__char {
  fill-opacity: 0;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.js .names__char--amp {
  stroke: var(--mimosa);
}

.is-written .names__char {
  animation:
    ink-draw 1.1s var(--ease-soft) forwards,
    ink-fill 0.6s ease forwards;
  animation-delay:
    calc(0.2s + var(--i) * 0.2s),
    calc(0.65s + var(--i) * 0.2s);
}

@keyframes ink-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes ink-fill {
  to {
    fill-opacity: 1;
    stroke-width: 0.3;
  }
}

@media (min-width: 900px) {
  .names {
    width: min(100%, 30rem);
  }
}

.hero__date {
  margin-top: 0.75rem;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-style: italic;
}

.hero__place {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* Bouton RSVP du hero en mimosa (texte anthracite pour rester lisible) */
/* Indicateur de défilement : le mot « Défiler » et, dessous, une flèche fine
   qui rebondit légèrement vers le bas */
.scroll-down {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

/* Trois chevrons empilés : ils rebondissent l'un après l'autre
   en s'estompant légèrement puis en revenant */
.scroll-down__arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-down__arrows i {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: -0.3rem;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
  animation: scroll-bounce 1.8s ease-in-out infinite;
}

.scroll-down__arrows i:first-child { margin-top: 0; }
.scroll-down__arrows i:nth-child(2) { animation-delay: 0.15s; }
.scroll-down__arrows i:nth-child(3) { animation-delay: 0.3s; }

@keyframes scroll-bounce {
  0%, 100% { opacity: 1;    transform: translateY(0) rotate(45deg); }
  50%      { opacity: 0.35; transform: translateY(0.35rem) rotate(45deg); }
}

/* ---------- Compte à rebours ---------- */

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 22rem;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.25rem;
  border-radius: var(--radius-small);
  background: rgba(228, 230, 236, 0.85);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.countdown__value {
  font-family: var(--font-title);
  font-size: 1.7rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.countdown__done {
  grid-column: 1 / -1;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-style: italic;
}

/* Desktop : texte à gauche, photo à droite */
@media (min-width: 900px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
    padding: 2rem;
  }

  .hero::after {
    display: none;
  }

  .hero__media {
    position: static;
    grid-column: 2;
    grid-row: 1;
    height: calc(100svh - 4rem);
    min-height: 32rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    object-position: center 60%;
    transform: translateY(calc(var(--hero) * 40px));
  }

  .hero__content {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
    gap: 3.5rem;
    min-height: 0;
    padding: 0;
  }

  .hero__date {
    font-size: 1.6rem;
  }
}

/* ---------- Sections ---------- */

.section {
  --blob-a: rgba(195, 180, 224, 0.5);
  --blob-b: rgba(246, 226, 127, 0.45);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 0;
}

/* Même fond partout, seules les taches de couleur varient */
#lieu,
#cagnotte {
  --blob-a: rgba(242, 181, 174, 0.45);
  --blob-b: rgba(195, 180, 224, 0.5);
}

/* Taches de couleur pastel qui dérivent lentement en fond */
.section::before,
.section::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  pointer-events: none;
  animation: drift 20s ease-in-out infinite alternate;
}

.section::before {
  top: 4%;
  left: -12rem;
  background: radial-gradient(circle, var(--blob-a), transparent 68%);
}

.section::after {
  right: -12rem;
  bottom: 6%;
  background: radial-gradient(circle, var(--blob-b), transparent 68%);
  animation-duration: 26s;
  animation-direction: alternate-reverse;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(5rem, 3rem) scale(1.15);
  }
}

.section__title {
  margin-bottom: 2rem;
  font-size: clamp(2.2rem, 9vw, 3.25rem);
}

#programme .eyebrow,
#programme .section__title,
#lieu .eyebrow,
#lieu .section__title,
#souvenirs .eyebrow,
#souvenirs .section__title {
  text-align: center;
}

.lead {
  font-size: 1.1rem;
}

.placeholder {
  margin-top: 1.75rem;
  padding: 1.25rem;
  border: 1.5px dashed rgba(95, 74, 139, 0.45);
  border-radius: var(--radius);
  font-style: italic;
}

.note {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

@media (min-width: 900px) {
  .section {
    padding: 7rem 0;
  }
}

/* ---------- Apparition / disparition au scroll ----------
   Mis à jour en JS pour chaque élément :
   --v (0 à 1) : visibilité, l'élément apparaît en montant vers le milieu
   de l'écran et s'estompe en approchant du haut ;
   --p : position par rapport au milieu de l'écran, pour un léger décalage. */

.reveal {
  opacity: var(--v, 1);
  transform: translateY(calc(var(--p, 0) * 50px));
}

.photo {
  --speed: 80px;
  margin: 0;
  opacity: var(--v, 1);
  transform:
    translateY(calc(var(--p, 0) * var(--speed)))
    rotate(calc(var(--rot, 0deg) * var(--tilt, 1)))
    scale(calc((0.94 + var(--v, 1) * 0.06) * var(--zoom, 1)));
}

.photo img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-photo);
  object-fit: cover;
}

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

/* Photo d'un côté (qui sort de l'écran), texte de l'autre */
.duo {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 1.5rem;
}

.duo + .duo {
  margin-top: 2rem;
}

.duo--reverse {
  grid-template-columns: 1.1fr 0.9fr;
}

.duo--reverse .bleed {
  order: 2;
}

.duo .bleed img {
  height: 34vh;
  height: 34svh;
}

/* --edge : distance entre le bord du texte et le bord de l'écran */
.bleed {
  --edge: calc((100vw - min(100vw, var(--cw))) / 2 + var(--gutter));
  --over: 12vw;
}

.bleed--left {
  margin-left: calc(-1 * (var(--edge) + var(--over)));
}

/* L'image ne commence qu'au bord visible de l'écran (le cadre, lui, ne bouge pas) :
   utile quand quelqu'un se trouve dans la partie qui sort de l'écran */
.bleed--fit img {
  width: calc(100% - var(--edge) - var(--over) + 1.5rem);
  margin-left: calc(var(--edge) + var(--over) - 1.5rem);
}

.bleed--right {
  --speed: 110px;
  margin-right: calc(-1 * (var(--edge) + var(--over)));
}

.day__title {
  margin-bottom: 1.25rem;
  font-size: 1.6rem;
  font-style: italic;
  color: var(--aperol);
}

.duo--reverse .day__title {
  color: var(--violet);
}

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 2rem;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.45rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--mimosa), var(--lilac));
}

.timeline__item {
  position: relative;
}

/* Pastille */
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.4rem;
  left: -2rem;
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--cloud);
  border-radius: 50%;
  background: var(--aperol);
  box-shadow: 0 0 0 2px var(--mimosa);
}

.duo--reverse .timeline__item::before {
  background: var(--violet);
  box-shadow: 0 0 0 2px var(--lilac);
}

.timeline__time {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet);
}

.timeline__name {
  font-size: 1.5rem;
}

/* ---------- Animations Lottie (feux d'artifice, coupes, avion) ---------- */

.lottie svg {
  display: block;
}

/* Feux d'artifice autour du samedi */
.day {
  position: relative;
  isolation: isolate;
}

.fireworks {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 19rem;
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

/* Coupes qui trinquent, à côté du brunch */
.cheers {
  display: inline-block;
  width: 2.8em;
  height: 2.8em;
  margin-left: 0.1em;
  vertical-align: -0.8em;
}

@media (min-width: 900px) {
  .fireworks {
    width: 20rem;
  }
}

@media (min-width: 900px) {
  .duo {
    grid-template-columns: 4fr 7fr;
    gap: 4rem;
  }

  .duo--reverse {
    grid-template-columns: 7fr 4fr;
  }

  .duo + .duo {
    margin-top: 1.5rem;
  }

  .duo .bleed img {
    height: 44vh;
  }

  .bleed {
    --over: 4vw;
  }

  .day__title {
    font-size: 2.2rem;
  }

  .timeline__name {
    font-size: 1.9rem;
  }
}

/* ---------- Lieu ---------- */

/* Titre « Où ? Le lieu » entouré de deux brins de fleurs champêtres */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.lieu-heading {
  position: relative;
  margin-bottom: 2rem;
  text-align: center;
}

.lieu-heading .section__title {
  margin-bottom: 0;
}

/* Chaque branche part du bord de l'écran et s'arrête près du titre */
.branch-art {
  --gap: 6.5rem;
  position: absolute;
  top: 50%;
  z-index: -1;
  width: calc(50vw - var(--gap) + 1rem);
  height: 10rem;
  overflow: visible;
  pointer-events: none;
  transform: translateY(-50%);
}

.branch-art--left {
  right: calc(50% + var(--gap));
}

.branch-art--right {
  left: calc(50% + var(--gap));
  transform: translateY(-50%) scaleX(-1);
}

.branch-art .ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.branch-art .ink--thin {
  stroke-width: 0.75;
}

.branch-art .ink-fill {
  fill: var(--ink);
}

/* Les brins se dessinent depuis le bord de l'écran quand le titre apparaît ;
   les feuilles et clochettes pleines s'encrent juste après */
.js .branch-art .ink {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.3s var(--ease-soft) var(--d);
}

.js .branch-art .ink-fill {
  opacity: 0;
  transition: opacity 0.7s ease var(--d);
}

.is-drawn .branch-art .ink {
  stroke-dashoffset: 0;
}

.is-drawn .branch-art .ink-fill {
  opacity: 1;
}

/* Mobile : pas assez de place à côté du titre, les branches l'encadrent
   en diagonale (en haut depuis la gauche, en bas depuis la droite) */
@media (max-width: 899px) {
  .lieu-heading {
    padding: 6.5rem 0 6rem;
    margin-bottom: 0.5rem;
  }

  .branch-art {
    top: auto;
    width: 82vw;
    height: 7rem;
    transform: none;
  }

  .branch-art--left {
    top: 0;
    right: auto;
    left: calc(-1 * var(--gutter) - 4vw);
  }

  .branch-art--right {
    bottom: 0;
    left: auto;
    right: calc(-1 * var(--gutter) - 4vw);
    transform: scaleX(-1);
  }
}

@media (min-width: 900px) {
  .branch-art {
    --gap: 8rem;
    height: 13rem;
  }

  .lieu-heading {
    margin-bottom: 4.5rem;
  }
}

.venue {
  overflow: hidden;
  max-width: 48rem;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--cloud-light);
  box-shadow: var(--shadow);
}

.venue__photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.venue__body {
  padding: 1.75rem 1.5rem 2rem;
  text-align: center;
}

.venue__name {
  font-size: 1.6rem;
}

.venue__address {
  margin-top: 0.5rem;
  font-style: normal;
}

.venue__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Grand écran : photo et adresse côte à côte */
@media (min-width: 900px) {
  .venue {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    max-width: 56rem;
  }

  .venue__photo {
    height: 100%;
    min-height: 22rem;
    aspect-ratio: auto;
  }
}

/* ---------- Souvenirs : collage de tirages photo ----------
   Rangées de 2 ou 3 photos qui se chevauchent un peu ; chaque tirage a sa
   largeur (--w), son format (--ar), sa rotation (--rot) et son décalage (--dy). */

.memories {
  max-width: 42rem;
  margin: 0 auto;
}

.memories__row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.memories__row + .memories__row {
  margin-top: -3%;
}

.memories__row:nth-child(even) {
  padding-left: 3%;
}

.memory {
  position: relative;
  z-index: 1;
  flex: none;
  width: var(--w);
  margin: var(--dy) -1.5% 0;
  cursor: zoom-in;
}

.memory:nth-child(2) { z-index: 2; }
.memory:nth-child(3) { z-index: 3; }

/* Chaque photo est un tirage à bord blanc, posé un peu de travers */
.memory {
  padding: 0.45rem;
  background: var(--paper);
  box-shadow: 0 2px 4px rgba(43, 43, 43, 0.08), 0 14px 28px rgba(43, 43, 43, 0.18);
  transition: transform 0.4s var(--ease-out-soft), box-shadow 0.6s var(--ease-out-soft);
}

.memory img {
  height: auto;
  aspect-ratio: var(--ar);
  border-radius: 0;
  box-shadow: none;
}

@media (min-width: 900px) {
  .memory {
    padding: 0.7rem;
  }
}

/* Une photo s'agrandit au survol (souris) ou au toucher (mobile, géré en JS) */
.memory.is-zoomed {
  z-index: 5;
  cursor: zoom-out;
}

.memory.is-zoomed {
  --zoom: 1.25;
  --tilt: 0;
  box-shadow: 0 30px 60px rgba(43, 43, 43, 0.3);
}

@media (hover: hover) {
  .memory:hover {
    z-index: 5;
  }

  .memory:hover {
    --zoom: 1.25;
    --tilt: 0;
    box-shadow: 0 30px 60px rgba(43, 43, 43, 0.3);
  }
}


/* ---------- RSVP & Cagnotte : le texte encadré par deux photos ----------
   Mobile : une photo en haut qui sort à gauche, une en bas qui sort à droite.
   Grand écran : une photo de chaque côté du texte, décalées en hauteur. */

.frame {
  --speed: 90px;
  width: 60vw;
  height: 19vh;
  height: 19svh;
}

.frame--a {
  align-self: flex-start;
  margin-bottom: 1.75rem;
  margin-left: -8vw;
}

.frame--a img {
  border-radius: 0 999px 999px 0;
}

.frame--b {
  --speed: 130px;
  align-self: flex-end;
  margin-top: 1.75rem;
  margin-right: -8vw;
}

.frame--b img {
  border-radius: 999px 0 0 999px;
}

@media (min-width: 1000px) {
  .framed {
    display: grid;
    grid-template-columns: 1fr minmax(0, 40rem) 1fr;
    align-items: center;
    column-gap: 3rem;
  }

  .framed > .container {
    grid-row: 1;
    grid-column: 2;
    padding: 0;
  }

  .frame {
    grid-row: 1;
    width: min(22rem, 100%);
    height: 62vh;
    margin: 0;
  }

  .frame--a {
    grid-column: 1;
    align-self: start;
    justify-self: start;
    margin-left: -3vw;
  }

  .frame--a img {
    border-radius: 999px 999px var(--radius) var(--radius);
  }

  .frame--b {
    grid-column: 3;
    align-self: end;
    justify-self: end;
    margin-right: -3vw;
  }

  .frame--b img {
    border-radius: var(--radius) var(--radius) 999px 999px;
  }

  /* Le portrait est en format paysage : cadre moins haut pour garder les deux visages */
  #cagnotte .frame--b {
    width: min(26rem, 100%);
    height: 40vh;
  }
}

/* ---------- Avion en papier (RSVP) ---------- */

.framed > .container {
  position: relative;
  z-index: 1;
}

.framed {
  overflow: hidden;
}

/* L'animation est large (16:9) : elle est centrée sur le titre et,
   sur mobile, cadrée plus large que l'écran */
.plane {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  z-index: -1;
  width: 170vw;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  opacity: 0.85;
  transform: translate(-50%, -50%);
}

@media (min-width: 1000px) {
  .plane {
    top: 5rem;
    width: 100vw;
  }
}

/* ---------- Cagnotte : deck de cartes à faire glisser ----------
   La position de chaque carte dans la pile (--pos), sa rotation (--r) et le
   glissé en cours (--x, --dr) sont mis à jour en JS. */

/* Phrase d'introduction au-dessus des idées de cadeaux */
.gift-intro {
  margin-top: 2.25rem;
  font-weight: 500;
}

.gift-deck {
  max-width: 17rem;
  margin: 1.75rem auto 0;
}

.gift-deck__stack {
  position: relative;
  aspect-ratio: 4 / 5;
  touch-action: pan-y;
}

.gift-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.6rem 0;
  background: var(--paper);
  box-shadow: 0 2px 4px rgba(43, 43, 43, 0.08), 0 16px 30px rgba(43, 43, 43, 0.16);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transform:
    translateX(var(--x, 0px))
    translateY(calc(var(--pos, 0) * 12px))
    rotate(calc(var(--r, 0deg) + var(--dr, 0deg)))
    scale(calc(1 - var(--pos, 0) * 0.05));
  transition: transform 0.5s var(--ease-out-soft), opacity 0.4s ease;
}

.gift-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.gift-card__media {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 55%),
    var(--tint);
}

.gift-card__icon {
  width: 42%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* Photo pas encore fournie : on garde l'illustration */
.gift-card.is-missing img {
  display: none;
}

.gift-card__title {
  padding: 0.75rem 0.25rem 0.9rem;
  font-size: 1.15rem;
  line-height: 1.25;
  text-align: center;
}

.gift-deck__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.gift-deck__btn {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0 0 0.2rem;
  border: 1.5px solid var(--violet);
  border-radius: 50%;
  background: transparent;
  color: var(--violet);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.gift-deck__btn:hover {
  background: var(--violet);
  color: #fff;
}

.gift-deck__count {
  min-width: 3rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ---------- Phrase mise en avant (date limite du RSVP, urne de la cagnotte) ---------- */

.accent-note {
  margin-top: 1.25rem;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--violet);
}

.rsvp-action {
  margin-top: 2rem;
}

/* ---------- Cagnotte : virement ou Wero ---------- */

.pay {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pay__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 1.25rem;
  border: 1.5px dashed rgba(95, 74, 139, 0.4);
  border-radius: var(--radius);
  background: rgba(251, 250, 247, 0.45);
}

.pay__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet);
}

.pay__numbers {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pay__numbers li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.pay__name {
  min-width: 3.5rem;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-style: italic;
  text-align: right;
}

.pay__phone {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.pay__copy {
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--violet);
  border-radius: 999px;
  background: transparent;
  color: var(--violet);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.pay__copy:hover,
.pay__copy.is-copied {
  background: var(--violet);
  color: #fff;
}

@media (min-width: 700px) {
  .pay {
    grid-template-columns: 1fr 1.4fr;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding: 4rem 0;
  border-top: 1px solid rgba(95, 74, 139, 0.2);
  background: var(--cloud);
  color: var(--ink);
}

.footer__names {
  margin-bottom: 0.75rem;
  font-family: var(--font-title);
  font-size: 2rem;
}

.footer .amp {
  color: var(--aperol);
}

.footer__small {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ---------- Mouvement réduit ---------- */

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

  .scroll-down__arrows i {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }

  .section::before,
  .section::after {
    animation: none;
  }

  .js .branch-art .ink,
  .js .branch-art .ink-fill {
    transition: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }

  .plane {
    display: none;
  }

  /* Prénoms affichés directement */
  .js .names__char {
    animation: none;
    fill-opacity: 1;
    stroke-width: 0;
  }

  /* Enveloppe : simple fondu, sans mouvement */
  .js .envelope-screen {
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
  }

  .envelope-screen.is-open {
    opacity: 0;
  }

  .envelope-screen *,
  .seal:hover {
    animation: none !important;
    transition: none !important;
  }

  .is-open .flap,
  .is-open .seal {
    transform: none;
  }
}
