/* Not My Event: "Where Forever Begins" (public/templates/where-forever-begins.html), the burgundy and ivory wedding invitation (2026-11-21).
   A film of whole screens, after the owner's screen recording ("this is how we want transitions to show up"): a real envelope in the recording's gold plaid
   fills the screen and opens at the seal; its card comes out until its photo fills the screen, and the invitation writes itself in over it; the two of them; the details cards fly in from off the screen; the gold hoop drops in for the reply and later flies up to the
   corner for the thank you. forever.js runs the clock; this file holds every move. Everything that moves moves by transform and opacity only.
   One unit, --u, sizes everything: a hundredth of the width, or a two-hundredth of the height on a screen wider than half its height, so each screen fits.
   html.film is the film (one screen at a time, hidden starting states). Without it (no script, reduced motion, the editor) the screens stand one under the
   other, everything shown: every hidden starting state below lives under html.film only. */
:root {
  --ivory: #F3EBDD; --paper: #F6EFE4; --ink: #3E1524; --wine: #581F32; --gold: #C5A46B; --gold-d: #8C6B32;
  --ease: cubic-bezier(.22, 1, .36, 1); --leave: cubic-bezier(.65, 0, .35, 1); --pen: cubic-bezier(.33, .08, .4, 1);
  --f-script: 'Allura', 'Segoe Script', 'Brush Script MT', cursive;
  --f-caps: 'Gilda Display', 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  --f-body: 'Sorts Mill Goudy', Georgia, 'Times New Roman', serif;
  --u: min(1vw, .46vh); --hw: calc(var(--u) * 56);
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
}
@supports (height: 1svh) { :root { --u: min(1vw, .46svh); } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ivory); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--f-body); }
img { display: block; max-width: none; }
button { font: inherit; color: inherit; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 80; padding: 10px 14px; border-radius: 10px; background: var(--wine); color: var(--paper); text-decoration: none; }
.skip:focus { top: 12px; }
#snd-hint { position: fixed; top: calc(20px + var(--top)); right: 66px; z-index: 30; margin: 0; font: 12px/1 var(--f-caps); letter-spacing: .14em; text-transform: uppercase; color: var(--wine); opacity: .72; transition: opacity .5s ease; pointer-events: none; }
#snd-hint.gone { opacity: 0; visibility: hidden; }

/* ---------------- the stage and its screens ---------------- */
#stage { position: relative; background: var(--ivory) url(/assets/burgundy/bw-paper.webp) repeat; overflow: hidden; overflow: clip; }
.scr { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; overflow: clip; }
.col { position: relative; z-index: 4; min-height: inherit; width: calc(var(--u) * 92); margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--u) * 12 + var(--top)) 0 calc(var(--u) * 14 + var(--bot)); }
.fl, .spray, .hoop { position: absolute; z-index: 3; height: auto; pointer-events: none; user-select: none; -webkit-user-select: none; }
.tint { position: absolute; inset: 0; z-index: 0; background: radial-gradient(120% 70% at 50% 30%, rgba(240, 222, 206, .55), rgba(232, 210, 192, .75)); pointer-events: none; }
/* a faint gold damask printed on the paper: one medallion (a bud between two scrolls, a stem with two leaves, a drop) set in a half-drop repeat */
.damask { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5; background-size: calc(var(--u) * 30) calc(var(--u) * 42); background-position: 50% 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='168' viewBox='0 0 120 168'%3E%3Cdefs%3E%3Cg id='m'%3E%3Cg fill='none' stroke='%23B48F55' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M0-46C-9-34-14-22-12-10C-10 0-4 6 0 10C4 6 10 0 12-10C14-22 9-34 0-46Z'/%3E%3Cpath d='M0-36V2M0-46V-53M0 10V34'/%3E%3Cpath d='M-4 12C-14 18-28 18-33 8C-37-1-31-10-23-9C-17-8-15-2-19 2'/%3E%3Cpath d='M4 12C14 18 28 18 33 8C37-1 31-10 23-9C17-8 15-2 19 2'/%3E%3Cpath d='M0 22C-8 26-16 34-18 44M0 22C8 26 16 34 18 44'/%3E%3Cpath d='M-12-10C-20-18-28-20-34-16M12-10C20-18 28-20 34-16'/%3E%3Cpath d='M0 34C-4 40-4 46 0 50C4 46 4 40 0 34Z'/%3E%3C/g%3E%3Cg fill='%23B48F55'%3E%3Ccircle cy='-56' r='2.2'/%3E%3Ccircle cx='-26' cy='-30' r='1.5'/%3E%3Ccircle cx='26' cy='-30' r='1.5'/%3E%3Ccircle cx='-30' cy='40' r='1.3'/%3E%3Ccircle cx='30' cy='40' r='1.3'/%3E%3C/g%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23m' x='60' y='84'/%3E%3Cuse href='%23m'/%3E%3Cuse href='%23m' x='120'/%3E%3Cuse href='%23m' y='168'/%3E%3Cuse href='%23m' x='120' y='168'/%3E%3C/svg%3E"); }
.s-rsvp .damask { opacity: .38; }

html.film, html.film body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.film #stage { position: fixed; inset: 0; touch-action: pinch-zoom; -webkit-user-select: none; user-select: none; }
html.film .scr { position: absolute; inset: 0; min-height: 0; opacity: 0; visibility: hidden; transition: opacity var(--fade, 800ms) ease, visibility 0s linear var(--fade, 800ms); }
html.film .scr.on { opacity: 1; visibility: visible; transition: opacity var(--fade, 800ms) ease, visibility 0s; }
html.film .col { position: absolute; left: 50%; top: 0; bottom: 0; margin-left: calc(var(--u) * -46); min-height: 0; }

/* ---------------- lettering ---------------- */
.caps { font-family: var(--f-caps); text-transform: uppercase; color: var(--wine); margin: 0; font-weight: 400; }
.caps.sm { font-size: calc(var(--u) * 3.9); letter-spacing: .3em; line-height: 1.6; max-width: calc(var(--u) * 80); text-wrap: balance; }
.caps.xs { font-size: calc(var(--u) * 3.7); letter-spacing: .22em; line-height: 1.4; margin-top: calc(var(--u) * 3); }
.script { font-family: var(--f-script); color: var(--wine); margin: 0; font-weight: 400; line-height: 1; }
.name { font-family: var(--f-script); color: var(--wine); font-size: calc(var(--u) * 16); line-height: .98; margin: 0; }
.amp { font-family: var(--f-script); color: var(--gold-d); font-size: calc(var(--u) * 9); line-height: .7; margin: calc(var(--u) * -.6) 0 calc(var(--u) * .4); }
.place { margin: calc(var(--u) * 1) 0 0; font-style: italic; font-size: calc(var(--u) * 4.4); line-height: 1.4; color: var(--ink); }
.lt .c, .wds .wo { display: inline-block; }
#t-top { margin-bottom: calc(var(--u) * 2); }
#t-invite { margin-top: calc(var(--u) * 2.2); }

/* the writing window: the outer box (.w) opens left to right over the words (.wi), which stand still; the padding gives the script's swashes room */
.w { display: inline-block; overflow: hidden; vertical-align: top; margin: -.36em -40px -.36em -.3em;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%); }
.w > .wi { display: block; padding: .36em 40px .36em .3em; }

/* the gold divider: two lines drawn out from a little heart knot */
.dv { display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 2.4); width: calc(var(--u) * 70); margin: calc(var(--u) * 2.6) auto calc(var(--u) * 2.4); }
.dv .ln { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 70%); transform-origin: 100% 50%; }
.dv .ln.r { background: linear-gradient(270deg, transparent, var(--gold) 70%); transform-origin: 0 50%; }
.knot { width: calc(var(--u) * 11); height: calc(var(--u) * 5.5); flex: none; overflow: visible; }

/* the date row of the recording: the day, the date large, the time */
.when { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: calc(var(--u) * 3); width: calc(var(--u) * 82); }
.when p { margin: 0; }
.wl, .wr { font: calc(var(--u) * 3.6)/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--wine); padding: calc(var(--u) * 2) 0; border-top: 1px solid rgba(197, 164, 107, .85); border-bottom: 1px solid rgba(197, 164, 107, .85); white-space: nowrap; }
.wd { display: flex; flex-direction: column; align-items: center; }
.wd b { font: 400 calc(var(--u) * 13)/.9 var(--f-caps); color: var(--wine); }
.wd span { font: calc(var(--u) * 2.9)/1.2 var(--f-caps); letter-spacing: .22em; text-transform: uppercase; color: var(--gold-d); margin-top: calc(var(--u) * .8); white-space: nowrap; }

/* the twinkling gold stars beside the flowers */
.tw { position: absolute; z-index: 5; left: var(--x); top: var(--y); width: calc(var(--u) * 5); height: calc(var(--u) * 5); margin: calc(var(--u) * -2.5) 0 0 calc(var(--u) * -2.5); pointer-events: none; overflow: visible; }
.tw path { transform-box: fill-box; transform-origin: 50% 50%; animation: twinkle var(--tw, 2.6s) ease-in-out var(--twd, 0s) infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(.25) rotate(0deg); opacity: .2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }

/* ---------------- 1. the invitation ---------------- */
.frame { position: absolute; z-index: 1; pointer-events: none; }
.frame.o { inset: calc(var(--u) * 3 + var(--top)) calc(var(--u) * 3) calc(var(--u) * 3 + var(--bot)); }
.frame.i { inset: calc(var(--u) * 4.5 + var(--top)) calc(var(--u) * 4.5) calc(var(--u) * 4.5 + var(--bot)); }
.frame i { position: absolute; background: rgba(197, 164, 107, .9); }
.frame.i i { background: rgba(197, 164, 107, .45); }
.frame .e-t { left: 0; right: 0; top: 0; height: 1px; transform-origin: 0 50%; }
.frame .e-r { top: 0; bottom: 0; right: 0; width: 1px; transform-origin: 50% 0; }
.frame .e-b { left: 0; right: 0; bottom: 0; height: 1px; transform-origin: 100% 50%; }
.frame .e-l { top: 0; bottom: 0; left: 0; width: 1px; transform-origin: 50% 100%; }
/* on a wide screen the corner flowers grow with the window, so the scene fills it */
.s-inv .roses { left: calc(var(--u) * -6); top: calc(var(--u) * -5 + var(--top)); width: max(calc(var(--u) * 50), 26vw); transform-origin: 0 0; }
.s-inv .tulips { right: calc(var(--u) * -6); bottom: calc(var(--u) * -5 + var(--bot)); width: max(calc(var(--u) * 44), 24vw); transform-origin: 100% 100%; }
/* the card that came out of the envelope fills the screen and the words are written over it (the owner: "it should fill the background and the text should be
   on top of it"). Three layers for depth: the photo at the back, a wash that darkens toward the words, the words; the flowers in the corners in front, with
   their shadows on the photo. The photo sits exactly where the card ended, so the hand-over cannot be seen. */
.bgph { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.s-inv, .s-cpl { background: #2a0d16; }
.shade { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(26, 6, 13, .38) 0%, rgba(26, 6, 13, 0) 15%, rgba(26, 6, 13, 0) 30%, rgba(26, 6, 13, .42) 46%, rgba(26, 6, 13, .62) 66%, rgba(26, 6, 13, .72) 100%); }
.s-inv .frame { z-index: 2; }
.s-inv .fl { z-index: 5; filter: drop-shadow(0 calc(var(--u) * 1.4) calc(var(--u) * 2.2) rgba(16, 3, 8, .5)); }
.s-inv .col { justify-content: flex-end; padding-top: calc(var(--u) * 30 + var(--top)); padding-bottom: calc(var(--u) * 4 + 84px + var(--bot)); text-shadow: 0 1px 2px rgba(16, 3, 8, .55), 0 0 calc(var(--u) * 5) rgba(16, 3, 8, .45); }
.s-inv .caps, .s-inv .name, .s-inv .wd b, .s-inv .place, .s-inv .wl, .s-inv .wr { color: #FBF3E4; }
.s-inv .wd span { color: rgba(251, 243, 228, .85); }
.s-inv .amp { color: #E4CA92; }
.s-inv .wl, .s-inv .wr { border-color: rgba(228, 202, 146, .75); }
.s-inv .knot g { stroke: #E4CA92; }
.s-inv .dv .ln { background: linear-gradient(90deg, transparent, #E4CA92 70%); }
.s-inv .dv .ln.r { background: linear-gradient(270deg, transparent, #E4CA92 70%); }

/* ---------------- 2. the two of them: their photo fills the screen (on a wide screen it stands framed in the middle, over a soft copy of itself) ---------------- */
.s-cpl .cph { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.s-cpl .cbg { display: none; }
@media (min-aspect-ratio: 4/5) {
  .s-cpl .cbg { display: block; position: absolute; inset: -6%; width: 112%; height: 112%; object-fit: cover; filter: blur(26px) brightness(.5); }
  .s-cpl .cph { left: 50%; right: auto; top: 5vh; width: auto; height: 90vh; aspect-ratio: 9 / 16; margin-left: calc(90vh * 9 / 32 * -1); border-radius: 4px; box-shadow: 0 0 0 calc(var(--u) * .5) var(--gold), 0 calc(var(--u) * 3) calc(var(--u) * 10) rgba(0, 0, 0, .5); }
}
.s-cpl .tw { z-index: 5; }
.s-cpl .cspray { z-index: 5; left: 50%; bottom: calc(var(--u) * -4 + var(--bot)); width: max(calc(var(--u) * 120), 60vw); margin-left: calc(max(calc(var(--u) * 120), 60vw) * -.5); filter: drop-shadow(0 calc(var(--u) * -1) calc(var(--u) * 2.4) rgba(16, 3, 8, .45)); }
.s-cpl .col { justify-content: flex-end; padding-bottom: calc(var(--u) * 26 + var(--bot)); text-shadow: 0 1px 2px rgba(16, 3, 8, .55), 0 0 calc(var(--u) * 5) rgba(16, 3, 8, .45); }
.s-cpl .cn { font-size: calc(var(--u) * 15); color: #FBF3E4; white-space: nowrap; }
.s-cpl .caps { color: #FBF3E4; margin-top: calc(var(--u) * 2.4); }

/* ---------------- 2. the details ---------------- */
.s-det .col { justify-content: flex-start; padding-top: calc(var(--u) * 11 + var(--top)); padding-bottom: calc(var(--u) * 30 + var(--bot)); }
.s-det .spray { left: 50%; bottom: calc(var(--u) * -3 + var(--bot)); width: max(calc(var(--u) * 112), min(100%, calc(var(--u) * 150))); transform: translateX(-50%); }
.dhead { display: flex; flex-direction: column; align-items: center; margin-bottom: calc(var(--u) * 6); }
.the { font-size: calc(var(--u) * 13); line-height: .8; }
#d-head, #g-head { font-size: calc(var(--u) * 9.5); letter-spacing: .16em; line-height: 1.05; }
.dhead .knot { margin-top: calc(var(--u) * 1.2); }
.pages { position: relative; width: 100%; display: flex; flex-direction: column; gap: calc(var(--u) * 8); }
.pg { display: flex; flex-direction: column; gap: calc(var(--u) * 7.5); }
html.film .pages { flex: 1 1 auto; display: block; }
html.film .pg { position: absolute; left: 0; right: 0; top: 0; }
.card { position: relative; width: calc(var(--u) * 80); text-align: left; padding: calc(var(--u) * 5.4) calc(var(--u) * 5) calc(var(--u) * 4.2); border: 1px solid rgba(197, 164, 107, .7); border-radius: calc(var(--u) * 3.4); background: rgba(251, 247, 240, .95); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(88, 31, 50, .09); }
.card.r { align-self: flex-start; margin-left: calc(var(--u) * 1); }
.card.l { align-self: flex-end; margin-right: calc(var(--u) * 1); }
.card.r.ph { padding-right: calc(var(--u) * 19); }
.card.l.ph { padding-left: calc(var(--u) * 19); }
.card .chip { position: absolute; top: calc(var(--u) * -2.7); left: calc(var(--u) * 5); padding: calc(var(--u) * 1.3) calc(var(--u) * 3) calc(var(--u) * 1.1); border-radius: 999px; background: var(--wine); color: var(--paper); font: calc(var(--u) * 2.9)/1.2 var(--f-caps); letter-spacing: .22em; text-transform: uppercase; white-space: nowrap; }
.card.l.ph .chip { left: calc(var(--u) * 19); }
.card p { margin: 0 0 calc(var(--u) * .8); font-size: calc(var(--u) * 4.1); line-height: 1.4; }
.card p.b { font-family: var(--f-caps); text-transform: uppercase; letter-spacing: .08em; font-size: calc(var(--u) * 3.8); color: var(--wine); }
.card p.m { font-style: italic; color: #5b3a43; }
.card .links { display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); margin-top: calc(var(--u) * 1); }
.card .links a, .card .go-map { color: var(--wine); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; font-size: calc(var(--u) * 4.1); }
.card .go-map { display: inline-block; margin-top: calc(var(--u) * 1); font: calc(var(--u) * 3.3)/1.3 var(--f-caps); letter-spacing: .16em; text-transform: uppercase; }
.card.tap { cursor: pointer; }
.card.tap:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 3px; }
.card .hint { font-style: italic; color: #8a6f74; }
.rp { position: absolute; top: 50%; width: calc(var(--u) * 25); height: calc(var(--u) * 25); margin: calc(var(--u) * -12.5) 0 0; border-radius: 50%; overflow: hidden; border: calc(var(--u) * .7) solid var(--gold); box-shadow: 0 calc(var(--u) * 1.2) calc(var(--u) * 3) rgba(88, 31, 50, .2); background: var(--ivory); }
.card.r .rp { right: calc(var(--u) * -9); }
.card.l .rp { left: calc(var(--u) * -9); }
.rp img { width: 100%; height: 100%; object-fit: cover; }
/* how long until the day, under the heading */
.dhead .cd { margin-top: calc(var(--u) * 2.4); letter-spacing: .3em; }

/* ---------------- 4. where they are registered: each store a card of its own, its name set in the invitation's lettering (never the store's logo) ---------------- */
.s-reg .col { justify-content: flex-start; padding-top: calc(var(--u) * 11 + var(--top)); padding-bottom: calc(var(--u) * 26 + var(--bot)); }
.s-reg .spray { left: 50%; bottom: calc(var(--u) * -3 + var(--bot)); width: max(calc(var(--u) * 112), min(100%, calc(var(--u) * 150))); transform: translateX(-50%); }
.s-reg .dhead { margin-bottom: calc(var(--u) * 3); }
/* the registry's words stand clear of the damask: a soft ivory glow round each letter, and the damask fainter here (the owner: "can't hardly see the text") */
.s-reg .damask { opacity: .28; }
.s-reg .dhead, .s-reg .gl { text-shadow: 0 0 calc(var(--u) * 1.4) #F7EEE4, 0 0 calc(var(--u) * .5) #F7EEE4; }
.lede.gl { margin: 0 0 calc(var(--u) * 6); font-size: calc(var(--u) * 5); line-height: 1.4; color: var(--ink); }
.stores { display: flex; flex-direction: column; gap: calc(var(--u) * 3.6); width: calc(var(--u) * 82); }
.store { position: relative; display: flex; align-items: center; gap: calc(var(--u) * 3); padding: calc(var(--u) * 4.6) calc(var(--u) * 5); border: 1px solid rgba(197, 164, 107, .75); border-radius: calc(var(--u) * 3.4); background: rgba(251, 247, 240, .96); color: var(--wine); text-decoration: none; text-align: left;
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) rgba(88, 31, 50, .12), inset 0 0 0 calc(var(--u) * .9) rgba(251, 247, 240, .96), inset 0 0 0 calc(var(--u) * 1.1) rgba(197, 164, 107, .45); -webkit-tap-highlight-color: transparent; }
.store .sn { flex: 1; min-width: 0; }
.store b { display: block; font: 400 calc(var(--u) * 5.4)/1.15 var(--f-caps); letter-spacing: .1em; text-transform: uppercase; overflow-wrap: anywhere; }
.store small { display: block; margin-top: calc(var(--u) * 1); font: italic calc(var(--u) * 4.1)/1.3 var(--f-body); color: var(--ink); }
.store .ar { flex: none; display: grid; place-items: center; width: calc(var(--u) * 10); height: calc(var(--u) * 10); border-radius: 50%; background: var(--wine); color: var(--paper); font: calc(var(--u) * 5.4)/1 var(--f-caps); }
.store:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 3px; }
.stores .hint { margin: 0; font-style: italic; color: #8a6f74; font-size: calc(var(--u) * 4.1); }

/* ---------------- 3. the reply ---------------- */
.hoop { top: calc(var(--top) * .5); left: 50%; width: calc(var(--u) * 30); margin-left: calc(var(--u) * -15); transform-origin: 50% -12%; }
/* the reply's form is right on the screen; on a short screen the column scrolls under the hoop */
.s-rsvp .col { justify-content: flex-start; padding-top: calc(var(--u) * 46 + var(--top)); padding-bottom: calc(var(--u) * 4 + 84px + var(--bot)); }
.rcard .more { display: block; margin: -4px 0 12px; padding: 4px 0; font-size: 16px; }
html.film .s-rsvp .col { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-y pinch-zoom; }
html.film .s-rsvp .col::-webkit-scrollbar { display: none; }
.please { font-size: calc(var(--u) * 9); line-height: .9; }
.rsvp-h { font-size: calc(var(--u) * 13.5); line-height: .95; letter-spacing: .06em; color: var(--gold-d); }
/* gold foil lettering, painted on each letter (a letter that fades in is its own box) */
.rsvp-h, .rsvp-h .c { background: linear-gradient(180deg, #C2A060 0%, #8C6B32 48%, #6E5122 62%, #B08E4E 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.by { font-size: calc(var(--u) * 7); line-height: 1.05; }
/* the reply card: ivory with a gold edge, the form on it (sizes in pixels, so a phone never zooms into a field) */
.rcard { width: min(calc(var(--u) * 94), 500px); flex: none; margin-top: calc(var(--u) * 2); padding: 16px 14px 14px; border-radius: calc(var(--u) * 3); background: rgba(251, 247, 240, .97); color: var(--ink); text-align: left;
  box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(88, 31, 50, .16), inset 0 0 0 1px rgba(197, 164, 107, .8), inset 0 0 0 6px rgba(251, 247, 240, .97), inset 0 0 0 7px rgba(197, 164, 107, .45); }
.rcard .q { margin: 0 0 10px; text-align: center; font: italic 20px/1.2 var(--f-body); color: var(--wine); }
.rcard .f { display: flex; flex-direction: column; gap: 5px; margin: 0 0 11px; font: 12px/1.3 var(--f-caps); letter-spacing: .14em; text-transform: uppercase; color: var(--wine); }
.rcard input[type=text], .rcard textarea, .rcard select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid rgba(140, 107, 50, .45); border-radius: 10px; background: #FFFDF9; color: var(--ink); font: 17px/1.35 var(--f-body); letter-spacing: 0; text-transform: none; }
.rcard textarea { min-height: 62px; resize: vertical; }
.rcard input:focus, .rcard textarea:focus, .rcard select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav button:focus-visible { outline: 2px solid var(--wine); outline-offset: 3px; }
.rdone { text-align: center; padding: 4px 0 2px; }
.rdone .got { margin: 4px 0 8px; font: 44px/1 var(--f-script); color: var(--wine); }
.rdone p { margin: 0 0 10px; font-size: 17px; line-height: 1.5; }
.going { margin: 12px 0 0; text-align: center; font-style: italic; font-size: 16px; color: #5b3a43; }
.closed { margin: 0; font-style: italic; font-size: 17px; line-height: 1.45; }

/* ---------------- 4. thank you ---------------- */
.hoop.small { transform: translate(calc(var(--u) * -31), calc(var(--u) * -5.9)) scale(.767); }
.s-thx .trail { right: calc(var(--u) * -3); bottom: calc(max(calc(var(--u) * 80), 36vw) * .42 + var(--bot)); width: max(calc(var(--u) * 26), 11vw); transform-origin: 70% 100%; }
.s-thx .bouquet { right: calc(var(--u) * -5); bottom: calc(var(--u) * -3 + var(--bot)); width: max(calc(var(--u) * 80), 36vw); transform-origin: 100% 100%; }
.s-thx .col { justify-content: flex-start; padding-top: calc(var(--u) * 48 + var(--top)); }
.ty { font-size: calc(var(--u) * 18); line-height: .95; }
.lede { margin: calc(var(--u) * 1.5) 0 0; max-width: calc(var(--u) * 72); font-style: italic; font-size: calc(var(--u) * 4.8); line-height: 1.45; color: var(--ink); text-wrap: balance; }
.plaque { position: relative; width: calc(var(--u) * 72); margin: calc(var(--u) * 5) auto calc(var(--u) * 3); }
.plaque img { width: 100%; height: auto; }
.s-thx .cal { width: auto; margin: 0 auto calc(var(--u) * 2); }
.plaque .pn { position: absolute; left: 14%; right: 14%; top: 50%; transform: translateY(-50%); margin: 0; font: calc(var(--u) * 9)/1.05 var(--f-script); color: var(--wine); white-space: nowrap; }
.linkish { border: 0; background: none; padding: 6px 2px; color: var(--wine); font: italic calc(var(--u) * 4.2)/1.4 var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 3px; }

/* ---------------- the envelope: the whole screen, edge to edge (the owner: "It's supposed to show full screen, even on mobile") ----------------
   A real envelope on the rules of The Night Before Christmas, drawn by forever.js for the very screen it is on: --ft is how far down the flap's point comes,
   --fh the flap's box, --sw the seal's width, --pp the flap's perspective. Back to front: the lining (z 1), the card (z 2), the pocket and the seal's lower
   half (z 3), the flap and the seal's upper half (z 4, dropping to 1 once it has turned past upright). .envframe itself never moves, fades or filters: that
   would make it one layer, and the card would be drawn over or under the whole envelope. Once the card has risen, each piece of the envelope slides down
   off the screen by itself (the same move on each), so the card stays between them until they are gone; then the card comes toward you and fills the screen. */
.env { display: none; }
html.film .env { display: block; position: absolute; inset: 0; z-index: 20; cursor: pointer; -webkit-tap-highlight-color: transparent; background: #F3ECDF; }
html.film .env.gone { display: none; }
/* what is behind the envelope, seen once it has been drawn away from under the card: deep burgundy, lit from above */
html.film .env.open { background: radial-gradient(130% 90% at 50% 34%, #7A2A40 0%, #4C1526 52%, #26090F 100%); }
.envwrap { position: absolute; inset: 0; isolation: isolate; overflow: hidden; }
.edefs { position: absolute; width: 0; height: 0; overflow: hidden; }
.envframe { position: absolute; inset: 0; }
.env .ev { position: absolute; display: block; }
.env .ev svg { display: block; width: 100%; height: 100%; overflow: visible; }
.env-under { inset: 0; z-index: 1; }
.env-front { inset: 0; z-index: 3; }
/* the flap turns toward you: the eye is at the middle of the screen (--po), so the flap lifts up at you and passes over the top edge */
.env-flapbox { left: 0; top: 0; width: 100%; height: var(--fh, 46%); z-index: 4; perspective: var(--pp, 1600px); perspective-origin: 50% var(--po, 116%); }
.flap { position: absolute; inset: 0; transform-origin: 50% 0; transform-style: preserve-3d; }
.ff, .fb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ff { filter: drop-shadow(0 calc(var(--u) * .9) calc(var(--u) * 1.3) rgba(30, 6, 14, .3)); }
.fb { transform: rotateX(180deg) scaleY(-1); }
.flap-names { position: absolute; left: 0; right: 0; top: calc(var(--ft, 40%) * .27); margin: 0; text-align: center; font: calc(var(--u) * 9)/1 var(--f-script); color: var(--wine); white-space: nowrap; }
/* the seal: one picture cut in two along a crack through the wax; the upper half is stuck to the flap, the lower half to the pocket, and both stay there */
.half { position: absolute; left: 50%; width: var(--sw, 60vw); transform: translate(-48.8%, -40.4%); }
.half img { display: block; width: 100%; height: auto; filter: drop-shadow(0 calc(var(--u) * 1) calc(var(--u) * 1.4) rgba(40, 8, 16, .32)); }
.half .ini { position: absolute; left: 48.8%; top: 40.4%; transform: translate(-50%, -52%); font: 400 calc(var(--sw, 60vw) * .108)/1 var(--f-caps); letter-spacing: .04em; color: #E4CA92; text-shadow: 0 1px 1px rgba(40, 0, 10, .7), 0 0 1px rgba(40, 0, 10, .5); white-space: nowrap; }
.half .ini i { font: calc(var(--sw, 60vw) * .08)/1 var(--f-script); font-style: normal; margin: 0 .06em; }
.hb { top: var(--ft, 43%); z-index: 3; clip-path: polygon(0 40.4%, 33% 40.4%, 37% 42.2%, 41% 39.2%, 45% 43%, 49% 39%, 53% 42.6%, 57% 38.6%, 61% 41.4%, 64% 40.4%, 100% 40.4%, 100% 100%, 0 100%); }
.ht { top: var(--ft, 43%); clip-path: polygon(0 0, 100% 0, 100% 40.4%, 64% 40.4%, 61% 41.4%, 57% 38.6%, 53% 42.6%, 49% 39%, 45% 43%, 41% 39.2%, 37% 42.2%, 33% 40.4%, 0 40.4%); }
/* the card: the invitation's own photo at the size of the screen, held smaller in the envelope with an ivory border, until it comes out and fills the screen */
.ecard { position: absolute; inset: 0; z-index: 2; overflow: hidden; transform-origin: 50% 50%; transform: translateY(5%) scale(.8); background: #2a0d16; box-shadow: 0 calc(var(--u) * 2.5) calc(var(--u) * 9) rgba(20, 4, 10, .55); }
.ecard .cph { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ecard .mat { position: absolute; inset: 0; box-shadow: inset 0 0 0 calc(var(--u) * 3.4) #FBF7EF, inset 0 0 0 calc(var(--u) * 3.9) var(--gold), inset 0 0 calc(var(--u) * 5) calc(var(--u) * 3.9) rgba(30, 6, 14, .28); }
.burst { position: absolute; left: 50%; top: var(--ft, 43%); z-index: 5; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: calc(var(--u) * -1.6); top: calc(var(--u) * -1.6); width: calc(var(--u) * 3.2); height: calc(var(--u) * 3.2); border-radius: 50%; background: radial-gradient(circle at 38% 38%, #FFF7DE 0, #E9CC8C 40%, rgba(197, 164, 107, 0) 72%); }
html.film .burst i { opacity: 0; }
/* the gold stars that twinkle beside the seal, as in the recording; they go out when the seal is broken */
.sstars { position: absolute; left: 50%; top: var(--ft, 43%); z-index: 5; width: var(--sw, 60vw); height: calc(var(--sw, 60vw) * 1.1); transform: translate(-50%, -40%); pointer-events: none; }
.env .est { width: calc(var(--u) * var(--sz)); height: calc(var(--u) * var(--sz)); margin: calc(var(--u) * var(--sz) * -.5) 0 0 calc(var(--u) * var(--sz) * -.5); }
.seal-hit { position: absolute; z-index: 7; left: 50%; top: var(--ft, 43%); width: calc(var(--sw, 60vw) * .9); height: calc(var(--sw, 60vw) * .9); transform: translate(-50%, -45%); border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seal-hit:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.envhint { position: absolute; z-index: 8; left: 0; right: 0; bottom: calc(5.5% + var(--bot)); margin: 0; text-align: center; font: calc(var(--u) * 3.4)/1 var(--f-caps); letter-spacing: .32em; text-transform: uppercase; color: var(--wine); text-shadow: 0 1px 0 rgba(255, 255, 255, .7); pointer-events: none; }
/* the opening, one step after another (forever.js adds the classes): the seal cracks and the gold flies; the flap swings up toward you and over; the card
   rises a little; the envelope is drawn away beneath it; the card comes toward you until its photo fills the screen and the invitation is written over it */
html.film .flap { transition: transform 1100ms cubic-bezier(.45, .05, .3, 1); }
html.film .ht { transition: transform 350ms ease; }
html.film .ecard { transition: transform 800ms cubic-bezier(.3, 0, .2, 1); }
html.film .envwrap:not(.s-flap) .ecard { visibility: hidden; }
html.film .envwrap.s-release .ht { transform: translate(-48.8%, -42.8%) rotate(-1.4deg); }
html.film .envwrap.s-release .burst i { animation: burst 1000ms var(--ease) both; }
@keyframes burst { 0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scale(.4); } 12% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(calc(var(--u) * 30)) scale(1.1); } }
html.film .envwrap.s-flap .flap { transform: rotateX(178deg); }
html.film .envwrap.s-back .env-flapbox { z-index: 1; }
html.film .envwrap.s-out .ecard { transform: translateY(-5%) scale(.8); }
html.film .envwrap.s-pull .env-under, html.film .envwrap.s-pull .env-front, html.film .envwrap.s-pull .hb, html.film .envwrap.s-pull .env-flapbox { animation: envdrop 1000ms cubic-bezier(.55, 0, .75, .3) both; }
@keyframes envdrop { from { translate: 0 0; } to { translate: 0 112vh; } }
html.film .envwrap.s-grow .ecard { z-index: 6; transform: none; transition: transform 1150ms cubic-bezier(.45, 0, .15, 1); }
html.film .envwrap.s-grow .mat { opacity: 0; transition: opacity 900ms ease 150ms; }
html.film .env.open .envhint, html.film .env.open .est { opacity: 0; transition: opacity 300ms ease; }
html.film .env.snap, html.film .env.snap * { transition: none !important; animation: none !important; }

/* ---------------- falling gold glitter, all the time, over the envelope too (as in the recording) ---------------- */
.glitter { display: none; position: absolute; inset: 0; z-index: 21; pointer-events: none; overflow: hidden; }
html.film .glitter { display: block; }
.glitter i { position: absolute; top: -3%; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 38% 38%, #FFF7DE 0, #E9CC8C 38%, rgba(197, 164, 107, 0) 72%); animation: fall var(--dur) linear var(--dl) infinite; }
@keyframes fall {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  8% { opacity: .95; }
  30% { opacity: .35; }
  45% { transform: translate3d(var(--sway), 48vh, 0); opacity: .95; }
  70% { opacity: .4; }
  100% { transform: translate3d(0, 108vh, 0); opacity: 0; }
}

/* ---------------- back and next ---------------- */
.nav { display: none; }
html.film .nav { display: flex; position: absolute; left: 50%; bottom: calc(30px + var(--bot)); z-index: 30; gap: 52px; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
html.film.opened:not(.busy) .nav { opacity: .8; pointer-events: auto; }
/* on the reply the buttons wait in the empty top left corner, so they never sit on the form or its Send button */
html.film[data-scr="rsvp"] .nav { left: calc(14px + env(safe-area-inset-left, 0px)); bottom: auto; top: calc(14px + var(--top)); transform: none; }
.nav button { width: 44px; height: 44px; padding: 0 0 3px; border-radius: 50%; border: 1px solid rgba(140, 107, 50, .55); background: rgba(246, 239, 228, .82); color: var(--wine); font: 26px/1 var(--f-caps); cursor: pointer; }
.nav button.off { visibility: hidden; }

/* ---------------- the reply form's parts ---------------- */
.ans { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0 0 12px; }
.ans label { flex: 1 1 128px; }
.ans input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ans span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 6px; white-space: nowrap; border: 1px solid rgba(140, 107, 50, .45); border-radius: 999px; background: #FFFDF9; font: italic min(16px, 4.3vw)/1.2 var(--f-body); color: var(--ink); cursor: pointer; text-align: center; }
.ans input:checked + span { background: var(--wine); border-color: var(--wine); color: var(--paper); }
.ans input:focus-visible + span { outline: 2px solid var(--gold-d); outline-offset: 2px; }
.step { display: flex; align-items: center; gap: 14px; }
.step button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(140, 107, 50, .55); background: #FFFDF9; color: var(--wine); font-size: 22px; cursor: pointer; }
.step output { min-width: 24px; text-align: center; font: 22px/1 var(--f-caps); color: var(--ink); letter-spacing: 0; }
#err { min-height: 1.2em; margin: 0 0 10px; font-size: 15px; color: #5b3a43; }
#err.err { color: #9B1C31; }
.btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 12px 26px; border-radius: 999px; border: 1px solid var(--gold-d); background: rgba(246, 239, 228, .9); color: var(--wine); font: 15px/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
.btn.solid { background: var(--wine); color: var(--paper); border-color: var(--wine); }
.btn:focus-visible { outline: 2px solid var(--gold-d); outline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ================= the film: hidden starting states and every move (html.film only) ================= */
html.film .scr .m, html.film .scr .c, html.film .scr .wo, html.film .scr .w, html.film .scr .wi {
  transition: transform var(--t, 900ms) var(--ez, var(--ease)) var(--d, 0ms), opacity var(--to, var(--t, 900ms)) ease var(--d, 0ms); }
html.film .scr .w, html.film .scr .wi { --ez: var(--pen); }
html.film .scr:not(.go) .w { transform: translateX(-100%); }
html.film .scr:not(.go) .w > .wi { transform: translateX(100%); }
html.film .scr:not(.go) .c { opacity: 0; transform: translateY(.3em); }
html.film .scr:not(.go) .wo { opacity: 0; transform: translateY(.45em); }
html.film .scr .c { --t: 420ms; }
html.film .scr .wo { --t: 650ms; }

/* the invitation */
html.film .s-inv:not(.go) .roses { opacity: 0; transform: translate(-36%, -34%) rotate(-14deg) scale(.86); }
html.film .s-inv:not(.go) .tulips { opacity: 0; transform: translate(34%, 40%) rotate(10deg) scale(.86); }
html.film .s-inv .roses, html.film .s-inv .tulips { --t: 1700ms; --to: 1000ms; }
html.film .s-inv:not(.go) .frame .e-t, html.film .s-inv:not(.go) .frame .e-b { transform: scaleX(0); }
html.film .s-inv:not(.go) .frame .e-r, html.film .s-inv:not(.go) .frame .e-l { transform: scaleY(0); }
html.film .s-inv .frame i { --t: 420ms; --ez: linear; }
html.film .scr:not(.go) .tw { opacity: 0; }
html.film .scr .tw { --t: 900ms; }
html.film .s-inv:not(.go) .amp { opacity: 0; transform: scale(.55) rotate(-10deg); }
html.film .s-inv .amp { --t: 800ms; }
html.film .scr:not(.go) .dv .ln { transform: scaleX(0); }
html.film .scr:not(.go) .knot { opacity: 0; transform: scale(.6); }
html.film .scr .dv .ln { --t: 800ms; }
html.film .s-inv:not(.go) .wl { opacity: 0; transform: translateX(calc(var(--u) * -8)); }
html.film .s-inv:not(.go) .wr { opacity: 0; transform: translateX(calc(var(--u) * 8)); }
html.film .s-inv:not(.go) .wd { opacity: 0; transform: scale(.7); }
html.film .s-inv .when p { --t: 800ms; }
/* leaving: the flowers go back the way they came while the screen fades */
html.film .s-inv.x .roses { transform: translate(-22%, -22%) rotate(-6deg); opacity: 0; transition: transform 1000ms var(--leave), opacity 700ms ease; }
html.film .s-inv.x .tulips { transform: translate(20%, 24%) rotate(5deg); opacity: 0; transition: transform 1000ms var(--leave), opacity 700ms ease; }

/* the details: the spray rises from the bottom, the cards fly in from off the screen, the third one rises */
html.film .s-det:not(.go) .spray { opacity: 0; transform: translate(-50%, 55%); }
html.film .s-det .spray { --t: 1400ms; --to: 900ms; }
html.film .s-det.x .spray { transform: translate(-50%, 40%); opacity: 0; transition: transform 900ms var(--leave), opacity 700ms ease; }
html.film .s-det:not(.go) .cd { opacity: 0; transform: translateY(.6em); }

/* the invitation's wash comes in under the words once the card has become the photo */
html.film .s-inv:not(.go) .shade { opacity: 0; }
html.film .s-inv .shade { transition: opacity 1300ms ease; }

/* the two of them: the flowers rise in front of the photo, their names are written over it */
html.film .s-cpl:not(.go) .cspray { opacity: 0; transform: translateY(60%) rotate(3deg); }
html.film .s-cpl .cspray { --t: 1600ms; --to: 900ms; }
html.film .s-cpl:not(.go) .shade { opacity: .35; }
html.film .s-cpl .shade { transition: opacity 1400ms ease; }

/* the registry: the spray rises; the stores fly in from either side, one after another */
html.film .s-reg:not(.go) .spray { opacity: 0; transform: translate(-50%, 55%); }
html.film .s-reg .spray { --t: 1400ms; --to: 900ms; }
html.film .s-reg.x .spray { transform: translate(-50%, 40%); opacity: 0; transition: transform 900ms var(--leave), opacity 700ms ease; }
html.film .s-reg .store { transition: transform 900ms var(--ease) var(--d, 0ms), opacity 600ms ease var(--d, 0ms); }
html.film .s-reg:not(.go) .store { opacity: 0; transform: translateX(100vw); }
html.film .s-reg:not(.go) .store:nth-child(even) { transform: translateX(-100vw); }
html.film .pg .card { transition: transform 900ms var(--ease) var(--d, 0ms), opacity 600ms ease var(--d, 0ms); }
html.film .pg .card:nth-child(2) { --d: 520ms; }
html.film .pg .card:nth-child(3) { --d: 1040ms; }
html.film .pg:not(.go) .card.mr, html.film .pg.x .card.mr { transform: translateX(100vw); }
html.film .pg:not(.go) .card.ml, html.film .pg.x .card.ml { transform: translateX(-100vw); }
html.film .pg:not(.go) .card.mu, html.film .pg.x .card.mu { transform: translateY(calc(var(--u) * 70)); opacity: 0; }
html.film .pg.x .card { transition: transform 700ms var(--leave) var(--dx, 0ms), opacity 500ms ease var(--dx, 0ms); }
html.film .pg.x .card:nth-child(2) { --dx: 90ms; }
html.film .pg.x .card:nth-child(3) { --dx: 180ms; }
html.film .pg:not(.go) .card .chip { opacity: 0; transform: scale(.7); }
html.film .pg .card .chip { transition: transform 450ms var(--ease) calc(var(--d, 0ms) + 600ms), opacity 450ms ease calc(var(--d, 0ms) + 600ms); }
html.film .pg.x .card .chip { transition: none; }
html.film .pg.away { visibility: hidden; }

/* the reply: the hoop drops in from above the screen and swings to rest on its ribbon */
html.film .s-rsvp .hoop { transition: none; }   /* a transition would outrank the drop's animation */
html.film .s-rsvp:not(.go) .hoop { transform: translateY(-112%); }
html.film .s-rsvp.go .hoop { animation: drop 1500ms cubic-bezier(.3, .6, .3, 1) both; }
@keyframes drop {
  0% { transform: translateY(-112%) rotate(0deg); }
  55% { transform: translateY(3.5%) rotate(2.4deg); }
  72% { transform: translateY(-1.4%) rotate(-1.6deg); }
  86% { transform: translateY(.6%) rotate(.8deg); }
  100% { transform: none; }
}
html.film .s-rsvp:not(.go) .rcard { opacity: 0; transform: translateY(calc(var(--u) * 24)); }
html.film .s-rsvp .rcard { --t: 1000ms; --to: 700ms; }
/* leaving for the thank you: everything fades but the hoop, which flies up to the corner */
html.film .s-rsvp.fly .col { opacity: 0; transition: opacity 600ms ease; }
html.film .s-rsvp.fly .hoop { animation: none; transform: translate(calc(var(--u) * -31), calc(var(--u) * -5.9)) scale(.767); transition: transform 1300ms cubic-bezier(.6, 0, .2, 1); }

/* thank you: the flowers rise from the bottom corner, the plaque arrives, the names are written on it */
html.film .s-thx:not(.landed) .hoop.small { opacity: 0; }
html.film .s-thx:not(.go) .bouquet { opacity: 0; transform: translate(18%, 62%) rotate(6deg); }
html.film .s-thx:not(.go) .trail { opacity: 0; transform: translateY(70%) rotate(8deg); }
html.film .s-thx .bouquet, html.film .s-thx .trail { --t: 1700ms; --to: 900ms; }
html.film .s-thx:not(.go) .plaque { opacity: 0; transform: scale(.8); }
html.film .s-thx .plaque { --t: 1000ms; --to: 600ms; }
html.film .s-thx:not(.go) .again, html.film .s-thx:not(.go) .cal { opacity: 0; }
html.film .s-thx .again, html.film .s-thx .cal { --t: 700ms; }

/* a screen shown finished (going back, or tapped to finish): no entrance */
html.film .scr.done, html.film .scr.done * { transition: none !important; }
html.film .s-rsvp.done .hoop { animation: none; }
