/* ============================================================
   Invitación · Virgen Candelaria de Copacabana
   Paleta: marfil / pergamino / oro viejo
   ============================================================ */

:root {
  --marfil: #faf6ec;
  --pergamino: #f6efdd;
  --pergamino-hondo: #efe5cc;
  --oro: #b08d2f;
  --oro-claro: #c9a24b;
  --oro-brillo: #e9cf8f;
  --oro-hondo: #8a6d1f;
  --tinta: #4a3b22;
  --tinta-suave: #7a6844;
  --blanco-calido: #fffdf6;

  --f-script: "Great Vibes", cursive;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-caps: "Cinzel", Georgia, serif;

  /* escala de espaciado vertical (4 pasos) */
  --e1: 1.5rem;   /* 24px — dentro de un bloque */
  --e2: 2rem;     /* 32px — entre bloques relacionados */
  --e3: 3rem;     /* 48px — cambio de sección */
  --e4: 4rem;     /* 64px — respiro mayor */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-serif);
  color: var(--tinta);
  background: var(--pergamino);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* textura de papel sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.65 0 0 0 0 0.55 0 0 0 0 0.35 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.oculto { display: none !important; }

/* ============================================================
   SOBRE — pantalla de apertura
   ============================================================ */

.sobre {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sobre-panel {
  position: absolute;
  top: 0; bottom: 0;
  width: 51%;
  background:
    linear-gradient(115deg, rgba(255,255,255,.35), rgba(0,0,0,0) 40%),
    var(--pergamino-hondo);
  transition: transform 1.15s cubic-bezier(.7, 0, .25, 1) .35s;
}
.sobre-izq  { left: 0;  border-right: 1px solid rgba(138,109,31,.35); box-shadow: inset -18px 0 32px -22px rgba(74,59,34,.45); }
.sobre-der  { right: 0; border-left: 1px solid rgba(138,109,31,.35);  box-shadow: inset 18px 0 32px -22px rgba(74,59,34,.45); }

.sobre.abierto .sobre-izq { transform: translateX(-102%); }
.sobre.abierto .sobre-der { transform: translateX(102%); }

.sobre-contenido {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem;
  transition: opacity .5s ease;
}
.sobre.abierto .sobre-contenido { opacity: 0; pointer-events: none; }

.sobre-pre {
  font-family: var(--f-caps);
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.sobre-nombre {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(1.5rem, 7.4vw, 2.7rem);
  color: var(--oro-hondo);
  margin-top: .9rem;
  line-height: 1.2;
  text-wrap: balance;
}

.sobre-linea {
  width: 130px;
  height: 1px;
  margin: 1.4rem auto 2.2rem;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
}

/* Sello de cera dorado — forma real de lacre vectorizada (img/sello-cera.svg) */
.sello {
  position: relative;
  width: 138px;
  aspect-ratio: 210 / 195;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: url("../img/sello-cera.svg") center / contain no-repeat;
  filter: drop-shadow(0 10px 16px rgba(90, 68, 15, .45));
  transition: transform .35s ease, filter .35s ease;
  animation: latido 3.2s ease-in-out infinite;
}
.sello:hover { transform: scale(1.06); }
.sello:active { transform: scale(.96); }

/* el anillo grabado ya viene en la cera */
.sello-anillo { display: none; }

.sello-texto {
  font-family: var(--f-caps);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #57400e;
  text-shadow: 0 1px 0 rgba(238, 217, 163, .55);
}
.sello-texto i { font-style: normal; font-size: 1.05rem; }

@keyframes latido {
  0%, 100% { filter: drop-shadow(0 10px 16px rgba(90, 68, 15, .45)); }
  50%      { filter: drop-shadow(0 12px 22px rgba(90, 68, 15, .6)) brightness(1.05); }
}

.sobre.abierto .sello { animation: romper .6s ease forwards; }
@keyframes romper {
  to { transform: scale(1.35) rotate(8deg); opacity: 0; }
}

.sobre-hint {
  margin-top: 1.4rem;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--tinta-suave);
}

/* ============================================================
   CARTA
   ============================================================ */

.carta {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(.6rem, 2.5vw, 2rem);
  opacity: 0;
  transition: opacity 1s ease .6s;
}
.carta.visible { opacity: 1; }

.marco {
  --cor: clamp(74px, 17vw, 108px);   /* tamaño de las esquinas ornamentales */
  --oro-marco: #a08c4f;              /* oro exacto del marco de la tarjeta */
  position: relative;
  background:
    linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,0) 55%),
    var(--blanco-calido);
  box-shadow: 0 24px 60px -30px rgba(74, 59, 34, .5);
  padding: clamp(2.4rem, 7vw, 3.6rem) clamp(1.4rem, 5.5vw, 3.2rem);
  text-align: center;
}

/* doble línea recta del marco — insets y grosores medidos del render original
   (fracciones del tile de 720px de la esquina; ejes X/Y difieren en el diseño) */
.marco::before,
.marco::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-style: solid;
  border-color: var(--oro-marco);
}
.marco::before {                              /* línea exterior */
  inset: calc(var(--cor) * .0333) calc(var(--cor) * .0556);
  border-width: calc(var(--cor) * .0292) calc(var(--cor) * .0347);
  /* ocultar la línea dentro de las 4 esquinas: ahí dibuja el ornamento PNG */
  -webkit-mask:
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * (var(--cor) * .9444) + 2px) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * (var(--cor) * .9667) + 2px) no-repeat;
  mask:
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * (var(--cor) * .9444) + 2px) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * (var(--cor) * .9667) + 2px) no-repeat;
}
.marco::after {                               /* línea interior */
  inset: calc(var(--cor) * .1625) calc(var(--cor) * .1903);
  border-width: calc(var(--cor) * .0292) calc(var(--cor) * .025);
  -webkit-mask:
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * (var(--cor) * .8097) + 2px) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * (var(--cor) * .8375) + 2px) no-repeat;
  mask:
    linear-gradient(#000 0 0) 50% 50% / calc(100% - 2 * (var(--cor) * .8097) + 2px) 100% no-repeat,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - 2 * (var(--cor) * .8375) + 2px) no-repeat;
}

/* esquinas ornamentales calcadas de la tarjeta original */
.esquina {
  position: absolute;
  width: var(--cor);
  height: var(--cor);
  background: url("../img/marco-esquina.png") no-repeat center / contain;
  pointer-events: none;
  z-index: 1;
}
.eq-tl { top: 0; left: 0; }
.eq-tr { top: 0; right: 0; transform: scaleX(-1); }
.eq-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.eq-br { bottom: 0; right: 0; transform: scale(-1); }

/* ---------- encabezado ---------- */

.emblema {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}
.emblema-img {
  height: clamp(140px, 34vw, 168px);
  width: auto;
  filter: drop-shadow(0 6px 14px rgba(138,109,31,.4));
}

.eyebrow {
  font-family: var(--f-caps);
  font-size: .7rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.titulo-script {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(1.4rem, 7.4vw, 2.6rem);   /* T1 · una sola línea */
  line-height: 1.25;
  white-space: nowrap;
  color: var(--oro-hondo);
  margin: .5rem 0 1rem;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

.divisor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  margin: 1.3rem auto;
  max-width: 300px;
}
.divisor span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--oro-claro)); }
.divisor span:last-child { background: linear-gradient(90deg, var(--oro-claro), transparent); }
.divisor em { font-style: normal; color: var(--oro); font-size: .8rem; }

.anfitriones {                                /* T3 */
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(1.1rem, 5.6vw, 1.9rem);
  line-height: 1.2;
  color: var(--tinta);
  margin-top: .4rem;
  text-wrap: balance;
}

/* ---------- saludo personal ---------- */

.personal-nombre {                            /* T2 */
  font-family: var(--f-script);
  font-size: clamp(1.25rem, 6.4vw, 2.2rem);
  color: var(--oro-hondo);
  margin: 1.75rem 0 .6rem;   /* 28px arriba = mismo aire que hasta la línea de abajo */
  line-height: 1.2;
  text-wrap: balance;
}

.personal-cupos {
  font-family: var(--f-caps);
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tinta);
  border-top: 1px solid rgba(176,141,47,.35);
  border-bottom: 1px solid rgba(176,141,47,.35);
  display: inline-block;
  padding: .55rem 1.1rem;
  margin-top: .4rem;
}

/* ---------- detalles ---------- */

.detalles {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(.6rem, 3vw, 1.6rem);
  margin-top: var(--e3);
}

.detalle { flex: 1; max-width: 220px; }

.detalle-titulo {
  font-family: var(--f-caps);
  font-weight: 500;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-bottom: .7rem;
}

.detalle-fecha { font-size: 1.2rem; font-weight: 500; }
.detalle-fecha sup { font-size: .6em; }
.detalle-hora { font-family: var(--f-caps); font-size: 1.25rem; color: var(--tinta); margin-top: .2rem; }
.detalle-hora span { font-size: .55em; letter-spacing: .1em; }
.detalle-hora-nota { font-style: italic; color: var(--tinta-suave); margin-top: .35rem; }

.detalle-sep {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--oro);
}
.detalle-sep em { font-style: normal; font-size: .75rem; }
.detalle-sep::before, .detalle-sep::after {
  content: "";
  width: 1px;
  flex: 1;
  background: linear-gradient(180deg, transparent, var(--oro-claro), transparent);
  margin: .2rem 0;
}

/* ---------- lugar ---------- */

.lugar { margin-top: var(--e2); }
.lugar-nombre { font-family: var(--f-caps); font-size: 1.25rem; letter-spacing: .12em; color: var(--tinta); }
.lugar-dir { font-size: 1.05rem; font-style: italic; color: var(--tinta-suave); margin-top: .3rem; }
.lugar-acciones { display: flex; justify-content: center; gap: .8rem; margin-top: 1.1rem; flex-wrap: wrap; }

/* ---------- botones ---------- */

.btn {
  font-family: var(--f-caps);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: .8rem 1.5rem;
  transition: all .3s ease;
  display: inline-block;
}

.btn-linea {
  color: var(--oro-hondo);
  background: transparent;
  border: 1px solid rgba(176,141,47,.55);
}
.btn-linea:hover { background: rgba(201,162,75,.12); border-color: var(--oro); }

.btn-oro {                                    /* acción principal: dominante */
  font-size: .8rem;
  letter-spacing: .14em;
  padding: 1rem clamp(1rem, 4vw, 1.9rem);
  white-space: nowrap;
  color: #fffdf4;
  background: linear-gradient(160deg, var(--oro-claro), var(--oro-hondo));
  border: 1px solid var(--oro-hondo);
  box-shadow: 0 10px 22px -10px rgba(138,109,31,.65);
}
.btn-oro:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(138,109,31,.75); }

.btn-tenue {                                  /* declinar: salida discreta, no compite */
  font-family: var(--f-serif);
  font-size: .95rem;
  font-style: italic;
  letter-spacing: normal;
  text-transform: none;
  padding: .5rem 1rem;
  color: var(--tinta-suave);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(176,141,47,.5);
}
.btn-tenue:hover { color: var(--tinta); }

/* ---------- cuenta regresiva ---------- */

.cuenta {
  display: flex;
  justify-content: center;
  gap: clamp(.9rem, 4vw, 2rem);
  margin-top: var(--e2);
}

.cuenta-item { text-align: center; min-width: 56px; }
.cuenta-item span {                           /* T4 · en tinta, no compite con el oro */
  display: block;
  font-family: var(--f-caps);
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  color: var(--tinta);
}
.cuenta-item small {
  font-family: var(--f-caps);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

/* ---------- RSVP ---------- */

.rsvp { margin-top: var(--e3); }

.rsvp-titulo {                                /* encabezado por encima de su cuerpo */
  font-family: var(--f-caps);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tinta);
}

.rsvp-nota {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--tinta-suave);
  margin-top: .8rem;
  line-height: 1.55;
}

.selector-cupos { margin-top: 1.6rem; }
.selector-label { font-size: 1.05rem; font-style: italic; color: var(--tinta); }

.selector-opciones {
  display: flex;
  justify-content: center;
  gap: .7rem;
  margin-top: .9rem;
}

.opcion-cupo {
  font-family: var(--f-caps);
  font-size: 1.05rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(176,141,47,.55);
  background: transparent;
  color: var(--tinta);
  cursor: pointer;
  transition: all .25s ease;
}
.opcion-cupo:hover { border-color: var(--oro); }
.opcion-cupo.activa {
  background: linear-gradient(160deg, var(--oro-claro), var(--oro-hondo));
  color: #fffdf4;
  border-color: var(--oro-hondo);
  box-shadow: 0 8px 18px -8px rgba(138,109,31,.7);
}

.rsvp-botones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  margin-top: 1.8rem;
}

.rsvp-contacto {
  margin-top: 1.6rem;
  font-size: .95rem;
  font-style: italic;
  color: var(--tinta-suave);
  line-height: 1.6;
}

.rsvp-aviso {
  margin-top: 1.1rem;
  font-size: .92rem;
  font-style: italic;
  color: var(--oro-hondo);
  line-height: 1.5;
  animation: aparecer .5s ease;
}

.btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- pase confirmado ---------- */

.pase { margin-top: 2.4rem; animation: aparecer .8s ease; }

/* ---------- ticket (compartido: confirmación, pase y declinado) ---------- */

.ticket {
  border: 1px solid var(--oro-claro);
  outline: 1px solid rgba(176,141,47,.3);
  outline-offset: 4px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(233,207,143,.25), transparent 60%),
    var(--blanco-calido);
  padding: 2.2rem clamp(.9rem, 3.5vw, 1.4rem);
}

.pase-eyebrow {
  font-family: var(--f-caps);
  font-size: .68rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--oro-hondo);
}

.pase-nombre {                                /* T2 */
  font-family: var(--f-script);
  font-size: clamp(1.25rem, 6.4vw, 2.2rem);
  color: var(--tinta);
  margin-top: .7rem;
  line-height: 1.2;
  text-wrap: balance;
}

.pase-cupos {
  font-family: var(--f-caps);
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-top: .5rem;
}

.pase-fecha { font-size: 1.12rem; line-height: 1.6; }
.pase-fecha sup { font-size: .6em; }

.pase-gracias {
  font-family: var(--f-script);
  font-size: 1.7rem;
  color: var(--oro-hondo);
  margin-top: 1rem;
}

.btn-cambiar { margin-top: 1rem; font-size: .68rem; }

/* ---------- declinado ---------- */

.declinado { margin-top: 2.4rem; animation: aparecer .8s ease; }
.declinado-msg { font-size: 1.15rem; font-style: italic; line-height: 1.7; color: var(--tinta); }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- pie ---------- */

.pie { margin-top: var(--e3); }
.pie p {
  font-family: var(--f-caps);
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

/* ---------- reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s ease, transform .9s ease;
}
.reveal.visto { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .sello { animation: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 420px) {
  .detalles { flex-direction: column; align-items: center; gap: 1.4rem; }
  .detalle-sep { display: none; }
}
