/* Noche negra; los lirios entran desde los bordes y el texto ocupa la oscuridad que dejan. */
:root {
  color-scheme: dark;
  --noche: #040306;
  --ciruela: #3a2a47;
  --lila: #a88fc6;
  --lavanda: #cfc1e6;
  --blanco: #f5f1fb;
  --error: #f3b6cf;

  --f-nombre: "Imperial Script", "Snell Roundhand", cursive;
  --f-titulo: "Bellefair", "Times New Roman", serif;
  --f-texto: "Mulish", system-ui, sans-serif;

  --margen-izq: max(24px, env(safe-area-inset-left, 0px));
  --margen-der: max(24px, env(safe-area-inset-right, 0px));
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--noche);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--lavanda);
  font: 400 1.0625rem/1.6 var(--f-texto);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, fieldset { margin: 0; padding: 0; border: 0; }

h2 {
  color: var(--blanco);
  font: 400 clamp(2.75rem, 9vw, 4.5rem)/1 var(--f-titulo);
  text-wrap: balance;
}

a { color: var(--blanco); text-underline-offset: .3em; text-decoration-color: var(--lila); text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid var(--lavanda); outline-offset: 4px; border-radius: 4px; }

/* Capas: flores (0), brillos y mariposas (1), texto (2) */
.cielo { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.hero-texto, .noche > *, .bebida > div, .confirmar-caja { position: relative; z-index: 2; }

.hero, .noche, .bebida, .confirmar {
  position: relative;
  padding-left: var(--margen-izq);
  padding-right: var(--margen-der);
}

/* ---------- Entrada ---------- */
.intro {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--noche);
  color: var(--blanco);
  font: 400 clamp(1.75rem, 6.5vw, 3rem)/1.3 var(--f-titulo);
  text-align: center;
  animation: irse 1.4s ease 3.6s forwards;
}
.intro.saltar { animation: irse .5s ease forwards; }
.intro span { display: block; opacity: 0; animation: aparecer 1.5s ease .3s forwards; }
.intro span + span { color: var(--lila); animation-delay: 1.5s; }

@keyframes irse { to { opacity: 0; visibility: hidden; } }
@keyframes aparecer { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }

/* ---------- Portada ---------- */
.hero {
  display: flex; align-items: flex-end;
  min-height: max(100vh, 640px);
  min-height: max(100svh, 640px);
  padding-block: 24px max(44px, env(safe-area-inset-bottom, 0px));
  overflow: clip;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 45% at 68% 34%, rgb(94 68 128 / .32), transparent 72%);
}
.ramo {
  position: absolute; top: 1%; right: -3%;
  height: 76%; aspect-ratio: 1075 / 2000;
}
.ramo img {
  display: block; width: 100%; height: 100%;
  transform-origin: 60% 100%; will-change: transform;
  animation: encender 3s ease 3.8s backwards, mecer 9s ease-in-out infinite alternate;
}
@keyframes encender { from { opacity: 0; filter: brightness(.2) blur(3px); } to { opacity: 1; filter: none; } }
@keyframes mecer { from { transform: rotate(-.7deg); } to { transform: rotate(.9deg); } }

.hero-texto { display: grid; justify-items: start; }
.nombre {
  display: block;
  margin: 0 0 -.08em -.04em; padding: .1em .15em 0 .06em;
  color: var(--blanco);
  font: 400 clamp(8rem, 41vw, 17rem)/.8 var(--f-nombre);
  text-shadow: 0 0 .22em rgb(190 160 235 / .55), 0 2px 24px rgb(4 3 6 / .8);
}
.veinte {
  display: block;
  color: var(--lavanda);
  font: 400 clamp(2.5rem, 11vw, 4.75rem)/1 var(--f-titulo);
}
.fecha { margin-top: 18px; color: var(--blanco); font-size: 1.1875rem; font-weight: 500; }
.bajada { margin-top: 2px; max-width: 32ch; }

.boton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; margin-top: 26px; padding: 10px 34px;
  border: 1px solid rgb(245 241 251 / .7); border-radius: 999px;
  background: linear-gradient(105deg, #f5f1fb, #cdb9ea 55%, #efe7fa);
  background-size: 220% 100%;
  box-shadow: 0 0 32px rgb(168 143 198 / .42);
  color: #21152e; font: 500 1.0625rem/1.2 var(--f-texto); text-decoration: none;
  cursor: pointer;
  transition: background-position .7s ease, box-shadow .4s ease;
}
.boton:hover { background-position: 100% 0; box-shadow: 0 0 48px rgb(190 160 235 / .7); }
.boton:disabled { cursor: progress; opacity: .7; }

/* ---------- La noche ---------- */
.noche { max-width: 1120px; margin-inline: auto; padding-block: clamp(88px, 14vw, 150px); }
.cuenta p { color: var(--lavanda); font: 400 clamp(1.5rem, 5vw, 2rem)/1.2 var(--f-titulo); }
.cuenta ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 760px; margin: 10px 0 0; padding: 0; list-style: none; }
.cuenta b {
  display: block; color: var(--blanco);
  font: 400 clamp(3.5rem, 17vw, 8rem)/1 var(--f-titulo);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 .5em rgb(190 160 235 / .4);
}
.cuenta span { color: var(--lila); }
.cuenta.llego p { color: var(--blanco); font-size: clamp(2.5rem, 10vw, 4.5rem); }
.noche dl { display: grid; gap: 44px; margin-top: 68px; }
.noche dt { margin-bottom: 6px; color: var(--lila); }
.noche dd { color: var(--blanco); font: 400 clamp(1.875rem, 6vw, 2.75rem)/1.12 var(--f-titulo); text-wrap: balance; }
.noche small { display: block; margin-top: 10px; color: var(--lavanda); font: 400 1.0625rem/1.6 var(--f-texto); text-wrap: pretty; }
.noche small a { display: inline-block; padding-block: 8px; }

/* ---------- Bebida ---------- */
.bebida {
  display: grid; justify-items: center;
  padding-block: 24px clamp(72px, 12vw, 130px);
  text-align: center;
  overflow: clip;
}
.lirios {
  width: 100vw; height: clamp(400px, 56vw, 820px);
  margin-inline: calc(50% - 50vw);
  -webkit-mask-image: linear-gradient(transparent, #000 24%, #000 72%, transparent);
  mask-image: linear-gradient(transparent, #000 24%, #000 72%, transparent);
}
.lirios img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 17% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.bebida h2 + p { margin-top: 14px; color: var(--blanco); font-size: 1.25rem; }

/* ---------- Confirmar ---------- */
.confirmar {
  display: grid; align-content: center;
  min-height: 760px; min-height: max(100svh, 760px);
  padding-block: clamp(56px, 10vw, 110px) 110px;
  overflow: clip;
}
.ramo-espejo {
  position: absolute; bottom: -120px; left: -130px;
  width: 300px; max-width: none; height: auto;
  opacity: .3; transform: scaleX(-1);
}
.confirmar-caja { width: 100%; max-width: 520px; margin-inline: auto; }
.limite { margin-top: 18px; }
.limite strong { color: var(--blanco); font-weight: 500; }
#cerrado { padding-block: 40px; }
#cerrado p { margin-top: 18px; }
#formulario { display: grid; gap: 30px; margin-top: 38px; outline: 0; scroll-margin-top: 40px; animation: abrir .8s ease; }
@keyframes abrir { from { opacity: 0; transform: translateY(14px); } }
#abrir { width: 100%; }
#solo-si { display: grid; gap: 30px; }

.campo label, .campo legend, .fila > span { display: block; padding: 0; color: var(--lavanda); }
.campo small { color: var(--lila); font-size: .9375rem; }
.ayuda { margin-top: 10px; color: var(--lila); font-size: .9375rem; line-height: 1.5; }

input[type="text"], textarea {
  display: block; width: 100%;
  margin-top: 4px; padding: 10px 0;
  border: 0; border-bottom: 1px solid var(--lila); border-radius: 0;
  background: transparent;
  color: var(--blanco); font: 400 1.1875rem/1.5 var(--f-texto);
  transition: border-color .3s, box-shadow .3s;
}
textarea { resize: vertical; }
input[type="text"]:focus, textarea:focus { outline: 0; border-color: var(--blanco); box-shadow: 0 1px 0 var(--blanco), 0 14px 18px -14px rgb(190 160 235 / .7); }
[aria-invalid="true"] { border-color: var(--error) !important; }
.error { margin-top: 8px; color: var(--error); }

.opciones > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.opciones label { position: relative; }
.opciones input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opciones span {
  display: grid; place-items: center; min-height: 52px;
  border: 1px solid var(--ciruela); border-radius: 999px;
  color: var(--lavanda);
  transition: border-color .3s, color .3s, box-shadow .3s, background-color .3s;
}
.opciones input:checked + span {
  border-color: var(--lavanda); background: rgb(168 143 198 / .18);
  box-shadow: 0 0 24px rgb(168 143 198 / .3);
  color: var(--blanco);
}
.opciones input:focus-visible + span { outline: 2px solid var(--lavanda); outline-offset: 4px; }

.fila { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.contador { display: flex; align-items: center; flex: none; }
.contador button {
  width: 46px; height: 46px; padding: 0;
  border: 1px solid var(--lila); border-radius: 50%;
  background: transparent; color: var(--blanco);
  font: 300 1.5rem/1 var(--f-texto); cursor: pointer;
}
.contador button:disabled { border-color: var(--ciruela); color: var(--lila); cursor: default; }
.contador output { width: 2.2ch; color: var(--blanco); font: 400 2rem/1 var(--f-titulo); text-align: center; }

.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.playlist p { color: var(--lavanda); }
.playlist a {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; margin-top: 14px; padding: 10px 24px;
  border: 1px solid var(--lila); border-radius: 999px;
  color: var(--blanco); text-align: center; text-decoration: none;
  transition: border-color .3s, box-shadow .3s;
}
.playlist a:hover { border-color: var(--blanco); box-shadow: 0 0 24px rgb(168 143 198 / .4); }
#gracias-playlist { max-width: 360px; margin: 34px auto 0; }
#enviar { width: 100%; margin-top: 4px; }

#gracias { padding-block: 60px; text-align: center; outline: 0; animation: aparecer 1.4s ease; }
#gracias-texto { margin-top: 18px; font-size: 1.1875rem; overflow-wrap: anywhere; }
#gracias-titulo { overflow-wrap: anywhere; }
.acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin-top: 30px; }
.enlace {
  min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--lavanda); font: inherit;
  text-decoration: underline 1px var(--lila); text-underline-offset: .3em; cursor: pointer;
}

/* ---------- Pantallas anchas ---------- */
@media (min-width: 800px) {
  .hero { align-items: center; padding-left: max(8vw, env(safe-area-inset-left, 0px)); }
  .hero::before { background: radial-gradient(38% 60% at 72% 46%, rgb(94 68 128 / .34), transparent 72%); }
  .ramo { top: 2%; right: 11vw; height: 112%; }
  .nombre { font-size: clamp(12rem, 23vw, 21rem); }
  .veinte { font-size: clamp(3.5rem, 6vw, 5.5rem); }
  .noche dl { grid-template-columns: 1fr 1fr; gap: 64px; }
  .ramo-espejo { left: max(0px, calc(50vw - 690px)); bottom: -60px; width: 390px; opacity: .85; }
}
@media (min-width: 800px) and (max-width: 1250px) { .ramo-espejo { left: -150px; opacity: .55; } }

/* Para quienes piden menos movimiento en su celu o compu (la clase se pone en index.html) */
.quieto { scroll-behavior: auto; }
.quieto .intro { display: none; }
.quieto *, .quieto *::before, .quieto *::after { animation: none !important; transition: none !important; }
