:root {
  --sage: #959e83;
  --sage-dark: #454d42;
  --sage-light: #d8dacc;
  --sand: #cfba9b;
  --brown: #b18d6b;
  --text: #252525;
  --bg: #ffffff;
  --font: "Quicksand", "Segoe UI", sans-serif;
  --script: "Allura", cursive;
  --names: "Great Vibes", cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  text-align: center;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

svg {
  flex-shrink: 0;
}

main > section,
.date-band {
  margin-inline: auto;
}

/* ---------- Animaciones ---------- */

@keyframes hero-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Portada ---------- */

.hero {
  padding: 8px 8px 0;
}

.hero-photo {
  position: relative;
  overflow: hidden;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.05;
  animation: hero-in 1.4s ease both;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.35));
  pointer-events: none;
}

.hero-text {
  position: absolute;
  inset: auto 0 6%;
  z-index: 1;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: rise 1.2s 0.6s ease both;
}

.hero-text h1 {
  font-family: var(--names);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 5.5rem);
  line-height: 1.1;
}

.hero-text p {
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(1rem, 3.6vw, 1.5rem);
  letter-spacing: 0.02em;
}

/* ---------- Reproductor ---------- */

.player {
  padding: 22px 16px 8px;
}

.player-hint {
  color: var(--sage);
  font-size: 0.95rem;
  line-height: 1.25;
}

.icon-inline {
  width: 1em;
  height: 1em;
  fill: var(--sage);
  vertical-align: -0.12em;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 12px;
}

.player-skip svg {
  width: 22px;
  height: 22px;
  fill: var(--sage-dark);
  opacity: 0.85;
  transition: transform 0.2s;
}

.player-skip:hover svg {
  transform: scale(1.15);
}

.player-main {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sage);
  transition: transform 0.2s, background 0.3s;
}

.player-main:hover {
  transform: scale(1.06);
}

.player-main::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--sage-dark);
  transition: background 0.3s;
}

.player-main svg {
  position: relative;
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  fill: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s, transform 0.25s;
}

.player-main[data-state="idle"] .i-play,
.player-main[data-state="playing"] .i-pause,
.player-main[data-state="paused"] .i-heart {
  opacity: 1;
  transform: scale(1);
}

/* En pausa: corazón blanco sobre salvia claro */
.player-main[data-state="paused"]::before {
  background: var(--sage);
}

.player-main[data-state="paused"] .i-heart {
  width: 24px;
  height: 24px;
}

.player-main[data-state="playing"] {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(149, 158, 131, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(149, 158, 131, 0); }
}

/* ---------- Títulos ---------- */

.script-title {
  font-family: var(--script);
  font-weight: 400;
  color: var(--sage);
  font-size: clamp(3rem, 12vw, 4.2rem);
  line-height: 1.1;
}

.subtitle {
  color: var(--sage);
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 14px;
}

/* ---------- Invitación ---------- */

.invite {
  max-width: 640px;
  padding: 28px 20px 10px;
}

.invite p {
  font-size: 1.05rem;
  margin-top: 14px;
}

/* ---------- Banda de fecha ---------- */

.date-band {
  max-width: 1200px;
  background: var(--sage-light);
  margin: 4px 8px 0;
  padding: 18px 10px;
}

@media (min-width: 1216px) {
  .date-band {
    margin-inline: auto;
  }
}

.date-band p {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 600;
  font-size: clamp(2.1rem, 9vw, 3rem);
  letter-spacing: 0.02em;
}

.date-band svg {
  width: 0.6em;
  height: 0.6em;
  fill: var(--sage);
}

/* ---------- Cuenta regresiva ---------- */

.countdown-section {
  padding: 28px 16px 10px;
}

.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 6px;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bubble {
  display: grid;
  place-items: center;
  width: clamp(52px, 13vw, 72px);
  height: clamp(52px, 13vw, 72px);
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font-weight: 500;
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* Más de 99 días: tres dígitos */
.bubble.long {
  font-size: clamp(1.35rem, 5.2vw, 1.8rem);
}

.unit small {
  color: var(--sage);
  font-size: 0.8rem;
  margin-top: 2px;
}

.colon {
  color: var(--sage);
  font-weight: 700;
  font-size: 1.8rem;
  line-height: clamp(52px, 13vw, 72px);
  padding: 0 2px;
}

/* ---------- Galería ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 1100px;
  padding: 26px 30px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
}

.gallery-item.wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transition: transform 0.6s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.06);
}

/* ---------- Detalles ---------- */

.details {
  display: grid;
  gap: 28px;
  max-width: 1100px;
  padding: 20px 20px 30px;
}

.detail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.detail-icon {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-icon.small {
  width: 44px;
  height: 44px;
  stroke-width: 2.6;
}

.detail h3 {
  color: var(--sage);
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 4px 0 6px;
  letter-spacing: 0.02em;
}

.detail p {
  font-size: 1.15rem;
  line-height: 1.4;
}

.detail p + p {
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: background 0.25s, transform 0.25s;
}

.pill:hover {
  background: var(--sage-dark);
  transform: translateY(-2px);
}

.pill svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.pill.whatsapp {
  text-decoration: none;
  padding-left: 0;
  background: linear-gradient(90deg, transparent 18px, var(--sage) 18px);
}

.pill.whatsapp:hover {
  background: linear-gradient(90deg, transparent 18px, var(--sage-dark) 18px);
}

.pill.whatsapp svg {
  width: 34px;
  height: 34px;
  padding: 4px;
  margin: -6px 2px -6px 0;
  border-radius: 50%;
  background: #fff;
  stroke: var(--sage-dark);
}

.pill.whatsapp .fill {
  fill: var(--sage-dark);
  stroke: none;
}

.swatch-label {
  margin-top: 18px;
}

.swatches {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.swatches span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c);
}

.gifts {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.gift-btn svg {
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: transform 0.25s;
}

.gift-btn:hover svg {
  transform: scale(1.12) rotate(-4deg);
}

/* ---------- Cierre ---------- */

.closing {
  max-width: 1100px;
  padding: 10px 8px 40px;
}

.closing img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.closing-text {
  padding: 16px 20px 0;
}

.closing-text > p:first-child {
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto;
}

.signature {
  font-family: var(--names);
  color: var(--sage);
  font-size: 1.9rem;
  margin-top: 6px;
}

.script-title.big {
  font-size: clamp(3.4rem, 14vw, 5rem);
}

/* ---------- Ventanas ---------- */

.modal,
.lightbox {
  margin: auto;
  border: 0;
}

.modal {
  width: min(90vw, 420px);
  padding: 36px 26px 30px;
  border-radius: 16px;
  color: var(--text);
}

.modal h3 {
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.8rem;
  color: var(--sage);
  line-height: 1;
  margin-bottom: 12px;
}

.modal p + p {
  margin-top: 10px;
}

.modal-data {
  background: var(--sage-light);
  border-radius: 10px;
  padding: 12px;
  font-weight: 600;
}

.modal::backdrop,
.lightbox::backdrop {
  background: rgba(37, 37, 37, 0.6);
  backdrop-filter: blur(3px);
}

.modal[open],
.lightbox[open] {
  animation: rise 0.35s ease;
}

.modal-close {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 2rem;
  line-height: 1;
  color: var(--sage);
  z-index: 2;
}

.lightbox {
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
}

.lightbox .modal-close {
  position: fixed;
  top: 12px;
  right: 18px;
  color: #fff;
  font-size: 2.6rem;
}

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--sage-dark);
  font-size: 2rem;
  line-height: 1;
  z-index: 2;
}

.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

/* ---------- Tablet / Escritorio ---------- */

@media (min-width: 700px) {
  .hero {
    padding: 16px 16px 0;
  }

  .hero-photo {
    aspect-ratio: auto;
    height: min(82vh, 760px);
    border-radius: 0 0 24px 24px;
  }

  .hero-photo img {
    object-position: center 55%;
  }

  .player {
    padding-top: 30px;
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 40px 24px;
  }

  .gallery-item.wide {
    aspect-ratio: auto;
  }

  .details {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 40px;
    row-gap: 48px;
    align-items: start;
  }
}

@media (min-width: 1000px) {
  body {
    font-size: 1.1rem;
  }

  .player-hint {
    font-size: 1.05rem;
  }

  .invite p {
    font-size: 1.2rem;
  }

  .details {
    grid-template-columns: repeat(6, 1fr);
  }

  /* Ceremonia, Celebración, Dress code en una fila; Obsequios y Confirmar en otra */
  .detail {
    grid-column: span 2;
  }

  .detail:nth-child(4),
  .detail:nth-child(5) {
    grid-column: span 3;
  }

  .closing {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 30px 24px 60px;
  }

  .closing img {
    border-radius: 16px;
    aspect-ratio: 4 / 3;
  }
}
