/* ==========================================================================
   Design tokens — change these to re-theme the whole site
   ========================================================================== */
:root {
  /* Brand palette */
  --green: #2C4034;        /* main */
  --ivory: #F3EBDD;        /* main */
  --gold: #A8824E;         /* accent */
  --plum: #4A2B3D;         /* accent */

  /* Derived */
  --bg: var(--ivory);
  --bg-tint: #EADFCB;
  --surface: #FBF7EE;
  --ink: #25312A;
  --muted: #5E665F;
  --line: #D9CDB5;
  --accent: var(--green);
  --accent-dark: #1E2E24;
  --gold-text: #7D5E2C;    /* darker gold: readable on ivory */
  --gold-soft: #D6B87F;    /* lighter gold: readable on green/plum */
  --error: #A32B2B;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(44, 64, 52, .10);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h3 { font-size: 1.6rem; }
a { color: var(--accent-dark); }
img, iframe { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.wrap--narrow { width: min(720px, 100% - 40px); }

.eyebrow { font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-text); font-weight: 500; margin: 0 0 .6rem; }
.lead { color: var(--muted); max-width: 56ch; margin-inline: auto; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  transition: background .3s, box-shadow .3s;
}
.nav.is-solid { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
/* PJ monogram: the two-colour artwork in img/logo-mark.png (champagne P, green-outlined J), shown as-is */
.logo {
  display: block; aspect-ratio: 425 / 560;
  background: url("../img/logo-mark.png") center / contain no-repeat;
}
.nav__brand { display: flex; align-items: center; height: 54px; text-decoration: none; color: var(--gold-text); }
.nav__brand .logo { height: 100%; }
.nav.is-solid .nav__brand .logo { filter: drop-shadow(0 0 .6px rgba(125, 94, 44, .9)) drop-shadow(0 0 .6px rgba(125, 94, 44, .6)); }   /* the pale champagne P needs an edge on ivory */
.nav__links { display: flex; gap: 22px; }
.nav__links a { text-decoration: none; color: var(--ink); font-size: .95rem; letter-spacing: .03em; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav__links a:hover, .nav__links a.is-active { border-color: var(--gold); }
.nav__toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--ink); cursor: pointer; padding: 4px 10px; }
.nav__right { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.nav:not(.is-solid) .nav__right { color: var(--ivory); }
.lang { display: inline-flex; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; color: inherit; font: inherit; font-size: .78rem; font-weight: 500; letter-spacing: .1em; padding: 5px 11px; cursor: pointer; transition: background .2s, color .2s; }
.lang button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.lang button[aria-pressed="true"] { background: var(--gold); color: #1d1a14; }
/* over the dark green hero, nav is ivory until the page scrolls */
.nav:not(.is-solid) .nav__toggle, .nav:not(.is-solid) .nav__links a { color: var(--ivory); }
.nav:not(.is-solid) .nav__links a:hover, .nav:not(.is-solid) .nav__links a.is-active { border-color: var(--gold-soft); }

@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px; display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a, .nav:not(.is-solid) .nav__links a { padding: 12px 0; font-size: 1.05rem; color: var(--ink); }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: grid; place-items: center; text-align: center;
  padding: 110px 20px 70px; position: relative;
  color: var(--ivory);
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(168, 130, 78, .30), transparent 70%),
    radial-gradient(800px 520px at 100% 100%, rgba(74, 43, 61, .65), transparent 70%),
    var(--green);
}
.hero .eyebrow { color: var(--gold-soft); }
.hero .hero__names .amp { color: var(--gold-soft); }
.hero .hero__place, .hero .hero__sub { color: rgba(243, 235, 221, .78); }
.hero .scrollhint { color: rgba(243, 235, 221, .7); }
.hero .btn--primary { background: var(--gold); border-color: var(--gold); color: #1d1a14; }
.hero .btn--primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.hero .btn--ghost { color: var(--ivory); border-color: rgba(243, 235, 221, .6); }
.hero .btn--ghost:hover { background: rgba(243, 235, 221, .1); }
.hero .countdown__cell { background: rgba(243, 235, 221, .07); border-color: rgba(214, 184, 127, .35); box-shadow: none; }
.hero .countdown__lbl { color: var(--gold-soft); }
.hero__inner { animation: heroIn .9s ease both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } }
.hero__names { font-size: clamp(3.4rem, 12vw, 7.5rem); margin: .1em 0 .1em; letter-spacing: .01em; }
.hero__names .amp { font-style: italic; padding: 0 .12em; }
.hero__date { font-family: var(--serif); font-size: clamp(1.4rem, 3.6vw, 2rem); margin: 0; }
.hero__place { color: var(--muted); letter-spacing: .08em; margin: .2rem 0 2rem; }
.hero__sub { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 1.25rem; margin: 1.2rem 0 1.8rem; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.scrollhint { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; font-size: 2rem; color: var(--muted); text-decoration: none; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }

.countdown { display: inline-grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: clamp(8px, 2vw, 18px); }
.countdown__cell {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px 10px; box-shadow: var(--shadow); min-width: 70px;
}
.countdown__num { display: block; font-family: var(--serif); font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown__lbl { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 500; letter-spacing: .04em;
  padding: 13px 28px; border-radius: 999px; cursor: pointer; text-decoration: none; text-align: center;
  border: 1.5px solid var(--accent); transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; color: var(--accent-dark); }
.btn--ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* external links (open in a new tab) get a small north-east arrow */
.btn[target="_blank"]::after, .stay[target="_blank"] h4::after {
  content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .55em; vertical-align: -.04em; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11L11 5M6 5h5v5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11L11 5M6 5h5v5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.stay[target="_blank"] h4::after { opacity: .55; }
.btn--block { display: block; width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1.2rem; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; padding: 6px 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 110px) 0; }
.section--tint { background: var(--bg-tint); }
.section__head { text-align: center; margin-bottom: 2.4rem; }
.subhead { margin: 3rem 0 1.2rem; text-align: center; }
.subhead small { font-family: var(--sans); font-size: .8rem; color: var(--muted); font-weight: 300; letter-spacing: .04em; }
.planner .subhead, .venue h3 { text-align: left; }
.planner .subhead { margin-top: 0; }

.story { max-width: 62ch; margin: 0 auto; text-align: center; }
.story h3 { font-style: italic; color: var(--plum); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 680px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 22px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 64px; margin-bottom: 10px; }
.timeline__dot {
  position: absolute; left: 0; top: 4px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-size: 1.3rem;
  transition: border-color .2s, background .2s;
}
.timeline__btn {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px;
  display: block; transition: box-shadow .2s, border-color .2s;
}
.timeline__btn:hover { box-shadow: var(--shadow); }
.timeline__time { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); font-weight: 500; }
.timeline__title { font-family: var(--serif); font-size: 1.45rem; display: flex; justify-content: space-between; align-items: center; }
.timeline__title::after { content: "+"; color: var(--muted); font-family: var(--sans); transition: transform .2s; }
.timeline__text { max-height: 0; overflow: hidden; transition: max-height .3s ease; color: var(--muted); margin: 0; }
.timeline li.is-open .timeline__text { max-height: 140px; margin-top: 6px; }
.timeline li.is-open .timeline__title::after { transform: rotate(45deg); }
.timeline li.is-open .timeline__dot { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 3rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card__icon { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.card h4 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 .3em; font-weight: 500; line-height: 1.2; }
.card p { margin: 0; color: var(--muted); font-size: .98rem; }
.cards--stay { margin-top: 1.5rem; }
.stay { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.stay:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(60, 50, 30, .14); }
.stay__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--accent-dark); }
.tag--gold { background: color-mix(in srgb, var(--plum) 12%, transparent); color: var(--plum); }
.stay__price { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }

/* ---------- Venue ---------- */
.venue__photo { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.venue__photo[hidden] { display: none; }
.venue__photo img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover; object-position: 60% 55%; }
@media (max-width: 800px) { .venue__photo img { aspect-ratio: 4 / 3; object-position: 68% 60%; } }
.venue { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; align-items: stretch; }
.venue__map { min-height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.venue__map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
@media (max-width: 800px) { .venue { grid-template-columns: 1fr; } }

/* ---------- Tabs / chips ---------- */
.tabs, .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.tab, .chip {
  font: inherit; cursor: pointer; padding: 9px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); transition: all .2s;
}
.tab:hover, .chip:hover { border-color: var(--accent); }
.tab[aria-selected="true"], .chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabpanel { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow); text-align: center; }
.travel__text { margin: 0 0 .5em; }
.travel__from { margin: 1.1em 0 .15em; font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-text); }

/* ---------- Form ---------- */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 5vw, 36px); box-shadow: var(--shadow); }
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 500; margin-bottom: 6px; padding: 0; }
.field small { color: var(--muted); font-weight: 300; }
.req { color: var(--error); }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field.has-error input[type="text"], .field.has-error input[type="email"] { border-color: var(--error); }
.error { display: block; color: var(--error); font-size: .88rem; min-height: 0; margin-top: 4px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span { display: block; text-align: center; padding: 14px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); cursor: pointer; transition: all .2s; }
.choice__opt input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); font-weight: 500; }
.choice__opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 460px) { .choice { grid-template-columns: 1fr; } }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.stepper button { width: 48px; height: 44px; font-size: 1.4rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.stepper button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.stepper output { min-width: 44px; text-align: center; font-weight: 500; font-size: 1.15rem; }

.guest-list { display: grid; gap: 12px; margin-bottom: 20px; }
.guest { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.guest__title { grid-column: 1 / -1; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--plum); font-weight: 500; }
.guest input[type="text"], .guest select { background: var(--surface); }
.guest .radios { align-self: center; }
.guest__drinks { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.guest__drinks[hidden] { display: none; }
.guest__q { font-weight: 500; font-size: .95rem; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.radio { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 300; transition: border-color .2s, background .2s; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.radio:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); font-weight: 500; }
.radio:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 560px) { .guest { grid-template-columns: 1fr; } }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; font-weight: 300 !important; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form__note { text-align: center; color: var(--muted); font-size: .88rem; margin: 12px 0 0; }

.rsvp-status {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; text-align: center;
}
.rsvp-status .btn-row { justify-content: center; margin-top: .8rem; }

/* ---------- Planner ---------- */
.planner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
@media (max-width: 800px) { .planner { grid-template-columns: 1fr; } }
.milestones, .checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.milestone { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.milestone__days { text-align: center; line-height: 1; }
.milestone__days b { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 500; }
.milestone__days span { font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.milestone h4 { margin: 0 0 2px; line-height: 1.2; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.milestone p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.milestone.is-past { opacity: .55; }
.milestone.is-soon { border-color: var(--gold); }
.milestone__days b { color: var(--plum); }
.milestone.is-soon .milestone__days b { color: var(--gold-text); }
.icon-btn { border: 1.5px solid var(--line); background: transparent; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; transition: all .2s; }
.icon-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--plum)); transition: width .4s ease; }
.progress__text { margin: 6px 0 14px; color: var(--muted); font-size: .9rem; }
.checklist li label { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: all .2s; }
.checklist li label:hover { border-color: var(--accent); }
.checklist input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 0 20px; }
.faq summary { cursor: pointer; padding: 16px 0; font-family: var(--serif); font-size: 1.3rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 18px; color: var(--muted); }

/* ---------- Footer / toast / confetti ---------- */
.footer { text-align: center; padding: 56px 20px; background: var(--green); color: var(--gold-soft); }
.footer__names { font-family: var(--serif); font-size: 2rem; color: var(--ivory); margin: 0; }

/* plum feature section (RSVP) */
.section--plum { background: var(--plum); color: var(--ivory); }
.section--plum .eyebrow { color: var(--gold-soft); }
.section--plum .lead { color: rgba(243, 235, 221, .82); }
.section--plum .form, .section--plum .rsvp-status { color: var(--ink); }
.section--plum .form { border-color: var(--gold); }
.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 30px; opacity: 0; pointer-events: none; z-index: 90;
  background: var(--green); color: var(--ivory); border: 1px solid var(--gold); padding: 12px 22px; border-radius: 999px; transition: all .3s; max-width: calc(100% - 32px); text-align: center;
}
.toast.is-show { opacity: 1; translate: -50% 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 80; }
.confetti i { position: absolute; top: -20px; font-style: normal; font-size: 1.5rem; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: .8; } }

/* ---------- Opening envelope (intro) ---------- */
.envelope { display: none; }
.env-pending body { overflow: hidden; }
.env-pending .envelope {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 300; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 50% 12%, rgba(168, 130, 78, .30), transparent 70%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(74, 43, 61, .65), transparent 70%),
    var(--green);
  color: var(--ivory);
  transition: opacity .6s ease, visibility .6s;
}
.envelope:focus { outline: none; }
.envelope.is-closing { opacity: 0; visibility: hidden; }
.envelope__bar {
  position: absolute; z-index: 10; left: 16px; right: 16px; top: max(14px, env(safe-area-inset-top));
  display: flex; justify-content: space-between; align-items: center;
}
.envelope__skip {
  background: none; border: 0; color: inherit; font: inherit; font-size: .8rem; letter-spacing: .14em;
  text-transform: uppercase; cursor: pointer; opacity: .8; padding: 8px 4px;
}
.envelope__skip:hover { opacity: 1; }

/* Everything is sized from --w, so the envelope scales to any screen. */
.envelope__stage {
  --w: min(420px, 86vw, 56vh);
  --env-h: calc(var(--w) * .667);
  --card-h: calc(var(--w) * 1.4);
  font-size: calc(var(--w) * .04);
  display: grid; justify-items: center; gap: 2.4em; text-align: center;
}
.env {
  position: relative; width: var(--w); height: var(--env-h); cursor: pointer;
  filter: drop-shadow(0 1.6em 2em rgba(0, 0, 0, .38));
  animation: envIn .9s ease both;
}
@keyframes envIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }

.env__back, .env__front, .env__flap {
  position: absolute; left: 0; width: 100%;
  transition: translate .8s ease .1s, opacity .7s ease .2s, transform .75s ease;
}
.env__back  { inset: 0; z-index: 1; border-radius: 6px; background: color-mix(in srgb, var(--ivory) 76%, var(--gold)); }
.env__front {
  inset: 0; z-index: 3; border-radius: 6px;
  background: linear-gradient(165deg, var(--ivory), color-mix(in srgb, var(--ivory) 88%, var(--gold)));
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.env__flap {
  top: 0; height: 54%; z-index: 4; transform-origin: 50% 0;
  transform: perspective(900px) rotateX(0deg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ivory) 84%, var(--gold)), color-mix(in srgb, var(--ivory) 92%, var(--gold)));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* the card sits inside a clip window so it can't poke out of the closed envelope */
.env__clip { position: absolute; inset: 0; z-index: 2; clip-path: inset(0 round 6px); transition: clip-path 0s linear .45s; }
.env__card {
  position: absolute; left: 6%; top: 0; width: 88%; height: var(--card-h);
  transform: translateY(calc(var(--env-h) * .14));
  transition: transform .95s cubic-bezier(.2, .8, .2, 1) .45s;
  display: flex; flex-direction: column; gap: .8em; padding: 5% 5% 4%;
  background: var(--surface); color: var(--ink); border-radius: 6px;
  box-shadow: inset 0 0 0 .4em var(--surface), inset 0 0 0 calc(.4em + 1px) rgba(168, 130, 78, .5);
}
.env__photo { position: relative; flex: 1 1 0; min-height: 0; border-radius: 3px; overflow: hidden; background: var(--bg-tint); display: grid; place-items: center; }
/* absolutely positioned so the image fills the frame exactly; object-fit/object-position then crop it */
.env__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.env__mono {
  font-family: var(--serif); font-size: 3.2em; line-height: 1; color: var(--gold-text); letter-spacing: .04em;
  width: 2.6em; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%;
}
.env__card .eyebrow { font-size: .62em; margin: .2em 0 0; }
.env__names { font-size: 2.1em; line-height: 1.05; margin: 0; }
.env__names .amp { font-style: italic; color: var(--gold-text); padding: 0 .12em; }
.env__date { font-family: var(--serif); font-size: 1.2em; line-height: 1.2; margin: 0; }
.env__where { font-size: .72em; letter-spacing: .1em; color: var(--muted); margin: 0; }
.env__enter { align-self: center; font-size: .85em; opacity: 0; visibility: hidden; transition: opacity .5s ease .5s, visibility 0s linear .5s; }

/* wax seal on the flap — the thing to tap */
.env__seal {
  position: absolute; z-index: 6; left: 50%; top: 54%; translate: -50% -50%;
  width: 4.4em; height: 4.4em; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; font-size: 1.15em;
  background: radial-gradient(circle at 35% 30%, #6b3d55, var(--plum) 58%, #2c1823);
  box-shadow: 0 .25em .7em rgba(0, 0, 0, .45), inset 0 0 0 .18em rgba(214, 184, 127, .55), inset 0 0 0 .32em rgba(0, 0, 0, .18);
  transition: opacity .3s ease, scale .3s ease;
  animation: sealPulse 2.4s ease-in-out infinite;
}
@keyframes sealPulse { 50% { scale: 1.07; } }
/* the monogram pressed into the wax: a little shadow below and highlight above gives an embossed look */
.env__seal-mark { width: 50%; filter: drop-shadow(0 .06em .06em rgba(0, 0, 0, .5)); }
.envelope__hint { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.4em; color: var(--gold-soft); transition: opacity .4s ease; }

/* step 1: open — seal fades, flap swings up, card rises */
.is-open .env__seal { opacity: 0; scale: .6; pointer-events: none; animation: none; }
.is-open .env__flap { transform: perspective(900px) rotateX(180deg); z-index: 1; transition: transform .75s ease, z-index 0s linear .38s; }
.is-open .env__clip { clip-path: inset(-120% -12% 0 -12%); }
.is-open .env__card { transform: translateY(calc(var(--env-h) * -.55)); }
.is-open .envelope__hint { opacity: 0; }

/* step 2: reveal — envelope drops away, card comes forward with the button */
.is-reveal .env__back, .is-reveal .env__front, .is-reveal .env__flap { translate: 0 70vh; opacity: 0; }
.is-reveal .env__clip { z-index: 5; clip-path: inset(-120% -12% -120% -12%); transition: none; }
.is-reveal .env__card { transform: translateY(calc(var(--env-h) * -.55)) scale(1.04); transition: transform .7s ease; }
.is-reveal .env__enter { opacity: 1; visibility: visible; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
