:root {
  --ink: #6B2F44;
  --rose-deep: #8C3552;
  --rose-day: #A23F5E;
  --rose: #B5546F;
  --line: #B77A8C;
  --gold: #C9A24A;
  --page-bg: #F4D9DF;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Montserrat', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  /* Números de altura completa en todo el sitio (Cormorant usa números "antiguos" de distintos tamaños) */
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
  background: var(--page-bg);
  color: var(--ink);
}
/* Los botones no heredan la fuente por defecto */
button { font-variant-numeric: inherit; font-feature-settings: inherit; }

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* Columna de la invitación, pensada para iPhone (390–430px) */
.stage {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 1033px;
  padding: 136px 24px 300px;
  background-image: url('assets/bg-oval.jpg');
  background-size: 100% 100%;
  background-position: center top;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Estrellas */
.star { position: absolute; fill: #E9BF55; animation: twinkle 3s ease-in-out infinite; }
.star--1 { width: 22px; height: 22px; left: 26px; top: 180px; }
.star--2 { width: 16px; height: 16px; right: 30px; top: 170px; fill: #fff; animation-delay: 1.1s; }
.star--3 { width: 26px; height: 26px; right: 26px; top: 490px; animation-delay: .6s; }
.star--4 { width: 14px; height: 14px; left: 34px; top: 540px; fill: #fff; animation-delay: 1.8s; }

/* Textos */
.intro {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  text-align: center;
}

.name, .closing {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--rose-deep);
  text-shadow: 0 1px 0 rgba(255,255,255,.7), 0 3px 8px rgba(255,255,255,.5);
  text-align: center;
}
.name { margin: 16px 0 0; font-size: 72px; line-height: 1.05; }
.closing { margin: 40px 0 0; font-size: 44px; line-height: 1.1; }

.celebrate {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: .02em;
  text-align: center;
}

.ribbon { display: block; margin-top: 8px; max-width: 100%; }

/* Fecha */
.date { margin-top: 24px; width: 100%; display: flex; align-items: center; }
.date__side {
  flex: 1;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .08em;
}
.date__center { flex: none; width: 104px; display: flex; flex-direction: column; align-items: center; }
.date__arc { display: block; }
.date__day {
  margin-top: -2px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 66px;
  line-height: .95;
  color: var(--rose-day);
}

/* Lugar */
.venue { margin-top: 24px; text-align: center; }
.venue__label { margin: 0; font-family: var(--font-serif); font-weight: 600; font-size: 22px; }
.venue__name { margin: 2px 0 0; font-family: var(--font-serif); font-weight: 700; font-size: 30px; }

/* Botones circulares */
.seals {
  margin: 32px -10px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 22px 26px;
  justify-content: center;
}
.seal {
  position: relative;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: radial-gradient(circle at 50% 30%, #fff, #FBDDE5);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(255,255,255,.55), 0 8px 18px rgba(120,60,80,.25);
  transition: transform .2s ease;
}
.seal:hover { transform: scale(1.05); }
.seal:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.seal__pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  animation: pulse 2.2s ease-out infinite;
}
.seal__heart { position: absolute; top: -9px; left: 40px; width: 18px; height: 18px; fill: var(--rose); stroke: #fff; stroke-width: 1.5; }
.seal__label {
  padding: 0 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: .04em;
}

/* Pantallas angostas (< 380px): los tres botones caben en una fila */
@media (max-width: 379px) {
  .stage { padding-left: 16px; padding-right: 16px; }
  .seals { gap: 22px 14px; }
  .seal { width: 92px; height: 92px; }
  .seal__heart { left: 37px; }
  .seal__label { font-size: 11px; }
}

/* Botón de música (fijo arriba a la derecha de la invitación) */
.music {
  position: fixed;
  z-index: 10;
  top: 12px;
  right: max(12px, calc(50% - 215px + 12px));
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 30%, #fff, #FBDDE5);
  box-shadow: 0 0 0 3px rgba(255,255,255,.55), 0 4px 10px rgba(120,60,80,.25);
  color: var(--rose-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music[hidden] { display: none; }
.music:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.music__icon { width: 20px; height: 20px; fill: currentColor; }
.music.is-playing .music__icon { animation: sway 1.6s ease-in-out infinite; }
/* Línea diagonal cuando la música está en pausa */
.music__slash {
  position: absolute;
  width: 26px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 0 0 1.5px #fff;
  transform: rotate(-45deg);
}
.music.is-playing .music__slash { display: none; }

/* Portada "Abrir invitación" */
.gate { display: none; }
.js .gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(ellipse at 50% 40%, #FFF6F7 0%, #F8E3E8 45%, var(--page-bg) 100%);
  transition: opacity .7s ease, visibility .7s;
}
.js .gate.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.gate__intro {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 22px;
  text-align: center;
}
.gate__name {
  margin: 6px 0 40px;
  font-family: var(--font-script);
  font-size: 64px;
  line-height: 1.1;
  color: var(--rose-deep);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
  text-align: center;
}
.gate__open { width: 128px; height: 128px; cursor: pointer; font: inherit; }
.gate__open .seal__heart { left: 52px; top: -10px; width: 22px; height: 22px; }
.gate__open .seal__label { font-size: 13px; }
.gate__hint {
  margin: 36px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 18px;
}
.gate__hint svg { width: 16px; height: 16px; fill: currentColor; }
.gate__star--1 { width: 22px; height: 22px; left: 18%; top: 22%; }
.gate__star--2 { width: 16px; height: 16px; right: 20%; bottom: 24%; fill: #fff; animation-delay: 1.2s; }

/* Mientras la portada está cerrada: sin scroll y la aparición escalonada espera */
.is-locked body { overflow: hidden; }
.is-locked .rise { animation-play-state: paused; }
.is-locked .music { display: none; }

/* Ventana de confirmación */
.modal {
  width: min(340px, calc(100% - 32px));
  padding: 0;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop { background: rgba(107, 47, 68, .45); }
.modal[open] { animation: pop .3s ease both; }
.modal__card {
  outline: none;
  position: relative;
  margin: 0;
  padding: 36px 24px 26px;
  border-radius: 24px;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 0%, #fff, #FBE6EB 70%);
  box-shadow: 0 0 0 5px rgba(255,255,255,.6), 0 18px 40px rgba(80,30,50,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.modal__heart {
  position: absolute;
  top: -13px;
  left: calc(50% - 13px);
  width: 26px;
  height: 26px;
  fill: var(--rose);
  stroke: #fff;
  stroke-width: 1.5;
}
.modal__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:focus-visible { outline: 3px solid var(--ink); outline-offset: -4px; border-radius: 50%; }
.modal__title {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
}
.modal__options {
  margin: 22px 0 18px;
  display: flex;
  gap: 12px;
  justify-content: center;
}
.modal__note {
  margin: 0 0 22px;
  max-width: 260px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
}
.modal__option {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #fff;
  color: var(--ink);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.modal__option:hover { transform: scale(1.06); }
.modal__option[aria-checked="true"] {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--gold);
}
.modal__option:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.modal__confirm {
  min-height: 48px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--rose-deep);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(120,60,80,.3);
  transition: opacity .2s ease;
}
.modal__confirm[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.modal__confirm:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

/* Animaciones */
.rise { animation: rise .9s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.7) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
@keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.28); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .rise, .star, .seal__pulse, .music.is-playing .music__icon { animation: none; }
  .js .gate { transition: none; }
  .modal[open], .modal__option, .modal__confirm { animation: none; transition: none; }
}
