@font-face { font-family: "Titulos"; src: url("fonts/display.woff2") format("woff2"), url("fonts/display.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Texto"; src: url("fonts/texto.woff2") format("woff2"), url("fonts/texto.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Script"; src: url("fonts/script.woff2") format("woff2"), url("fonts/script.woff") format("woff"); font-display: swap; }

:root {
  --fondo: #F5F5F3;
  --tinta: #31496A;
  --gris: #A79F9F;
  --azul: #698DC9;
  --azul-osc: #1B243F;
  --blanco: #FFFFFF;
  --sombra: 0 18px 40px -18px rgba(27, 36, 63, 0.35);
  --rebote: cubic-bezier(0.34, 1.56, 0.64, 1);
  --suave: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Texto", Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
  overflow-x: clip;
}
body.cerrado { overflow: hidden; height: 100dvh; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--azul); outline-offset: 3px; border-radius: 6px; }

/* ---------- Tipografía ---------- */
.titulo {
  font-family: "Titulos", Georgia, serif;
  color: var(--gris);
  text-transform: uppercase;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
}
.titulo-hero { font-size: 2.15rem; text-align: center; margin-bottom: 14px; }
.titulo-seccion { font-size: 2.6rem; text-align: center; position: relative; margin-bottom: 22px; }
.texto-grande { font-size: 1.55rem; line-height: 1.3; }
.texto-medio { font-size: 1.2rem; }
.script { font-family: "Script", cursive; font-size: 2.4rem; line-height: 1.1; color: var(--tinta); }

/* ---------- Layout ---------- */
main { width: min(1120px, 100%); margin: 0 auto; padding: 32px 22px 120px; }
section { position: relative; padding: 56px 0; text-align: center; overflow-x: clip; }

/* ---------- Polaroids ---------- */
.polaroid {
  background: var(--blanco);
  padding: 12px 12px 56px;
  box-shadow: var(--sombra);
  position: relative;
}
.polaroid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.polaroid-hero { width: min(330px, 86%); margin: 0 auto; }
.polaroid-hero img { aspect-ratio: 1 / 0.95; object-position: 50% 30%; }
.polaroid-mini { width: 150px; padding: 8px 8px 30px; }
.polaroid-mini img { aspect-ratio: 1 / 1.05; }
.girar-d { transform: rotate(6deg); }
.girar-i { transform: rotate(-7deg); }

/* ---------- Hero ---------- */
.hero { padding-top: 24px; display: grid; gap: 36px; }
.nombres { position: relative; display: grid; justify-items: center; padding: 10px 0; }
.nombre, .amp { font-size: 4.4rem; }
.amp { font-size: 3rem; margin: 6px 0; }
.invitamos { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 30px; text-align: left; }
.invitamos .polaroid-mini { width: 112px; flex: none; }

/* ---------- Reproductor ---------- */
.player {
  width: min(340px, 92%);
  margin: 26px auto 0;
  background: var(--blanco);
  border-radius: 22px;
  padding: 14px 14px 16px;
  box-shadow: var(--sombra);
  text-align: left;
  position: relative;
}
/* El reproductor de YouTube existe pero no se ve: solo se usa como fuente de audio */
.yt-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; left: -9999px; }
.player-portada { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; object-position: 50% 30%; flex: none; }
.sonando:not(.muteado) .player-portada { animation: respirar 2.4s ease-in-out infinite; }
@keyframes respirar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.player-info { display: flex; align-items: center; gap: 12px; padding: 4px 4px 10px; }
.player-texto { flex: 1; min-width: 0; }
.player-cancion { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.player-artista { font-size: 0.86rem; color: var(--gris); }
.player-botones { display: flex; align-items: center; gap: 2px; flex: none; }
.player-barra { height: 4px; margin: 2px 6px 0; border-radius: 4px; background: #E3E6EE; overflow: hidden; cursor: pointer; }
.player-barra span { display: block; height: 100%; width: 0; background: var(--azul); transition: width 0.25s linear; }

.ctrl {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  transition: transform 0.2s var(--rebote), background 0.2s;
}
.ctrl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctrl:hover { background: rgba(105, 141, 201, 0.12); }
.ctrl:active { transform: scale(0.88); }
.ctrl-play { width: 48px; height: 48px; background: var(--azul); color: var(--azul-osc); }
.ctrl-play:hover { background: #7C9BD2; }
.ctrl-play svg, .mini .ctrl[data-accion="play"] svg { fill: currentColor; stroke: none; }
.i-pausa, .i-mudo { display: none; }
.sonando .i-play { display: none; }
.sonando .i-pausa { display: block; }
.muteado .i-son { display: none; }
.muteado .i-mudo { display: block; }

/* Control flotante */
.mini {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; align-items: center; gap: 2px;
  padding: 6px 6px 6px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(27, 36, 63, 0.4);
  transform: translateY(140%); opacity: 0;
  transition: transform 0.45s var(--rebote), opacity 0.3s;
}
.mini.visible { transform: none; opacity: 1; }
.mini .ctrl { width: 42px; height: 42px; }
.mini-onda { display: flex; align-items: flex-end; gap: 3px; height: 16px; margin-right: 6px; }
.mini-onda i { width: 3px; height: 4px; background: var(--azul); border-radius: 2px; }
.sonando:not(.muteado) .mini-onda i { animation: onda 0.9s ease-in-out infinite; }
.mini-onda i:nth-child(2) { animation-delay: 0.15s; }
.mini-onda i:nth-child(3) { animation-delay: 0.3s; }
@keyframes onda { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 14px; padding: 14px 22px;
  font-size: 1.05rem; text-decoration: none;
  transition: transform 0.25s var(--rebote), box-shadow 0.25s, background 0.25s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.96); }
.btn-lleno {
  background: var(--azul); color: var(--blanco);
  font-family: "Titulos", Georgia, serif; text-transform: uppercase; font-size: 2rem; letter-spacing: 0.04em;
  width: 100%; padding: 14px 20px; border-radius: 12px;
  box-shadow: 0 12px 24px -14px rgba(105, 141, 201, 0.9);
}
.btn-borde { border: 1.5px solid var(--azul); color: var(--tinta); background: var(--blanco); }
.btn-borde:hover { box-shadow: 0 10px 20px -12px rgba(105, 141, 201, 0.8); }

/* ---------- Fecha ---------- */
.fecha { display: grid; gap: 40px; }
.fecha-grande { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 8px; }
.fecha-mes { font-size: 1.55rem; line-height: 1.15; text-align: center; }
.fecha-mes span { font-size: 1.3rem; }
.fecha-dia { font-family: "Titulos", Georgia, serif; font-size: 5rem; line-height: 1; color: var(--tinta); }
.calendario { margin-top: 26px; }
.calendario-label { font-size: 0.95rem; color: var(--gris); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 12px; }
.calendario-botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.fecha-media { position: relative; }
.octagono {
  width: min(330px, 86%); margin: 0 auto; aspect-ratio: 1.3 / 1; object-fit: cover;
  clip-path: polygon(14% 0, 86% 0, 100% 18%, 100% 82%, 86% 100%, 14% 100%, 0 82%, 0 18%);
  border-radius: 10px;
}
.cuenta { margin-top: 26px; }
.reloj { display: flex; justify-content: center; align-items: flex-start; gap: 6px; margin: 10px 0 6px; }
.reloj div { display: grid; justify-items: center; min-width: 58px; }
.reloj span { font-family: "Titulos", Georgia, serif; font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.reloj small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gris); margin-top: 6px; }
.reloj b { font-family: "Titulos", Georgia, serif; font-size: 2.2rem; line-height: 1; font-weight: 400; color: var(--gris); }

/* ---------- Ubicación ---------- */
.ubicacion-grid { display: grid; gap: 26px; }
.foto { width: 100%; object-fit: cover; border-radius: 4px; }
.foto-salon { aspect-ratio: 0.82 / 1; }
.ubicacion-info { display: grid; gap: 24px; justify-items: center; }
.direccion { text-align: center; }
.foto-mapa { border-radius: 10px; box-shadow: var(--sombra); }
.ubicacion-fotos { display: grid; gap: 22px; margin-top: 30px; }
.ubicacion-fotos .foto { aspect-ratio: 1.15 / 1; }

/* ---------- Vestimenta ---------- */
.vestimenta-figuras { display: flex; justify-content: center; align-items: flex-end; gap: 18px; margin: 22px 0; }
.vestimenta-figuras img { width: 40%; max-width: 190px; }
.sugerencia span { display: inline-block; margin-top: 10px; }
.titulo-seccion + .texto-grande::before { content: ""; display: block; width: 70%; max-width: 320px; height: 1px; background: var(--gris); margin: -10px auto 14px; opacity: 0.6; }

/* ---------- Regalos ---------- */
.regalos-deco { position: relative; height: 200px; margin-bottom: 20px; }
.regalos-deco .polaroid-mini { position: absolute; right: 18%; top: 0; }
.regalos-intro { max-width: 560px; margin: 18px auto 0; }
.regalos-cards { display: grid; gap: 12px; margin: 28px auto 0; max-width: 820px; }
.regalo {
  display: grid; gap: 2px; text-align: center; text-decoration: none;
  background: var(--blanco); border-radius: 16px; padding: 18px 16px;
  box-shadow: 0 10px 26px -18px rgba(27, 36, 63, 0.5);
  transition: transform 0.25s var(--rebote), box-shadow 0.25s;
}
.regalo:hover { transform: translateY(-3px); box-shadow: var(--sombra); }
.regalo:active { transform: scale(0.97); }
.regalo-nombre { font-weight: 700; font-size: 1.2rem; }
.regalo-dato { color: var(--gris); font-size: 1rem; }
.regalo-accion { margin-top: 8px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--azul); }
.regalos-qr { margin: 22px auto 0; max-width: 820px; }
.regalos-qr summary { cursor: pointer; color: var(--azul); font-size: 0.95rem; list-style: none; }
.regalos-qr summary::-webkit-details-marker { display: none; }
.regalos-qr summary::after { content: " +"; }
.regalos-qr[open] summary::after { content: " −"; }
.regalos-qr img { margin-top: 16px; border-radius: 12px; }

/* ---------- Confirmación ---------- */
.collage { position: relative; height: 190px; margin-bottom: 30px; }
.collage .polaroid-mini { position: absolute; top: 10px; }
.collage .polaroid-mini:first-child { left: calc(50% - 150px); }
.collage .polaroid-mini:last-child { left: calc(50% - 10px); top: 22px; }
.ramo { margin: 40px auto 0; }

.pie { text-align: center; padding: 30px 0 10px; color: var(--gris); font-size: 0.9rem; }
.pie .script { font-size: 2.2rem; color: var(--tinta); }

/* ---------- Flores ---------- */
.flor { pointer-events: none; user-select: none; }
.esquinas .esquina { position: fixed; z-index: 30; width: 120px; opacity: 0; }
/* Las imágenes son ramas verticales: se rotan (y reflejan) para que entren desde cada esquina */
.e-si { top: -26px; left: -34px; --rot: 150deg; --sx: 1; }
.e-sd { top: -26px; right: -34px; --rot: -150deg; --sx: -1; }
.e-ii { bottom: -26px; left: -34px; --rot: 30deg; --sx: -1; }
.e-id { bottom: -26px; right: -34px; --rot: -30deg; --sx: 1; }

.ramita { position: absolute; width: 96px; opacity: 0; }
.ramita-1 { left: 2%; top: -8px; --rot: -55deg; }
.ramita-2 { right: 2%; bottom: 8px; --rot: 120deg; }
.ramita-3 { left: 4%; top: 46%; width: 110px; --rot: -20deg; z-index: 2; }
.titulo-ancla { position: relative; display: inline-block; }
.ramita-4 { left: -66px; top: -50px; width: 70px; --rot: -70deg; }
.ramita-5 { right: -34px; top: -52px; width: 70px; --rot: 30deg; }
.ramita-6 { left: 18%; top: 0; width: 160px; --rot: -30deg; }
.ramita, .esquina { transform: rotate(var(--rot, 0deg)) scaleX(var(--sx, 1)); }

/* Brinco tipo "seleccionar" de juego móvil: aparece, se pasa de tamaño, rebota y se asienta */
@keyframes brinco {
  0%   { opacity: 0; transform: rotate(var(--rot, 0deg)) scaleX(var(--sx, 1)) scale(0) translateY(30px); }
  45%  { opacity: 1; transform: rotate(calc(var(--rot, 0deg) + 8deg)) scaleX(var(--sx, 1)) scale(1.22) translateY(-6px); }
  62%  { transform: rotate(calc(var(--rot, 0deg) - 5deg)) scaleX(var(--sx, 1)) scale(0.9) translateY(2px); }
  78%  { transform: rotate(calc(var(--rot, 0deg) + 2deg)) scaleX(var(--sx, 1)) scale(1.06); }
  90%  { transform: rotate(var(--rot, 0deg)) scaleX(var(--sx, 1)) scale(0.98); }
  100% { opacity: 1; transform: rotate(var(--rot, 0deg)) scaleX(var(--sx, 1)) scale(1); }
}
@keyframes mecer {
  0%, 100% { transform: rotate(var(--rot, 0deg)) scaleX(var(--sx, 1)); }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 2.5deg)) scaleX(var(--sx, 1)); }
}
.brinca { animation: brinco 0.9s var(--suave) both, mecer 5s ease-in-out 1s infinite; }

/* Destello que acompaña al brinco */
.chispa {
  position: fixed; z-index: 31; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--azul); pointer-events: none;
  animation: chispa 0.7s var(--suave) forwards;
}
@keyframes chispa {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

/* Contenido aparece suave al hacer scroll */
.aparece { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--suave), transform 0.8s var(--suave); }
.aparece.visto { opacity: 1; transform: none; }

/* ---------- Portada ---------- */
.sobre {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--fondo);
  transition: opacity 0.7s var(--suave), visibility 0.7s;
  overflow: hidden;
}
.sobre.abierto { opacity: 0; visibility: hidden; }
.sobre-centro { text-align: center; padding: 24px; position: relative; z-index: 2; }
.sobre-pre { font-family: "Script", cursive; font-size: 2.6rem; color: var(--tinta); }
.sobre-titulo { font-family: "Titulos", Georgia, serif; text-transform: uppercase; font-weight: 400; color: var(--gris); font-size: 2.7rem; line-height: 1.05; margin: 6px 0 10px; }
.sobre-fecha { letter-spacing: 0.3em; font-size: 1.05rem; margin-bottom: 34px; }
.btn-abrir { background: var(--azul); color: var(--blanco); font-size: 1.1rem; padding: 16px 28px; border-radius: 999px; box-shadow: 0 14px 30px -14px rgba(105, 141, 201, 1); animation: latido 2.2s ease-in-out infinite; }
.btn-abrir svg { width: 20px; height: 20px; }
.sobre-nota { margin-top: 14px; font-size: 0.85rem; color: var(--gris); }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.flor-sobre { position: absolute; width: 190px; opacity: 0.95; }
.fs-1 { top: -30px; left: -40px; transform: rotate(150deg); }
.fs-2 { bottom: -30px; right: -40px; transform: rotate(-30deg); }

.aviso {
  position: fixed; left: 50%; bottom: 90px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--azul-osc); color: var(--blanco); font-size: 0.9rem;
  padding: 10px 16px; border-radius: 999px;
  transition: opacity 0.25s, transform 0.35s var(--rebote);
  pointer-events: none;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mi boda en fotos ---------- */
.enfotos .script { font-size: 2.2rem; margin-bottom: 4px; }
.enfotos-texto { max-width: 520px; margin: 0 auto 24px; }
.btn-enfotos { font-family: "Texto", Georgia, serif; text-transform: none; letter-spacing: 0; font-size: 1.15rem; width: auto; padding: 16px 28px; border-radius: 999px; }
.btn-enfotos svg { width: 24px; height: 24px; }
.ramita-7 { right: 6%; top: 10px; width: 90px; --rot: 35deg; }

/* ---------- Escritorio ---------- */
@media (min-width: 900px) {
  body { font-size: 19px; }
  main { padding: 48px 48px 140px; }
  section { padding: 90px 0; }
  .titulo-seccion { font-size: 3.4rem; }

  .hero { grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; padding-top: 40px; min-height: min(92vh, 860px); }
  .titulo-hero { font-size: 2.6rem; }
  .polaroid-hero, .player { width: 380px; }
  .nombre { font-size: 6.4rem; }
  .amp { font-size: 4rem; }
  .invitamos { margin-top: 44px; }
  .invitamos .polaroid-mini { width: 140px; }

  .fecha { grid-template-columns: 1fr 1fr; align-items: center; text-align: center; }
  .fecha-dia { font-size: 6.5rem; }
  .octagono { width: 420px; }

  .ubicacion-grid { grid-template-columns: 1fr 1fr; align-items: start; gap: 48px; }
  .foto-salon { height: 100%; }
  .ubicacion-fotos { grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
  .btn-lleno { max-width: 420px; }

  .vestimenta-figuras img { max-width: 230px; }
  .sugerencia { max-width: 520px; margin: 0 auto; }

  .regalos-cards { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  .esquinas .esquina { width: 190px; }
  .ramita { width: 130px; }
  .ramita-6 { width: 200px; }
  .flor-sobre { width: 300px; }
  .sobre-titulo { font-size: 4rem; }
}

@media (min-width: 1300px) {
  .esquinas .esquina { width: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .aparece { opacity: 1; transform: none; }
}
