/* ==========================================================
   Diseño "Historias" · Boda en formato stories
   ========================================================== */

:root {
  --blanco: #fbf7f4;
  --tinta: #1d1a19;
  --rosa: #b8735f;
  --rubor: #f2d9d0;
  --anillo: conic-gradient(from 0deg, #f6c38b, #e8746b, #c64f8e, #8f5fd0, #e8746b, #f6c38b);

  --s-fondo: var(--blanco);
  --s-tinta: var(--tinta);
  --s-suave: #7a706b;
  --s-acento: var(--rosa);
  --s-acento-tinta: #fff;
  --s-tarjeta: #fff;
  --s-borde: rgba(29, 26, 25, .08);
  --s-radio: 20px;
  --s-sombra: 0 18px 34px -22px rgba(60, 30, 20, .45);
  --s-fuente: "DM Sans", system-ui, sans-serif;
  --s-titulo: "DM Serif Display", Georgia, serif;
  --s-etiqueta: "DM Sans", system-ui, sans-serif;
  --s-num: "DM Serif Display", Georgia, serif;
}

body { background: var(--blanco); color: var(--tinta); font-family: var(--s-fuente); }
.amp { font-family: "DM Serif Display", serif; font-style: italic; color: var(--rosa); }

/* ---------- Portada ---------- */
.portada {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(70% 50% at 50% 35%, var(--rubor), transparent 70%), var(--blanco);
}
.avatar {
  all: unset;
  position: relative;
  width: min(54vw, 210px);
  height: min(54vw, 210px);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  animation: latir 2.4s ease-in-out infinite;
}
.avatar:focus-visible { outline: 3px solid var(--rosa); outline-offset: 8px; }
.avatar__anillo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--anillo);
  animation: girar 3s linear infinite;
}
.avatar img {
  position: relative;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--blanco);
}
.avatar.vista .avatar__anillo { background: #d8cfca; animation: none; }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes latir { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.portada__nueva { margin: 14px 0 0; font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--rosa); }
.portada__nombres { margin: 0; font-family: "DM Serif Display", serif; font-weight: 400; font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1.05; }
.portada__sub { margin: 0; font-size: 1.05rem; color: #7a706b; }
.portada__hint { margin: 26px 0 0; display: flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #7a706b; }
.portada__dedo { width: 14px; height: 14px; border-radius: 50%; background: var(--rosa); box-shadow: 0 0 0 0 rgba(184, 115, 95, .6); animation: toque 1.6s ease-out infinite; }
@keyframes toque { to { box-shadow: 0 0 0 16px rgba(184, 115, 95, 0); } }

/* ---------- Visor ---------- */
.visor {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #000;
  animation: abrirVisor .45s cubic-bezier(.2, .8, .2, 1) both;
}
.visor.cerrando { animation: cerrarVisor .4s ease forwards; }
@keyframes abrirVisor { from { opacity: 0; transform: scale(.85); border-radius: 50%; } }
@keyframes cerrarVisor { to { opacity: 0; transform: translateY(40px) scale(.92); } }
.visor__fondo {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(.5);
  transition: background-image .4s;
}
.visor__marco {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
@media (min-width: 600px) {
  .visor__marco { width: min(430px, 56svh); height: min(92svh, 860px); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
}

.barras {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  gap: 4px;
}
.barra { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.barra i { display: block; height: 100%; width: 0; background: #fff; }
.barra.vista i { width: 100%; }
.barra.actual i { animation: llenar linear forwards; }
.visor.pausado .barra.actual i { animation-play-state: paused; }
@keyframes llenar { from { width: 0; } to { width: 100%; } }

.visor__cab {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 22px);
  left: 12px;
  right: 6px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: .85rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.visor__mini { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.visor__quien { font-weight: 700; }
.visor__quien .amp { color: #fff; font-size: 1em; }
.visor__cuando { opacity: .7; }
.visor__cerrar {
  all: unset;
  margin-left: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.visor__cerrar:focus-visible { outline: 2px solid #fff; border-radius: 50%; }

.diapos { position: absolute; inset: 0; }
.diapo { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s; }
.diapo.activa { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.diapo__fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); }
.diapo.activa .diapo__fondo { animation: kenburns 9s ease-out forwards; }
.visor.pausado .diapo.activa .diapo__fondo { animation-play-state: paused; }
.diapo__fondo--borroso { filter: blur(14px) brightness(.75); }
@keyframes kenburns { from { transform: scale(1.12) translate(0, 0); } to { transform: scale(1.02) translate(-2%, -1%); } }
.diapo::after {                            /* degradados para legibilidad */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), transparent 22%, transparent 55%, rgba(0, 0, 0, .65));
  pointer-events: none;
}
.diapo__capa {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 110px 26px 80px;
  text-align: center;
  color: #fff;
  pointer-events: none;
}
.diapo__capa--centro { justify-content: center; }
.diapo__capa--abajo { justify-content: flex-end; padding-bottom: calc(env(safe-area-inset-bottom) + 70px); }
.diapo__capa a, .diapo__capa button { pointer-events: auto; }

/* Texto con movimiento */
.kin-eyebrow { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; opacity: 0; }
.kin-eyebrow .amp { color: #fff; }
.kin { margin: 0; font-family: "DM Serif Display", serif; font-size: clamp(3.6rem, 18vw, 5.2rem); line-height: .95; text-shadow: 0 6px 30px rgba(0, 0, 0, .4); }
.kin span { display: block; opacity: 0; }
.kin--chico { font-size: clamp(2.2rem, 10vw, 2.8rem); opacity: 0; }
.diapo.activa .kin-eyebrow { animation: subir .7s .1s ease both; }
.diapo.activa .kin span { animation: palabra .8s cubic-bezier(.2, .9, .3, 1.2) both; }
.diapo.activa .kin span:nth-child(1) { animation-delay: .35s; }
.diapo.activa .kin span:nth-child(2) { animation-delay: .75s; }
.diapo.activa .kin--chico { animation: subir .7s .2s ease both; }
@keyframes palabra { from { opacity: 0; transform: translateY(40px) rotate(-4deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes subir { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pegar { 0% { opacity: 0; transform: scale(.4) rotate(-14deg); } 70% { transform: scale(1.06) rotate(var(--r, -3deg)); } 100% { opacity: 1; transform: rotate(var(--r, -3deg)); } }

/* Stickers */
.sticker-fecha, .sticker-cuenta, .sticker-lugar, .sticker-agenda, .sticker-dress, .sticker-encuesta { opacity: 0; }
.diapo.activa .sticker-fecha, .diapo.activa .sticker-cuenta, .diapo.activa .sticker-dress, .diapo.activa .sticker-encuesta { animation: pegar .7s .55s cubic-bezier(.3, 1.4, .5, 1) both; }
.diapo.activa .sticker-lugar { animation: pegar .7s .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.diapo.activa .sticker-agenda { animation: subir .7s .8s ease both; }

.sticker-fecha {
  --r: -4deg;
  width: 150px;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  color: var(--tinta);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 14px;
}
.sticker-fecha__mes { align-self: stretch; padding: 8px 0; background: var(--rosa); color: #fff; font-weight: 700; letter-spacing: .3em; font-size: .9rem; }
.sticker-fecha__dia { font-family: "DM Serif Display", serif; font-size: 4.6rem; line-height: 1; margin-top: 6px; }
.sticker-fecha__sem { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rosa); }
.sticker-fecha__anio { font-size: .8rem; color: #7a706b; }

.sticker-cuenta {
  --r: 2deg;
  width: min(100%, 300px);
  padding: 18px 16px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f6c38b, #e8746b 45%, #c64f8e);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .4);
}
.sticker-cuenta__t { margin: 0 0 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; }
.sticker-cuenta__nums { display: flex; justify-content: center; gap: 8px; }
.sticker-cuenta__nums span { flex: 1; padding: 8px 0; border-radius: 12px; background: rgba(255, 255, 255, .22); display: flex; flex-direction: column; align-items: center; }
.sticker-cuenta__nums b { font-family: "DM Serif Display", serif; font-weight: 400; font-size: 1.9rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sticker-cuenta__nums small { font-size: .55rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.sticker-cuenta__fecha { margin: 12px 0 0; font-size: .9rem; font-weight: 600; }

.sticker-lugar {
  --r: -2deg;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  color: var(--rosa);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.sticker-agenda { list-style: none; margin: 0; padding: 14px 18px; border-radius: 16px; background: rgba(0, 0, 0, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: left; font-size: .95rem; line-height: 1.7; }
.sticker-agenda b { display: inline-block; min-width: 3.4em; color: var(--rubor); }

.sticker-dress {
  --r: 3deg;
  padding: 16px 22px;
  border-radius: 22px;
  background: #fff;
  color: var(--tinta);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  font-family: "DM Serif Display", serif;
  font-size: 1.8rem;
}
.sticker-dress ul { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 8px 0 0; padding: 0; }
.sticker-dress svg { display: block; width: 32px; height: 32px; }

.sticker-encuesta {
  --r: 0deg;
  width: min(100%, 320px);
  padding: 22px 18px 18px;
  border-radius: 24px;
  background: #fff;
  color: var(--tinta);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticker-encuesta__t { margin: 0 0 6px; font-family: "DM Serif Display", serif; font-size: 2rem; line-height: 1.1; }
.sticker-encuesta__op {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: #f2ece8;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  color: var(--tinta);
  text-decoration: none;
  transition: transform .2s ease, background-color .2s;
}
.sticker-encuesta__op:active { transform: scale(.97); }
.sticker-encuesta__op:focus-visible { outline: 2px solid var(--rosa); outline-offset: 2px; }
.sticker-encuesta__op i { font-style: normal; }
.sticker-encuesta__op--si { background: linear-gradient(135deg, #f6c38b, #e8746b 50%, #c64f8e); color: #fff; }
.sticker-encuesta__antes { margin: 4px 0 0; font-size: .82rem; color: #7a706b; }

/* Zonas de toque */
.zona { all: unset; position: absolute; top: 80px; bottom: 0; z-index: 2; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.zona--ant { left: 0; width: 30%; }
.zona--sig { right: 0; width: 70%; }
.zona:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -6px; }
.visor__pista {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  z-index: 6;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: .72rem;
  white-space: nowrap;
  pointer-events: none;
  animation: subir .5s 1.2s ease both, desvanecer .6s 5s ease forwards;
}
@keyframes desvanecer { to { opacity: 0; } }

/* ---------- Página completa ---------- */
.pagina { animation: subir .8s ease both; }
.cartel { position: relative; min-height: 92svh; display: flex; align-items: flex-end; overflow: hidden; color: #fff; }
.cartel__foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cartel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15), transparent 35%, rgba(20, 10, 8, .8)); }
.cartel__texto { position: relative; z-index: 2; width: 100%; padding: 0 26px 44px; text-align: center; }
.cartel__eyebrow { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--rubor); }
.cartel__nombres { margin: 6px 0 0; font-family: "DM Serif Display", serif; font-weight: 400; font-size: clamp(3rem, 14vw, 4.4rem); line-height: .95; }
.cartel__nombres .amp { display: block; font-size: .5em; color: var(--rubor); margin: 4px 0; }
.cartel__fecha { margin: 14px 0 0; font-size: 1.05rem; letter-spacing: .06em; }
.otra-vez {
  all: unset;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 16px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.otra-vez img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #e8746b; }
.otra-vez:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.s-cuenta { background: linear-gradient(180deg, var(--blanco), #f6ebe5); }
.s-titulo { font-size: clamp(2.4rem, 10vw, 3rem); }
.btn-musica { background: var(--tinta); color: var(--rubor); }

@media (prefers-reduced-motion: reduce) {
  .avatar, .avatar__anillo, .portada__dedo, .diapo.activa .diapo__fondo { animation: none !important; }
}
