/* ------------------------------------------------------------------ fonts (self-hosted, OFL) */
@font-face { font-family: "Cormorant"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-style: italic; font-weight: 300 700; font-display: swap; src: url(fonts/cormorant-italic.woff2) format("woff2"); }
@font-face { font-family: "Great Vibes"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/greatvibes.woff2) format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/jost.woff2) format("woff2"); }

:root {
  --blush: #f6d6de; --rose: #d98a9c; --deep-rose: #b5566f; --wine: #7a3450;
  --gold: #d8b46a; --gold-l: #f3dfa8; --champ: #f7e7c6; --lav: #d9cdf0; --ivory: #fffaf3; --plum: #2a1631;
  --ink: #6b3550;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Segoe Script", "Brush Script MT", cursive;
  --sans: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;
  --vis: min(80vw, 44vh, 420px);
  --vis-top: 40%;
  --ease: cubic-bezier(.22, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--serif);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
[hidden] { display: none !important; }
body[data-scene="none"] #bg, body[data-scene="none"] #fx { display: none; }

/* ------------------------------------------------------------------ background layers */
#bg, #fx { position: fixed; inset: 0; }
#bg { overflow: hidden; z-index: 0; }
#fx { z-index: 1; pointer-events: none; width: 100%; height: 100%; }
.bgl { position: absolute; inset: 0; opacity: 0; transition: opacity 2.2s ease-in-out; }
.bg-intro { opacity: 1; background:
  radial-gradient(120% 70% at 20% 10%, #fde7ee 0%, transparent 60%),
  radial-gradient(100% 80% at 90% 90%, #e3d6f6 0%, transparent 60%),
  linear-gradient(160deg, #f8dce6 0%, #eedcf3 55%, #e6d6f3 100%); }
.bg-s1 { background:
  radial-gradient(60% 45% at 50% 42%, #fff4ec 0%, transparent 70%),
  linear-gradient(170deg, #fbe3ea 0%, #f6cfda 60%, #f0c3d2 100%); }
.bg-s2 { background:
  radial-gradient(60% 50% at 50% 40%, #fff3d9 0%, transparent 70%),
  linear-gradient(165deg, #f3dcef 0%, #e2d4f4 45%, #f5e3c6 100%); }
.bg-s3 { background:
  radial-gradient(80% 60% at 30% 30%, #fff8ee 0%, transparent 70%),
  radial-gradient(70% 60% at 80% 80%, #f9dccf 0%, transparent 70%),
  linear-gradient(160deg, #fdf0f2 0%, #efe6fb 50%, #fbe9dc 100%); }
.bg-s4 { background:
  radial-gradient(55% 45% at 50% 42%, #6b3a6e 0%, transparent 75%),
  linear-gradient(180deg, #1f1027 0%, #2d1736 50%, #3b1c3a 100%); }
.bg-s5 { background:
  radial-gradient(55% 45% at 50% 45%, #fff0d2 0%, transparent 72%),
  linear-gradient(170deg, #f4cdd8 0%, #ecc2cf 45%, #f1d9b8 100%); }
.bg-s6 { background:
  radial-gradient(70% 55% at 50% 42%, #fffaf0 0%, #ffeccc 30%, transparent 75%),
  linear-gradient(165deg, #fbe0e7 0%, #f8e4cf 55%, #f3d5c0 100%); }
.bg-reveal { background:
  radial-gradient(60% 45% at 50% 38%, #fff7e6 0%, transparent 72%),
  radial-gradient(90% 70% at 100% 0%, #f2c7d3 0%, transparent 60%),
  linear-gradient(165deg, #f7d9e1 0%, #f2dcc8 55%, #ead1b4 100%); }
.bg-letter { background:
  radial-gradient(80% 60% at 50% 0%, #fff 0%, transparent 70%),
  linear-gradient(170deg, #fdf4ee 0%, #f9e6e9 60%, #f3dfe6 100%); }
body[data-scene="s1"] .bg-s1, body[data-scene="s2"] .bg-s2, body[data-scene="s3"] .bg-s3,
body[data-scene="s4"] .bg-s4, body[data-scene="s5"] .bg-s5, body[data-scene="s6"] .bg-s6,
body[data-scene="reveal"] .bg-reveal, body[data-scene="letter"] .bg-letter { opacity: 1; }

.aura { position: absolute; inset: -20%; filter: blur(60px); opacity: .55; transition: opacity 2s; }
.aura i { position: absolute; border-radius: 50%; width: 55vmax; height: 55vmax; mix-blend-mode: soft-light; }
.aura i:nth-child(1) { background: #ffd1dc; left: -5%; top: 0; animation: drift1 22s ease-in-out infinite alternate; }
.aura i:nth-child(2) { background: #d7c6f7; right: -10%; top: 25%; animation: drift2 26s ease-in-out infinite alternate; }
.aura i:nth-child(3) { background: #ffe6b8; left: 25%; bottom: -15%; animation: drift1 30s ease-in-out infinite alternate-reverse; }
body[data-scene="s4"] .aura { opacity: .2; }
@keyframes drift1 { to { transform: translate(12vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vmax, -6vmax) scale(.9); } }
.vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(122, 52, 80, .16) 100%); }
body[data-scene="s4"] .vignette { background: radial-gradient(100% 80% at 50% 45%, transparent 40%, rgba(10, 2, 14, .6) 100%); }

/* ------------------------------------------------------------------ journey stage */
main, section { position: fixed; inset: 0; z-index: 2; }
.visual { position: absolute; left: 50%; top: var(--vis-top); width: var(--vis); height: var(--vis); transform: translate(-50%, -50%); }
.v { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity 1.4s var(--ease), transform 1.6s var(--ease); pointer-events: none; }
.v.on { opacity: 1; }
.env-flap, .env-flap-open, .env-card, .env-seal, .env-shadow, .env-float, .bloom, .float-a, .float-b, .brush, .fly, .wing, .twk, .petals,
.door, .door-orn, .gift-lid, .gift-body, .bow-l, .bow-r, .tail-l, .tail-r, .gift-beam, .gift-inner, .gift-heart, .crown-shine { transform-box: fill-box; }

.orb { position: absolute; left: 50%; top: 50%; width: 30%; height: 30%; border-radius: 50%; transform: translate(-50%, -50%) scale(.2);
  background: radial-gradient(circle, #fffef8 0%, #fff1cf 30%, rgba(255, 214, 170, .5) 55%, rgba(255, 200, 190, 0) 72%);
  opacity: 0; transition: transform 4.5s var(--ease), opacity 2.5s ease; filter: blur(2px); }
.orb.on { opacity: 1; transform: translate(-50%, -50%) scale(2.2); }
.orb.on.bright { transform: translate(-50%, -50%) scale(3); }
.orb.gold { transition: transform 1.2s var(--ease), opacity 1.2s; }

.rays { position: absolute; left: 50%; top: 50%; width: 260%; height: 260%; transform: translate(-50%, -50%) rotate(0deg); border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 240, 200, .5) 0deg 5deg, rgba(255, 240, 200, 0) 5deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 30%, transparent 62%); mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .55) 30%, transparent 62%);
  opacity: 0; transition: opacity 2s; animation: spin 60s linear infinite; }
.rays.on { opacity: .6; }
.rays.full { opacity: 1; width: 420%; height: 420%; transition: opacity 1.5s, width 2.5s var(--ease), height 2.5s var(--ease); }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* envelope */
.v-envelope { transform: scale(.92); }
.v-envelope.on { transform: scale(1); }
.env-float { animation: bob 4.5s ease-in-out infinite; }
.env-shadow { animation: shadowPulse 4.5s ease-in-out infinite; transform-origin: center; }
@keyframes bob { 50% { transform: translateY(-7px); } }
@keyframes shadowPulse { 50% { transform: scaleX(.86); opacity: .07; } }
.v-envelope { filter: drop-shadow(0 0 22px rgba(255, 236, 200, .8)) drop-shadow(0 10px 30px rgba(181, 86, 111, .18)); }
.env-seal { transform-origin: center; animation: sealGlow 2.6s ease-in-out infinite; }
@keyframes sealGlow { 50% { transform: scale(1.08); filter: brightness(1.15); } }
.env-flap { transform-origin: 50% 0%; transition: transform .45s ease-in; }
.env-flap-open { transform-origin: 50% 100%; transform: scaleY(0); transition: transform .45s ease-out .42s; }
.env-card { transition: transform 1.1s var(--ease) .8s; }
.v-envelope.open .env-flap { transform: scaleY(0); }
.v-envelope.open .env-flap-open { transform: scaleY(1); }
.v-envelope.open .env-seal { animation: none; opacity: 0; transition: opacity .3s; }
.v-envelope.open .env-card { transform: translateY(-62px); }
.v-envelope.gone { opacity: 0; transform: scale(1.25) translateY(-4%); transition: opacity 1.4s ease, transform 2s var(--ease); }

/* heart */
.v-heart { transform: scale(.55); filter: drop-shadow(0 0 18px rgba(255, 214, 150, .9)); }
.v-heart .heart-line { stroke-dasharray: 700; stroke-dashoffset: 700; transition: stroke-dashoffset 2.4s ease-in-out; }
.v-heart .heart-fill { opacity: 0; transition: opacity 2s ease .8s; }
.v-heart.on { transform: scale(.62); }
.v-heart.on .heart-line { stroke-dashoffset: 0; }
.v-heart.on .heart-fill { opacity: .8; }
.v-heart.on.beat { animation: beat 1.25s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(.62); } 14% { transform: scale(.69); } 28% { transform: scale(.63); } 42% { transform: scale(.67); } }
.v-heart.away { opacity: 0; transform: scale(1.4); transition: opacity 1.2s, transform 1.6s var(--ease); animation: none; }

/* creative world */
.v-world { transform: scale(.9) rotate(-4deg); }
.v-world.on { transform: scale(1.04) rotate(0deg); transition: opacity 1.4s, transform 6s ease-out; }
.v-world .draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.v-world.on .draw { animation: draw 3.5s ease-in-out forwards; }
.v-world.on .thread { animation-delay: 1s; }
.v-world .swirl { stroke-dasharray: 520; stroke-dashoffset: 520; }
.v-world.on .swirl { animation: draw 2.6s ease-in-out .4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.v-world .petals { transform-origin: center; }
.v-world.on .petals { animation: spinSlow 40s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.bloom { transform-origin: center; transform: scale(0) rotate(-60deg); }
.v-world.on .bloom { animation: bloom 1.6s var(--ease) var(--d) forwards, sway 5s ease-in-out calc(var(--d) + 1.6s) infinite; }
@keyframes bloom { to { transform: scale(1) rotate(0deg); } }
@keyframes sway { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.06) rotate(8deg); } }
.float-a, .float-b, .brush { transform-origin: center; opacity: 0; }
.v-world.on .float-a { animation: fadeIn 1.2s .3s forwards, floaty 5s ease-in-out 1.5s infinite; }
.v-world.on .float-b { animation: fadeIn 1.2s .6s forwards, floaty 6s ease-in-out 1.8s infinite reverse; }
.v-world.on .brush { animation: fadeIn .8s .1s forwards, brush 2.6s ease-in-out .4s 1; }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes floaty { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes brush { 0% { transform: translate(-260px, 104px); } 35% { transform: translate(-150px, 30px); } 70% { transform: translate(-60px, 70px); } 100% { transform: translate(0, 0); } }
.fly { opacity: 0; }
.v-world.on .fly-a { animation: fadeIn 1s .8s forwards, flyA 7s ease-in-out .8s infinite; }
.v-world.on .fly-b { animation: fadeIn 1s 1.2s forwards, flyB 8s ease-in-out 1.2s infinite; }
.wing { transform-origin: center; animation: flap .32s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleX(.25); } }
@keyframes flyA { 50% { transform: translate(-40px, -30px) rotate(-10deg); } }
@keyframes flyB { 50% { transform: translate(50px, -24px) rotate(12deg); } }
.twk { transform-origin: center; opacity: 0; }
.v-world.on .twk { animation: twinkle 2.2s ease-in-out var(--d) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.1); } }

/* portal */
.v-portal { transform: scale(.85) translateY(4%); }
.v-portal.on { transform: scale(1) translateY(0); transition: opacity 2s, transform 5s ease-out; }
.v-portal .portal-frame { stroke-dasharray: 700; stroke-dashoffset: 700; }
.v-portal .portal-frame2 { opacity: 0; transition: opacity 2s 1.2s; }
.v-portal.on .portal-frame { animation: draw 2.4s ease-in-out .2s forwards; }
.v-portal.on .portal-frame2 { opacity: .7; }
.v-portal .portal-light { opacity: .15; transition: opacity 2.5s; }
.v-portal.on .portal-light { opacity: .5; }
.door { transition: transform 2.1s cubic-bezier(.6, .05, .25, 1); }
.door.door-l { transform-origin: 0% 50%; }
.door.door-r { transform-origin: 100% 50%; }
.door-orn { transition: transform 2.1s cubic-bezier(.6, .05, .25, 1), opacity 1s 1s; }
.door-orn.door-l { transform-origin: 0% 50%; }
.door-orn.door-r { transform-origin: 100% 50%; }
.v-portal.open .door, .v-portal.open .door-orn { transform: scaleX(.06); }
.v-portal.open .door-orn { opacity: 0; }
.v-portal.open .portal-light { opacity: 1; }
.portal-beams { transition: opacity 2s .6s; }
.v-portal.open .portal-beams { opacity: 1; }
.v-portal { filter: drop-shadow(0 0 26px rgba(255, 215, 150, .55)); }
.v-portal.open { filter: drop-shadow(0 0 48px rgba(255, 230, 180, .95)); transition: opacity 2s, transform 5s ease-out, filter 2s; }
.v-portal.away { opacity: 0; transform: scale(1.6); transition: opacity 1.2s, transform 1.8s ease-in; }

/* gift */
.v-gift { transform: scale(.35) translateY(30%); filter: drop-shadow(0 0 22px rgba(255, 226, 170, .7)); }
.v-gift.on { transform: scale(.9); transition: opacity 1.2s, transform 1.8s cubic-bezier(.3, 1.4, .5, 1); }
.v-gift.on .gift-body, .v-gift.on .gift-lid { animation: glowBox 2.2s ease-in-out infinite; }
@keyframes glowBox { 50% { filter: brightness(1.08) saturate(1.05); } }
.bow-l { transform-origin: 100% 85%; animation: ribbonL 2.4s ease-in-out infinite; }
.bow-r { transform-origin: 0% 85%; animation: ribbonR 2.4s ease-in-out infinite; }
.tail-l, .tail-r { transform-origin: 50% 0%; animation: tail 3s ease-in-out infinite; }
@keyframes ribbonL { 50% { transform: rotate(-7deg) scale(1.04); } }
@keyframes ribbonR { 50% { transform: rotate(7deg) scale(1.04); } }
@keyframes tail { 50% { transform: rotate(6deg); } }
.v-gift.shake .gift-body, .v-gift.shake .gift-lid { animation: shake .55s ease-in-out 2; }
@keyframes shake { 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
.gift-lid { transform-origin: 20% 100%; transition: transform 1.6s cubic-bezier(.3, 1.3, .5, 1); }
.v-gift.open .gift-lid { transform: translate(-30px, -64px) rotate(-24deg); animation: none; }
.gift-beam { transform-origin: 50% 100%; transform: scaleY(0); opacity: 0; transition: transform 1.8s var(--ease) .2s, opacity 1.2s .2s; }
.v-gift.open .gift-beam { transform: scaleY(1); opacity: .9; }
.gift-inner { opacity: 0; transform-origin: center; transform: scale(.4); transition: opacity 1s, transform 2s var(--ease); }
.v-gift.open .gift-inner { opacity: 1; transform: scale(1.3); }
.gift-heart { opacity: 0; transform-origin: center; transform: translateY(60px) scale(.3); }
.v-gift.heart .gift-heart { opacity: 1; animation: heartRise 2.4s var(--ease) forwards, none; }
@keyframes heartRise { to { transform: translateY(-48px) scale(1.25); } }
.v-gift.finale .gift-lid { transform: translate(-60px, -150px) rotate(-50deg); opacity: 0; transition: transform 1.6s ease-in, opacity 1.2s; }
.v-gift.finale .gift-heart { animation: heartRise 2.4s var(--ease) forwards, heartBeatUp 1.3s ease-in-out 2.4s infinite; }
@keyframes heartBeatUp { 0%, 100% { transform: translateY(-48px) scale(1.25); } 18% { transform: translateY(-48px) scale(1.38); } 36% { transform: translateY(-48px) scale(1.28); } }

/* ------------------------------------------------------------------ captions */
#caption { position: absolute; left: 0; right: 0; top: calc(var(--vis-top) + var(--vis) / 2 + 3.2vh); height: 32vh; pointer-events: none; }
.line { position: absolute; left: 7vw; right: 7vw; top: 0; margin: 0 auto; max-width: 30ch; text-align: center;
  font: italic 500 clamp(1.55rem, 6vw, 2.7rem)/1.22 var(--serif); letter-spacing: .01em; color: var(--ink);
  text-shadow: 0 0 18px rgba(255, 255, 255, .85), 0 0 2px rgba(255, 255, 255, .6); text-wrap: balance; }
.line.script { font: 400 clamp(2.6rem, 11vw, 4.4rem)/1.1 var(--script); color: var(--deep-rose); }
body[data-scene="s4"] .line { color: #fbe9c6; text-shadow: 0 0 22px rgba(255, 200, 140, .55), 0 0 2px rgba(0, 0, 0, .4); }
.w { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.35em); animation: wIn 1.2s var(--ease) var(--d) forwards; }
@keyframes wIn { to { opacity: 1; filter: blur(0); transform: none; } }
.line.out { animation: lineOut 1s ease forwards; }
@keyframes lineOut { to { opacity: 0; filter: blur(8px); transform: translateY(-.4em); } }

/* ------------------------------------------------------------------ buttons */
#cta, .l-cta { text-align: center; }
#cta { position: absolute; left: 0; right: 0; bottom: max(11vh, calc(env(safe-area-inset-bottom) + 36px)); }
.magic-btn { position: relative; display: inline-block; overflow: hidden; cursor: pointer; border: 1px solid rgba(255, 255, 255, .85); border-radius: 999px;
  padding: 1.1em 2.1em; font: 500 clamp(.8rem, 3.5vw, 1rem)/1 var(--sans); letter-spacing: .16em; color: #5d2a40;
  background: linear-gradient(135deg, #fff1cf 0%, #f2c6cf 48%, #e2bc72 100%);
  box-shadow: 0 0 0 0 rgba(255, 214, 160, .7), 0 10px 30px rgba(181, 86, 111, .28), inset 0 1px 0 rgba(255, 255, 255, .9);
  opacity: 0; transform: translateY(14px) scale(.96); animation: btnIn 1.3s var(--ease) forwards, pulse 2.4s ease-in-out 1.3s infinite;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.magic-btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: sheen 3.2s ease-in-out 1.6s infinite; }
.magic-btn:hover { filter: brightness(1.05); }
.magic-btn:active { transform: scale(.95); transition: transform .12s; }
.magic-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.magic-btn.tapped { animation: tapOut .7s ease forwards; pointer-events: none; }
@keyframes btnIn { to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 160, .65), 0 10px 30px rgba(181, 86, 111, .28), inset 0 1px 0 #fff; }
  50% { box-shadow: 0 0 0 14px rgba(255, 214, 160, 0), 0 10px 40px rgba(217, 138, 156, .45), inset 0 1px 0 #fff; } }
@keyframes sheen { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes tapOut { 0% { transform: scale(.95); } 40% { transform: scale(1.05); opacity: 1; filter: brightness(1.3); } 100% { transform: scale(1.1); opacity: 0; filter: blur(4px); } }

/* ------------------------------------------------------------------ reveal */
#reveal { overflow: hidden; }
.curtain { position: absolute; top: 0; bottom: 0; width: 51%; z-index: 4; transition: transform 2.6s cubic-bezier(.65, 0, .25, 1);
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 26px), linear-gradient(90deg, #b9607c, #e3a1b2 40%, #c86f89 70%, #e9b3c1); }
.c-l { left: 0; box-shadow: inset -3px 0 0 #e6c27a, 8px 0 30px rgba(120, 40, 70, .3); }
.c-r { right: 0; box-shadow: inset 3px 0 0 #e6c27a, -8px 0 30px rgba(120, 40, 70, .3); }
#reveal.open .c-l { transform: translateX(-102%); }
#reveal.open .c-r { transform: translateX(102%); }
.door-glow { position: absolute; left: 50%; top: 40%; width: 10vmin; height: 70vh; transform: translate(-50%, -50%); z-index: 3;
  background: radial-gradient(closest-side, #fffdf4, rgba(255, 236, 190, .6) 50%, transparent); opacity: 0; pointer-events: none; }
#reveal.open .door-glow { animation: doorGlow 3.4s cubic-bezier(.65, 0, .25, 1) forwards; }
@keyframes doorGlow { 0% { width: 6vmin; opacity: 1; } 55% { opacity: .95; } 100% { width: 180vmax; opacity: 0; } }
.reveal-center { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
.reveal-center .line { position: absolute; top: 44%; transform: translateY(-50%); font: 500 clamp(1.5rem, 6.4vw, 2.8rem)/1.25 var(--serif); letter-spacing: .14em; color: var(--wine); }
.reveal-center .line .w { transform: translateY(.35em) scale(.96); }
.reveal-stack { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(8px, 1.8vh, 18px); padding: max(5vh, env(safe-area-inset-top)) 6vw max(6vh, env(safe-area-inset-bottom)); }
.crown-wrap { height: clamp(46px, 8vh, 74px); opacity: 0; transform: translateY(-40px) scale(.6); }
.crown { height: 100%; overflow: visible; filter: drop-shadow(0 0 14px rgba(255, 210, 130, .9)); }
#reveal.admin .crown-wrap { animation: crownDrop 1.4s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes crownDrop { to { opacity: 1; transform: none; } }
.crown-shine { animation: crownShine 3.4s ease-in-out 1.4s infinite; }
@keyframes crownShine { 0% { transform: translateX(0); } 50%, 100% { transform: translateX(190px); } }
.admin-title { margin: 0; min-height: 1.2em; text-align: center; font: 400 clamp(2rem, 8.4vw, 3.6rem)/1.1 var(--script); color: var(--deep-rose);
  text-shadow: 0 0 22px rgba(255, 255, 255, .9); }
.site-card { position: relative; width: min(84vw, 470px, 52vh); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #fffaf6;
  box-shadow: 0 0 0 1px rgba(230, 194, 122, .9), 0 0 40px rgba(255, 220, 160, .8), 0 24px 60px rgba(150, 60, 90, .25);
  opacity: 0; transform: translateY(20px) scale(.9); transition: opacity 1.6s, transform 1.8s var(--ease), filter 2.4s ease; }
#reveal.card .site-card { opacity: 1; transform: none; }
.site-card.silhouette { filter: brightness(1.7) blur(3px) saturate(.4); }
.site-card.silhouette > :not(.sc-shine) { opacity: 0; }
.site-card > * { transition: opacity 1.6s ease; }
.site-card.live { animation: cardFloat 6s ease-in-out infinite; }
@keyframes cardFloat { 50% { transform: translateY(-6px); } }
.sc-bar { display: flex; align-items: center; gap: 5px; height: 9%; padding: 0 3.5%; background: linear-gradient(#f9e9ec, #f3dde3); border-bottom: 1px solid #f0d3da; }
.sc-bar i { width: 1.4vmin; height: 1.4vmin; max-width: 9px; max-height: 9px; border-radius: 50%; background: #e7a6b7; }
.sc-bar i:nth-child(2) { background: #ecc98a; } .sc-bar i:nth-child(3) { background: #c7b6ea; }
.sc-url { flex: 1; height: 56%; margin-left: 4%; border-radius: 99px; background: #fff; display: flex; align-items: center; gap: 6%; padding: 0 4%; overflow: hidden; }
.sc-url b { font-size: 9px; filter: saturate(.3); } .sc-url em { flex: 1; height: 30%; border-radius: 9px; background: linear-gradient(90deg, #f3dfe4, #f8eef0, #f3dfe4); background-size: 200% 100%; animation: shimmerBar 2s linear infinite; }
@keyframes shimmerBar { to { background-position: -200% 0; } }
.sc-body { height: 91%; padding: 3.5%; display: flex; flex-direction: column; gap: 4%; }
.sc-nav { display: flex; align-items: center; gap: 4%; height: 8%; }
.sc-logo { height: 100%; width: auto; }
.sc-nav span { height: 40%; width: 12%; border-radius: 9px; background: #f1dde2; } .sc-nav span:first-of-type { margin-left: auto; }
.sc-hero { flex: 1.25; border-radius: 10px; display: flex; align-items: center; gap: 6%; padding: 0 6%;
  background: radial-gradient(80% 90% at 85% 40%, #fff3d8, transparent), linear-gradient(120deg, #f9d7e0, #eadff8); }
.sc-flower { flex: none; width: 24%; height: auto; animation: spinSlow 18s linear infinite; }
.sc-lines { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.sc-lines span { height: 9px; border-radius: 9px; background: rgba(181, 86, 111, .35); width: 90%; }
.sc-lines span:nth-child(2) { width: 65%; background: rgba(181, 86, 111, .2); }
.sc-lines .btn { width: 38%; height: 14px; background: linear-gradient(90deg, #e2bc72, #f0cf8d); }
.sc-tiles { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; }
.sc-tiles span { border-radius: 8px; background: linear-gradient(160deg, #fbe4ea, #f3cfd9); }
.sc-tiles span:nth-child(2) { background: linear-gradient(160deg, #efe8fb, #d9cdf0); } .sc-tiles span:nth-child(3) { background: linear-gradient(160deg, #fdf0dc, #f3d9a6); }
.sc-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .9) 50%, transparent 65%); background-size: 260% 100%; background-position: 160% 0; pointer-events: none; }
.site-card.live .sc-shine { animation: cardShine 4.5s ease-in-out .4s infinite; }
@keyframes cardShine { 0% { background-position: 160% 0; } 45%, 100% { background-position: -60% 0; } }
.reveal-line { position: relative; width: 100%; min-height: 3.2em; text-align: center; }
.reveal-line .line { left: 0; right: 0; font-size: clamp(1.3rem, 5.4vw, 2.1rem); }

/* ------------------------------------------------------------------ letter */
#letter { display: grid; place-items: center; padding: max(3vh, env(safe-area-inset-top)) 4.5vw max(3vh, env(safe-area-inset-bottom)); }
.paper { position: relative; width: min(100%, 600px); max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: clamp(28px, 6vh, 56px) clamp(22px, 7vw, 56px) clamp(24px, 5vh, 44px); border-radius: 22px; text-align: center;
  background: radial-gradient(120% 60% at 50% 0%, #fff 0%, rgba(255, 250, 243, .96) 60%), #fffaf3;
  box-shadow: 0 0 0 1px rgba(230, 194, 122, .55), 0 0 0 7px rgba(255, 255, 255, .5), 0 0 0 8px rgba(230, 194, 122, .35), 0 30px 80px rgba(150, 60, 90, .22);
  opacity: 0; transform: translateY(26px) scale(.97); transition: opacity 1.6s, transform 1.8s var(--ease); -webkit-user-select: text; user-select: text; }
.paper::-webkit-scrollbar { display: none; }
#letter.on .paper { opacity: 1; transform: none; }
.corner { position: absolute; width: clamp(80px, 22vw, 130px); height: auto; pointer-events: none; opacity: .95; }
.corner.tl { left: 6px; top: 8px; transform: scaleY(-1) rotate(8deg); }
.corner.br { right: 6px; bottom: 8px; transform: scaleX(-1) rotate(8deg); }
.mini-crown { width: 46px; height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 0 8px rgba(255, 210, 130, .8)); animation: crownFloat 3.5s ease-in-out infinite; }
@keyframes crownFloat { 50% { transform: translateY(-4px) rotate(-3deg); } }
.l-heading { margin: 0 0 .6em; font: 400 clamp(1.9rem, 8.2vw, 2.9rem)/1.15 var(--script); color: var(--deep-rose); min-height: 1.1em; }
.l-body p, .l-closing { font: italic 500 clamp(1.14rem, 4.5vw, 1.42rem)/1.55 var(--serif); color: #5f3348; margin: 0 0 1em; text-wrap: pretty; }
.l-closing { margin: 1.3em 0 .1em; }
.l-sign { margin: 0 0 1.1em; font: 400 clamp(1.8rem, 7.6vw, 2.6rem)/1.2 var(--script); color: var(--deep-rose); min-height: 1.2em; }
.fadein { opacity: 0; filter: blur(6px); transform: translateY(10px); animation: wIn 1.6s var(--ease) forwards; }
.l-cta { min-height: 64px; padding-top: 4px; }

/* ------------------------------------------------------------------ sound control */
#sound { position: fixed; z-index: 9; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 6px;
  padding: 5px; border-radius: 99px; background: rgba(255, 255, 255, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); opacity: .7; transition: opacity .3s; animation: fadeIn 1.5s; }
#sound:hover, #sound:focus-within { opacity: 1; }
.snd-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .55); color: var(--wine); display: grid; place-items: center; cursor: pointer; padding: 0; }
.snd-btn svg { width: 19px; height: 19px; }
.snd-btn .cross { display: none; }
.snd-btn[aria-pressed="true"] .cross { display: block; } .snd-btn[aria-pressed="true"] .wave { display: none; }
.snd-vol { width: 0; opacity: 0; transition: width .3s, opacity .3s; accent-color: #c97b8e; margin: 0; }
#sound:hover .snd-vol, #sound:focus-within .snd-vol, #sound.open .snd-vol { width: 74px; opacity: 1; margin-right: 6px; }
body[data-scene="s4"] #sound { background: rgba(255, 255, 255, .12); }

/* ------------------------------------------------------------------ larger screens */
@media (min-aspect-ratio: 4/3) {
  :root { --vis: min(46vh, 440px); --vis-top: 40%; }
  .line { max-width: 34ch; }
}
@media (max-height: 560px) and (orientation: landscape) {
  :root { --vis: 52vh; --vis-top: 36%; }
  #caption { top: calc(var(--vis-top) + var(--vis) / 2 + 1vh); }
  .line { font-size: clamp(1.2rem, 4.6vh, 1.8rem); }
  .site-card { width: min(60vw, 40vh * 4 / 3); }
}

/* ------------------------------------------------------------------ reduced motion: same story, gentler motion */
@media (prefers-reduced-motion: reduce) {
  .aura i, .rays, .env-float, .env-shadow, .env-seal, .wing, .petals, .bloom, .float-a, .float-b, .fly, .brush, .twk,
  .bow-l, .bow-r, .tail-l, .tail-r, .crown-shine, .sc-flower, .site-card.live, .mini-crown, .sc-url em { animation: none !important; }
  .bloom, .float-a, .float-b, .fly, .brush { transform: none; opacity: 1; }
  .v-world .draw, .v-world .swirl, .v-portal .portal-frame, .v-heart .heart-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .v-heart.on.beat, .v-gift.shake .gift-body, .v-gift.shake .gift-lid { animation: none; }
  .v-gift.finale .gift-heart { animation: heartRise .01s forwards; }
  .w { filter: none; transform: none; animation-duration: .9s; }
  .line.out { animation: fadeOut .8s forwards; }
  .magic-btn { animation: btnIn .8s forwards; }
  .magic-btn::after { display: none; }
  .curtain { transition-duration: 1.2s; }
}
@keyframes fadeOut { to { opacity: 0; } }

/* lines used as static titles (admin welcome, letter heading) */
.line.as-title { position: static; max-width: none; margin: 0; font: inherit; color: inherit; text-shadow: inherit; letter-spacing: normal; }

/* celebration on "enter": balloons + crackers play over everything */
body.celebrate #fx { z-index: 8; }
body.celebrate #letter .paper { transition: opacity 2.4s ease .6s, transform 3s ease; opacity: .55; transform: scale(.97); }

/* ================================================================== launch: brand, gallery, end card */
.brand { margin: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .1em; }
.brand-name { display: block; min-height: 1.05em; font: 400 clamp(3rem, 13.5vw, 5.6rem)/1.05 var(--script); color: var(--deep-rose);
  text-shadow: 0 0 26px rgba(255, 255, 255, .95), 0 2px 0 rgba(255, 255, 255, .6); }
.brand-tag { display: block; min-height: 1.3em; font: italic 500 clamp(1.05rem, 4.4vw, 1.5rem)/1.3 var(--serif); color: var(--ink); opacity: 0; }
.brand-tag.fadein { animation: wIn 1.6s var(--ease) .5s forwards; }
.gallery { position: relative; width: min(74vw, 40vh, 400px); aspect-ratio: 1; flex: none; }
.ph { position: absolute; left: 50%; top: 50%; width: 64%; margin: 0; padding: 4% 4% 13%; background: #fffdf9; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(230, 194, 122, .45), 0 12px 30px rgba(120, 40, 70, .22);
  opacity: 0; transform: translate(-50%, -50%) translateY(70vh) rotate(calc(var(--r) * 4));
  transition: transform 1.15s cubic-bezier(.2, .9, .3, 1.12), opacity .5s ease; }
.ph img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.ph.in { opacity: 1; transform: translate(-50%, -50%) translateX(calc(var(--x) * .38)) rotate(var(--r)); }
.ph:last-child.in { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.04); }
.reveal-cta { min-height: 58px; text-align: center; }
.reveal-line { min-height: 2.6em; }

#endcard { display: grid; place-items: center; z-index: 3; padding: 6vh 8vw; }
.ec-inner { text-align: center; opacity: 0; transform: scale(.94); transition: opacity 1.4s, transform 2s var(--ease); }
#endcard.on .ec-inner { opacity: 1; transform: none; }
.ec-kicker { margin: 0 0 .4em; font: 500 clamp(.85rem, 3.6vw, 1.1rem)/1 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: #a0697d; }
.ec-name { margin: 0; font: 400 clamp(3.4rem, 15vw, 6.4rem)/1.05 var(--script); color: var(--deep-rose); text-shadow: 0 0 30px rgba(255, 255, 255, .95); }
.ec-url { display: inline-block; margin: .45em 0 .5em; padding: .28em .9em; border-radius: 999px; font: 600 clamp(1.5rem, 7vw, 2.6rem)/1.1 var(--serif); letter-spacing: .02em; color: var(--wine);
  background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px rgba(216, 180, 106, .9), 0 0 30px rgba(255, 220, 160, .8); }
.ec-tag { margin: 0; font: italic 500 clamp(1.05rem, 4.6vw, 1.5rem)/1.3 var(--serif); color: var(--ink); }
#endcard.on .ec-kicker { animation: wIn 1.2s var(--ease) .1s both; }
#endcard.on .ec-name { animation: wIn 1.4s var(--ease) .4s both; }
#endcard.on .ec-url { animation: wIn 1.4s var(--ease) 1.1s both; }
#endcard.on .ec-tag { animation: wIn 1.4s var(--ease) 1.6s both; }

/* video recording: no controls */
body.film #sound { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ph { transition-duration: .6s; } }
