:root {
  color-scheme: light;
  --ink: #87524d;
  --rose: #c97980;
  --rose-dark: #a95f67;
  --paper: #fbf7f4;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(242, 185, 193, .26), transparent 30rem),
    radial-gradient(circle at 85% 90%, rgba(236, 180, 188, .22), transparent 28rem),
    #eee8e5;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button { font: inherit; }

.sound-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(242, 185, 193, .42), transparent 35rem),
    radial-gradient(circle at 80% 85%, rgba(236, 180, 188, .35), transparent 32rem),
    #f7f0ed;
  transition: opacity .65s ease, visibility .65s ease;
}

.sound-gate.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.sound-gate-card {
  width: min(90vw, 390px);
  padding: 42px 30px 34px;
  border: 1px solid rgba(135, 82, 77, .13);
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 252, 249, .88);
  box-shadow: 0 24px 70px rgba(86, 52, 49, .18);
  backdrop-filter: blur(12px);
}

.sound-gate-card h2 { margin: 8px 0 24px; font-size: clamp(1.8rem, 7vw, 2.35rem); line-height: 1.08; }
.sound-gate-note { display: inline-block; margin-bottom: 8px; color: var(--rose); font-size: 2.5rem; animation: music-pulse 1.2s ease-in-out infinite; }
.enter-button { width: 100%; border: 0; border-radius: 999px; padding: 14px 20px; color: #fff; background: linear-gradient(105deg, #c87a7f, #c88286); cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.enter-button:focus-visible { outline: 3px solid var(--rose-dark); outline-offset: 4px; }
.sound-gate-hint { margin: 14px 0 0; font: .82rem/1.4 Arial, Helvetica, sans-serif; opacity: .72; }

body:not(.experience-started) .layer,
body:not(.experience-started) .rsvp-button { animation-play-state: paused; }

.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
}

.invitation {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 941 / 1672;
  overflow: hidden;
  isolation: isolate;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(86, 52, 49, .22), 0 2px 9px rgba(86, 52, 49, .12);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.layer--background { z-index: 0; }
.layer--clouds { z-index: 1; animation: cloud-drift 12s ease-in-out infinite alternate; }
.layer--stars { z-index: 2; animation: twinkle 4.5s ease-in-out infinite; }
.layer--balloons {
  z-index: 3;
  transform-origin: 23% 31%;
  animation: balloon-float 6.5s ease-in-out infinite;
}
.layer--bear {
  z-index: 4;
  transform-origin: 22% 47%;
  animation: bear-sway 5.2s ease-in-out infinite;
}
.layer--copy { z-index: 5; animation: copy-reveal 1.4s ease-out both; }

.rsvp-button {
  position: absolute;
  z-index: 6;
  left: 21.8%;
  top: 87.15%;
  width: 56.9%;
  height: 4.9%;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(105deg, #c87a7f, #c88286);
  box-shadow: 0 7px 18px rgba(155, 84, 91, .2);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(.67rem, 3.2vw, 1.12rem);
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  animation: button-breathe 3.2s ease-in-out 1.8s infinite;
}

.rsvp-button:hover { filter: saturate(1.08); box-shadow: 0 10px 24px rgba(155, 84, 91, .3); }
.rsvp-button:active { transform: translateY(1px) scale(.985); }
.rsvp-button:focus-visible { outline: 3px solid #6e3f44; outline-offset: 4px; }

.music-toggle {
  position: fixed;
  z-index: 20;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(135, 82, 77, .2);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(251, 247, 244, .9);
  box-shadow: 0 6px 18px rgba(86, 52, 49, .14);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.music-toggle:hover { background: #fff; }
.music-toggle:focus-visible { outline: 3px solid var(--rose-dark); outline-offset: 3px; }
.music-note { font-size: 1.25rem; line-height: 1; }
.music-label { font: 600 .76rem/1 Arial, Helvetica, sans-serif; text-transform: uppercase; letter-spacing: .07em; }
.music-toggle[data-playing="true"] .music-note { animation: music-pulse 1.2s ease-in-out infinite; }

.rsvp-dialog {
  width: min(92vw, 430px);
  border: 0;
  padding: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 24px 80px rgba(69, 40, 37, .35);
}

.rsvp-dialog::backdrop {
  background: rgba(55, 37, 35, .46);
  backdrop-filter: blur(5px);
}

.rsvp-card {
  position: relative;
  padding: 34px;
  text-align: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(238, 178, 190, .22), transparent 45%),
    var(--paper);
}

.rsvp-card h2 { margin: 4px 0 16px; font-size: clamp(1.55rem, 6vw, 2rem); line-height: 1.1; }
.rsvp-card p { line-height: 1.55; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; }
.close-button { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--ink); font-size: 1.9rem; cursor: pointer; }
.dialog-actions { display: grid; gap: 10px; margin-top: 24px; }
.primary-button, .secondary-button { border-radius: 999px; padding: 12px 18px; cursor: pointer; }
.primary-button { border: 0; color: #fff; background: var(--rose); }
.secondary-button { border: 1px solid rgba(135, 82, 77, .35); color: var(--ink); background: #fff; }
.status { min-height: 1.5em; margin: 12px 0 0; font-size: .9rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes balloon-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-.3deg); }
  50% { transform: translate3d(0, -1.1%, 0) rotate(.7deg); }
}

@keyframes bear-sway {
  0%, 100% { transform: rotate(-.45deg); }
  50% { transform: translateY(-.25%) rotate(1deg); }
}

@keyframes cloud-drift {
  from { transform: translateX(-.35%); opacity: .86; }
  to { transform: translateX(.5%); opacity: 1; }
}

@keyframes twinkle {
  0%, 100% { opacity: .76; filter: brightness(.98); }
  50% { opacity: 1; filter: brightness(1.08); }
}

@keyframes copy-reveal {
  from { opacity: 0; transform: translateY(.6%); }
  to { opacity: 1; transform: none; }
}

@keyframes button-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}

@keyframes music-pulse {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-2px) rotate(4deg); }
}

@media (max-width: 520px) {
  .page-shell { padding: 0; }
  .invitation { width: 100%; min-height: 100dvh; border-radius: 0; box-shadow: none; }
  .music-toggle { top: 10px; right: 10px; min-height: 38px; padding: 7px 10px; }
  .music-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
