/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-size);
  padding: 10px 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  color: #fff;
  background: var(--color-rose-strong);
  box-shadow: var(--shadow-soft);
}

.btn--sage {
  color: #fff;
  background: var(--color-sage-deep);
  box-shadow: var(--shadow-soft);
}

.btn--outline {
  color: var(--color-rose-strong);
  background: #fff;
  border-color: var(--color-rose);
}

/* ---------- Pantalla del sobre ---------- */
.envelope-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px var(--gutter);
  overflow: hidden;
  text-align: center;
  background: linear-gradient(180deg, var(--color-sky) 0%, #f7eef0 60%, var(--color-rose-soft) 100%);
}

.envelope-screen__clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.envelope-screen__cloud {
  position: absolute;
  width: 180px;
  height: 72px;
  opacity: 0.9;
}

.envelope-screen__cloud--a {
  top: 6%;
  left: -20px;
}

.envelope-screen__cloud--b {
  bottom: 8%;
  right: -30px;
  width: 220px;
  height: 88px;
}

.envelope-screen__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.envelope-screen__kicker {
  font-size: 1.15rem;
  color: var(--color-ink-soft);
}

.envelope-screen__guest {
  max-width: 100%;
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 10vw, 3rem);
  color: var(--color-rose-deep);
  overflow-wrap: anywhere;
}

.envelope-screen__button {
  margin-top: 30px;
}

.envelope {
  position: relative;
  width: min(80vw, 330px);
  aspect-ratio: 4 / 3;
  perspective: 900px;
}

.envelope > * {
  position: absolute;
}

.envelope__back {
  inset: 0;
  border-radius: 8px;
  background: #e9bcc1;
  box-shadow: var(--shadow-soft);
}

.envelope__letter {
  inset: 8% 8% 10%;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 2rem;
  color: var(--color-rose-deep);
  background: #fffdfa;
  box-shadow: 0 2px 8px rgba(74, 59, 63, 0.12);
}

.envelope__pocket {
  inset: 0;
  z-index: 2;
  border-radius: 8px;
  background: #f4cdd1;
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}

.envelope__flap {
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  z-index: 3;
  background: #efc2c7;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
}

.envelope__seal {
  top: 56%;
  left: 50%;
  z-index: 4;
  width: 22%;
  margin: -11% 0 0 -11%;
  filter: drop-shadow(0 3px 4px rgba(74, 59, 63, 0.3));
}

/* ---------- Portada ---------- */
.cover {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-sky) 0%, #f4eff4 55%, var(--color-cream) 100%);
}

.cover__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cover__cloud {
  position: absolute;
  opacity: 0.92;
}

.cover__cloud--a {
  top: 6%;
  left: -30px;
  width: 190px;
  height: 76px;
}

.cover__cloud--b {
  top: 22%;
  right: -40px;
  width: 230px;
  height: 92px;
}

.cover__cloud--c {
  bottom: 10%;
  left: 6%;
  width: 170px;
  height: 68px;
}

.cover__dove {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 118px;
  height: 77px;
}

.dove__body,
.dove__tail,
.dove__wing {
  fill: #fffdfb;
  stroke: #b9cbd8;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.dove__wing--back {
  fill: #eef4f9;
}

.dove__eye {
  fill: var(--color-ink);
}

.dove {
  transform-box: fill-box;
}

.petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -24px;
  left: calc(var(--i) * 10.5%);
  width: 14px;
  height: 18px;
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #fbe4e6, var(--color-rose));
  opacity: 0;
}

.cover__content {
  position: relative;
  z-index: 1;
  padding-top: 18vh;
}

.cover__kicker {
  font-size: 1.2rem;
  color: var(--color-ink-soft);
}

.cover__title {
  margin: 8px 0 4px;
  font-size: clamp(3.6rem, 18vw, 5.4rem);
  color: var(--color-rose-deep);
}

.cover__name {
  font-size: clamp(1.9rem, 8.5vw, 2.5rem);
  color: var(--color-ink);
  overflow-wrap: anywhere;
}

.cover__date {
  margin-top: 22px;
  padding: 8px 18px;
  display: inline-block;
  border: 1.5px solid var(--color-gold);
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-gold-deep);
  background: rgba(255, 249, 244, 0.7);
}

/* ---------- Versículo ---------- */
.verse {
  background: var(--color-rose-soft);
}

.verse__spray {
  width: 200px;
  height: 125px;
  margin: -24px auto 12px;
}

.verse__quote p {
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.45;
}

.verse__quote footer {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--color-gold-deep);
}

.verse__quote footer:empty {
  display: none;
}

/* ---------- Padres y padrinos ---------- */
.family__group + .family__group {
  margin-top: 32px;
}

.family__label {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-deep);
}

.family__names li {
  font-size: 1.7rem;
  line-height: 1.35;
}

/* ---------- Saludo ---------- */
.greeting {
  background: linear-gradient(180deg, var(--color-cream), var(--color-sky) 130%);
}

.greeting__card {
  padding: 36px 24px;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.greeting__heart {
  width: 34px;
  height: 31px;
  margin: 0 auto 10px;
  fill: var(--color-rose);
}

.greeting__name {
  font-size: clamp(2.2rem, 10vw, 3rem);
  color: var(--color-rose-deep);
  overflow-wrap: anywhere;
}

.greeting__name::after {
  content: ",";
}

.greeting__line {
  margin-top: 6px;
  font-size: 1.45rem;
}

/* ---------- Cuenta regresiva ---------- */
.countdown {
  background: var(--color-sky);
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.countdown__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 4px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
}

.countdown__value {
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-rose-deep);
}

.countdown__label {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--color-ink-soft);
}

.countdown__done {
  font-size: 2.8rem;
  color: var(--color-rose-deep);
}

/* ---------- Ceremonia y recepción ---------- */
.event-card {
  padding: 30px 20px 24px;
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.event-card + .event-card {
  margin-top: 28px;
}

.event-card__title {
  font-size: 2.4rem;
  color: var(--color-rose-deep);
}

.event-card__time {
  margin-top: 4px;
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-gold-deep);
}

.event-card__date {
  font-size: 1.15rem;
  color: var(--color-ink-soft);
}

.event-card__place {
  margin-top: 14px;
  font-size: 1.4rem;
  font-weight: 600;
}

.event-card__address {
  margin-top: 4px;
  font-size: 1.15rem;
}

.event-card__map {
  width: 100%;
  height: 220px;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  background: var(--color-sky);
}

.event-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.event-card__actions .btn {
  flex: 1 1 130px;
}

/* ---------- Galería ---------- */
.gallery {
  background: linear-gradient(180deg, var(--color-cream), var(--color-rose-soft));
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gallery__frame {
  display: block;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-organic);
  background: linear-gradient(135deg, var(--color-rose), var(--color-sky) 55%, var(--color-sage));
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
}

.gallery__frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 38% 62% 42% 58% / 46% 40% 60% 54%;
  background: var(--color-sky);
}

.gallery__frame.is-missing img {
  visibility: hidden;
}

.gallery__frame.is-missing {
  background:
    radial-gradient(circle at 30% 30%, #fff8, transparent 55%),
    linear-gradient(135deg, var(--color-rose), var(--color-sky) 60%, var(--color-sage));
  aspect-ratio: 4 / 5;
}

.lightbox {
  max-width: min(94vw, 560px);
  max-height: 92vh;
  padding: 12px;
  border: 0;
  border-radius: 24px;
  background: var(--color-cream);
}

.lightbox::backdrop {
  background: rgba(74, 59, 63, 0.75);
}

.lightbox__image {
  max-width: 100%;
  max-height: calc(92vh - 24px);
  margin: 0 auto;
  border-radius: 16px;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--tap-size);
  height: var(--tap-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-rose-strong);
  background: rgba(255, 249, 244, 0.92);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.lightbox__close svg {
  width: 22px;
  height: 22px;
}

/* ---------- Lluvia de sobres ---------- */
.gifts__card {
  padding: 32px 22px;
  border: 2px dashed var(--color-gold);
  border-radius: var(--radius-card);
  background: #fffdfa;
}

.gifts__icon {
  width: 96px;
  height: 72px;
  margin: 0 auto 12px;
}

.gifts .section__title {
  margin-bottom: 12px;
}

/* ---------- Confirmación ---------- */
.rsvp {
  background: var(--color-sky);
}

.rsvp__deadline {
  margin-bottom: 22px;
}

.rsvp__deadline strong {
  color: var(--color-rose-strong);
}

.rsvp__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Cierre ---------- */
.closing {
  padding-bottom: 96px;
  background: var(--color-rose-soft);
}

.closing__spray {
  width: 220px;
  height: 137px;
  margin: -24px auto 12px;
}

.closing__text {
  font-size: 1.35rem;
}

.closing__signature {
  margin-top: 20px;
  font-size: 2.2rem;
  color: var(--color-rose-deep);
}

/* ---------- Botón de música ---------- */
.music-toggle {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, calc(50% - var(--page-width) / 2 + 12px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 2px solid var(--color-gold);
  border-radius: 50%;
  color: var(--color-rose-strong);
  background: rgba(255, 249, 244, 0.95);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.music-toggle__icon {
  grid-area: 1 / 1;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.music-toggle__icon--pause {
  display: none;
}

.music-toggle.is-playing .music-toggle__icon--play {
  display: none;
}

.music-toggle.is-playing .music-toggle__icon--pause {
  display: block;
}
