/* Asel & Oneli – web invitation */
:root {
  --wine: #5c1729;
  --wine-deep: #3a0c18;
  --ink: #6a1f33;
  --ivory: #fbf7f0;
  --gold: #c9a35b;
  --gold-hi: #f0d590;
  --bg: #e8d9c9;
  --serif: "Cormorant Garamond", Georgia, serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #bea48e; color: var(--ink); font-family: var(--serif); }
body { overscroll-behavior: none; touch-action: manipulation; font-variant-numeric: lining-nums; }

/* ---------- stage: the 1080x1920 scene, scaled to the screen ---------- */
#viewport { position: fixed; inset: 0; overflow: hidden;
  background: radial-gradient(ellipse 85% 60% at 50% 42%, #f7efe6 0%, #e8d9c9 48%, #bea48e 100%); }
#stage { position: absolute; left: 50%; top: 50%; width: 1080px; height: 1920px; transform-origin: 0 0; }
.abs { position: absolute; left: 0; top: 0; }
#lace { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .10; }
#dustFar, #sparkle { width: 1080px; height: 1920px; pointer-events: none; }
#dustFar { filter: blur(1.5px); }
#vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 62% at 50% 46%, rgba(60,30,18,0) 55%, rgba(60,30,18,.22) 100%); }
#world { width: 1080px; height: 1920px; transform-origin: 540px 960px; }
#envShadow { width: 900px; height: 140px; border-radius: 50%; transform-origin: 450px 70px;
  background: radial-gradient(ellipse at center, rgba(60,25,15,.5) 0%, rgba(60,25,15,0) 70%); }
#cardWrap { width: 1080px; height: 1920px; transform-origin: 50% 50%; border-radius: 6px; overflow: hidden; background: #f6f2ea;
  box-shadow: 0 34px 70px rgba(70,35,20,.32), 0 6px 14px rgba(70,35,20,.2); }
#world > *, #cardWrap, #rsvp { will-change: transform, opacity; }
#cardWrap img, #cardWrap svg { position: absolute; inset: 0; width: 1080px; height: 1920px; display: block; }
#guest { fill: var(--ink); font-family: "Great Vibes", cursive; }
#sheen { position: absolute; inset: -40%; mix-blend-mode: soft-light; opacity: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0) 38%, rgba(255,250,235,.9) 50%, rgba(255,255,255,0) 62%); }
#flap { width: 900px; height: 420px; transform-origin: 450px 0; }
#rsvp { width: 704px; height: 1100px; transform-origin: 352px 380px; opacity: 0; }
#rsvp .body { position: absolute; left: 0; top: 0; width: 704px; height: 1100px; }
#rsvp .tassel { position: absolute; left: 259px; top: 734px; width: 200px; height: 360px; transform-origin: 100px 0;
  filter: drop-shadow(2px 5px 5px rgba(40,20,10,.35)); }
#foil { position: absolute; left: 117px; top: 127.5px; width: 458px; height: 612px; border-radius: 50%; overflow: hidden; mix-blend-mode: screen; }
#foilBand { position: absolute; inset: -30% -60%; opacity: 0;
  background: linear-gradient(105deg, rgba(255,230,170,0) 42%, rgba(255,232,180,.38) 50%, rgba(255,230,170,0) 58%); }
#fade { position: absolute; inset: 0; background: #1c0b07; pointer-events: none; }

/* ---------- overlay UI (not scaled with the stage) ---------- */
.ui { position: fixed; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 24px; text-align: center; pointer-events: none; transition: opacity .6s ease, transform .6s ease; }
.ui > * { pointer-events: auto; }
.ui.hidden { opacity: 0; transform: translateY(14px); }
.ui.hidden > * { pointer-events: none; }
#intro { top: max(7vh, env(safe-area-inset-top)); }
#intro .eyebrow { font-size: 15px; letter-spacing: .32em; text-transform: uppercase; font-weight: 600; color: var(--ink); opacity: .8; }
#intro .dear { font-family: "Great Vibes", cursive; font-size: clamp(30px, 8.5vw, 44px); line-height: 1.1; color: var(--ink); }
#openBar { bottom: max(9vh, calc(env(safe-area-inset-bottom) + 24px)); }
#rsvpBar { bottom: max(4.5vh, calc(env(safe-area-inset-bottom) + 16px)); }
.hint { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .75; font-weight: 600; }

.btn { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .2em; text-transform: uppercase;
  border: 0; border-radius: 999px; padding: 16px 34px; min-height: 52px; cursor: pointer; color: var(--gold-hi);
  background: linear-gradient(180deg, #6e1d33, #4d1222); box-shadow: 0 10px 24px rgba(60,20,20,.32), inset 0 1px 0 rgba(255,220,170,.25);
  transition: transform .15s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn.ghost { background: rgba(251,247,240,.85); color: var(--ink); box-shadow: 0 6px 16px rgba(60,20,20,.18); backdrop-filter: blur(6px); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 10px 24px rgba(60,20,20,.32), 0 0 0 0 rgba(201,163,91,.45); }
                   50% { box-shadow: 0 10px 24px rgba(60,20,20,.32), 0 0 0 12px rgba(201,163,91,0); } }

#sound { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(251,247,240,.8); color: var(--ink); font-size: 18px; box-shadow: 0 4px 12px rgba(60,20,20,.2);
  cursor: pointer; display: none; backdrop-filter: blur(6px); }
#sound.on { display: block; }

/* ---------- RSVP sheet ---------- */
#sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow: auto; border-radius: 22px 22px 0 0;
  background: rgba(251,247,240,.97); box-shadow: 0 -12px 40px rgba(60,20,20,.25); padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .6s cubic-bezier(.2,.8,.2,1); max-width: 560px; margin: 0 auto; }
#sheet.open { transform: translateY(0); }
#sheet h2 { font-family: "Great Vibes", cursive; font-weight: 400; font-size: 38px; text-align: center; color: var(--ink); line-height: 1.1; }
#sheet .sub { text-align: center; font-size: 15px; letter-spacing: .08em; color: #7a4a55; margin: 4px 0 18px; }
#sheet label.q { display: block; font-weight: 700; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; margin: 16px 0 8px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { font-family: var(--serif); font-size: 18px; font-weight: 600; padding: 14px 10px; min-height: 52px; border-radius: 14px;
  border: 1.5px solid #d8c2b4; background: #fff; color: var(--ink); cursor: pointer; }
.choice button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--gold-hi); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid #d8c2b4; background: #fff; font-size: 24px; color: var(--ink); cursor: pointer; }
.stepper output { font-size: 30px; font-weight: 700; min-width: 40px; text-align: center; }
#sheet textarea { width: 100%; min-height: 84px; border-radius: 14px; border: 1.5px solid #d8c2b4; padding: 12px 14px;
  font-family: var(--serif); font-size: 18px; color: var(--ink); background: #fff; resize: vertical; }
#sheet textarea:focus, .choice button:focus-visible, .stepper button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#sheet .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
#sheet .actions .btn { width: 100%; }
#sheet .note { font-size: 14px; text-align: center; color: #7a4a55; margin-top: 10px; }
#sheet .err { color: #a3122d; font-size: 15px; text-align: center; min-height: 20px; margin-top: 8px; }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.links a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 10px; border-radius: 14px;
  border: 1.5px solid #d8c2b4; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; }
[hidden] { display: none !important; }

/* short phones (iPhone SE etc.): keep the card's last lines clear of the buttons */
@media (max-height: 760px) {
  #rsvpBar { bottom: max(8px, env(safe-area-inset-bottom)); }
  #rsvpBar .btn { min-height: 42px; padding: 10px 24px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } #sheet { transition: none; } }
