/* ==========================================================
   Invitación de boda · Kewin & Viviana
   ========================================================== */

/* ---------- Variables ---------- */
:root {
  --ink: #f1ecee;
  --gold: #d9bc62;
  --gold2: #d9bc62;
  --b1: linear-gradient(170deg, #8b2540, #6b1a2f 55%, #7c2038);
  --b2: linear-gradient(160deg, #4a0f1f, #35091a);
  --b3: linear-gradient(180deg, #4a1b28, #3a121d);
  --b4: linear-gradient(200deg, #7a1d35, #5e1428 70%, #6c1a2f);
  --card: rgba(0, 0, 0, 0.25);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: inherit;
}
html {
  scroll-behavior: smooth;
}
html,
body {
  overflow-x: hidden;
}
img,
textarea {
  max-width: 100%;
}
body {
  margin: 0;
  background: #5a1425;
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.65;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  margin: 0;
}
h2 {
  font-size: clamp(2.4rem, 8vw, 3.3rem);
  margin-bottom: 10px;
}
:focus-visible {
  outline: 3px solid var(--gold2);
  outline-offset: 3px;
}

/* ---------- Secciones ---------- */
section {
  padding: 84px 22px;
  text-align: center;
  position: relative;
}
section::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold2), transparent);
}
.w {
  max-width: 720px;
  margin: 0 auto;
}
.b1 {
  background: var(--b1);
}
.b2 {
  background: var(--b2);
}
.b3 {
  background: var(--b3);
}
.b4 {
  background: var(--b4);
}
.b1,
.b2,
.b4 {
  --card: rgba(255, 255, 255, 0.08);
}

/* Texto dorado (todas las secciones son oscuras) */
.gold {
  color: var(--gold);
  background: linear-gradient(100deg, #d9bc62, #fff0b0 45%, #d9bc62);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Inicio ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px solid var(--gold2);
  outline: 1px solid var(--gold2);
  outline-offset: 6px;
  pointer-events: none;
}
.guest {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  margin: 0 0 6px;
}
.names {
  font-size: clamp(3.3rem, 16vw, 9rem);
  line-height: 0.95;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.names .amp {
  display: block;
  font-style: italic;
  font-weight: 600;
  font-size: 0.5em;
  margin: 0.1em 0;
}
.date {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 6.5vw, 2.8rem);
  letter-spacing: 0.06em;
  margin: 22px 0 0;
}
.orn {
  width: min(260px, 60%);
  height: 14px;
  margin: 28px auto;
  background: linear-gradient(
      90deg,
      transparent,
      #d9bc62 30%,
      #d9bc62 70%,
      transparent
    )
    center/100% 1px no-repeat;
  position: relative;
}
.orn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #b08a2e;
  transform: translate(-50%, -50%) rotate(45deg);
}
.inv {
  font-size: clamp(1.4rem, 4.5vw, 1.8rem);
  margin: 0;
}
.inv b {
  font-family: var(--serif);
  font-size: 1.3em;
  font-weight: 700;
}
.cue {
  margin: 30px 0 0;
  font-size: 1.1rem;
}
.cue span {
  display: block;
  font-size: 2rem;
  line-height: 1;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  50% {
    transform: translateY(8px);
  }
}

/* ---------- Cuenta regresiva ---------- */
.count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 520px;
  margin: 28px auto 0;
}
.count div {
  border: 2px solid var(--gold2);
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.14);
}
.count strong {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 6vw, 2.7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #f1de9a;
}
.count span {
  font-size: 1.05rem;
  font-weight: 500;
}
.then {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.6rem;
  margin: 20px 0 0;
}

/* ---------- Detalles (tarjetas) ---------- */
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
  align-items: stretch;
}
.card {
  background: var(--card);
  border: 2px solid var(--gold);
  padding: 26px 16px;
  box-shadow: 0 8px 24px rgba(40, 5, 15, 0.18);
}
.card h3 {
  font-size: 2rem;
  margin-bottom: 6px;
}
.card p {
  margin: 4px 0;
  font-size: 1.3rem;
}
.card b {
  font-weight: 700;
}
.card .addr {
  font-size: 1.1rem;
  opacity: 0.9;
}
.card a.map {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold2);
  padding-bottom: 2px;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.card a.map::before {
  content: "📍 ";
  font-style: normal;
}
.card a.map:hover,
.card a.map:focus-visible {
  color: #fff0b0;
  border-bottom-color: #fff0b0;
}
.sw {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid var(--gold);
  vertical-align: -0.12em;
  margin: 0 0.1em;
}

/* ---------- Confirmación y mensajes ---------- */
.lead {
  max-width: 34ch;
  margin: 0 auto 26px;
  font-size: 1.35rem;
}
.choice {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}
.btn {
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: #2b0b14;
  color: #edeef1;
  border: 2px solid var(--gold);
  padding: 14px 34px;
  cursor: pointer;
  border-radius: 2px;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}
.btn:hover {
  background: var(--gold);
  color: #fff;
  transform: translateY(-2px);
}
.btn.alt {
  background: transparent;
  color: inherit;
}
.btn.big {
  min-width: 170px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.8rem;
}
.thanks {
  display: none;
  max-width: 460px;
  margin: 26px auto 0;
  padding: 28px 20px;
  border: 2px solid var(--gold);
  background: var(--card);
}
.thanks.on {
  display: block;
  animation: pop 0.5s ease both;
}
.thanks h3 {
  font-size: 1.9rem;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
form {
  max-width: 480px;
  margin: 26px auto 0;
  display: grid;
  gap: 16px;
}
label {
  font-weight: 500;
  font-size: 1.15rem;
  display: block;
  text-align: left;
  margin-bottom: 4px;
}
textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 2px solid var(--gold);
  padding: 10px 12px;
  min-height: 90px;
  border-radius: 2px;
}

/* ---------- Pie ---------- */
footer {
  padding: 40px 22px calc(60px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 1.8rem;
  background: #2b0b14;
  color: #f1de9a;
}

/* ---------- Animación al bajar ---------- */
.js .rv {
  opacity: 0;
  transform: translateY(34px) scale(0.97);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 120ms);
}
.js .rv.up {
  transform: translateY(-34px) scale(0.97);
}
.js .rv:not(.in) {
  transition-delay: 0s;
}
.js .rv.in {
  opacity: 1;
  transform: none;
}

/* ---------- Lluvia de sobres ---------- */
#rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}
.env {
  position: absolute;
  top: -50px;
  width: var(--w);
  height: calc(var(--w) * 0.42);
  background: var(--c);
  border-radius: 100% 0 100% 0;
  opacity: 0.8;
  animation: fall var(--t) linear var(--d) forwards;
}
.env.sp {
  height: var(--w);
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cc, #e2c76f 40%, transparent 70%);
  opacity: 0.95;
}
@keyframes fall {
  0% {
    transform: translate(0, 0) rotate(var(--r0));
  }
  50% {
    transform: translate(var(--sw), 55vh) rotate(calc(var(--r0) * -1));
  }
  100% {
    transform: translate(0, 115vh) rotate(var(--r0));
  }
}

/* ---------- Portada ---------- */
#cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 35%, #8b2540, #3e0b1a);
  transition:
    opacity 0.9s,
    visibility 0.9s;
  color: #edeef1;
}
#cover.off {
  opacity: 0;
  visibility: hidden;
}
#cover .para {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d9bc62;
}
#cover .guest {
  color: #f1de9a;
  max-width: 18ch;
  margin: 0 auto 6px;
  line-height: 1.15;
}
#cover .big {
  width: min(72vw, 280px);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  border: 3px solid #9a7418;
  outline: 2px solid #d9bc62;
  outline-offset: 7px;
  background: radial-gradient(circle at 35% 30%, #fff3c0, #d9bc62 45%, #a8801f);
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34% 22% 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.2;
  color: #2b0b14;
  transition: transform 0.3s;
}
#cover .big:hover {
  transform: scale(1.04);
}
#cover .big::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 1px solid rgba(43, 11, 20, 0.55);
}
#cover .big::after {
  content: "K & V";
  position: absolute;
  top: 24%;
  left: 0;
  right: 0;
  font-size: 2.6rem;
  font-style: italic;
}

/* ---------- Botón de música ---------- */
#music {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--gold2);
  background: #2b0b14;
  color: #f1de9a;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==========================================================
   Responsive
   ========================================================== */

/* Celulares muy pequeños */
@media (max-width: 360px) {
  .names {
    font-size: 3rem;
  }
  .count strong {
    font-size: 1.25rem;
  }
  .count span {
    font-size: 0.7rem;
  }
}

/* Celulares */
@media (max-width: 520px) {
  body {
    font-size: 1.15rem;
  }
  section {
    padding: 64px 16px;
  }
  .hero::before {
    inset: 8px;
    outline-offset: 4px;
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .count {
    gap: 8px;
  }
  .count strong {
    font-size: 1.5rem;
  }
  .count span {
    font-size: 0.8rem;
  }
  .card {
    padding: 22px 14px;
  }
  .card p {
    font-size: 1.15rem;
  }
  .lead {
    font-size: 1.2rem;
  }
  .btn.big {
    min-width: 130px;
    font-size: 1.5rem;
    padding: 12px 24px;
  }
  #music {
    width: 42px;
    height: 42px;
  }
}

/* Tablets grandes y laptops pequeñas */
@media (min-width: 900px) {
  .hero::before {
    inset: 28px;
    outline-offset: 8px;
  }
  .hero .w {
    max-width: 980px;
  }
  .guest {
    font-size: clamp(2rem, 2.6vw, 3rem);
  }
  .names {
    font-size: clamp(6rem, 11vw, 9rem);
  }
  .names .amp {
    font-size: 0.4em;
  }
  .date {
    font-size: clamp(2.2rem, 3vw, 3.2rem);
    margin-top: 28px;
  }
  .orn {
    width: 340px;
    margin: 36px auto;
  }
  .inv {
    font-size: clamp(1.6rem, 2vw, 2.1rem);
  }
  #cover .big {
    width: min(34vh, 340px);
    font-size: 1.7rem;
  }
  #cover .big::after {
    font-size: 3.2rem;
  }
}

/* Ancho de contenido en escritorio */
@media (min-width: 1000px) {
  .w {
    max-width: 820px;
  }
  .cols {
    gap: 28px;
  }
}

/* Escritorio: nombres en una sola línea */
@media (min-width: 1100px) {
  .hero::before {
    inset: 40px;
  }
  .hero .w {
    max-width: 1200px;
  }
  .names {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25em;
    font-size: clamp(5rem, 7vw, 8.5rem);
  }
  .names .amp {
    display: inline;
    margin: 0;
    font-size: 0.55em;
  }
}

/* Pantallas muy grandes */
@media (min-width: 1700px) {
  .hero::before {
    inset: 56px;
  }
  .inv {
    font-size: 2.3rem;
  }
  .date {
    font-size: 3.4rem;
  }
}

/* Celular horizontal */
@media (orientation: landscape) and (max-height: 520px) {
  .hero {
    min-height: auto;
  }
  #cover .big {
    width: min(40vh, 200px);
  }
}

/* Accesibilidad: menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .js .rv,
  .js .rv.up {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .cue span {
    animation: none;
  }
  .thanks.on {
    animation: none;
  }
  #rain {
    display: none;
  }
}
