/* Not My Event: The Royal Reveal (public/templates/the-royal-reveal.html). The ceremony is a WebGL canvas (royal-gl.js); everything in front of it is placed and
   moved by royal.js, by transform and opacity only. The owner's palette: ivory, silver, soft gold, champagne and dusk lavender. */
:root { --ivory: #FBF6EC; --cream: #F3EADA; --gold: #C9A35E; --gold-d: #9B7433; --ink: #3E3348; --lav: #6E5F8A; --dusk: #2E2742; }
html, body { margin: 0; height: 100%; background: var(--dusk); overflow: hidden; -webkit-tap-highlight-color: transparent; }
body { font: 400 17px/1.5 "Cormorant Infant", Georgia, serif; color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 60; padding: 8px 14px; background: var(--ivory); color: var(--ink); border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* (before even the first frame's picture is in: its own colours, sky over the aisle, never a black screen) */
#stage { position: fixed; inset: 0; overflow: hidden; isolation: isolate; touch-action: manipulation; cursor: default; user-select: none; -webkit-user-select: none;
  background: linear-gradient(#6f93c4, #92a0b4 30%, #8f9898 45%, #c2a987 62%, #ab9071); }
/* the film's first frame as a picture, there at once; the canvas over it stays see-through until its own pictures are in and it has drawn that same frame */
.poster, .poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; opacity: 0; }
html.gl-on #gl { opacity: 1; transition: opacity .35s ease; }
/* without WebGL: the first frame stands still */
html.no-gl #gl { display: none; }
/* the envelope stays out of sight until royal.js brings it in (it once showed, unplaced, for a moment as the page opened) */
#envw { visibility: hidden; }

/* every moving layer: placed at the top left, moved by its transform */
.ly { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; pointer-events: none; }
/* the envelope's pieces sit in a wrapper that only ever fades in (never moved), so the card and the doves can stand between its back and its pocket */
#envw { position: absolute; inset: 0; pointer-events: none; }
.e-back, .e-pocket { width: 1041px; height: 669px; }
.e-back { z-index: 2; }
.e-pocket { z-index: 4; }
.e-flapsh { width: 1041px; height: 565px; z-index: 5; }
/* the flap: its outside, and its gold-lined inside on the back of it; it turns over on its fold */
.e-flap { width: 1041px; height: 541px; z-index: 6; transform-origin: 50% 0; transform-style: preserve-3d; }
.e-flap img { position: absolute; left: 0; top: 0; width: 1041px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.e-flap .ff { height: 541px; }
.e-flap .fi { height: 532px; transform: rotateX(180deg); }
/* the seal: a real button, its touch area a little larger than the wax */
.seal { position: absolute; left: 0; top: 0; z-index: 7; width: 220px; height: 220px; padding: 0; border: 0; border-radius: 50%; background: none; transform-origin: 50% 50%; will-change: transform; pointer-events: auto; cursor: pointer; visibility: hidden; }
.seal::before { content: ""; position: absolute; inset: -30%; border-radius: 50%; }
.seal img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.seal .glint { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle at 38% 32%, rgba(255, 248, 220, .95), rgba(255, 226, 150, .35) 38%, rgba(255, 210, 120, 0) 62%); opacity: 0; pointer-events: none; }
.seal:disabled { cursor: default; }
.seal:focus-visible { outline: 3px solid var(--ivory); outline-offset: 8px; }

/* the card: the owner's ivory card with its gold border and flowers; the words are type, never part of the picture */
.card { width: 1019px; height: 1449px; z-index: 3; transform-origin: 50% 50%; visibility: hidden; }
html.at-end .card { pointer-events: auto; cursor: pointer; }
.card > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ct { position: absolute; left: 270px; top: 232px; width: 430px; height: 1040px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #5A4A62; }
.ct p { margin: 0; }
.cw { opacity: 0; }
.ct .top { font: 400 30px/1.3 "Marcellus SC", Georgia, serif; letter-spacing: .14em; color: #8A6A2E; margin-bottom: 26px; }
.ct .nm { font: 400 118px/1 "Ephesis", cursive; color: var(--gold-d); }
.ct .amp { font: 400 70px/.9 "Ephesis", cursive; color: #B8955A; margin: 4px 0 0; }
.ct .inv { font: 400 29px/1.45 "Marcellus SC", Georgia, serif; letter-spacing: .08em; margin-top: 30px; }
.ct .orn { display: flex; align-items: center; gap: 14px; width: 220px; margin: 30px 0 28px; }
.ct .orn i { flex: 1; height: 2px; background: linear-gradient(90deg, rgba(201, 163, 94, 0), #C9A35E); }
.ct .orn i:last-child { background: linear-gradient(90deg, #C9A35E, rgba(201, 163, 94, 0)); }
.ct .orn b { width: 12px; height: 12px; background: #C9A35E; transform: rotate(45deg); }
.ct .dt { font: 400 37px/1.3 "Marcellus SC", Georgia, serif; letter-spacing: .06em; color: #6B4F2A; }
.ct .tm { font: italic 500 31px/1.35 "Cormorant Infant", Georgia, serif; margin-top: 4px; }
.ct .vn { font: 400 33px/1.3 "Marcellus SC", Georgia, serif; letter-spacing: .08em; color: #6B4F2A; margin-top: 26px; max-width: 390px; }
.ct .ad { font: 400 26px/1.35 "Marcellus SC", Georgia, serif; letter-spacing: .1em; margin-top: 4px; max-width: 380px; }

/* the doves: each a rig of the owner's pieces, moved by royal.js */
.dove { position: absolute; left: 0; top: 0; width: 760px; height: 648px; z-index: 3; opacity: 0; will-change: transform, opacity; pointer-events: none; }
.dove img { position: absolute; display: block; }
.dove .b.f { left: 0; top: 0; width: 760px; height: 648px; }
.dove .w { position: absolute; left: 0; top: 0; width: 768px; height: 512px; }
.dove .w img, .dove .w .wr { position: absolute; left: 0; top: 0; width: 768px; height: 512px; }
.dove .w.l { transform-origin: 715px 295px; }
.dove .w.r { transform-origin: 47.5px 395px; }
.dove .w.l .wr { transform-origin: 350px 145px; }
.dove .w.r .wr { transform-origin: 420px 150px; }
.dove .tail { left: 0; top: 0; width: 520px; height: 337px; transform-origin: 260px 18px; }
.dove .ft { width: 72px; height: auto; opacity: 0; }
.dove .b.k { opacity: 0; }

/* the opening: the couple's names in the sky, and the touch that starts the music and the film */
.intro { position: absolute; inset: 0; z-index: 12; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: max(9vh, 54px) 20px max(9vh, 48px); box-sizing: border-box; transition: opacity .8s ease; pointer-events: none; }
.intro .pre { margin: 0; font: 400 clamp(13px, 1.9vh, 17px)/1.3 "Marcellus SC", Georgia, serif; letter-spacing: .24em; color: #FFF6E2; text-shadow: 0 1px 10px rgba(46, 39, 66, .55); text-align: center; }
.intro .nm { margin: .2em 0 0; font: 400 clamp(46px, min(11vh, 14vw), 120px)/1.05 "Ephesis", cursive; color: #FBEFD2; text-shadow: 0 2px 18px rgba(46, 39, 66, .6); text-align: center; max-width: 92vw; }
.begin { pointer-events: auto; min-height: 50px; padding: 0 30px; border: 1px solid rgba(201, 163, 94, .7); border-radius: 999px; background: rgba(251, 246, 236, .93); color: var(--ink); font: 400 17px/1 "Marcellus SC", Georgia, serif; letter-spacing: .16em; cursor: pointer; box-shadow: 0 10px 30px rgba(30, 22, 44, .35); }
.begin:disabled { opacity: .75; cursor: progress; }
html.playing .intro { opacity: 0; }
html.playing .begin { pointer-events: none; }
.prompt { position: absolute; left: 50%; bottom: max(5vh, 22px); z-index: 12; margin: 0; transform: translateX(-50%); width: max-content; max-width: 90vw; padding: 10px 20px; border-radius: 999px; background: rgba(46, 39, 66, .62); color: #FFF6E2; font: italic 500 clamp(17px, 2.4vh, 21px)/1.3 "Cormorant Infant", Georgia, serif; text-align: center; visibility: hidden; pointer-events: none; }
.skip { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 12; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(46, 39, 66, .45); color: rgba(255, 246, 226, .9); font: 500 14px/1 "Cormorant Infant", Georgia, serif; letter-spacing: .04em; cursor: pointer; display: none; }
html.playing:not(.at-end) .skip { display: block; }
html.at-seal .skip { bottom: max(64px, 8vh); }

/* the end: the reply, the registry, the details, replay */
.acts { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 14px 14px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(46, 39, 66, 0), rgba(46, 39, 66, .55) 45%); opacity: 0; visibility: hidden; }
html:not(.at-end) .acts { pointer-events: none; }
.acts button { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(201, 163, 94, .75); background: rgba(251, 246, 236, .94); color: var(--ink); font: 400 15px/1 "Marcellus SC", Georgia, serif; letter-spacing: .12em; cursor: pointer; }
.acts .main { background: linear-gradient(#D9B873, #C29B53); color: #2E2236; border-color: #E8CF94; }
.acts .quiet { background: rgba(46, 39, 66, .55); color: #FFF6E2; border-color: rgba(255, 246, 226, .35); }

/* the sheets: champagne satin under ivory paper */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(24, 18, 34, .42); }
.sheet[hidden] { display: none; }
.pane { position: relative; box-sizing: border-box; width: min(560px, 100%); max-height: 92vh; overflow: auto; padding: 30px 24px max(26px, env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: linear-gradient(rgba(251, 246, 236, .9), rgba(251, 246, 236, .94)), url(/assets/royal/rr-satin.jpg) center / cover; box-shadow: 0 -12px 40px rgba(20, 14, 30, .35); text-align: center; transform: translateY(40px); opacity: 0; transition: transform .32s ease, opacity .32s ease; }
.sheet.on .pane { transform: none; opacity: 1; }
@media (min-width: 700px) and (min-height: 560px) { .sheet { align-items: center; } .pane { border-radius: 22px; padding-bottom: 30px; } }
.pane h2 { margin: 0 0 6px; font: 400 26px/1.2 "Marcellus SC", Georgia, serif; letter-spacing: .14em; color: #6B4F2A; outline: none; }
.pane .script { margin: 0; font: 400 34px/1 "Ephesis", cursive; color: var(--gold-d); }
.sh-x { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(110, 95, 138, .12); color: var(--ink); font: 400 24px/1 Georgia, serif; cursor: pointer; }
.d-names { margin: 6px 0 2px; font: 400 clamp(40px, 11vw, 58px)/1.05 "Ephesis", cursive; color: var(--gold-d); }
.d-top { margin: 0; font: 400 14px/1.4 "Marcellus SC", Georgia, serif; letter-spacing: .16em; color: #8A6A2E; }
.d-inv { margin: 6px auto 0; max-width: 34ch; font: 400 15px/1.5 "Marcellus SC", Georgia, serif; letter-spacing: .06em; }
.d-orn { width: 140px; height: 2px; margin: 18px auto; background: linear-gradient(90deg, rgba(201, 163, 94, 0), #C9A35E, rgba(201, 163, 94, 0)); }
.d-date { margin: 0; font: 400 21px/1.35 "Marcellus SC", Georgia, serif; letter-spacing: .06em; color: #6B4F2A; }
.d-time { margin: 2px 0 0; font: italic 500 19px/1.4 "Cormorant Infant", Georgia, serif; }
.d-venue { margin: 16px 0 0; font: 400 20px/1.35 "Marcellus SC", Georgia, serif; letter-spacing: .08em; color: #6B4F2A; }
.d-addr { margin: 2px 0 0; font: 400 16px/1.4 "Marcellus SC", Georgia, serif; letter-spacing: .08em; }
.linkish { margin-top: 20px; min-height: 44px; padding: 0 18px; border: 1px solid rgba(155, 116, 51, .5); border-radius: 999px; background: none; color: var(--ink); font: 400 14px/1 "Marcellus SC", Georgia, serif; letter-spacing: .12em; cursor: pointer; }
.lede { margin: 8px auto 16px; max-width: 38ch; font-size: 17px; }
.stores { display: grid; gap: 10px; text-align: left; }
.store { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(201, 163, 94, .55); background: rgba(255, 255, 255, .55); color: var(--ink); text-decoration: none; }
.store b { display: block; font: 400 17px/1.2 "Marcellus SC", Georgia, serif; letter-spacing: .06em; }
.store small { font-size: 15px; color: var(--lav); }
.store .ar { font-size: 26px; color: var(--gold-d); }
.store-none { margin: 4px 0 0; text-align: center; font-style: italic; }
/* the reply */
.by { margin: 2px 0 14px; font-style: italic; }
#rsvp-form { display: grid; gap: 12px; text-align: left; }
.ans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; border: 0; }
.ans label { position: relative; }
.ans input { position: absolute; opacity: 0; }
.ans span { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 8px; border-radius: 12px; border: 1px solid rgba(155, 116, 51, .45); background: rgba(255, 255, 255, .5); font: 400 14px/1.2 "Marcellus SC", Georgia, serif; letter-spacing: .06em; text-align: center; cursor: pointer; }
.ans input:checked + span { background: #C9A35E; color: #2E2236; border-color: #B08A45; }
.ans input:focus-visible + span { outline: 3px solid var(--lav); outline-offset: 2px; }
.f { display: grid; gap: 4px; font: 400 13px/1.3 "Marcellus SC", Georgia, serif; letter-spacing: .08em; color: #6B4F2A; }
.f input, .f textarea { box-sizing: border-box; width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(110, 95, 138, .35); background: rgba(255, 255, 255, .8); color: var(--ink); font: 400 17px/1.35 "Cormorant Infant", Georgia, serif; }
.step { display: flex; align-items: center; gap: 14px; }
.step button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(155, 116, 51, .5); background: rgba(255, 255, 255, .6); font-size: 22px; color: var(--ink); cursor: pointer; }
.step output { min-width: 2ch; text-align: center; font: 400 20px/1 "Marcellus SC", Georgia, serif; }
#err { min-height: 1em; margin: 0; color: #8E2F3B; font-size: 15px; }
.btn { min-height: 52px; border: 0; border-radius: 999px; background: linear-gradient(#D9B873, #C29B53); color: #2E2236; font: 400 16px/1 "Marcellus SC", Georgia, serif; letter-spacing: .14em; cursor: pointer; }
.btn:disabled { opacity: .6; }
.rdone .got { margin: 10px 0 4px; font: 400 34px/1.1 "Ephesis", cursive; color: var(--gold-d); outline: none; }
.going { margin: 14px 0 0; font-style: italic; }
.rclosed { font-style: italic; }
