/*
 * Lanterns on the lake (js/lantern-night.js): over the whole screen while it plays (only when it's the intro playing:
 * .intro-lanterns, js/intros.js), the night drawn here first so it's there before the canvas is; "Tap to begin" at the
 * bottom; it fades away onto the page.
 */
.lantern-night { display: none; }
.intro-on:where(.intro-lanterns) .lantern-night {
  display: block; position: fixed; inset: 0; z-index: 80; overflow: hidden; cursor: pointer; outline: none;
  background: linear-gradient(#03071a, #0b1434 25%, #1f1d4a 42%, #5a3150 56%, #3a2649 56%, #171833 64%, #05070f);
}
.intro-on:where(.intro-lanterns), .intro-on:where(.intro-lanterns) body { overflow: hidden; }
.lantern-night canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s ease; }
.lantern-night.is-ready canvas { opacity: 1; }
.lantern-night.is-done { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.lantern-night.is-going { cursor: default; }

/* "Tap to begin": a soft ring pulsing beside it, near the top, over the sky (gone once tapped) */
.lantern-night__tap {
  position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 14vh); margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: .9rem; text-align: center; pointer-events: none;
  color: #f6f1e7; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); transition: opacity .9s ease, transform .9s ease;
}
.lantern-night__line { font: 400 clamp(1.7rem, 6vw, 2.4rem)/1.1 "Pinyon Script", "Snell Roundhand", cursive; color: #f1d9a6; }
.lantern-night__cue { display: inline-flex; align-items: center; gap: .7rem; font: 500 .74rem "Jost", sans-serif; letter-spacing: .32em; text-transform: uppercase; }
.lantern-night__ring { width: 13px; height: 13px; border-radius: 50%; border: 1px solid currentColor; position: relative; }
.lantern-night__ring::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid currentColor; animation: lantern-night-ring 2.4s ease-out infinite; }
@keyframes lantern-night-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.lantern-night:not(.is-ready) .lantern-night__tap { opacity: 0; } /* (not while the page is still loading: only once the intro is chosen and begins) */
.lantern-night.is-going .lantern-night__tap { opacity: 0; transform: translateY(-10px); }

/* "Send up a lantern" (the save the date's "Lanterns on the lake, send up yours"): instead of "Tap to begin", a wish and
   a name to write, over the sky (gone once it's sent); as we go up onto the page, the page shows above the lake */
.lantern-night__send {
  position: absolute; inset: 0; margin: 0; pointer-events: none; text-align: center;
  color: #f6f1e7; text-shadow: 0 2px 14px rgba(0, 0, 0, .55); cursor: default; transition: opacity .9s ease, transform .9s ease;
}
/* (on the save the date: its words in the sky, as on the page, a little smaller; the wish, the name and "Release
   lantern" under the boat, placed by js/lantern-night.js just below where it sits on the water) */
.lantern-night__std, .lantern-night__fields { position: absolute; left: 50%; transform: translateX(-50%); width: min(92vw, 26rem); pointer-events: auto; }
.lantern-night__std { top: calc(env(safe-area-inset-top, 0px) + 4vh); margin: 0; }
.lantern-night__fields { top: 66%; display: flex; flex-direction: column; align-items: stretch; gap: .55rem; }
@media (max-height: 720px) { .lantern-night__send textarea { height: 4.4em; } }
.lantern-night__std[hidden] { display: none; }
.lantern-night__std > * { margin: 0; }
.lantern-night__std [hidden] { display: none; }
.lantern-night__std .hello, .lantern-night__std.is-to .from { margin: 0 0 .15rem; font: 400 clamp(1.4rem, 4.6vw, 2rem)/1.1 var(--script, "Pinyon Script", cursive); letter-spacing: 0; text-transform: none; color: #f1d9a6; }
.lantern-night__std .hello { margin-bottom: .9rem; } /* (room under "Dear …,": its tails clear of "Save the Date") */
.lantern-night__std .eyebrow { font: 500 .7rem "Jost", sans-serif; letter-spacing: .4em; text-transform: uppercase; color: #f1d9a6; }
.lantern-night__std.is-to .eyebrow:not(.from) { display: none; }
.lantern-night__std .title { margin: .6rem 0 .2rem; font: 400 clamp(2.6rem, 10vw, 4.2rem)/1.05 var(--title, "Great Vibes", cursive); color: #f6f1e7; }
.lantern-night__std .sub { margin: 0 0 .5rem; font: 400 clamp(1.3rem, 4.6vw, 1.8rem)/1.2 var(--script, "Pinyon Script", cursive); color: #f1d9a6; }
.lantern-night__std .from { margin: 0 0 .5rem; }
.lantern-night__std .date { font: 500 clamp(.74rem, 3vw, .9rem) "Jost", sans-serif; letter-spacing: .3em; text-transform: uppercase; }
.lantern-night__std .where { margin-top: .2rem; font: italic 400 1.05rem "Cormorant Garamond", Georgia, serif; color: rgba(246, 241, 231, .92); }
.lantern-night__send textarea, .lantern-night__send input {
  width: 100%; box-sizing: border-box; padding: .7rem .9rem; border-radius: 12px; border: 1px solid rgba(241, 217, 166, .45);
  background: rgba(10, 12, 28, .55); color: #f6f1e7; font: 400 1.05rem/1.4 "Cormorant Garamond", Georgia, serif; text-shadow: none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); resize: none;
}
.lantern-night__send :is(textarea, input)::placeholder { color: rgba(246, 241, 231, .6); }
.lantern-night__send :is(textarea, input):focus { outline: none; border-color: #f1d9a6; }
.lantern-night__send .is-missing { border-color: #e7a07a; box-shadow: 0 0 0 2px rgba(231, 160, 122, .35); }
.lantern-night__go {
  align-self: center; display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; margin-top: .2rem;
  padding: .8em 1.5em; border-radius: 999px; border: 1px solid rgba(241, 217, 166, .7); background: rgba(241, 217, 166, .16);
  color: #f6f1e7; font: 500 .74rem "Jost", sans-serif; letter-spacing: .26em; text-transform: uppercase;
}
.lantern-night__watch { align-self: center; background: none; border: 0; padding: .2rem; cursor: pointer; color: rgba(246, 241, 231, .78); font: italic 400 1rem "Cormorant Garamond", Georgia, serif; text-decoration: underline; text-underline-offset: 3px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.lantern-night__watch:hover { color: #f6f1e7; }
.lantern-night__go:hover { background: rgba(241, 217, 166, .28); }
.lantern-night__go .lantern-night__ring { color: #f1d9a6; }
.lantern-night.is-going .lantern-night__send { opacity: 0; transform: translateY(-10px); pointer-events: none; transition-duration: .35s; } /* (quickly: their words are showing already) */
.lantern-night.is-sliding { pointer-events: none; }

/* ───── On the page (js/lake-embed.js): under "Will you join us?", where a lantern is sent up ───── */
.lake-embed { position: relative; margin: 2.2rem auto 0; width: 100%; max-width: 980px; }
.lake-embed[hidden] { display: none; }
.lake-embed__stage {
  position: relative; height: clamp(360px, 64vh, 620px); border-radius: 18px; overflow: hidden;
  background: linear-gradient(#03071a, #0b1434 25%, #1f1d4a 42%, #5a3150 56%, #3a2649 56%, #171833 64%, #05070f);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7), 0 0 0 1px rgba(229, 211, 168, .18);
}
.lake-embed__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1s ease; }
.lake-embed__stage.is-ready canvas { opacity: 1; }
/* its button, over the water at the bottom (away while a lantern's going up) */
.lake-embed__cue { position: absolute; left: 0; right: 0; bottom: 1.2rem; margin: 0; text-align: center; pointer-events: none; transition: opacity .8s ease; }
.lake-embed.is-sent .lake-embed__cue { opacity: 0; }
.lake-embed__send {
  pointer-events: auto; display: inline-flex; align-items: center; gap: .7rem; cursor: pointer;
  padding: .8em 1.5em; border-radius: 999px; border: 1px solid rgba(241, 217, 166, .55); background: rgba(10, 12, 28, .55);
  color: #f6f1e7; font: 500 .74rem "Jost", sans-serif; letter-spacing: .26em; text-transform: uppercase;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.lake-embed__send:hover { background: rgba(10, 12, 28, .75); }
.lake-embed__send .lantern-night__ring { color: #f1d9a6; }
/* the website's: a section of its own under "Will you join us?", the whole width, edge to edge (no frame) */
.lake-embed--section { margin: 0; max-width: none; background: #05070f; }
.lake-embed--section .lake-embed__stage { height: clamp(460px, 92vh, 900px); height: clamp(460px, 92svh, 900px); border-radius: 0; box-shadow: none; }
.lake-embed--section .lake-embed__cue { bottom: calc(env(safe-area-inset-bottom, 0px) + 2.2rem); }

/* ───── Letters on the wind and the RSVP (js/letters-embed.js) ───── */
/* version 10: a section of its own under "Will you join us?", the screen's height, the dusk sky drawn here first so
   it's there before the 3D is; its RSVP button near the bottom. Pressed, the section is held over the whole screen. */
.letters-embed { position: relative; height: 100vh; height: 100svh; min-height: 460px; overflow: hidden; background: linear-gradient(#081322, #1b2744 42%, #4b3f63 70%, #a8717a 86%, #e3aa7e); }
.letters-embed[hidden] { display: none; }
.letters-embed__stage { position: absolute; inset: 0; background: inherit; }
.letters-embed__stage canvas, .letters-over canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.letters-embed__stage.is-ready canvas, .letters-over.is-ready canvas { opacity: 1; }
.letters-embed.is-flying .letters-embed__stage { position: fixed; z-index: 200; }
.letters-embed__cue {
  position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 12vh); margin: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; pointer-events: none;
  color: #f6f1e7; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); transition: opacity .8s ease, transform .8s ease;
}
.letters-embed__line { margin: 0; font: 400 clamp(1.7rem, 6vw, 2.4rem)/1.1 "Pinyon Script", "Snell Roundhand", cursive; color: #e5d3a8; }
.letters-embed__go { pointer-events: auto; }
.letters-embed__go .lantern-night__ring { color: #f1d9a6; }
.letters-embed.is-going .letters-embed__cue { opacity: 0; transform: translateY(10px); pointer-events: none; }
.letters-embed.is-going .letters-embed__go { pointer-events: none; }
/* version 11: over the whole screen, see-through, over the photo of "Will you join us?" while the letter comes (its
   words, and the menu, fading away so it's just the photo) */
.letters-over { position: fixed; inset: 0; z-index: 200; pointer-events: none; visibility: hidden; }
html.is-flying .letters-over { visibility: visible; }
#rsvp :is(.section__head, .rsvp__toggles, .rsvp__panel), .nav { transition: opacity .8s ease; }
html.is-going #rsvp :is(.section__head, .rsvp__toggles, .rsvp__panel), html.letters-on .nav { opacity: 0; pointer-events: none; }
html.letters-on, html.letters-on body { overflow: hidden; }
/* the RSVP, as the letter becomes it: there at once (no rising into view), seen unseen a moment to be drawn */
.rsvp-pop.is-from-letter[open] { animation: rsvp-from-letter .5s ease; }
@keyframes rsvp-from-letter { from { opacity: 0; } }
.rsvp-pop.is-measuring { visibility: hidden !important; animation: none !important; }
.rsvp-pop.is-measuring::backdrop { background: transparent; }
/* version 12: in "Will you join us?", over its photo and under its words, letters drifting across it; held over the
   whole screen while theirs comes */
.letters-in-photo { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.letters-in-photo[hidden] { display: none; }
#rsvp:has(> .letters-in-photo:not([hidden])) > .container { position: relative; z-index: 1; }
html.is-flying .letters-in-photo { position: fixed; z-index: 200; }
.lantern-night.is-sliding ~ main .lantern-sky { opacity: 0; } /* (the page's lanterns there once the wishes are handed on to it, not twice meanwhile) */
/* the RSVP out of the letter (js/letters-embed.js): cream, the whole screen, as on a phone (no photo behind it) */
.rsvp-pop.is-letter { background: var(--cream); color: var(--ink); }
.rsvp-pop.is-letter .rsvp-pop__title { color: var(--pine); text-shadow: none; }
.rsvp-pop.is-letter .rsvp-pop__title em { color: #8a6526; }
.rsvp-pop.is-letter .rsvp-pop__bar { position: sticky; top: 0; z-index: 3; max-width: none; padding-inline: max(clamp(.75rem, 4vw, 2rem), calc((100% - 820px) / 2 + clamp(.75rem, 4vw, 2rem))); background: var(--cream); border-bottom: 1px solid rgba(86, 112, 79, .2); }
.rsvp-pop.is-letter .rsvp__card { flex: 1 0 auto; border-radius: 0; box-shadow: none; }
/* "Find my invitation" before the letter: a white pop-up over the letters (or the photo), not over the whole screen */
.rsvp-pop.is-finding { justify-content: center; padding: 1rem; background: rgba(6, 10, 22, .28); }
.rsvp-pop.is-finding::backdrop { background: transparent; }
.rsvp-pop.is-finding .rsvp-pop__bar { position: static; max-width: 560px; padding: 0 0 .7rem; background: none; border: 0; }
.rsvp-pop.is-finding .rsvp-pop__title { color: #f6f1e7; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.rsvp-pop.is-finding .rsvp-pop__title em { color: var(--gold); }
.rsvp-pop.is-finding .rsvp-pop__body { flex: none; max-width: 560px; padding: 0; }
.rsvp-pop.is-finding .rsvp__card { flex: none; background-color: #fffdf8; border-radius: calc(var(--radius) + 6px); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7); }
/* (versions 11 and 12, while the letter comes: "Will you join us?" over the rest of the page, so nothing after it covers
   the letter; and, if it's shorter than the screen, its photo filling the screen behind the letter) */
html.is-flying #rsvp { z-index: 199; }
.letters-photo { position: fixed; inset: 0; z-index: 150; pointer-events: none; opacity: 0; visibility: hidden; background-size: cover; background-repeat: no-repeat; transition: opacity .6s ease, visibility 0s linear .6s; }
html.is-flying .letters-photo.is-on { opacity: 1; visibility: visible; transition: opacity .6s ease; }
/* (the page's own lanterns hidden while the lake's carry the same wishes up onto it: js/lanterns.js takes them over, just
   where they are, as it ends) */
.intro-on:where(.intro-lanterns) .lantern-sky { visibility: hidden; }
