/* ───────────────────────────────────────────────────────────
   Save the date — Sara & Luca
   ─────────────────────────────────────────────────────────── */

html { scrollbar-gutter: stable; }
html:has(body.is-sealed), body.is-sealed { overflow: hidden; }

.amp { font-family: var(--script); }
.amp-sc { font-family: var(--serif); font-style: italic; letter-spacing: 0; padding: 0 .15em; }

body.is-sealed .details { visibility: hidden; }

/* ═════════════  HERO ENVELOPE  ═════════════ */

.hero {
  --W: min(94vw, 640px);
  --H: calc(var(--W) / 1.45);
  --lining: linear-gradient(180deg, #E9DDCC, var(--linen));
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0 72px;
  overflow: hidden;
}
@supports (height: 1svh) {
  .hero { --W: min(94vw, 640px, 72svh); min-height: 100svh; }
}

.stage {
  position: relative;
  width: var(--W);
  padding-top: calc(var(--H) * .7);
}

.hero__head {
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--H) * .7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity .6s var(--ease), translate .8s var(--ease);
}
.hero__from { margin: 0 0 .15em; font-style: italic; font-size: clamp(17px, 4.6vw, 21px); letter-spacing: .02em; color: var(--walnut); }
.hero__names { margin: 0; font-size: clamp(50px, 14vw, 78px); }
.hero__names .amp { font-size: .82em; padding: 0 .04em; color: var(--walnut); }

.env {
  position: relative;
  width: 100%;
  height: var(--H);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.env:focus { outline: none; }
.env:focus-visible { outline: 1.5px solid var(--mahogany); outline-offset: 12px; }
.env > * { position: absolute; }

.env__shadow {
  z-index: 0;
  inset: 8% 4% -3%;
  border-radius: 24px;
  background: rgba(36, 24, 20, .42);
  filter: blur(22px);
}
.env__inside {
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border-radius: 2px;
  background: #3d2823;
}
.env__liner {
  position: absolute;
  inset: 3.5% 3.5% 0;
  background: var(--lining);
}

/* tucked-in contents */
.namecard {
  z-index: 2;
  left: 48%;
  top: 6%;
  width: 47%;
  aspect-ratio: .74;
  padding: 0 5%;
  rotate: 4deg;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #F8F3EA;
  outline: 1px solid var(--hairline);
  outline-offset: calc(var(--W) * -.014);
  box-shadow: 0 1px 2px rgba(36, 24, 20, .1), 0 12px 26px -12px rgba(36, 24, 20, .5);

}
.namecard p { position: relative; margin: 0; }
.namecard__first { font-size: calc(var(--W) * .088); line-height: 1.02; color: var(--mahogany); }
.namecard__last {
  margin-top: .1em !important;
  font-size: max(9px, calc(var(--W) * .03));
  letter-spacing: .16em;
  color: var(--mahogany);
}
.namecard__amp { margin: .28em 0 .08em !important; font-size: calc(var(--W) * .05); line-height: 1; color: var(--olive); }
/* a little olive sprig tucked behind the photo, peeking over the card's top-left */
.namecard__sprig { position: absolute; left: -16%; top: -9%; width: 34%; aspect-ratio: .6; rotate: -24deg; pointer-events: none; }
.namecard__sprig svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 3px rgba(36, 24, 20, .2)); }

.print {
  margin: 0;
  background: #FDFBF7;
  box-shadow:
    0 1px 2px rgba(36, 38, 31, .08),
    0 14px 30px -10px rgba(77, 52, 45, .34);
}
.print img { width: 100%; height: 100%; object-fit: cover; }

.print--main {
  z-index: 3;
  left: 2%;
  top: 8%;
  width: 47%;
  padding: 3.6% 3.6% 9%;
  rotate: -5deg;
  box-shadow: 0 1px 2px rgba(36, 24, 20, .1), 0 14px 28px -12px rgba(36, 24, 20, .55);

}
.print__photo { aspect-ratio: 4 / 5; overflow: hidden; background: #ddd; }
.print--main img { object-position: 50% 88%; scale: 1.45; transform-origin: 50% 78%; }
/* envelope back */
.env__pocket {
  z-index: 4;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.env__pocket .fold {
  fill: none;
  stroke: rgba(20, 12, 10, .3);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.env__flap {
  z-index: 6;
  inset: 0 0 auto 0;
  height: 58%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transform: perspective(1400px) rotateX(0deg);
}
.flap-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flap-front svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flap-back { transform: rotateX(180deg); }
.flap-back svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flap-back__paper { fill: #46302a; }
.flap-back__liner { fill: url(#flapBackLining); }

/* wax seal */
.seal {
  z-index: 7;
  left: 50%;
  top: calc(57% - var(--W) * .095);
  width: calc(var(--W) * .19);
  aspect-ratio: 1;
  translate: -50% 0;
  filter: drop-shadow(0 3px 2px rgba(20, 12, 10, .35)) drop-shadow(0 10px 14px rgba(20, 12, 10, .3));
  animation: sealBreathe 3.6s var(--ease-soft) infinite;
  transition: scale .7s var(--ease), opacity .6s var(--ease), translate .7s var(--ease);
}
.seal svg { width: 100%; height: 100%; overflow: visible; }
.seal__mono { font-family: var(--script); font-size: 40px; fill: #3f3f31; }
.seal__mono--hi { fill: #e4e2c8; opacity: .7; }
@keyframes sealBreathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.04; }
}

/* olive vine tucked on the corner, loose leaves on the table */
.env__sprig { z-index: 8; right: -4%; top: -32%; width: 21%; height: 100%; pointer-events: none; }
.env__sprig svg {
  position: absolute;
  overflow: visible;
  filter: drop-shadow(0 6px 6px rgba(36, 24, 20, .25));
}
.env__sprig .s1 { width: 100%; right: 0; top: 0; rotate: 16deg; }
.env__sprig .s2 { width: 78%; right: 40%; top: 18%; rotate: -14deg; }
.env__leaves { z-index: 0; left: -6%; bottom: -16%; width: 34%; height: 22%; pointer-events: none; }
.env__leaves svg { position: absolute; overflow: visible; filter: drop-shadow(0 3px 3px rgba(36, 24, 20, .18)); }

/* (the photo-mode reveal still uses this for its own scroll cue) */
@keyframes cue { to { top: 100%; } }

/* ── opening sequence ── */
.is-opening .env { cursor: default; }
.is-opening .hero__head { opacity: 0; translate: 0 -14px; }
.is-opening .seal { animation: none; scale: 1.15; opacity: 0; translate: -50% -12px; }
/* movement and layering are separate animations, so the turn itself runs on the GPU */
.is-opening .env__flap { animation: flapOpen 1s var(--ease-soft) .35s forwards, flapLayer 1s .35s forwards; }
.is-opening .namecard { translate: 0 calc(var(--H) * -.72); }
.is-opening .print--main { translate: 0 calc(var(--H) * -.70); }

@keyframes flapOpen {
  0% { transform: perspective(1400px) rotateX(0deg); }
  100% { transform: perspective(1400px) rotateX(180deg); }
}
@keyframes flapLayer {
  0%, 50% { z-index: 6; }
  51%, 100% { z-index: 1; }
}

/* ═════════════  DETAILS  ═════════════ */

.letter { position: relative; overflow: hidden; }

/* ─── announcement ─── */
.announce {
  max-width: 680px;
  margin: 0 auto;
  padding: max(7vh, 48px) 24px max(5vh, 32px);
  text-align: center;
}
.kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: .34em;
  color: var(--moss);
}
.announce__title {
  margin: .14em 0 .32em;
  font-size: clamp(62px, 17vw, 112px);
}
.announce__names {
  margin: 0;
  font-size: clamp(15px, 4.3vw, 20px);
  letter-spacing: .2em;
  color: var(--ink);
}
.announce__names span { white-space: nowrap; }
.amp-script { font-size: 1.7em; letter-spacing: 0; padding: 0 .2em; line-height: .8; color: var(--walnut); }
@media (max-width: 560px) {
  .announce__names { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .amp-script { padding: 4px 0 0; }
}
.announce__day {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .34em;
  color: var(--moss);
}
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 52px 0 48px;
  color: var(--olive);
}
.ornament span { width: 56px; height: 1px; background: var(--hairline); }
.ornament i { font-style: normal; font-size: 11px; }

.announce__date {
  margin: 0;
  font-size: clamp(21px, 6vw, 27px);
  letter-spacing: .18em;
  color: var(--mahogany);
}
.announce__sketch {
  display: block;
  width: min(100%, 480px);
  height: auto;
  margin: 44px auto 0;
}
.announce__sketch + .announce__venue { margin-top: 18px; }
.announce__venue {
  margin: 40px 0 8px;
  font-style: italic;
  font-size: clamp(22px, 6vw, 28px);
  color: var(--mahogany);
}
.announce__address {
  display: inline-block;
  font-size: 16px;
  color: var(--walnut);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 5px;
  transition: text-decoration-color .3s;
}
.announce__address:hover { text-decoration-color: var(--walnut); }
.announce__follow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 60px 0 0;
  font-size: clamp(15px, 4.2vw, 18px);
  font-weight: 700;
  letter-spacing: .26em;
  color: var(--mahogany);
}
.announce__follow::before,
.announce__follow::after {
  content: "";
  flex: 0 0 clamp(24px, 7vw, 48px);
  height: 1px;
  background: var(--olive);
  opacity: .7;
}

.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(8px, 3vw, 22px);
  margin: 60px 0 0;
}
.countdown div { display: flex; flex-direction: column; align-items: center; min-width: 3ch; }
.countdown span {
  font-weight: 300;
  font-size: clamp(32px, 9.5vw, 50px);
  line-height: 1;
  color: var(--mahogany);
  font-variant-numeric: tabular-nums lining-nums;
}
.countdown small { margin-top: 10px; font-size: 11px; letter-spacing: .2em; color: var(--moss); }
.countdown i {
  font-style: normal;
  font-weight: 300;
  font-size: clamp(26px, 7vw, 40px);
  line-height: 1.1;
  color: var(--olive);
}

.calendar {
  position: relative;
  z-index: 5;
  margin: 40px 0 0;
  font-size: 13px;
  letter-spacing: .2em;
}
.calendar__toggle {
  font: inherit;
  letter-spacing: inherit;
  color: var(--walnut);
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 5px;
}
.calendar__menu {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  translate: -50% 0;
  min-width: 210px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 0 16px 34px -18px rgba(77, 52, 45, .45);
  animation: calMenu .22s var(--ease);
}
@keyframes calMenu { from { opacity: 0; translate: -50% -6px; } }
.calendar__menu a {
  display: block;
  padding: 11px 22px;
  color: var(--walnut);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.calendar__menu a:hover,
.calendar__menu a:focus-visible { background: rgba(221, 204, 183, .35); color: var(--mahogany); outline: none; }
.calendar__menu li + li a { border-top: 1px solid rgba(77, 52, 45, .08); }

/* ─── questions from the host ─── */
.host {
  position: relative;
  padding: max(13vh, 96px) 16px 0;
}

/* two overlapping polaroids + a note, then the reply card */
.duo {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto max(10vh, 72px);
}
.polaroid {
  position: relative;
  padding: 4.2% 4.2% 0;
}
.polaroid img { aspect-ratio: 4 / 5; height: auto; }
.polaroid figcaption {
  padding: .55em 0 .7em;
  text-align: center;
  line-height: 1.1;
  color: var(--mahogany);
  white-space: nowrap;
}
.polaroid--a { z-index: 1; width: 52%; margin-right: -10%; rotate: -4deg; }
.polaroid--a img { object-position: 50% 42%; }
.polaroid--b { z-index: 2; width: 50%; margin-top: 30%; rotate: 3deg; }
.polaroid--b img { object-position: 50% 64%; }
.polaroid__date { font-style: italic; font-size: clamp(17px, 4.6vw, 24px); letter-spacing: .08em; }
.polaroid__note { font-size: clamp(22px, 6vw, 31px); }

.card {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  padding: 10px;
  background: var(--paper);
  box-shadow:
    0 1px 2px rgba(36, 38, 31, .06),
    0 24px 50px -24px rgba(77, 52, 45, .35);
}
.card__inner {
  border: 1px solid var(--hairline);
  padding: 52px clamp(20px, 6vw, 56px) 44px;
}
.card__head { text-align: center; }
.card__head h2 {
  margin: .14em 0 0;
  font-size: clamp(40px, 11vw, 60px);
}

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.q {
  margin: 34px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.q__label {
  display: block;
  padding: 0;
  font-style: italic;
  font-size: 21px;
  line-height: 1.3;
  color: var(--mahogany);
}
.q__label .soft { font-style: italic; opacity: .75; }
.q__num {
  font-family: var(--sc);
  font-style: normal;
  font-size: 16px;
  letter-spacing: .08em;
  color: var(--olive);
  margin-right: .25em;
}
.q__note {
  margin: 10px 0 0;
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  color: var(--walnut);
  text-wrap: pretty;
}
.field {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 2px 9px;
  border: 0;
  border-bottom: 1px solid rgba(77, 52, 45, .24);
  border-radius: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  transition: border-color .3s;
  -webkit-appearance: none;
  appearance: none;
}
.field::placeholder { color: rgba(36, 38, 31, .4); font-style: italic; }
.field:focus { outline: none; border-bottom-color: var(--mahogany); }
.field:focus-visible { outline: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 359px) { .row { grid-template-columns: 1fr; } }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pill { position: relative; cursor: pointer; flex: 1 1 0; max-width: 150px; }
.pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.pill span {
  display: block;
  padding: 10px 14px 11px;
  white-space: nowrap;
  border: 1px solid var(--linen-deep);
  border-radius: 999px;
  text-align: center;
  font-family: var(--sc);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .16em;
  color: var(--mahogany);
  background: rgba(255, 255, 255, .4);
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s;
  user-select: none;
}
.pill:hover span { background: rgba(221, 204, 183, .4); }
.pill input:checked + span {
  background: var(--mahogany);
  border-color: var(--mahogany);
  color: var(--paper);
  box-shadow: 0 6px 14px -8px rgba(77, 52, 45, .7);
}
.pill input:focus-visible + span { outline: 1.5px solid var(--mahogany); outline-offset: 3px; }

@keyframes fadeUp { from { opacity: 0; translate: 0 -6px; } }

.q__error {
  display: none;
  margin: 10px 0 0;
  font-style: italic;
  font-size: 16px;
  color: #8c3d2f;
}
.q.has-error .q__error { display: block; }
.field.is-invalid { border-bottom-color: #a5523f; }

.submit { margin-top: 44px; text-align: center; }
.btn {
  position: relative;
  display: inline-block;
  padding: 17px 30px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--olive);
  color: var(--paper);
  font-family: var(--sc);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .14em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(77, 52, 45, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: background-color .35s, translate .35s var(--ease), box-shadow .35s;
}
.btn:hover { background: var(--moss); translate: 0 -1px; }
.btn:active { translate: 0 1px; }
.btn[disabled] { cursor: progress; opacity: .8; }
.submit__error { margin: 14px 0 0; font-style: italic; font-size: 16px; color: #8c3d2f; }

/* after sending, the card shows only the thank-you, centred */
.card:has(.thanks:not([hidden])) .card__head { display: none; }
.thanks { text-align: center; padding: 20px 0 28px; animation: fadeUp .8s var(--ease); }
.thanks:focus { outline: none; }
.thanks__title { margin: 0; font-size: clamp(50px, 13vw, 66px); }
.thanks__text { margin: 10px auto 0; max-width: 30ch; font-style: italic; font-size: 20px; color: var(--walnut); }
.link {
  margin-top: 26px;
  padding: 4px;
  border: 0;
  background: none;
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--moss);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 5px;
}

/* ─── farewell + closing ─── */
.farewell {
  margin: 0;
  padding: max(8vh, 56px) 24px max(7vh, 48px);
  text-align: center;
  font-size: clamp(16px, 4.4vw, 19px);
  letter-spacing: .26em;
  color: var(--moss);
}

.closing {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  color: var(--paper);
  text-align: center;
}
@supports (height: 1svh) { .closing { min-height: 92svh; } }
.closing__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 80%;
}
.closing__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(36, 38, 31, .66) 0%, rgba(42, 40, 33, .42) 36%, rgba(42, 40, 33, .08) 62%, rgba(36, 38, 31, .38) 100%);
}
.closing__content {
  position: relative;
  padding: max(11vh, 72px) 24px 40px;
  text-shadow: 0 1px 12px rgba(36, 38, 31, .35);
}
.crest {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
}
.crest__wreath { position: absolute; inset: 0; color: rgba(251, 248, 243, .82); }
.crest__wreath svg { width: 100%; height: 100%; overflow: visible; }
.crest__mono {
  position: relative;
  font-size: 54px;
  color: var(--paper);
  line-height: 1;
  padding-top: 6px;
}
.crest__mono i { font-style: normal; font-size: .6em; padding: 0 .06em; opacity: .85; }
.closing__line { margin: 0; font-size: 17px; letter-spacing: .3em; }
.closing__date { margin: 10px 0 0; font-size: 13px; letter-spacing: .26em; opacity: .9; }
.closing__site {
  display: inline-block;
  margin-top: 26px;
  font-size: 13px;
  letter-spacing: .24em;
  color: var(--paper);
  text-underline-offset: 6px;
}

/* ─── scroll reveals ─── */
[data-reveal] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 1.1s var(--ease), translate 1.1s var(--ease);
}
[data-reveal].is-visible { opacity: 1; translate: 0 0; }

/* ─── larger screens ─── */
@media (min-width: 760px) {
  body { font-size: 20px; }
  .closing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    background: #3b3b2f;
  }
  .closing__photo {
    position: relative;
    min-height: 100vh;
    object-position: 50% 88%;
  }
  .closing__veil { display: none; }
  .closing__content {
    align-self: center;
    padding: 60px 40px;
  }
  .crest { width: 190px; height: 190px; }
  .crest__mono { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}

@media (max-width: 560px) {
  .announce__follow { display: block; letter-spacing: .22em; text-wrap: balance; }
  .announce__follow::before,
  .announce__follow::after { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   OPENING STYLE
   config.js → openStyle: "cards" (envelope + cards, the original)
                          "photo" (envelope opens into the lake photo)
   Try either without editing: add ?open=cards or ?open=photo to the link.
   ═══════════════════════════════════════════════════════════ */
.reveal, .lettercard { display: none; }
.mode-photo .namecard,
.mode-photo .print--main { display: none; }

/* the card that rises out of the envelope */
.mode-photo .lettercard {
  display: flex;
  z-index: 2;
  left: 23%;
  top: 7%;
  width: 54%;
  aspect-ratio: .92;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--W) * .055);
  background-color: #F8F3EA;
  outline: 1px solid var(--hairline);
  outline-offset: calc(var(--W) * -.014);
  box-shadow: 0 1px 2px rgba(36, 24, 20, .1), 0 14px 30px -12px rgba(36, 24, 20, .5);
  transition: top 1.3s var(--ease) 1.05s;
}
.crest--card { width: calc(var(--W) * .3); height: calc(var(--W) * .3); margin: 0; }
.crest--card .crest__wreath { color: var(--moss); }
.crest--card .crest__mono { font-size: calc(var(--W) * .095); color: var(--mahogany); }
.lettercard__date {
  margin: calc(var(--W) * .035) 0 0;
  font-size: max(9px, calc(var(--W) * .024));
  letter-spacing: .3em;
  color: var(--moss);
}
.mode-photo.is-opening .lettercard { top: -52%; }

/* the photo: fixed over the screen while it opens out of the card… */
.mode-photo .reveal {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  min-height: 0;
  visibility: hidden;
  background: #3b3b2f;
}
.mode-photo .reveal.is-expanding { visibility: visible; }
.reveal .closing__photo { scale: 1.14; transition: scale 2.6s var(--ease-soft); }
.reveal.is-expanding .closing__photo { scale: 1; }
.reveal .closing__veil { opacity: 0; transition: opacity 1.2s var(--ease) .5s; }
.reveal .closing__content > * { opacity: 0; translate: 0 14px; transition: opacity 1.1s var(--ease), translate 1.1s var(--ease); }
.reveal.is-expanding .closing__veil { opacity: 1; }
.reveal.is-expanding .closing__content > * { opacity: 1; translate: 0 0; }
.reveal.is-expanding .crest { transition-delay: .75s; }
.reveal.is-expanding .closing__line { transition-delay: 1.05s; }
.reveal.is-expanding .closing__date { transition-delay: 1.25s; }

/* …then it settles into the top of the page and guests scroll on */
.mode-photo.is-open .hero { display: none; }
.mode-photo.is-open .reveal {
  position: relative;
  inset: auto;
  z-index: auto;
  height: 100vh;
}
@supports (height: 1svh) { .mode-photo.is-open .reveal { height: 100svh; } }
.reveal .closing__content { padding-top: max(13vh, 80px); }

.reveal__cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  width: 1px;
  height: 52px;
  overflow: hidden;
  background: rgba(251, 248, 243, .35);
  opacity: 0;
  transition: opacity 1s var(--ease) 2s;
}
.reveal__cue span {
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: var(--paper);
  animation: cue 2.2s var(--ease-soft) infinite;
}
.reveal.is-expanding .reveal__cue { opacity: 1; }

/* the opening photo stays full-bleed on big screens too */
@media (min-width: 760px) {
  .mode-photo .reveal.closing { display: block; }
  .reveal .closing__photo { position: absolute; min-height: 0; object-position: 50% 66%; }
  .reveal .closing__veil { display: block; }
  .reveal .closing__content { padding: max(14vh, 96px) 40px 40px; }
}

/* photo mode, phones: the crest already opened the page, so the footer keeps it simple */
@media (max-width: 759px) {
  .mode-photo footer.closing { display: flex; flex-direction: column; justify-content: flex-end; }
  .mode-photo footer.closing .crest { display: none; }
  .mode-photo footer.closing .closing__veil {
    background: linear-gradient(180deg, rgba(36, 38, 31, 0) 55%, rgba(36, 38, 31, .62) 100%);
  }
  .mode-photo footer.closing .closing__content { padding: 0 24px max(6vh, 40px); }
}

/* photo mode, big screens: larger crest + a soft shade behind the words */
@media (min-width: 760px) {
  .reveal .closing__veil {
    background:
      radial-gradient(ellipse 46% 42% at 50% 30%, rgba(36, 38, 31, .42), rgba(36, 38, 31, 0) 70%),
      linear-gradient(180deg, rgba(36, 38, 31, .5) 0%, rgba(36, 38, 31, .12) 45%, rgba(36, 38, 31, .08) 75%, rgba(36, 38, 31, .3) 100%);
  }
  .reveal .crest { width: 220px; height: 220px; }
  .reveal .crest__mono { font-size: 70px; }
  .reveal .closing__line { font-size: 21px; }
  .reveal .closing__date { font-size: 15px; margin-top: 14px; }
}


/* ═══ square "Save the Date" card + extra vines (appear once the envelope opens) ═══ */
.sdcard {
  /* same layer as the pocket but earlier in the page, so it sits behind it while tucked in */
  z-index: 4;
  left: 9%;
  top: 30%;
  width: 45%;
  aspect-ratio: 1;
  rotate: 0deg;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(36, 24, 20, .14)) drop-shadow(0 14px 18px rgba(36, 24, 20, .32));
}
.sdcard__lace, .sdcard__lace svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sdcard__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--mahogany);
}
.sdcard__text p { margin: 0; }
.sdcard__title { font-size: calc(var(--W) * .078); line-height: .98; rotate: -4deg; }
.sdcard__date { margin-top: .6em !important; font-size: max(10px, calc(var(--W) * .036)); letter-spacing: .16em; }

.sdsprig { z-index: 6; left: -9%; top: 56%; width: 34%; aspect-ratio: 1.6; pointer-events: none; opacity: 0; transition: opacity 1s var(--ease) 3s; }
.env__cascade { z-index: 8; right: -7%; top: 6%; width: 22%; height: 118%; pointer-events: none; opacity: 0; translate: 0 -4%; transition: opacity 1.1s var(--ease) 2s, translate 1.4s var(--ease) 2s; }
.sdsprig svg, .env__cascade svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 5px rgba(36, 24, 20, .24)); }

.is-opening .sdcard { animation: sdOut 1.9s 1.45s forwards, sdLayer 1.9s 1.45s forwards; }
/* slides up out of the envelope, then is laid down in front of it
   (movement and layering are separate animations, so the movement runs on the GPU) */
@keyframes sdOut {
  0%   { translate: 0 0;                     rotate: 0deg;  scale: 1;    animation-timing-function: cubic-bezier(.3, .6, .35, 1); }
  48%  { translate: 0 calc(var(--H) * -.70); rotate: -4deg; scale: 1.04; animation-timing-function: cubic-bezier(.45, 0, .25, 1); }
  100% { translate: 0 calc(var(--H) * -.08); rotate: -7deg; scale: 1; }
}
@keyframes sdLayer {
  0%, 48% { z-index: 4; }
  49%, 100% { z-index: 7; }
}
.is-opening .sdsprig { opacity: 1; }
.is-opening .env__cascade { opacity: 1; translate: 0 0; }
.mode-photo .sdcard, .mode-photo .sdsprig, .mode-photo .env__cascade { display: none; }

/* subtle "click to open" under the sealed envelope */
.hero__hint {
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 8%;
  margin: 0;
  text-align: center;
  font-size: max(10px, calc(var(--W) * .021));
  letter-spacing: .32em;
  color: var(--linen);
  animation: hint 3.6s ease-in-out 1.2s infinite both;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.hint--tap { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint--click { display: none; }
  .hint--tap { display: inline; }
}
@keyframes hint { 0%, 100% { opacity: .45; } 50% { opacity: .85; } }
.is-opening .hero__hint { animation: none; opacity: 0; }

/* tucked-in pieces sit straight so no corner pokes out past the closed envelope; they tilt as they rise */
.namecard, .print--main { rotate: 0deg; }
.is-opening .namecard { rotate: 4deg; }
.is-opening .print--main { rotate: -5deg; }
.namecard { transition: translate 1.25s var(--ease) 1.1s, rotate 1.25s var(--ease) 1.1s; }
.print--main { transition: translate 1.25s var(--ease) 1.3s, rotate 1.25s var(--ease) 1.3s; }
/* give the moving pieces their own GPU layers up front, so their shadows are drawn once, not every frame */
.namecard, .print--main, .sdcard, .env__flap, .seal { will-change: transform; }
body:not(.is-sealed) .namecard, body:not(.is-sealed) .print--main, body:not(.is-sealed) .sdcard,
body:not(.is-sealed) .env__flap, body:not(.is-sealed) .seal { will-change: auto; }
