:root {
  --gold: #f0b950;
  --gold-deep: #bc7627;
  --cream: #fff8e9;
  --ink: #5c3c25;
  --blue: #aac7d8;
  --shadow: rgba(71, 44, 20, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #ead8bd;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.experience {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #f6e6c6;
}

.intro,
.video-stage,
.final-card {
  position: absolute;
  inset: 0;
}

.intro {
  z-index: 30;
  overflow: hidden;
  background: #f5e8cf;
  transition: opacity .45s ease, visibility .45s ease;
}

.intro-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 47%;
  transform: scale(1.001);
  transition: transform 1.35s cubic-bezier(.2,.8,.2,1), filter 1.35s ease;
}

.intro-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(26, 44, 61, .12), transparent 40%),
    linear-gradient(to top, rgba(255, 248, 232, .92) 2%, rgba(255, 248, 232, .12) 34%, transparent 55%);
  pointer-events: none;
}

.sun-trigger {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 47.5%;
  transform: translate(-50%, -50%);
  width: min(58vw, 390px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.sun-hit-area {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 230, 139, .62);
  animation: pulse 1.9s infinite;
}

.intro-copy {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(7vh, calc(env(safe-area-inset-bottom) + 28px));
  transform: translateX(-50%);
  width: min(88vw, 520px);
  text-align: center;
  text-shadow: 0 2px 14px rgba(255,255,255,.9);
}

.eyebrow {
  margin: 0 0 .45rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  font-weight: 700;
  opacity: .78;
}

.intro-copy h1,
.final-card h2,
.gift-panel h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.intro-copy h1 {
  font-size: clamp(2.25rem, 10vw, 4.1rem);
  color: #8d571e;
}

.intro-copy p:last-child {
  margin: .25rem 0 0;
  font-size: 1rem;
}

.tap-hint {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 47.5%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: rgba(255,255,255,.9);
  pointer-events: none;
  animation: sparkle 1.6s infinite;
}

.intro.is-opening .intro-bg {
  transform: scale(3.2);
  filter: brightness(1.5) saturate(1.08);
}

.intro.is-opening .intro-copy,
.intro.is-opening .tap-hint,
.intro.is-opening .sun-hit-area {
  opacity: 0;
  transition: opacity .28s ease;
}

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

.video-stage {
  z-index: 10;
  background: #000;
}

.invite-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.floating-button {
  position: absolute;
  z-index: 15;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: white;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(8px);
}

.final-card {
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 10%, rgba(255,255,255,.95), transparent 30%),
    linear-gradient(180deg, #b8d0df 0%, #f8dfae 42%, #fff7e7 100%);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  transition: opacity .65s ease, transform .65s ease, visibility .65s ease;
}

.final-card.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.final-glow {
  position: fixed;
  width: 52vmin;
  height: 52vmin;
  top: -12vmin;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,236,153,.95), rgba(245,184,71,.15) 55%, transparent 72%);
  filter: blur(4px);
}

.card-content {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  padding: 28px 22px 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 28px;
  background: rgba(255, 250, 238, .76);
  box-shadow: 0 22px 60px rgba(98, 64, 27, .18);
  backdrop-filter: blur(15px);
}

.mini-sun {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 7px;
  border-radius: 50%;
  color: #f8c75c;
  font-size: 2rem;
  filter: drop-shadow(0 4px 8px rgba(205,135,28,.25));
}

.final-card h2 {
  color: #9a601f;
  font-size: clamp(3.4rem, 15vw, 5.3rem);
  line-height: .92;
}

.age {
  margin: .45rem 0 1.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  color: #bd7b2b;
}

.event-details {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  text-align: left;
}

.event-details > div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.64);
  box-shadow: inset 0 0 0 1px rgba(210,160,81,.16);
}

.detail-label {
  display: block;
  margin-bottom: 2px;
  color: #a66c2f;
  font-size: .69rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.event-details strong {
  font-size: .94rem;
  line-height: 1.35;
}

.actions {
  display: grid;
  gap: 9px;
}

.action {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(181,113,37,.25);
  border-radius: 15px;
  color: #7b4b1b;
  background: rgba(255,255,255,.72);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.action.primary {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #e7aa43, #bd7425);
  box-shadow: 0 10px 25px rgba(181,105,27,.25);
}

.action.ghost { background: transparent; }

.signature {
  margin: 18px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  color: #9d6f40;
  font-style: italic;
}

.gift-dialog {
  width: min(90vw, 430px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
}

.gift-dialog::backdrop {
  background: rgba(40, 29, 21, .55);
  backdrop-filter: blur(5px);
}

.gift-panel {
  position: relative;
  padding: 30px 24px 24px;
  border-radius: 24px;
  text-align: center;
  background: #fff8e9;
  box-shadow: 0 25px 70px rgba(0,0,0,.28);
}

.gift-panel h3 { font-size: 1.75rem; }
.gift-panel p { margin-bottom: 12px; }
.gift-panel ul {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.gift-panel li {
  padding: 10px;
  border-bottom: 1px solid rgba(169,110,46,.13);
}

.close-dialog {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #7c5126;
  background: transparent;
  font-size: 1.75rem;
  cursor: pointer;
}
.dialog-ok { width: 100%; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 230, 139, .55); }
  50% { box-shadow: 0 0 0 28px rgba(255, 230, 139, 0); }
}

@keyframes sparkle {
  0%, 100% { opacity: .45; transform: translate(-50%, -50%) scale(.78) rotate(0deg); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(45deg); }
}

@media (min-width: 760px) {
  .experience {
    width: min(100vw, 520px);
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(70, 46, 21, .25);
  }
  body { background: #cdb999; }
}

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