:root {
  color-scheme: dark;
  --night: #070126;
  --violet: #26106d;
  --magenta: #c51b71;
  --gold: #f3ad28;
  --gold-light: #ffe5a1;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--night);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
  background:
    linear-gradient(rgba(7, 1, 38, 0.16), rgba(7, 1, 38, 0.34)),
    url("assets/fondo.png") center / cover fixed;
}

body.opened {
  overflow-x: hidden;
  overflow-y: auto;
}

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

.experience {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
}

.cover {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 46%, rgba(122, 92, 255, 0.16), transparent 34%),
    linear-gradient(rgba(4, 0, 28, 0.1), rgba(4, 0, 28, 0.34)),
    url("assets/fondo.png") center / cover;
  transition: opacity 850ms ease, visibility 850ms ease;
}

.cover::before,
.cover::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.cover::before {
  width: min(90vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(126, 231, 255, 0.34);
  box-shadow:
    0 0 42px rgba(45, 179, 255, 0.35),
    inset 0 0 48px rgba(204, 40, 204, 0.2);
  animation: portal-pulse 3.2s ease-in-out infinite;
}

.cover::after {
  width: min(72vw, 600px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(120, 68, 255, 0.06) 44%, transparent 70%);
  filter: blur(9px);
  animation: portal-breathe 2.6s ease-in-out infinite alternate;
}

.cover__content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(92vw, 900px);
  flex-direction: column;
  align-items: center;
  gap: clamp(22px, 5vh, 42px);
}

.cover__logo {
  display: block;
  width: 100%;
  height: auto;
  filter:
    drop-shadow(0 12px 12px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 20px rgba(255, 175, 43, 0.22));
  animation: logo-float 3.5s ease-in-out infinite;
  transform-origin: center;
}

.open-button {
  position: relative;
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid rgba(255, 229, 161, 0.86);
  border-radius: 999px;
  color: #fff8e3;
  font: inherit;
  font-size: clamp(1rem, 4vw, 1.25rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(110, 52, 167, 0.9), rgba(190, 24, 105, 0.92));
  box-shadow:
    0 10px 28px rgba(1, 0, 28, 0.5),
    0 0 24px rgba(226, 71, 199, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.open-button:hover,
.open-button:focus-visible {
  transform: translateY(-2px) scale(1.025);
  box-shadow:
    0 14px 34px rgba(1, 0, 28, 0.58),
    0 0 34px rgba(244, 90, 224, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  outline: none;
}

.open-button__spark {
  color: var(--gold-light);
  animation: sparkle 1.45s ease-in-out infinite;
}

.cover__glow {
  position: absolute;
  z-index: 1;
  width: 24vmin;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transform: scale(0.1);
  pointer-events: none;
}

.opened .cover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.opened .cover__content {
  animation: cover-away 820ms cubic-bezier(0.32, 0, 0.67, 0) forwards;
}

.opened .cover__glow {
  animation: flash-open 760ms ease-out forwards;
}

.invitation-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  place-items: start center;
  padding:
    max(28px, env(safe-area-inset-top))
    clamp(12px, 3vw, 28px)
    max(72px, calc(env(safe-area-inset-bottom) + 56px));
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease 350ms, visibility 0s linear 350ms;
}

.opened .invitation-stage {
  visibility: visible;
  opacity: 1;
}

.invitation-wrap {
  display: flex;
  width: min(94vw, 760px);
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.invitation-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(211, 174, 255, 0.32);
  border-radius: 8px;
  background: #170653;
  box-shadow:
    0 28px 70px rgba(2, 0, 32, 0.66),
    0 0 42px rgba(116, 74, 255, 0.22);
  transform: translateY(28vh) scale(0.72);
  transform-origin: 50% 10%;
  clip-path: circle(8% at 50% 8%);
}

.opened .invitation-card {
  animation: reveal-card 1.15s 240ms cubic-bezier(0.19, 0.85, 0.24, 1) forwards;
}

.invitation-image {
  display: block;
  width: 100%;
  height: auto;
}

.location-hotspot {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 4.5%;
  left: 0;
  height: 22%;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.location-hotspot:hover,
.location-hotspot:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 3px rgba(255, 225, 132, 0.72);
  outline: none;
}

.map-button {
  position: absolute;
  z-index: 4;
  top: 88%;
  left: 52%;
  display: inline-flex;
  min-height: clamp(38px, 7vw, 50px);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(8px, 1.8vw, 12px) clamp(16px, 4vw, 24px);
  border: 1px solid rgba(255, 224, 144, 0.72);
  border-radius: 999px;
  color: #fff;
  font-size: clamp(0.72rem, 3.1vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6b2a9d, #c51b71);
  box-shadow: 0 10px 28px rgba(0, 0, 30, 0.44);
  transform: translateX(-50%);
  white-space: nowrap;
  transition: transform 180ms ease, filter 180ms ease;
}

.map-button:hover,
.map-button:focus-visible {
  transform: translate(-50%, -2px);
  filter: brightness(1.12);
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.map-button span {
  color: var(--gold-light);
  font-size: 1.35rem;
}

.music-button {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: inline-flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 231, 173, 0.65);
  border-radius: 999px;
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: rgba(20, 4, 67, 0.82);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.music-button[hidden] {
  display: none;
}

.music-button.is-paused {
  opacity: 0.68;
}

.music-button__icon {
  color: var(--gold-light);
  font-size: 1.25rem;
}

@keyframes portal-pulse {
  0%, 100% { transform: scale(0.96) rotate(0deg); opacity: 0.52; }
  50% { transform: scale(1.04) rotate(2deg); opacity: 0.9; }
}

@keyframes portal-breathe {
  from { transform: scale(0.88); opacity: 0.48; }
  to { transform: scale(1.12); opacity: 0.88; }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.55; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(90deg); }
}

@keyframes flash-open {
  0% { opacity: 0; transform: scale(0.1); }
  38% { opacity: 0.88; }
  100% { opacity: 0; transform: scale(10); }
}

@keyframes cover-away {
  to { transform: scale(1.18); filter: blur(12px); opacity: 0; }
}

@keyframes reveal-card {
  0% { transform: translateY(28vh) scale(0.72); clip-path: circle(8% at 50% 8%); opacity: 0; }
  45% { opacity: 1; }
  100% { transform: translateY(0) scale(1); clip-path: circle(145% at 50% 8%); opacity: 1; }
}

@media (max-width: 560px) {
  .cover__content {
    width: min(96vw, 650px);
  }

  .cover__logo {
    width: 106%;
    max-width: none;
  }

  .invitation-stage {
    padding-right: 0;
    padding-left: 0;
  }

  .invitation-wrap {
    width: 100%;
  }

  .invitation-card {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .music-button__label {
    display: none;
  }
}

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