:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #173552;
  background: #c5e4f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #c5e4f7;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.7), transparent 48%),
    #c5e4f7;
}

.opening,
.invitation-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.opening {
  z-index: 2;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 760ms ease,
    transform 760ms cubic-bezier(0.2, 0.7, 0.15, 1);
}

.opening.is-opening {
  opacity: 0;
  transform: scale(1.025);
  pointer-events: none;
}

.countdown-overlay {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.invitation-screen.is-counting-down .countdown-overlay {
  opacity: 1;
  visibility: visible;
}

.countdown-number {
  display: grid;
  width: clamp(92px, 24vw, 148px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #4c9bd4, #163d78 72%);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.18), 0 18px 55px rgba(13, 35, 59, 0.38);
  color: #fff;
  font-size: clamp(54px, 15vw, 92px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 3px 16px rgba(13, 35, 59, 0.3);
}

.countdown-number.is-ticking { animation: countdown-pop 960ms cubic-bezier(0.18, 0.72, 0.22, 1) both; }

@keyframes countdown-pop {
  0% { opacity: 0; transform: scale(1.75); }
  22% { opacity: 1; transform: scale(0.92); }
  42% { transform: scale(1); }
  82% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.72); }
}

.envelope-frame {
  position: relative;
  width: min(100vw, 55.83dvh);
  aspect-ratio: 1106 / 1981;
  filter: drop-shadow(0 18px 26px rgba(20, 50, 82, 0.18));
  line-height: 0;
}

.envelope-image,
.invitation__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
}

.seal-button {
  position: absolute;
  top: 50.74%;
  left: 54.52%;
  width: 25%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, -50%);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.seal-button:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 0 8px rgba(20, 75, 142, 0.28);
}

.seal-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 5px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 10px rgba(20, 75, 142, 0.4);
}

.seal-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.invitation-screen {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.68), transparent 48%),
    #c5e4f7;
  transition: opacity 700ms ease;
}

.invitation-screen.is-visible {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
}

.celebration-effects {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.party-balloon {
  position: absolute;
  bottom: -2vh;
  display: block;
  width: clamp(34px, 9vw, 58px);
  height: clamp(48px, 12vw, 78px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  box-shadow: inset -8px -7px 13px rgba(23, 53, 82, 0.16), 0 5px 16px rgba(23, 53, 82, 0.12);
  opacity: 0;
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
  animation: balloon-rise 20s linear infinite;
  will-change: transform, opacity;
}

.celebration-effects:not(.is-active) .party-balloon,
.celebration-effects:not(.is-active) .party-confetti {
  animation-play-state: paused;
}

.celebration-effects:not(.is-active) .party-balloon { display: none; }

.celebration-effects.is-active .party-balloon,
.celebration-effects.is-active .party-confetti {
  animation-play-state: running;
}

.celebration-effects.is-active .party-balloon { display: block; }

.party-balloon:hover { filter: brightness(1.08); }
.party-balloon:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.party-balloon.is-popped { animation: balloon-pop 240ms ease-out forwards; }

.party-balloon::after {
  position: absolute;
  top: 96%;
  left: 50%;
  height: 62px;
  border-left: 1px solid rgba(54, 88, 122, 0.42);
  content: "";
}

.party-balloon--blue {
  left: 5%;
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #b9e8ff 22%, #5ca9e0 78%, #3682c0 100%);
  animation-delay: -7s;
}

.party-balloon--pink {
  left: 88%;
  width: clamp(30px, 7vw, 48px);
  height: clamp(42px, 10vw, 64px);
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #ffe4f1 22%, #ed9cce 78%, #d96eaf 100%);
  animation-delay: -15s;
  animation-duration: 22s;
}

.party-balloon--gold {
  left: 14%;
  width: clamp(27px, 6vw, 42px);
  height: clamp(38px, 8vw, 56px);
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #fff2bd 24%, #f4c85e 78%, #dca52d 100%);
  animation-delay: -3s;
  animation-duration: 24s;
}

.party-balloon--lilac {
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #e9deff 22%, #ab8de5 78%, #8264ca 100%);
}

.party-balloon--aqua {
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #d5fff3 22%, #6ed8c2 78%, #37ad9a 100%);
}

.party-balloon--silver {
  background: radial-gradient(ellipse at 32% 24%, #fff 0 5%, #f8fcff 22%, #b9d6eb 78%, #8fb5d4 100%);
}

.balloon-pop-particle {
  position: absolute;
  z-index: 3;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  background: #f3c44d;
  pointer-events: none;
  animation: balloon-spark 480ms ease-out forwards;
}

.party-confetti {
  position: absolute;
  width: 7px;
  height: 13px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-float 8s ease-in-out infinite;
  will-change: transform, opacity;
}

.party-confetti--one { left: 9%; top: 20%; background: #f3c44d; animation-delay: 0.1s; }
.party-confetti--two { left: 91%; top: 28%; background: #ee91c0; animation-delay: 0.8s; }
.party-confetti--three { left: 6%; top: 54%; background: #fff; animation-delay: 1.4s; }
.party-confetti--four { left: 95%; top: 62%; background: #69b9e8; animation-delay: 0.5s; }
.party-confetti--five { left: 17%; top: 38%; background: #ee91c0; animation-delay: 1.1s; }
.party-confetti--six { left: 84%; top: 45%; background: #f3c44d; animation-delay: 1.7s; }
.party-confetti--seven { left: 3%; top: 77%; background: #69b9e8; animation-delay: 0.3s; }
.party-confetti--eight { left: 97%; top: 17%; background: #fff; animation-delay: 1.9s; }

@keyframes balloon-rise {
  0% { opacity: 0.82; transform: translate3d(0, 0, 0) rotate(-8deg); }
  12% { opacity: 0.82; }
  88% { opacity: 0.72; }
  100% { opacity: 0; transform: translate3d(22px, -132vh, 0) rotate(9deg); }
}

@keyframes confetti-float {
  0%, 100% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  20%, 75% { opacity: 0.78; }
  50% { transform: translate3d(12px, -34px, 0) rotate(145deg); }
}

@keyframes balloon-pop {
  to { opacity: 0; transform: scale(1.65) rotate(15deg); filter: blur(5px); }
}

@keyframes balloon-spark {
  to { opacity: 0; transform: translate(var(--burst-x), var(--burst-y)) rotate(220deg) scale(0.2); }
}

.invitation {
  position: relative;
  isolation: isolate;
  width: min(100vw, 56.28dvh);
  aspect-ratio: 9 / 16;
  line-height: 0;
}

.hotspot {
  position: absolute;
  z-index: 1;
  top: 63.4%;
  width: 14.5%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform: translate(-50%, -50%);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.hotspot--location {
  left: 32.4%;
}

.hotspot--gift {
  left: 67.4%;
}

.hotspot:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 7px rgba(31, 133, 196, 0.32);
}

.hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 8px rgba(31, 108, 166, 0.42);
}

.hotspot:active {
  transform: translate(-50%, -50%) scale(0.94);
}

.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;
}

.action-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(80dvh, 600px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: #173552;
}

.action-dialog::backdrop {
  background: rgba(13, 35, 59, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.dialog-card {
  position: relative;
  padding: clamp(26px, 7vw, 38px);
  border: 1px solid rgba(41, 95, 139, 0.16);
  border-radius: 24px;
  background: linear-gradient(160deg, #fffefa 0%, #f1f9fd 100%);
  box-shadow: 0 24px 80px rgba(11, 36, 63, 0.28);
  text-align: center;
}

.dialog-kicker {
  margin: 0 42px 12px;
  color: #52789c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0 0 3px;
  border: 0;
  border-radius: 50%;
  background: rgba(63, 157, 211, 0.13);
  color: #1d4d77;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.dialog-title {
  margin: 0 0 12px;
  color: #163d78;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 7vw, 34px);
  font-weight: 500;
  line-height: 1.12;
}

.dialog-message {
  margin: 0;
  color: #495d70;
  font-size: 15px;
  line-height: 1.65;
}

.dialog-return {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #329bd2;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 160ms ease, transform 160ms ease;
}

.action-dialog--gift {
  width: min(500px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.action-dialog--gift .dialog-card {
  padding: clamp(14px, 4vw, 20px);
}

.action-dialog--gift .dialog-kicker {
  margin-bottom: 8px;
}

.gift-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 230px);
  margin: 0 auto;
  border-radius: 14px;
  object-fit: contain;
}

.action-dialog--gift .dialog-return {
  margin-top: 16px;
}

.dialog-return:hover {
  background: #237fae;
}

.dialog-return:active {
  transform: scale(0.97);
}

.dialog-close:focus-visible,
.dialog-return:focus-visible {
  outline: 3px solid #174d78;
  outline-offset: 3px;
}

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


.location-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 999px;
  background: #329bd2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.location-link:hover { background: #237fae; }
.location-link:focus-visible { outline: 3px solid #174d78; outline-offset: 3px; }
