/* =========================================================
   Franck & Ghyslaine — Wedding Invitation  (portrait "card" style)
   Vibe: sage green, ivory paper, white roses, a touch of ring
   gold — matched to the wedding-day stationery.
   The whole invite is a single tall phone-shaped card centered
   on a soft backdrop. EDIT colors in :root below.
   ========================================================= */

/* ---------- Self-hosted fonts (no Google Fonts request) ----------
   Variable fonts: one file per family covers all the weights we use.
   Browsers only download a "latin-ext" file if the page uses one of its
   characters, so normally just the 4 "latin" files (~130 KB) load. */
/* Cormorant Garamond italic — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Cormorant Garamond italic — latin */
@font-face {
  font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('assets/fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Cormorant Garamond — latin-ext */
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('assets/fonts/cormorant-garamond-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Cormorant Garamond — latin */
@font-face {
  font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('assets/fonts/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Great Vibes — latin-ext */
@font-face {
  font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/great-vibes-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Great Vibes — latin */
@font-face {
  font-family: 'Great Vibes'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('assets/fonts/great-vibes-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Jost — latin-ext */
@font-face {
  font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('assets/fonts/jost-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Jost — latin */
@font-face {
  font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('assets/fonts/jost-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --sage:        #7d8c5c;   /* main accent: headings, buttons, details */
  --sage-dark:   #5f6e42;
  --sage-light:  #b4bf98;
  --gold:        #e2cd9c;   /* light ring-gold, small accents on dark backgrounds */
  --ivory:       #fbfaf4;
  --cream:       #f1f1e6;
  --ink:         #3b4030;
  --muted:       #73776a;
  --white:       #ffffff;
  --line:        rgba(125,140,92,.28);

  --font-script: 'Great Vibes', cursive;
  --font-serif:  'Cormorant Garamond', Georgia, serif;
  --font-sans:   'Jost', system-ui, sans-serif;

  --card-w: 440px;          /* width of the invitation card */
  --shadow: 0 30px 70px rgba(52, 58, 40, 0.20);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* Soft backdrop behind the card (a warm wash + subtle texture). */
  background:
    radial-gradient(120% 80% at 50% -10%, #eef0e4 0%, #dde2cd 45%, #c6cdb0 100%);
  background-attachment: fixed;
  padding: clamp(0px, 4vw, 48px) 0;
}

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

/* ---------- The card column ---------- */
.invite {
  width: min(var(--card-w), 100%);
  margin: 0 auto;
  /* one continuous warm background shared by every section -> no hard color bands */
  background: linear-gradient(180deg, #fbfaf4 0%, #f6f5ec 45%, #eff0e3 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Each stacked panel sits on the shared background (transparent) */
.card { padding: 58px 30px; position: relative; background: transparent; }

/* The content "sheet" curves up over the hero photo for a soft transition */
.hero + .card {
  margin-top: -34px; border-radius: 34px 34px 0 0; z-index: 3;
  padding-top: 46px;
  background: linear-gradient(180deg, #fbfaf4, #fbfaf4);
  box-shadow: 0 -18px 30px rgba(0,0,0,.06);
}

/* ---------- Shared type ---------- */
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.3em;
  font-size: 0.68rem; color: var(--sage); margin: 0 0 0.5rem;
}
.title {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.15; margin: 0 0 1.2rem;
}
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-sans); font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.72rem;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid  { background: var(--sage); color: #fff; }
.btn--solid:hover { background: var(--sage-dark); box-shadow: 0 10px 24px rgba(95,110,66,.32); }
.btn--outline{ background: transparent; color: var(--sage-dark); border-color: var(--sage); }
.btn--outline:hover { background: var(--sage); color: #fff; }
.btn--light  { background: #fff; color: var(--sage-dark); box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.btn--light:hover { background: var(--sage); color: #fff; }
.btn--full   { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  min-height: 78vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; padding: 70px 34px;
  /* EDIT HERE: hero background image (assets/hero.jpg).
     The dark overlay keeps names readable; the gradient is a fallback
     shown if hero.jpg is missing. */
  background-image:
    radial-gradient(130% 80% at 50% 45%, rgba(26,30,20,.50), rgba(26,30,20,.30) 75%),
    linear-gradient(rgba(34,40,27,.52) 0%, rgba(34,40,27,.50) 45%, rgba(34,40,27,.72) 100%),
    url('assets/hero.jpg'),
    linear-gradient(135deg, #b9c2a2 0%, #8a9476 100%);
  background-size: cover; background-position: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.hero::before { content: none; } /* no divider above hero */
/* Hero entrance — animate the whole block so no child can get stuck hidden.
   Independent of AOS so the hero is never blank. */
.hero__inner { position: relative; animation: heroIn 1.1s ease .15s both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.hero__pretitle {
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.72rem; margin: 1rem 0 1rem;
  padding-block:30px;
  opacity: .92;
}
.hero__names {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(3rem, 16vw, 4.6rem); line-height: 1; margin: 0;
  text-shadow: 0 4px 26px rgba(0,0,0,.35);
}
.hero__names .amp { font-size: 0.62em; opacity: .9; display: block; margin: 2px 0; color: var(--gold); }

/* ---- names that "write on" letter by letter after Ouvrir l'invitation ---- */
.hero__names .ltr {
  display: inline-block; white-space: pre;
  opacity: 0; transform: translateY(34px) rotate(8deg) scale(.86);
  filter: blur(8px);
}
.hero__names.is-writing .ltr {
  animation: ltrIn .85s cubic-bezier(.2,.85,.25,1) both;
}
@keyframes ltrIn {
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
/* gentle shimmer once the whole name has finished writing */
.hero__names.is-written { animation: nameGlow 2.6s ease 1; }
@keyframes nameGlow {
  0%, 100% { text-shadow: 0 4px 26px rgba(0,0,0,.35); }
  45%      { text-shadow: 0 4px 26px rgba(0,0,0,.35), 0 0 22px rgba(226,205,156,.65); }
}
.hero__divider {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 18px 0; color: rgba(255,255,255,.85);
}
.hero__divider::before, .hero__divider::after {
  content: ''; height: 1px; width: 46px; background: rgba(255,255,255,.6);
}
.hero__invite { font-family: var(--font-serif); font-size: 1.05rem; margin: 0 0 1rem; opacity: .95; }
.hero__place {
  font-family: var(--font-serif); font-size: 1.15rem; letter-spacing: .04em;
  margin: 0 0 1.6rem; opacity: .95;
}
.hero__cta { margin-top: .2rem; }
.hero__date {
  font-family: var(--font-serif); font-size: 1.25rem; letter-spacing: 0.04em; margin: 0;
}
.hero__date small { font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: .85; }
.hero__scroll { margin-top: 30px; }
/* .hero__scroll span { */
  /* display: block; width: 20px; height: 34px; border: 2px solid rgba(255,255,255,.8); */
  /* border-radius: 12px; position: relative; */
/* } */
/* .hero__scroll span::after { */
  /* content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); */
  /* width: 3px; height: 6px; background: #fff; border-radius: 2px; animation: scrollDot 1.6s infinite; */
/* } */
@keyframes scrollDot { 0%{opacity:0;top:6px} 50%{opacity:1} 100%{opacity:0;top:16px} }

.hero__scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.hero__scroll-text {
  margin-top: 8px;
  font-size: 0.65rem;
  color: #fff;
  letter-spacing: 0.05em;
}

/* ---------- scrolling trials  ---------- */

.swipe-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: swipeUp 1.8s infinite;
}

.finger {
  font-size: 2rem;
}

.arrow {
  font-size: 1.2rem;
}


.swipe-icon {
  font-size: 1rem;
  animation: swipeUp 1.8s infinite;
  color:#ffffff;
}

@keyframes swipeUp {
  0% {
    transform: translateY(10px);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-10px);
    opacity: 1;
  }
  100% {
    transform: translateY(10px);
    opacity: 0.5;
  }
}

/* ---------- END scrolling trials  ---------- */


/* ---------- Countdown ---------- */
.countdown { text-align: center; padding-top: 30px; padding-bottom: 30px; }
.countdown .eyebrow { color: var(--sage); }
.countdown__grid {
  display: flex; justify-content: center; gap: 10px; margin-top: 1.2rem;
  /* soft rounded panel keeps it gently distinct without a jarring dark band */
  background: rgba(125,140,92,.09); border: 1px solid var(--line);
  border-radius: 20px; padding: 22px 12px;
}
.countdown__unit { min-width: 58px; }
.countdown__unit span {
  display: block; font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(2rem, 11vw, 2.8rem); line-height: 1; color: var(--sage-dark);
}
.countdown__unit label {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.62rem;
  color: var(--sage); margin-top: 6px; display: block;
}
.countdown__msg { font-family: var(--font-serif); font-size: 1.5rem; margin-top: 1rem; color: var(--sage-dark); }

/* ---------- Story (looping video in an arch frame) ---------- */
.story { text-align: center; }
.story__video {
  position: relative; width: min(72%, 260px); aspect-ratio: 480 / 848;
  margin: 0 auto 1.8rem; border-radius: 200px 200px 18px 18px;
  overflow: hidden; box-shadow: var(--shadow); background: var(--cream);
  border: 1px solid var(--line); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.story__video video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* play badge — only visible while the video is paused */
.story__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.85);
  width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(255,255,255,.7);
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(95,110,66,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.story__play svg { width: 24px; height: 24px; margin-left: 3px; }
.story__video.is-paused .story__play { opacity: 1; transform: translate(-50%,-50%); }
.story__play:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; opacity: 1; }
.story__text { color: var(--muted); font-size: 1.02rem; }

/* ---------- Details (no icons, centered) ---------- */
.detail-row {
  text-align: center; padding: 20px 0; border-bottom: 1px solid var(--line);
}
.detail-row:last-of-type { border-bottom: 0; }
.detail-row h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; margin: 0; }
.detail-row__time {
  font-family: var(--font-serif); color: var(--sage-dark); font-style: italic;
  font-size: 1.15rem; letter-spacing: .03em; margin: 3px 0;
}
.detail-row p { margin: 2px 0; color: var(--muted); }

/* ---------- Venue ---------- */
.venue__name { font-family: var(--font-serif); font-size: 1.4rem; margin: .3rem 0 .1rem; }
.venue__addr { color: var(--muted); margin: 0 0 1.4rem; }
.venue__map {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 5 / 4;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.venue__map iframe { width: 100%; height: 100%; border: 0; }
.venue__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- RSVP form ---------- */
.rsvp__deadline { color: var(--muted); margin: -0.6rem 0 1.6rem; }
.rsvp__form { text-align: left; }
.field { margin-bottom: 18px; }
.field > label {
  display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink); margin-bottom: 7px;
}
.req { color: var(--sage); }
.field input[type=text], .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-family: var(--font-sans); font-size: 1rem;
  border: 1px solid #d3d8c4; border-radius: 8px; background: var(--white); color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(125,140,92,.2);
}
.field textarea { resize: vertical; }
/* one drink choice per guest: "Vous", "Invité 2", … (rows added by JS) */
.drinks { display: flex; flex-direction: column; gap: 10px; }
.drink-row { display: flex; align-items: center; gap: 12px; }
.drink-row__label {
  flex: 0 0 72px; font-family: var(--font-serif); font-style: italic;
  font-size: 1.05rem; color: var(--sage-dark);
}
.field .drink-row select { flex: 1; min-width: 0; }
.drink-row.is-new { animation: drinkIn .35s ease both; }
@keyframes drinkIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.radios { display: flex; flex-direction: column; gap: 10px; }
.radio { display: flex; align-items: center; gap: 9px; font-size: 1rem; color: var(--ink); cursor: pointer; }
.radio input { accent-color: var(--sage); width: 18px; height: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__error { color: #b3261e; min-height: 1.2em; margin: 0 0 12px; font-size: .9rem; }
.thanks {
  text-align: center; font-family: var(--font-serif); font-size: 1.35rem;
  color: var(--sage-dark); padding: 26px 6px; line-height: 1.5;
}

/* Collapse the logistics questions when the guest can't make it */
.rsvp__attending-fields {
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  transition: max-height .5s ease, opacity .35s ease, margin .35s ease;
}
.rsvp__form.is-declining .rsvp__attending-fields {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

/* Sad message shown when the guest declines */
.rsvp__sad {
  text-align: center; font-family: var(--font-serif); font-size: 1.25rem;
  color: var(--sage-dark); line-height: 1.55;
  margin: 4px 0 18px; padding: 18px 6px 4px;
}

/* ---------- Footer (soft deep tone, rounded top) ---------- */
.footer {
  background: linear-gradient(180deg, #66724c, #4c5638); color: var(--ivory); text-align: center;
  border-radius: 34px 34px 0 0; margin-top: 26px;
}
.footer__names { font-family: var(--font-script); font-size: 2.6rem; color: var(--gold); margin: 0; }
.footer__date { letter-spacing: 0.3em; margin: .3rem 0 1.4rem; color: rgba(250,246,239,.85); }
.footer__note { max-width: 320px; margin: 0 auto 1.4rem; color: rgba(250,246,239,.78); font-size: .95rem; }
.footer__made { font-size: .78rem; color: rgba(250,246,239,.55); }

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .card { padding: 48px 22px; }
  .countdown__grid { gap: 10px; }
}

/* =========================================================
   INTRO OVERLAY + opening animation + CTA
   ========================================================= */
body.intro-open { overflow: hidden; height: 100vh; }

.intro {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #fbfaf4 0%, #eff0e4 55%, #dde2cc 100%);
  overflow: hidden; padding: 24px;
  transition: opacity .9s ease, visibility .9s ease;
}
.intro.is-closing { opacity: 0; visibility: hidden; }

/* ---------- Envelope with wax seal ---------- */
.env {
  position: relative; width: min(86vw, 360px); aspect-ratio: 7 / 5;
  z-index: 2; perspective: 1100px;
  margin-top: 16vh;                 /* headroom above so the card can rise fully out */
  overflow: hidden;                 /* keep the tucked letter clipped when closed */
  animation: envIn 1s cubic-bezier(.2,.8,.2,1) both;
}
/* while opening, let the card show in front of the envelope; sides & bottom stay
   clipped at the envelope edge so a long card can never spill out underneath */
.env.is-opening, .env.is-open {
  overflow: visible;
  clip-path: inset(-180% 0 0 0);
}
@keyframes envIn { from { opacity: 0; transform: translateY(26px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* the card, hidden BEHIND the envelope front until opened, then brought to the
   FRONT of the envelope (overlapping it) when the seal is clicked */
.env__letter {
  position: absolute; left: 8%; right: 8%; top: 8%; z-index: 1;
  background: #fffdf8; border-radius: 8px; padding: 12px 16px 14px; text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.14);
  opacity: 0;
  transform-origin: center;
  transition: transform 1s cubic-bezier(.2,.8,.2,1), box-shadow 1s ease, opacity .7s ease;
}
.env__flowers { width: 92px; margin: -2px auto 1px; display: block; }
.env__pre { text-transform: uppercase; letter-spacing: .24em; font-size: .52rem; color: var(--sage-dark); margin: 0 0 .12rem; }
.env__names { font-family: var(--font-script); font-weight: 400; color: var(--ink); font-size: clamp(1.4rem, 6.2vw, 1.85rem); line-height: 1; margin: .02rem 0 .2rem; }
.env__names span { color: var(--sage); }
.env__sub { font-family: var(--font-serif); font-size: .82rem; line-height: 1.3; color: var(--muted); margin: 0 0 .55rem; }
.env__letter .btn { opacity: 0; pointer-events: none; padding: 9px 18px; font-size: .66rem; transition: opacity .5s ease .2s; }

/* soft cream "cotton paper" finish shared by the envelope surfaces */
.env__back, .env__pocket, .env__flap {
  background-color: #f4f1e3;
  background-image:
    radial-gradient(130% 95% at 28% 18%, rgba(255,255,255,.6), rgba(255,255,255,0) 62%),
    repeating-linear-gradient(98deg, rgba(100,105,70,.035) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #f7f5ea, #e6e3cf);
  background-size: auto, 7px 7px, auto;
}
/* the back panel is the full envelope FRONT face — it hides the card behind it */
.env__back {
  position: absolute; inset: 0; z-index: 2; border-radius: 10px;
  box-shadow: var(--shadow);
}
.env__pocket {
  position: absolute; inset: 0; z-index: 3; border-radius: 10px;
  clip-path: polygon(0 42%, 50% 16%, 100% 42%, 100% 100%, 0 100%);
  overflow: hidden;
}
/* the closing flap — simply fades away the instant the seal is clicked */
.env__flap {
  position: absolute; top: 0; left: 0; width: 100%; height: 62%; z-index: 5;
  background-image:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.5), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(98deg, rgba(100,105,70,.035) 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #f1efe0, #e0dcc3);
  background-size: auto, 7px 7px, auto;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  overflow: hidden;
  transform-origin: top center;
  transition: opacity .4s ease;
  box-shadow: 0 6px 12px rgba(90,100,60,.12);
}

/* white tone-on-tone "glued flowers" relief embossed on the paper */
.env__emboss {
  position: absolute; pointer-events: none; user-select: none;
  backface-visibility: hidden;
  /* tone-on-tone relief: desaturate the spray to cream, keep petal detail,
     and add a raised highlight + drop shadow so it reads as embossed paper */
  filter:
    grayscale(1) brightness(1.18) contrast(.85)
    drop-shadow(0 1.5px 0.5px rgba(255,255,255,.7))
    drop-shadow(0 -1.5px 1px rgba(95,100,65,.5))
    drop-shadow(1px 0 1px rgba(95,100,65,.28));
  opacity: .5;
  mix-blend-mode: luminosity;
}
.env__emboss--flap {
  top: -6%; left: -10%; width: 72%; transform: rotate(-6deg);
}
.env__emboss--pocket {
  bottom: -4%; right: -8%; width: 64%; transform: rotate(170deg);
}
.seal {
  position: absolute; left: 50%; top: 56%; transform: translate(-50%,-50%);
  width: 86px; height: 86px; border-radius: 50%; z-index: 6; cursor: pointer; border: 0;
  /* real wax-seal photo (recolored sage), cropped to a round stamp */
  background: url('assets/wax-seal-sage.jpg') center/118% no-repeat, #6f7d50;
  box-shadow: 0 7px 18px rgba(40,50,25,.4), inset 0 2px 8px rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  transition: transform .45s ease, opacity .45s ease;
}
/* faint engraved ring inside the wax */
.seal::after {
  content: ''; position: absolute; inset: 14px; border-radius: 50%;
  border: 1px solid rgba(240,245,220,.25);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
/* F&G engraved / stamped into the wax */
.seal__mono {
  position: relative; z-index: 1;
  font-family: var(--font-serif); font-weight: 600; letter-spacing: .02em;
  font-size: 1.5rem; line-height: 1;
  color: #eef1dc;
  text-shadow: 0 1px 0 rgba(255,255,240,.35), 0 -1px 2px rgba(30,38,18,.7);
}
.seal__amp { font-size: .8em; margin: 0 .02em; opacity: .92; }
.seal:hover { transform: translate(-50%,-50%) scale(1.06); }
.seal:active { transform: translate(-50%,-50%) scale(.97); }

/* ---- open states (staged in JS: is-opening -> is-open) ---- */
/* on click: the seal and the whole flap simply disappear (the flap never opens) */
.env.is-opening .seal,
.env.is-open .seal { transform: translate(-50%,-50%) scale(.5); opacity: 0; pointer-events: none; }
.env.is-opening .env__flap,
.env.is-open .env__flap { opacity: 0; pointer-events: none; }

/* the card is brought to the FRONT of the envelope (overlapping it) and settles
   there — gently raised & scaled, not floating above the envelope */
.env.is-opening .env__letter,
.env.is-open .env__letter {
  z-index: 9; opacity: 1;
  transform: translateY(-16%) scale(1.06);
  box-shadow: 0 24px 48px rgba(0,0,0,.28);
}
.env.is-open .env__letter .btn { opacity: 1; pointer-events: auto; }

.intro__hint {
  display: block; margin-top: 26px; font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--sage-dark);
  animation: pulseHint 2s ease infinite;
}
.intro__hint.hide { opacity: 0; animation: none; transition: opacity .4s ease; }
@keyframes pulseHint { 0%,100%{opacity:.4} 50%{opacity:.95} }

/* ---------- Falling petals ---------- */
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -8%; width: 14px; height: 14px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #e4e8d4);
  box-shadow: 0 1px 3px rgba(80,90,55,.18);
  border-radius: 80% 0 80% 0; opacity: .85;
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translateY(-10vh) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: .9; }
  100% { transform: translateY(110vh) translateX(40px) rotate(420deg); opacity: .2; }
}

/* ---------- Watercolor floral accents (transparent PNGs) ---------- */
.floral {
  position: absolute; width: clamp(120px, 38%, 190px); pointer-events: none;
  opacity: .96; z-index: 1;
}
.floral--tl { top: 5px; left: 2px; }
.floral--tr { top: 6px; right: 2px; transform: scaleX(-1); }
.floral--bl { bottom: 6px; left: 2px; transform: scaleY(-1); }
.floral--br { bottom: 6px; right: 2px; transform: scale(-1); }
/* soften the warm mauve/peach watercolors so they sit with the sage & white palette */
.floral, .topper, .env__flowers { filter: saturate(.6); }
.hero .floral { filter: saturate(.6) drop-shadow(0 3px 10px rgba(0,0,0,.35)); }
.hero__inner { z-index: 2; }

/* floral topper above a section heading */
.topper {
  display: block; width: clamp(190px, 64%, 280px); margin: 0 auto .2rem; pointer-events: none;
}

/* =========================================================
   SCRATCH-TO-REVEAL date
   ========================================================= */
.reveal { text-align: center; }
.scratch {
  position: relative; width: 100%; max-width: 320px; height: 150px; margin: 1.4rem auto .4rem;
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none;
}
.scratch:active { cursor: grabbing; }
.scratch__prize {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(135deg, #fff 0%, #f3f5ea 100%); color: var(--ink);
}
.scratch__day  { font-family: var(--font-serif); font-size: 1.1rem; color: var(--sage-dark); letter-spacing: .14em; text-transform: uppercase; }
.scratch__date { font-family: var(--font-script); font-size: 2.1rem; color: var(--sage); line-height: 1; }
.scratch__time { font-family: var(--font-serif); font-size: 1rem; color: var(--muted); }
.scratch__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity .6s ease; }
.scratch.revealed .scratch__canvas { opacity: 0; pointer-events: none; }
.scratch.revealed { animation: prizePop .6s ease; }
@keyframes prizePop { 0%{transform:scale(1)} 40%{transform:scale(1.05)} 100%{transform:scale(1)} }
.scratch__hint { font-size: .8rem; letter-spacing: .1em; color: var(--muted); margin: .4rem 0 0; transition: opacity .4s ease; }
.scratch__hint.hide { opacity: 0; }

/* =========================================================
   CONFETTI burst
   ========================================================= */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i {
  position: absolute; top: -10px; width: 9px; height: 14px; opacity: 0;
  animation: confettiFall 2.4s ease-in forwards;
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(-10px) rotate(0); }
  100% { opacity: 0; transform: translateY(105vh) rotate(720deg); }
}

/* ---------- Scroll reveal (replaces AOS) ---------- */
/* Hidden only when JS is on; without JS everything stays visible. */
.js [data-aos] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.js [data-aos="fade-down"] { transform: translateY(-28px); }
.js [data-aos="zoom-in"]   { transform: scale(.94); }
.js [data-aos].is-visible  { opacity: 1; transform: none; }

/* =========================================================
   FLOATING MUSIC BUTTON (glassmorphism)
   ========================================================= */
.music-btn {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 300;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer; color: var(--sage-dark);
  border: 1px solid rgba(255, 255, 255, .6);
  /* fallback for browsers without backdrop-filter (kept readable on any background) */
  background: rgba(250, 246, 239, .82);
  box-shadow: 0 6px 18px rgba(58, 53, 47, .20), inset 0 1px 1px rgba(255, 255, 255, .5);
  -webkit-tap-highlight-color: transparent;
  /* hidden until the invitation is opened (also removed from tab order) */
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1),
              background .25s ease, box-shadow .25s ease;
}
/* true glassmorphism where supported */
@supports ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .music-btn {
    background: rgba(255, 255, 255, .2);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    backdrop-filter: blur(10px) saturate(150%);
  }
}
.music-btn.is-ready { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) {
  .music-btn:hover {
    background: rgba(255, 255, 255, .32);
    box-shadow: 0 10px 26px rgba(58, 53, 47, .28), inset 0 1px 1px rgba(255, 255, 255, .6);
    transform: translateY(-2px);
  }
}
.music-btn:active { transform: scale(.93); }
.music-btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }

.music-btn__icon { width: 22px; height: 22px; display: none; }
.music-btn.is-playing .music-btn__icon--on { display: block; }
.music-btn.is-muted   .music-btn__icon--off { display: block; }
/* sensible default before any state class is applied */
.music-btn:not(.is-playing):not(.is-muted) .music-btn__icon--off { display: block; }

/* gentle "now playing" pulse ring */
.music-btn.is-playing.is-ready { animation: musicPulse 3s ease-in-out infinite; }
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(58, 53, 47, .20), 0 0 0 0 rgba(125, 140, 92, .3); }
  50%      { box-shadow: 0 6px 18px rgba(58, 53, 47, .20), 0 0 0 9px rgba(125, 140, 92, 0); }
}

/* ---------- Respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero__scroll span::after, .petal { animation: none; }
  .js [data-aos] { opacity: 1 !important; transform: none !important; }
  .music-btn.is-playing.is-ready { animation: none; }
}
