/* Opening scenes of D020 (views/invite/scenes.templ), after invitation-openings.css: the same
   rules — the template palette, .is-open on the tap, .is-leaving when the overlay fades. */

/* A kicker inside a scene object stays when the stage's words fade on the tap. */
.scene-kicker { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.75; }

/* ── Scroll: a paper scroll on two rods unrolls downward ──────────────────── */
/* The seal ribbon rises 30px above the scroll; the top margin keeps it clear of the kicker. */
.scroll { position: relative; display: flex; flex-direction: column; align-items: center; width: min(280px, 76vw); margin-top: 36px; padding: 0; border: 0; background: none; cursor: pointer; animation: scroll-float 3.4s ease-in-out 1s infinite; }
.scroll-rod {
  position: relative; z-index: 2; display: block; width: 100%; height: 22px; border-radius: 11px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--op-cloth) 80%, #fff), var(--op-cloth) 55%, color-mix(in oklab, var(--op-cloth) 70%, #000));
  box-shadow: 0 6px 12px rgb(0 0 0 / 0.22);
}
.scroll-rod::before, .scroll-rod::after { content: ""; position: absolute; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--op-gold-light), var(--op-gold) 60%, var(--op-gold-dark)); }
.scroll-rod::before { left: -10px; } .scroll-rod::after { right: -10px; }
.scroll-paper {
  position: relative; display: block; box-sizing: border-box; width: 90%; height: 18px; overflow: hidden;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.06), transparent 12% 88%, rgb(0 0 0 / 0.06)), var(--op-paper);
  color: #3d2e22; box-shadow: inset 0 8px 10px -8px rgb(0 0 0 / 0.3), inset 0 -8px 10px -8px rgb(0 0 0 / 0.3);
}
.scroll-text { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; opacity: 0; }
.scroll-names { font-family: var(--cv-script, 'Great Vibes', 'Cormorant Garamond', cursive); font-size: clamp(30px, 9vw, 44px); line-height: 1.05; color: var(--op-cloth); text-wrap: balance; }
.op-dark .scroll-names { color: #6b3d2a; }
.scroll-date { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 20px; letter-spacing: 0.1em; }
.scroll-ribbon { position: absolute; z-index: 3; top: 6px; left: 50%; translate: -50% 0; }
.scroll-ribbon::before { content: ""; position: absolute; left: 50%; top: -30px; width: 14px; height: 100px; translate: -50% 0; z-index: -1; background: var(--op-gold); opacity: 0.9; }
.scroll-ribbon .op-seal { width: 64px; height: 64px; font-size: 18px; }
.op-scroll.is-open .scroll { animation: none; }
.op-scroll.is-open .scroll-ribbon { animation: scroll-ribbon 0.5s ease-in forwards; }
.op-scroll.is-open .scroll-paper { animation: scroll-unroll 1s 0.35s cubic-bezier(.5,0,.2,1) forwards; }
.op-scroll.is-open .scroll-text { animation: scroll-ink 0.6s 1s ease forwards; }
.op-scroll.is-open .scroll { animation: scroll-away 0.5s 1.75s ease-in forwards; }
@keyframes scroll-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes scroll-ribbon { to { transform: translateY(80px) scale(0.6); opacity: 0; } }
@keyframes scroll-unroll { to { height: min(300px, 46dvh); } }
@keyframes scroll-ink { to { opacity: 1; } }
@keyframes scroll-away { to { transform: scale(1.12); opacity: 0; } }

/* ── Boz üy: the felt door rolls up, light pours out, we step in ──────────── */
.yurt { position: relative; width: min(280px, 78vw); margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer; }
.yurt svg { display: block; width: 100%; height: auto; overflow: visible; }
.yurt-shadow { fill: rgb(0 0 0 / 0.12); }
.yurt-wall { fill: #faf6ee; }
.yurt-lattice { stroke: color-mix(in oklab, var(--op-cloth) 55%, #c9b79a); stroke-width: 1.6; opacity: 0.55; }
.yurt-dome { fill: #fffdf8; stroke: #e7dcc8; stroke-width: 1.5; }
.yurt-band { stroke: var(--op-cloth); stroke-width: 5; }
.yurt-orn { stroke: var(--op-cloth); stroke-width: 2.4; stroke-linecap: round; }
.yurt-tunduk { fill: var(--op-cloth); }
.yurt-tunduk-cross { stroke: var(--op-gold-light); stroke-width: 2; }
.yurt-light { fill: #ffd27a; opacity: 0.25; }
.yurt-door rect { fill: var(--op-cloth); }
.yurt-door path { stroke: var(--op-gold-light); stroke-width: 2.2; stroke-linejoin: round; }
.yurt-door { transform-box: fill-box; transform-origin: 50% 0; }
.yurt-glow { position: absolute; left: 50%; top: 76%; width: 30px; height: 30px; margin: -15px 0 0 -15px; will-change: transform; border-radius: 50%; background: radial-gradient(circle, #fff3c8, #ffd27a 40%, transparent 70%); opacity: 0; pointer-events: none; }
.op-yurt .yurt-tunduk { animation: yurt-smoke 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.op-yurt.is-open .yurt-door { animation: yurt-roll 0.8s cubic-bezier(.5,0,.3,1) forwards; }
.op-yurt.is-open .yurt-light { animation: yurt-lit 0.6s 0.4s ease forwards; }
.op-yurt.is-open .yurt-glow { animation: yurt-pour 1.1s 0.6s ease-in forwards; }
.op-yurt.is-open .yurt svg { animation: yurt-enter 0.8s 0.9s ease-in forwards; transform-origin: 50% 76%; }
@keyframes yurt-smoke { 0%, 100% { scale: 1; } 50% { scale: 1.12; } }
@keyframes yurt-roll { 0% { transform: scaleY(1); } 70% { transform: scaleY(0.12); } 100% { transform: scaleY(0.16); } }
@keyframes yurt-lit { to { opacity: 1; filter: drop-shadow(0 0 10px #ffd27a); } }
@keyframes yurt-pour { 0% { opacity: 0; transform: scale(1); } 30% { opacity: 1; } 100% { opacity: 1; transform: scale(90); } }
@keyframes yurt-enter { to { transform: scale(3.2); opacity: 0; } }

/* ── Balloons: the knot comes loose and the bunch floats away ─────────────── */
.balloons { position: relative; width: min(220px, 62vw); height: 230px; margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer; }
.balloon {
  position: absolute; left: 50%; top: 40px; width: 74px; height: 88px; margin-left: -37px;
  transform: translate(var(--x), var(--y)) rotate(var(--r)); animation: balloon-bob 3.6s ease-in-out infinite; animation-delay: calc(var(--d) * -6);
}
.balloon b {
  position: absolute; inset: 0; border-radius: 50% 50% 47% 53% / 44% 44% 56% 56%;
  background: radial-gradient(circle at 32% 28%, rgb(255 255 255 / 0.75), transparent 22%), var(--b);
  box-shadow: inset -8px -10px 18px rgb(0 0 0 / 0.14), 0 10px 18px rgb(0 0 0 / 0.12);
}
.balloon b::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 8px; margin-left: -5px; background: var(--b); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.balloon::after { content: ""; position: absolute; left: 50%; top: 94px; width: 1.5px; height: var(--l); background: color-mix(in srgb, var(--inv-text) 45%, transparent); transform-origin: top; rotate: var(--s); }
.balloons-knot { position: absolute; left: 50%; bottom: 0; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; border: 5px solid var(--op-gold); box-sizing: border-box; }
.op-balloons .op-confetti { top: 30%; --burst: 0.2s; }
.op-balloons.is-open .balloons-knot { animation: gift-bow 0.3s ease-in forwards; }
.op-balloons.is-open .balloon { animation: balloon-fly 1.6s cubic-bezier(.45,0,.6,1) forwards; animation-delay: var(--d); }
@keyframes balloon-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes balloon-fly { to { transform: translate(calc(var(--x) * 2.2), -120dvh) rotate(calc(var(--r) * 2)); } }

/* ── Fireworks over the mountains ─────────────────────────────────────────── */
.op-fireworks { background: radial-gradient(ellipse at 50% 100%, color-mix(in oklab, var(--inv-accent) 25%, #1a1840), #070a1a 70%); color: #f4ecff; }
.op-fireworks .op-names { color: var(--op-gold-light); }
.op-fireworks .op-cta { background: var(--op-gold); color: #241a0b; }
.op-mountains { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; width: 100%; height: 26vh; pointer-events: none; }
.op-mountains .mt-far { fill: color-mix(in oklab, var(--inv-accent) 22%, #1d2347); }
.op-mountains .mt-near { fill: color-mix(in oklab, var(--inv-accent) 12%, #0d1128); }
.op-mountains .mt-snow { fill: #e8ecff; opacity: 0.85; }
.fw { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fw-burst { position: absolute; left: var(--fx); top: var(--fy); width: 0; height: 0; }
.fw-burst i { position: absolute; left: -2px; top: -30px; width: 4px; height: 30px; border-radius: 2px; background: linear-gradient(to top, transparent, var(--fc)); transform-origin: 2px 30px; transform: rotate(var(--a)) translateY(0) scaleY(0.1); opacity: 0; }
.fw-trail { position: absolute; left: -1.5px; top: 0; width: 3px; height: 40px; border-radius: 2px; background: linear-gradient(to bottom, var(--fc), transparent); opacity: 0; }
.op-fireworks .fw-burst:nth-child(-n+2) i { animation: fw-ray 1.6s ease-out infinite; animation-delay: calc(var(--fd) * 2 + 1.4s); }
.op-fireworks.is-open .fw-burst i { animation: fw-ray 1.1s ease-out forwards; animation-delay: calc(var(--fd) + 0.45s); }
.op-fireworks.is-open .fw-trail { animation: fw-trail 0.45s ease-in forwards; animation-delay: var(--fd); }
.fw-rocket { width: 56px; padding: 0; border: 0; background: none; cursor: pointer; animation: fw-ready 1.4s ease-in-out infinite; }
.fw-rocket svg { display: block; width: 100%; height: auto; }
.fw-rocket-body { fill: var(--op-gold); }
.fw-rocket-fins { fill: color-mix(in srgb, var(--inv-accent) 70%, #fff); }
.fw-rocket-fuse { stroke: var(--op-gold-light); stroke-width: 2; stroke-dasharray: 4 3; }
.op-fireworks.is-open .fw-rocket { animation: fw-launch 0.7s ease-in forwards; }
.op-fireworks.is-open .op-stars i { animation-duration: 0.9s; }
@keyframes fw-ray {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scaleY(0.1); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-70px) scaleY(1); }
}
@keyframes fw-trail { from { opacity: 1; transform: translateY(60vh); } to { opacity: 0; transform: translateY(0); } }
@keyframes fw-ready { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes fw-launch { to { transform: translateY(-70vh) scale(0.4); opacity: 0; } }

/* ── Book: the cover opens on the first page ──────────────────────────────── */
.book { position: relative; width: min(230px, 64vw); aspect-ratio: 3 / 4; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1100px; }
.book-page, .book-cover { position: absolute; inset: 0; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px 18px; border-radius: 4px 12px 12px 4px; text-align: center; }
.book-page { background: linear-gradient(90deg, rgb(0 0 0 / 0.1), transparent 10%), var(--op-paper); color: #3d2e22; box-shadow: 0 16px 30px rgb(0 0 0 / 0.2); }
.book-chapter { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 22px; line-height: 1.2; }
.book-date { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 18px; letter-spacing: 0.1em; }
.book-cover {
  z-index: 2; transform-origin: left center; transform-style: preserve-3d; backface-visibility: hidden;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.22), transparent 9%), var(--op-cloth); color: var(--op-on-cloth);
  box-shadow: 0 18px 34px rgb(0 0 0 / 0.28), inset 0 0 0 7px color-mix(in srgb, var(--op-gold) 70%, transparent), inset 0 0 0 9px rgb(0 0 0 / 0.08);
}
.op-dark .book-cover { color: var(--inv-bg); }
.book-corner { position: absolute; inset: 16px; border: 1px solid var(--op-gold-light); border-radius: 2px 8px 8px 2px; opacity: 0.7; pointer-events: none; }
.book-names { font-family: var(--cv-script, 'Great Vibes', 'Cormorant Garamond', cursive); font-size: clamp(30px, 9vw, 42px); line-height: 1.05; text-wrap: balance; }
.book-seal { font-family: 'Cormorant Garamond', serif; font-size: 16px; letter-spacing: 0.2em; color: var(--op-gold-light); }
.book .scene-kicker { opacity: 0.85; }
.op-book .book { animation: book-tease 3.6s ease-in-out 1.2s infinite; }
.op-book.is-open .book { animation: book-away 0.5s 1.15s ease-in forwards; }
.op-book.is-open .book-cover { animation: book-open 1s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes book-tease { 0%, 80%, 100% { transform: none; } 88% { transform: rotateY(-8deg); } }
@keyframes book-open { to { transform: rotateY(-165deg); } }
@keyframes book-away { to { transform: scale(1.25); opacity: 0; } }

@property --u { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --r { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --c { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
/* ── Heart lock: the key turns, the shackle springs ───────────────────────── */
.lock { position: relative; width: min(180px, 52vw); height: 200px; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 620px; perspective-origin: 50% 51.5%; }
.lock-shackle { position: absolute; left: 22%; top: 0; width: 56%; height: auto; stroke: var(--op-gold); }
.lock-heart { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; fill: var(--op-cloth); filter: drop-shadow(0 12px 18px color-mix(in srgb, var(--inv-accent) 35%, transparent)); }
.lock-hole { fill: color-mix(in oklab, var(--op-cloth) 50%, #000); }
.lock-key { --u: 36px; --r: 90deg; --c: 20%; clip-path: inset(var(--c) 0 0 0); position: absolute; left: calc(50% - 13%); top: calc(51.5% - 0.37 * 4.5 * 0.26 * min(180px, 52vw)); width: 26%; height: auto; overflow: visible; transform-origin: 51.25% 37%; transform: rotateY(25deg) rotateX(66deg) translateY(var(--u)) rotateY(var(--r)); animation: key-nudge 2.4s ease-in-out 1.2s infinite; }
.lock-flash { position: absolute; left: calc(50% - 56px); top: calc(51.5% - 56px); width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle, #fffbe6 0%, #ffe9a0aa 38%, transparent 70%); opacity: 0; pointer-events: none; }
.op-lock .ask-hearts { top: 50%; }
.op-lock .ask-hearts i::before { font-size: 22px; color: var(--inv-accent); }
.op-lock .ask-hearts i:nth-child(3n)::before { color: #ff7aa8; font-size: 16px; }
.op-lock .ask-hearts i:nth-child(3n+1)::before { color: #f2c46d; font-size: 13px; }
.op-lock .ask-hearts i:nth-child(5n)::before { color: #fff; font-size: 18px; text-shadow: 0 0 6px var(--inv-accent); }
.op-lock.is-open .lock-key { animation: key-in 0.9s 0.05s cubic-bezier(.45, 0, .25, 1) forwards, key-turn 0.45s 1s cubic-bezier(.35, 1.3, .5, 1) forwards; }
.op-lock.is-open .lock-flash { animation: lock-flash 0.45s 1.35s ease-out forwards; }
.op-lock.is-open .lock-shackle { animation: shackle-up 0.5s 1.4s cubic-bezier(.3,1.6,.5,1) forwards; }
.op-lock.is-open .lock-heart { animation: heartbeat 0.6s 1.45s ease-in-out 2; }
.op-lock.is-open .ask-hearts i { animation: op-burst 1.15s cubic-bezier(.15,.7,.3,1) forwards; animation-delay: calc(1.35s + var(--d)); }
.op-lock.is-open .lock { animation: rb-zoom 0.5s 1.75s ease-in forwards; }
@keyframes key-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes key-in { 0% { --u: 36px; --c: 20%; } 14% { --u: 84px; --c: 0%; } 62% { --u: 14px; --c: 30%; } 82% { --u: -4px; --c: 39%; } 100% { --u: 0px; --c: 37.1%; } }
@keyframes key-turn { from { --r: 90deg; } to { --r: 180deg; } }
@keyframes lock-flash { 0% { opacity: 0; transform: scale(0.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes shackle-up { to { transform: translateY(-22px) rotate(-14deg); transform-origin: 20% 100%; } }

/* ── Vinyl: the arm drops, the record spins, notes rise ───────────────────── */
.vinyl { position: relative; width: min(240px, 66vw); aspect-ratio: 1; margin-top: 8px; padding: 0; border: 0; background: none; cursor: pointer; }
.vinyl-disc {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, transparent 31%, rgb(255 255 255 / 0.05) 32% 33%, transparent 34% 40%, rgb(255 255 255 / 0.05) 41% 42%, transparent 43% 52%, rgb(255 255 255 / 0.06) 53% 54%, transparent 55% 64%, rgb(255 255 255 / 0.05) 65% 66%, transparent 67%),
    conic-gradient(from 30deg, #161616, #2c2c2c 12%, #121212 25%, #2a2a2a 40%, #141414 55%, #2c2c2c 70%, #111 85%, #161616);
  box-shadow: 0 18px 34px rgb(0 0 0 / 0.35);
}
.vinyl-label { display: grid; place-items: center; width: 36%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #111 0 6%, transparent 7%), var(--op-cloth); color: var(--op-on-cloth); font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 18px; letter-spacing: 1px; }
.op-dark .vinyl-label { color: var(--inv-bg); }
.vinyl-arm { position: absolute; right: -12%; top: -6%; width: 26%; height: auto; fill: var(--op-gold); stroke: var(--op-gold); transform-origin: 73% 9%; rotate: -22deg; transition: rotate 0.6s cubic-bezier(.3,1.3,.5,1); }
.vinyl-notes { position: absolute; inset: 0; pointer-events: none; }
.vinyl-notes i { position: absolute; left: calc(20% + var(--n, 0) * 15%); top: 30%; font-style: normal; font-size: 26px; color: var(--inv-accent); opacity: 0; }
.vinyl-notes i:nth-child(2) { --n: 1; } .vinyl-notes i:nth-child(3) { --n: 2; } .vinyl-notes i:nth-child(4) { --n: 3; } .vinyl-notes i:nth-child(5) { --n: 4; }
.op-vinyl .vinyl-disc { animation: vinyl-idle 6s ease-in-out infinite; }
.op-vinyl.is-open .vinyl-arm { rotate: 8deg; }
.op-vinyl.is-open .vinyl-disc { animation: vinyl-spin 0.9s linear 0.45s infinite; }
.op-vinyl.is-open .vinyl-notes i { animation: note-rise 1.5s ease-out forwards; animation-delay: calc(0.6s + var(--n, 0) * 0.15s); }
.op-vinyl.is-open .vinyl { animation: rb-zoom 0.5s 1.6s ease-in forwards; }
@keyframes vinyl-idle { 0%, 100% { rotate: 0deg; } 50% { rotate: 8deg; } }
@keyframes vinyl-spin { to { rotate: 360deg; } }
@keyframes note-rise { 0% { opacity: 0; transform: translateY(0) rotate(-10deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-140px) rotate(14deg); } }

/* ── Moon over Ala-Too ────────────────────────────────────────────────────── */
.op-moon { background: linear-gradient(180deg, #060a1d, color-mix(in oklab, var(--inv-accent) 18%, #141b3d) 75%, color-mix(in oklab, var(--inv-accent) 28%, #26305a)); color: #eef0ff; }
.op-moon .op-names { color: var(--op-gold-light); }
.op-moon .op-cta { background: var(--op-gold); color: #241a0b; }
.op-moon .op-stage { flex: 1 0 auto; margin: 0; padding-top: 12vh; padding-bottom: max(24px, 5vh); }
/* The button sits at the bottom, under the moon on the mountains, like the other openings. */
.op-moon .op-cta { margin-top: auto; }
.moon { position: absolute; left: 50%; bottom: 14vh; z-index: 0; width: min(160px, 40vw); translate: -50% 0; filter: drop-shadow(0 0 22px rgb(255 232 170 / 0.55)); animation: moon-hint 4s ease-in-out infinite; }
.moon svg { display: block; width: 100%; height: auto; fill: #ffe6a6; }
.op-moon.is-open .moon { animation: moon-rise 1.6s cubic-bezier(.3,0,.2,1) forwards; }
.op-moon.is-open .op-stars i { animation-duration: 0.8s; }
.op-moon.is-open { animation: moon-dawn 1.8s ease forwards; }
@keyframes moon-hint { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -10px; } }
@keyframes moon-rise { to { translate: -50% -42vh; scale: 1.25; filter: drop-shadow(0 0 60px rgb(255 232 170 / 0.9)); } }
@keyframes moon-dawn { to { background-position: 0 0; filter: brightness(1.25); } }

@media (prefers-reduced-motion: reduce) {
  .inv-opening *, .inv-opening *::before, .inv-opening *::after { animation: none !important; transition: none !important; }
}
