* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: #e7e3db;
  min-height: 100vh;
  padding-bottom: 64px; /* deja lugar al reproductor sticky */
}

/* Frame tipo celular: ancho fijo, se ve igual en mobile y desktop */
.phone-frame {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

section {
  display: block;
}

.section-img,
.section-video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.video-wrapper {
  position: relative;
}

/* Dos <video>: uno liviano para mobile, uno full para desktop. El que no
   corresponde queda oculto por CSS (más confiable entre navegadores que
   elegir el src por JS o por <source media="">). */
.video-wrapper .video-mobile {
  display: none;
}

@media (max-width: 767px) {
  .video-wrapper .video-desktop {
    display: none;
  }

  .video-wrapper .video-mobile {
    display: block;
  }
}

/* Botón "ver ubicación" superpuesto sobre la imagen, entre los dos textos */
.datos-wrapper {
  position: relative;
}

.location-btn-link {
  position: absolute;
  top: 83.5%;
  left: 36%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.25s ease;
}

.location-btn-link:hover,
.location-btn-link:active {
  transform: translate(-50%, -50%) scale(1.05);
}

.location-btn-img {
  display: block;
  width: 165px;
  max-width: 38vw;
  height: auto;
}

/* Countdown de la boda */
.countdown-section {
  background: #fff;
  padding: 56px 20px;
  text-align: center;
}

.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.countdown-value {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  color: #2b2b28;
  font-variant-numeric: tabular-nums;
}

.countdown-value.countdown-seconds {
  color: #b08d57;
}

.countdown-colon {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  color: #2b2b28;
  padding-top: 2px;
}

.countdown-label {
  margin-top: 10px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #6b6558;
  text-transform: uppercase;
}

.countdown-message {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 20px;
  color: #b08d57;
}

/* Sección de código de vestimenta (texto) */
.dresscode-section {
  background: #fff;
  padding: 48px 32px;
  text-align: center;
}

.title-img {
  display: block;
  max-width: 220px;
  width: 60%;
  height: auto;
  margin: 0 auto 8px;
}

.gracias-title-img {
  max-width: 280px;
  width: 75%;
  margin-bottom: 20px;
}

.dresscode-title {
  margin: 0 0 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: #4a4a45;
}

.dresscode-subtitle {
  margin: 0 0 24px;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 18px;
  color: #b08d57;
}

.dresscode-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 28px;
  border-radius: 6px;
  transition: opacity 0.25s ease;
}

.dresscode-img:hover {
  opacity: 0.9;
}

.dresscode-text {
  margin: 0 0 28px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.7;
  color: #6b6558;
}

.gifts-section {
  background: #fff;
  padding: 48px 32px;
  text-align: center;
}

.gifts-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.gifts-link-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.gifts-link-name {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  color: #4a4a45;
}

.gifts-transfer-title {
  margin-bottom: 18px;
}

.gifts-account {
  margin-bottom: 20px;
  font-family: Georgia, 'Times New Roman', serif;
  color: #6b6558;
}

.gifts-account-bank {
  margin: 0 0 2px;
  font-weight: bold;
  color: #4a4a45;
}

.gifts-account-name {
  margin: 0 0 2px;
}

.gifts-alias-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.gifts-account-alias {
  margin: 0;
  color: #b08d57;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.copy-alias-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #b08d57;
  background: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 12px;
  color: #b08d57;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.copy-alias-btn i {
  font-size: 12px;
}

.copy-alias-btn:hover {
  background: #b08d57;
  color: #fff;
}

.copy-alias-btn.copied {
  background: #b08d57;
  color: #fff;
}

/* Sección de agradecimiento */
.gracias-section {
  background: #fff;
  text-align: center;
  padding: 48px 32px;
}

.gracias-prefix {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 16px;
  color: #b08d57;
}

.gracias-title {
  margin: 0 0 20px;
  font-family: 'Alex Brush', cursive;
  font-size: 56px;
  line-height: 1;
  color: #b08d57;
}

/* RSVP: toda la imagen es un link a WhatsApp */
.rsvp-link {
  display: block;
  line-height: 0;
  transition: opacity 0.25s ease;
}

.rsvp-link:hover,
.rsvp-link:active {
  opacity: 0.9;
}

.dresscode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: 1px solid #b08d57;
  border-radius: 30px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #b08d57;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.dresscode-link:hover {
  background: #b08d57;
  color: #fff;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-play-btn i {
  font-size: 24px;
  color: #fff;
  margin-left: 4px;
}

.video-play-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.8);
}

.video-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}

.video-loader[hidden] {
  display: none;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Aparición ligada directamente al scroll (progreso calculado en JS, sin
   transición de duración fija) */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  will-change: opacity, transform;
}

/* Preload / sobre clickeable: tapa todo hasta que el usuario abre la invitación */
html.gate-open,
html.gate-open body {
  height: 100%;
  overflow: hidden;
}

html.gate-open .phone-frame,
html.gate-open .music-player {
  display: none;
}

.envelope-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.envelope-gate.is-closing {
  opacity: 0;
  transform: scale(1.25);
  pointer-events: none;
}

.envelope-img {
  width: 100%;
  max-width: 480px;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Reproductor de música sticky, fijo abajo, mismo ancho que el frame */
.music-player {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-top: 1px solid #d8d2c4;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.music-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #b08d57;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.music-btn .icon {
  width: 18px;
  height: 18px;
  fill: #b08d57;
}

.music-btn .icon.hidden {
  display: none;
}

.music-label {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: #6b6558;
  text-transform: uppercase;
}
