/* Dee & Steve: the inside of the envelope. Silent luxury: one velvet, tone-on-tone roses that warm to gold, fine gold lines,
   ivory paper, blush wax. Nothing shouts: richness comes from the materials, not from effects. */
@property --g { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
:root {
  --wine: #2C050B; --wine-2: #3A0710; --ink: #F3E8D8; --ink-soft: #DCC8B2; --gold: #C9A15C; --gold-lt: #E9D2A2;
  --paper: #F6EEDF; --paper-ink: #4A0B15; --paper-soft: #7A4A47; --line: rgba(201, 161, 92, .42); --blush: #E8B9A4;
  --gloss: linear-gradient(104deg, #C99A52 0%, #EBCB8C 26%, #F7E6BC 46%, #DDB873 68%, #EFD39A 86%, #C99A52 100%);
  --name: 'Pinyon Script', 'Snell Roundhand', cursive;
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --label: 'Jost', 'Avenir Next', Helvetica, sans-serif;
  --pad: clamp(22px, 6vw, 80px); --nav-h: 64px;
  --t-label: clamp(12px, .92vw, 13.5px); --t-small: 18px; --t-body: clamp(20px, 1.45vw, 23px); --track: .3em;
  --bg: var(--wine); --fg: var(--ink); --accent: var(--gold); --muted: rgba(220, 200, 178, .7);
}
* { box-sizing: border-box; }
html { background: var(--wine); color: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wine); color: var(--ink); font-family: var(--serif); font-size: var(--t-body); font-weight: 500; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; font-variant-numeric: lining-nums; }
/* one velvet behind everything, on its own fixed layer */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: url(images/velvet-phone.webp) center / cover; }
@media (min-aspect-ratio: 1/1) { body::before { background-image: url(images/velvet-desk.webp); } }
body.locked { overflow: hidden; height: 100svh; }
a { color: inherit; } img { display: block; max-width: 100%; } button { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--wine); }
main { position: relative; z-index: 1; overflow: hidden; }
h1, h2, h3, .send { text-wrap: balance; } p, dd { text-wrap: pretty; }
section { position: relative; padding: clamp(84px, 13vh, 150px) var(--pad); scroll-margin-top: calc(var(--nav-h) - 1px); }

/* ---------- type ---------- */
.caps { font-family: var(--label); text-transform: uppercase; letter-spacing: var(--track); font-size: var(--t-label); font-weight: 400; color: var(--gold-lt); }
.name { font-family: var(--name); font-weight: 400; background: var(--gloss); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding: .22em .34em; margin: -.22em -.34em; display: inline-block; }
.amp { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: .62em; margin: 0 .08em; }
.title { font-family: var(--serif); font-style: italic; font-weight: 300; color: var(--ink); line-height: 1.12; margin: 0; letter-spacing: .005em; }
.hair { display: block; width: 56px; height: 1px; margin: 22px auto 0; background: var(--gold); }
.sec-head { text-align: center; margin: 0 auto clamp(44px, 8vh, 80px); }
.sec-head .kicker { margin: 0 0 12px; }
.sec-head .title { font-size: clamp(46px, 5.6vw, 76px); }
.sec-head .sub { margin: 14px 0 0; font-style: italic; }

/* ---------- reveals ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 1.3s ease, transform 1.5s cubic-bezier(.2, .7, .1, 1); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- nav ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad);
  background: linear-gradient(rgba(30, 3, 8, .82), rgba(30, 3, 8, 0)); opacity: 0; transform: translateY(-100%); transition: opacity 1s ease 1.2s, transform 1s ease 1.2s; }
.opened .nav { opacity: 1; transform: none; }
.nav .mono { font-family: var(--name); font-size: 32px; line-height: 1; text-decoration: none; color: var(--gold-lt); }
.nav nav { display: flex; align-items: center; gap: clamp(16px, 2.8vw, 40px); }
.nav nav a { text-decoration: none; font-family: var(--label); font-size: var(--t-label); letter-spacing: .24em; text-transform: uppercase; font-weight: 400; color: var(--ink); padding-block: 12px; }
.nav nav a:not(.pill) { background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px; transition: background-size .5s ease; }
.nav nav a:not(.pill):hover { background-size: 100% 1px; }
.pill { border: 1px solid var(--gold); padding: 9px 16px 8px !important; transition: background .3s, color .3s; }
.pill:hover { background: var(--gold); color: var(--wine) !important; }
.music[hidden] { display: none; }
.music { background: none; border: 0; display: flex; gap: 2px; align-items: flex-end; height: 16px; padding: 0; cursor: pointer; }
.music span { width: 2px; height: 5px; background: var(--gold); transition: height .3s; }
.music.on span { animation: eq 1s ease-in-out infinite; }
.music.on span:nth-child(2) { animation-delay: .2s; } .music.on span:nth-child(3) { animation-delay: .45s; }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 15px } }
@media (max-width: 640px) { .nav nav a:not(.pill) { display: none; } }

/* ---------- the roses: dark velvet, warming to gold from the edges in ---------- */
.roses-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* Sized from the screen's width, not its height: a phone's bars shorten the page, and the roses must still clear the names. */
.roses-bg i { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; background-size: auto max(124%, 263vw); }
@media (max-aspect-ratio: 1/1) and (min-width: 600px) { .roses-bg i { background-size: auto max(124%, 179vw); } }
.roses-bg .dark { background-image: url(images/hero-phone.webp); }
.roses-bg .gold { opacity: .86; background-image: url(images/hero-phone-gold.webp);
  -webkit-mask-image: radial-gradient(ellipse 72% 80% at 50% 48%, transparent calc(112% - var(--g) * 1.12), #000 calc(140% - var(--g) * 1.12));
  mask-image: radial-gradient(ellipse 72% 80% at 50% 48%, transparent calc(112% - var(--g) * 1.12), #000 calc(140% - var(--g) * 1.12)); }
@media (min-aspect-ratio: 1/1) {
  .roses-bg i { background-size: cover; }
  .roses-bg .dark { background-image: url(images/hero-desk.webp); }
  .roses-bg .gold { background-image: url(images/hero-desk-gold.webp); }
}
.gilded .roses-bg .gold, .still .roses-bg .gold { --g: 100%; }
.moving .gilded .roses-bg .gold { animation: gild 3.6s cubic-bezier(.35, 0, .2, 1) .35s both; }
@keyframes gild { from { --g: 0% } to { --g: 100% } }

/* ---------- hero ---------- */
/* The picture melts away before it ends, so only the page's velvet meets the next section: no edge, whatever the screen. */
.roses-bg { -webkit-mask-image: var(--melt); mask-image: var(--melt); }
#hero .roses-bg { --melt: linear-gradient(180deg, transparent 0, rgba(0,0,0,.4) 2.5%, rgba(0,0,0,.85) 5.5%, #000 8%, #000 64%, rgba(0,0,0,.94) 69%, rgba(0,0,0,.8) 75%, rgba(0,0,0,.56) 81%, rgba(0,0,0,.31) 87%, rgba(0,0,0,.13) 92%, rgba(0,0,0,.04) 96.5%, transparent 100%); }
#closing .roses-bg { --melt: linear-gradient(180deg, transparent 0, rgba(0,0,0,.04) 3.5%, rgba(0,0,0,.13) 8%, rgba(0,0,0,.31) 13%, rgba(0,0,0,.56) 19%, rgba(0,0,0,.8) 25%, rgba(0,0,0,.94) 31%, #000 36%, #000 84%, rgba(0,0,0,.72) 90%, rgba(0,0,0,.28) 96%, transparent 100%); }

#hero { min-height: 100svh; display: grid; place-items: center; padding: calc(var(--nav-h) + 8px) var(--pad) 64px; }
.hero-in { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: min(1000px, 66vw); }
.eyebrow { margin: 0 0 clamp(16px, 3vh, 30px); }
.names { margin: 0; font-weight: 400; display: flex; flex-direction: column; align-items: center; }
.names .name { font-size: clamp(40px, 4.9vw, 76px); line-height: 1.16; white-space: nowrap; }
.names i { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(22px, 2.2vw, 32px); color: var(--gold-lt); line-height: 1.5; }
.pb { display: none; }
.rule .hair { margin: clamp(20px, 3.4vh, 34px) auto clamp(18px, 3vh, 28px); }
.hero-date { margin: 0; color: var(--ink); letter-spacing: .24em; }
.hero-date i { font-style: normal; color: var(--gold); margin: 0 .2em; }
.hero-place { margin: 6px 0 0; color: var(--ink-soft); font-size: var(--t-small); }
.invite-line { margin: 4px 0 0; font-style: italic; color: var(--gold-lt); font-size: var(--t-small); }
.countdown { display: flex; gap: clamp(26px, 4vw, 54px); margin-top: clamp(20px, 3.4vh, 34px); }
.countdown div { display: flex; flex-direction: column; align-items: center; }
.countdown b { font-family: var(--serif); font-weight: 300; font-size: clamp(38px, 3.6vw, 52px); line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { font-size: 10.5px; letter-spacing: .26em; margin-top: 8px; color: var(--ink-soft); }
.scroll-cue { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; }
.scroll-cue span { font-size: 10.5px; color: var(--ink-soft); }
.scroll-cue i { width: 1px; height: 26px; background: linear-gradient(var(--gold), transparent); animation: drip 2.6s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top } 50% { transform: scaleY(1); transform-origin: top } 51% { transform-origin: bottom } 100% { transform: scaleY(0); transform-origin: bottom } }
@media (max-aspect-ratio: 1/1) {
  .pb { display: inline; }
  .names .name { font-size: clamp(34px, 10.6vw, 58px); line-height: 1.1; white-space: nowrap; }
  .names i { font-size: 22px; line-height: 1.7; }
  .hero-date { font-size: 11.5px; letter-spacing: .2em; line-height: 1.9; }
  .hero-date span { display: block; } .hero-date i { display: none; }
  .hero-in { max-width: 72vw; }
}
@media (max-aspect-ratio: 1/1) and (min-width: 600px) { .names .name { font-size: min(58px, 7.2vw); } }
@media (max-height: 600px) { .scroll-cue { display: none; } }

/* ---------- paper ---------- */
.paper { position: relative; color: var(--paper-ink); background: url(images/paper.webp) center / cover, var(--paper); box-shadow: 0 40px 80px rgba(8, 0, 2, .55), 0 2px 6px rgba(8, 0, 2, .4); }
.paper .title { color: var(--paper-ink); }
.paper .caps { color: var(--paper-soft); }
.paper .name { background: none; color: var(--paper-ink); -webkit-text-fill-color: var(--paper-ink); }
.seal { position: absolute; z-index: 4; filter: drop-shadow(0 8px 12px rgba(30, 5, 8, .4)); }

/* ---------- the letter ---------- */
.letter-wrap { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.couple { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.couple-line { width: min(100%, 420px); filter: brightness(1.2) saturate(.85); }
.letter { padding: clamp(44px, 6vw, 84px) clamp(30px, 5.4vw, 80px) clamp(70px, 7vw, 96px); margin-bottom: 40px; }
.letter .title { font-size: clamp(40px, 4.2vw, 58px); margin: 0 0 22px; }
.letter p { margin: 0 0 16px; }
.letter .sign { margin: 26px 0 0; display: flex; flex-direction: column; align-items: flex-start; }
.letter .sign em { color: var(--paper-soft); }
.letter .sign .name { font-size: clamp(46px, 4.6vw, 62px); line-height: 1.1; }
.seal.small { width: clamp(92px, 9vw, 120px); left: 50%; bottom: 0; translate: -50% 50%; }
@media (max-width: 899px) { .letter-wrap { grid-template-columns: 1fr; } .couple-line { width: min(82%, 340px); } }

/* ---------- ceremonies: a printed programme ---------- */
.city-group { max-width: 900px; margin: 0 auto clamp(56px, 9vh, 96px); }
.city { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 26px; text-align: center; }
.city .title { font-size: clamp(36px, 3.6vw, 50px); }
.events { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 124px minmax(0, 1fr); column-gap: clamp(22px, 4vw, 52px); align-items: start; padding: clamp(30px, 5vh, 44px) 0; border-top: 1px solid var(--line); }
.event:last-child { border-bottom: 1px solid var(--line); }
.wax { grid-row: 1 / span 5; width: 112px; filter: drop-shadow(0 8px 12px rgba(10, 0, 2, .55)); }
.event .title { grid-column: 2; font-size: clamp(36px, 3.3vw, 46px); }
.when { grid-column: 2; margin: 10px 0 12px; color: var(--gold-lt); letter-spacing: .16em; line-height: 1.8; }
.when b { font-weight: 400; color: var(--ink); letter-spacing: .16em; margin-left: .9em; }
.where { grid-column: 2; margin: 0; display: flex; flex-direction: column; }
.where b { font-weight: 600; color: var(--ink); line-height: 1.3; text-wrap: balance; }
.where em { color: var(--ink-soft); font-size: var(--t-small); }
.desc { grid-column: 2; margin: 8px 0 0; color: var(--ink-soft); line-height: 1.45; font-size: var(--t-small); font-style: italic; }
.ev-actions { grid-column: 2; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 26px; align-items: center; }
.dir, .cal summary { font-size: 11px; letter-spacing: .22em; text-decoration: none; cursor: pointer; padding: 6px 0 4px; border-bottom: 1px solid var(--gold); list-style: none; transition: color .3s; }
.dir:hover, .cal summary:hover { color: var(--ink); }
.cal summary::-webkit-details-marker { display: none; }
.cal { position: relative; }
.cal > div { position: absolute; z-index: 5; top: 34px; left: 0; display: flex; flex-direction: column; background: var(--wine); border: 1px solid var(--gold); padding: 8px 14px; white-space: nowrap; }
.cal > div a { padding: 6px 0; text-decoration: none; font-size: var(--t-small); }
@media (max-width: 640px) {
  .event { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .wax { grid-row: auto; width: 96px; margin-bottom: 14px; }
  .event .title, .when, .where, .desc, .ev-actions { grid-column: 1; }
  .when b { display: block; margin: 0; }
  .ev-actions { justify-content: center; }
  .cal > div { left: 50%; transform: translateX(-50%); }
}

/* ---------- travel ---------- */
.facts { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(36px, 6vw, 84px); }
.facts > div { padding: 24px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--gold-lt); }
.facts dd { margin: 8px 0 0; color: var(--ink); line-height: 1.5; }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; } }

/* ---------- rsvp ---------- */
.rsvp-card { max-width: 720px; margin: 70px auto 0; padding: clamp(84px, 10vw, 108px) clamp(26px, 6vw, 72px) clamp(44px, 6vw, 64px); }
.rsvp-card > .seal { left: 50%; top: 0; width: clamp(116px, 13vw, 148px); translate: -50% -50%; }
.rsvp-card .sec-head { margin-bottom: 38px; }
.rsvp-card .sec-head .title { font-size: clamp(40px, 4.8vw, 62px); }
.rsvp-card .hair { background: var(--paper-soft); opacity: .55; }
.rsvp-card .sec-head .sub { color: var(--paper-soft); }
.field { display: block; margin: 0 0 24px; border: 0; padding: 0; }
.field .caps, .field legend { display: block; margin-bottom: 10px; padding: 0; }
.field i { text-transform: none; font-family: var(--serif); letter-spacing: 0; font-size: 17px; font-weight: 500; }
input:not([type]), input[name="guestName"], textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px solid rgba(74, 11, 21, .45); color: var(--paper-ink);
  font: inherit; padding: 8px 2px; outline: none; border-radius: 0; transition: border-color .3s; }
input:focus, textarea:focus { border-bottom-color: var(--paper-ink); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(74, 11, 21, .55); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:not(.wide) { display: grid; grid-template-columns: repeat(6, minmax(0, 56px)); }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chips span { display: block; text-align: center; padding: 7px 14px 6px; border: 1px solid rgba(74, 11, 21, .4); font-size: 19px; color: var(--paper-ink); transition: background .25s, color .25s, border-color .25s; }
.chips:not(.wide) span { padding-inline: 0; }
.chips label:hover span { border-color: var(--paper-ink); }
.chips input:checked + span { background: var(--paper-ink); color: var(--paper); border-color: var(--paper-ink); }
.chips input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.send { width: 100%; margin-top: 10px; padding: 17px 14px; border: 0; background: var(--paper-ink); color: var(--paper); font-family: var(--label); font-weight: 400; letter-spacing: .24em; text-transform: uppercase; font-size: 12px; line-height: 1.6; cursor: pointer; transition: background .3s; }
.send:hover { background: #6E1422; }
.fine { text-align: center; color: var(--paper-soft); font-size: 17px; font-style: italic; }
.thanks { display: none; text-align: center; }
.thanks h3 { font-size: 56px; }
.rsvp-card.sent form { display: none; } .rsvp-card.sent .thanks { display: block; }
.thanks .via-sheet { display: none; } .rsvp-card.saved .thanks .via-sheet { display: block; } .rsvp-card.saved .thanks .via-wa { display: none; }
.ghost { background: none; border: 1px solid var(--gold); color: var(--ink); padding: 13px 24px 12px; font-family: var(--label); font-size: var(--t-label); letter-spacing: .24em; text-transform: uppercase; cursor: pointer; transition: background .3s, color .3s; }
.ghost:hover { background: var(--gold); color: var(--wine); }
.paper .ghost { color: var(--paper-ink); border-color: var(--paper-ink); }

/* ---------- closing ---------- */
#closing { text-align: center; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#closing > :not(.roses-bg) { position: relative; z-index: 2; }
#closing .big { font-size: clamp(46px, 6.6vw, 100px); max-width: 15ch; }
#closing .hair { margin-top: 28px; }
.tag { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 30px 0 26px; }
.tag b { font-style: italic; font-weight: 400; color: var(--gold-lt); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; }
#closing footer { margin-top: clamp(44px, 8vh, 84px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
#closing footer .name { font-size: clamp(40px, 3.6vw, 54px); line-height: 1.1; }
@media (max-aspect-ratio: 1/1) { #closing > :not(.roses-bg) { max-width: 70vw; } #closing footer .caps { font-size: 10.5px; letter-spacing: .22em; } }

/* ---------- gallery ("Moments") ---------- */
#gallery { padding-inline: 0; }
#gallery .sec-head { padding-inline: var(--pad); margin-bottom: clamp(32px, 6vh, 60px); }
.carousel { position: relative; --w: min(76vw, 440px, 58svh); }
.track {
  display: flex; gap: clamp(14px, 2vw, 26px); overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 14px calc(50% - var(--w) / 2) 30px; scrollbar-width: none; overscroll-behavior-x: contain; outline: none;
}
.track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 var(--w); aspect-ratio: 4 / 5; max-width: 100%; scroll-snap-align: center; padding: 0; border: 0;
  background: rgba(243, 232, 216, .06); cursor: pointer; overflow: hidden;
  transform: scale(.88); opacity: .42; transition: transform .7s cubic-bezier(.2,.7,.1,1), opacity .7s ease, box-shadow .7s ease;
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide.on { transform: none; opacity: 1; box-shadow: 0 28px 60px rgba(0, 0, 0, .35); cursor: zoom-in; }
.slide:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.gal-nav, .lb-nav {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent); background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--fg); transition: border-color .3s, background .3s;
}
.gal-nav { position: absolute; top: calc(50% - 8px); transform: translateY(-50%); backdrop-filter: blur(6px); }
.gal-nav:hover, .lb-nav:hover { border-color: var(--accent); }
.gal-nav svg, .lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gal-nav.prev { left: max(12px, calc(50% - var(--w) / 2 - 80px)); }
.gal-nav.next { right: max(12px, calc(50% - var(--w) / 2 - 80px)); }
.gal-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 8px; padding-inline: var(--pad); }
.gal-count { font-family: var(--capsf); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .14em; font-size: var(--t-label); color: var(--soft); }
.gal-count b { color: var(--fg); font-weight: 500; }
.gal-bar { width: 110px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.gal-bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .6s ease; }
.gal-cap { font-style: italic; color: var(--gold-lt); min-width: 7em; }
.single .gal-nav, .single .gal-bar { display: none; }
@media (max-width: 700px) { .gal-nav { display: none; } .gal-cap { min-width: 0; } }

.lightbox {
  position: fixed; inset: 0; z-index: 70; background: rgba(9, 13, 23, .95); display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 14px; padding: max(64px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; height: 100%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 44px); object-fit: contain; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #e7dccb; font-style: italic; }
.lightbox .lb-nav { color: #f2ece2; border-color: rgba(242, 236, 226, .3); background: transparent; }
.lb-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(242, 236, 226, .3); background: transparent; color: #f2ece2; font-size: 26px; line-height: 1; cursor: pointer;
}
.lb-close:focus-visible, .lb-nav:focus-visible, .gal-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.lb-open { overflow: hidden; }
@media (max-width: 700px) { .lightbox { grid-template-columns: minmax(0, 1fr); } .lightbox .lb-nav { display: none; } }


/* ---------- opening envelope: a still until the tap, then the film ---------- */
#envelope {
  position: fixed; inset: 0; z-index: 50; background: radial-gradient(ellipse at 50% 45%, #5A0912, #26030A 72%); color: #F6E6D0; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center; transition: opacity 1.1s ease, visibility 1.1s;
  -webkit-tap-highlight-color: transparent; outline: none;
}
/* once the page is behind the light, the flash adds light instead of veiling it, so colours stay rich as it fades */
#envelope.gone { opacity: 0; visibility: hidden; pointer-events: none; background: none; mix-blend-mode: screen; transition: opacity 1.15s cubic-bezier(.3, 0, .5, 1), visibility 1.15s; }
#envelope.gone .env-stage { visibility: hidden; }
.env-stage { position: relative; width: 100%; height: 100%; }
#env-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* wider than a phone: the envelope keeps its shape in the middle of a wine glow */
@media (min-aspect-ratio: 3/4) {
  .env-stage { width: auto; aspect-ratio: 9 / 16; box-shadow: 0 0 90px rgba(0,0,0,.6); }
}
.env-to { position: absolute; left: 0; right: 0; top: 15%; margin: 0; padding: 0 12%; text-align: center; font-size: clamp(30px, 4.6vh, 46px); line-height: 1.15; transition: opacity .5s ease; background: none; color: var(--gold-lt); -webkit-text-fill-color: var(--gold-lt); display: block; margin: 0; }
.env-tap { position: absolute; left: 0; right: 0; bottom: 13%; text-align: center; z-index: 3; font-size: 14px; letter-spacing: .3em; color: #FBEBC8; text-shadow: 0 1px 4px rgba(20,0,4,.85); opacity: 0; }
#envelope.ready .env-tap { opacity: 1; animation: tapin .6s ease both, tappulse 2.6s ease-in-out .6s infinite; }
@keyframes tapin { from { opacity: 0 } to { opacity: 1 } }
@keyframes tappulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
/* the join between film and page: the burst blooms until it fills the screen, the page swaps in behind it, the glow fades */
.env-flash { position: absolute; left: 50%; top: 46%; width: 320vmax; height: 320vmax; z-index: 4; pointer-events: none; border-radius: 50%; opacity: 0;
  transform: translate(-50%, -50%) scale(.04);
  background: radial-gradient(closest-side, #FFFDF4 0%, #FFF3CF 42%, #FFE29C 60%, rgba(250,196,104,.9) 72%, rgba(240,170,70,0) 100%); }
.env-flash::after { content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .32s ease-out;
  background: radial-gradient(closest-side, #FFD58A 0%, #F8B955 55%, #EE9E3A 72%, rgba(232, 150, 50, 0) 100%); }
#envelope.gone .env-flash::after { opacity: 1; }   /* the light warms to amber as it fades, so nothing goes milky */
#envelope.flash .env-flash { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: transform .62s cubic-bezier(.55,0,.75,.35), opacity .16s linear; }
#envelope.opening .env-to, #envelope.opening .env-tap, #envelope.opening .sound { opacity: 0; animation: none; transition: opacity .5s; }
/* tapped, but the film needs a moment: say so, rather than leave the envelope looking dead */
#envelope.opening.waiting .env-tap { opacity: 1; animation: tappulse 1.6s ease-in-out infinite; }
.sound { position: absolute; top: max(18px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(236, 233, 225, .25); background: rgba(255, 255, 255, .04); color: #ece9e1; display: grid; place-items: center; cursor: pointer; transition: opacity .4s; }
.sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound svg path:first-child { fill: currentColor; stroke: none; }
.sound[hidden] { display: none; }
.sound .x { display: none; }
.sound.off .x { display: inline; }
.sound.off .w1, .sound.off .w2 { display: none; }



/* ---------- motion (page/motion.js adds .moving once the envelope opens): slow, few, and nothing changes size ---------- */
/* the names write themselves, like the lettering on the seal */
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 110%; }
.moving .write { --p: -14%; -webkit-mask-image: linear-gradient(90deg, #000 var(--p), transparent calc(var(--p) + 14%)); mask-image: linear-gradient(90deg, #000 var(--p), transparent calc(var(--p) + 14%)); }
.moving .write.go { animation: write 2.2s cubic-bezier(.45, .05, .25, 1) var(--delay, 0ms) forwards; }
@keyframes write { to { --p: 110%; } }
.moving .names i { opacity: 0; transition: opacity 1.2s ease 1.5s; }
.moving .names.in i { opacity: 1; }
/* labels settle in softly */
.moving .settle { opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease var(--hd, 0s), transform 1.4s cubic-bezier(.2, .7, .1, 1) var(--hd, 0s); }
.moving .settle.go { opacity: 1; transform: none; }
/* gold lines draw from the centre */
.moving .hair { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.3, .7, .2, 1) .3s; }
.moving .in > .hair, .moving .hair.in { transform: none; }
.moving .rule.in .hair { transition-delay: var(--hd, .3s); }
/* wax presses down onto the page */
.moving .wax, .moving .seal { opacity: 0; scale: 1.28; transition: opacity .7s ease, scale .9s cubic-bezier(.3, 1.3, .5, 1); }
.moving .wax.go, .moving .seal.go { opacity: 1; scale: 1; }
/* the hero waits for the light to clear, then arrives in order */
html:not(.opened) .hero-in > [data-reveal] { opacity: 0; }
.hero-in > [data-reveal] { transition-delay: var(--hd, 0s); }
.hero-in > .eyebrow { --hd: .5s; } .hero-in > .names { --hd: .5s; } .hero-in > .rule { --hd: 2.2s; } .hero-in > .hero-date { --hd: 2.4s; }
.hero-in > .hero-place { --hd: 2.55s; } .hero-in > .invite-line { --hd: 2.7s; } .hero-in > .countdown { --hd: 2.75s; }
.moving .event[data-reveal], .moving .facts > div { transition-delay: var(--delay, 0ms); }
.moving .facts > div { opacity: 0; transform: translateY(12px); transition: opacity 1.1s ease var(--delay, 0ms), transform 1.3s cubic-bezier(.2, .7, .1, 1) var(--delay, 0ms); }
.moving .facts.in > div { opacity: 1; transform: none; }
.countdown b.flip { animation: flip .7s cubic-bezier(.3, .7, .2, 1); }
@keyframes flip { 0% { transform: translateY(-40%); opacity: 0 } 100% { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } [data-reveal] { transition: opacity .4s ease; transform: none; } .hero-in > [data-reveal] { transition-delay: 0s; } .scroll-cue i { animation: none; } }
