/* Pardelina · la paleta Ayu Light de Yume, con su noche (Ayu Dark) para quien la tenga puesta. */

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fuentes/fraunces-cursiva.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fuentes/figtree.woff2') format('woff2');
}

:root {
  --fondo: #FCFCFC;
  --cielo: #F7F9FA;
  --blanco: #FFFFFF;
  --linea: rgba(107, 125, 143, 0.14);
  --linea-fuerte: rgba(107, 125, 143, 0.26);
  --tinta: #33383D;
  --texto: #4A5057;
  --suave: #5C6166;
  --tenue: #6B7483;
  --acento: #F29718;
  --acento-tinte: #FEF5E8;
  --acento-borde: rgba(242, 151, 24, 0.5);
  --acento-halo: rgba(242, 151, 24, 0.16);
  --sobre-acento: #3A2300;
  --verde: #6C9200;
  --verde-tinte: #F2F8E6;
  --error: #C43D3D;
  --error-halo: rgba(196, 61, 61, 0.14);
  --mar-arriba: #EAF2F8;
  --mar-abajo: #DCE9F3;
  --ola: rgba(57, 158, 230, 0.3);
  --isla: #DDE4EA;
  --isla-lejos: #E6EBEF;
  --sombra-m: 0 6px 22px rgba(107, 125, 143, 0.12);
  --sombra-l: 0 18px 48px rgba(51, 56, 61, 0.18);
  --fuente: 'Figtree', system-ui, -apple-system, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --salida: cubic-bezier(0.22, 1, 0.36, 1);
  --muelle: linear(0, 0.0072, 0.0288 2.5%, 0.1134 5.2%, 0.2402 8.2%, 0.6015 16.4%, 0.7521 20.6%, 0.8703 25.3%, 0.9431 30%, 0.9876 34.8%, 1.0089 39.5%, 1.0155 43.6%, 1.0149 48.8%, 1.0038 63.4%, 0.9999 80.6%, 1);
  --rebote: linear(0, 0.0117, 0.0473 3.2%, 0.1869 6.6%, 0.4036 10.4%, 0.8081 18.6%, 0.9616 23.2%, 1.0493 28%, 1.0835 32%, 1.0858 36%, 1.0625 42%, 1.0209 51.6%, 0.9969 60.8%, 0.9951 70.6%, 1.0003 88%, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0F141A;
    --cielo: #121922;
    --blanco: #171E27;
    --linea: rgba(191, 189, 182, 0.12);
    --linea-fuerte: rgba(191, 189, 182, 0.22);
    --tinta: #E6E1CF;
    --texto: #BFBDB6;
    --suave: #ACB6BF;
    --tenue: #8A939C;
    --acento: #FFB454;
    --acento-tinte: #2A2116;
    --acento-borde: rgba(255, 180, 84, 0.5);
    --acento-halo: rgba(255, 180, 84, 0.16);
    --sobre-acento: #2A1800;
    --verde: #AAD94C;
    --verde-tinte: #1C2414;
    --error: #F07178;
    --error-halo: rgba(240, 113, 120, 0.16);
    --mar-arriba: #131C26;
    --mar-abajo: #0E1620;
    --ola: rgba(115, 184, 255, 0.16);
    --isla: #18212B;
    --isla-lejos: #151D26;
    --sombra-m: 0 6px 22px rgba(0, 0, 0, 0.35);
    --sombra-l: 0 18px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100svh;
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, var(--fondo) 0%, var(--cielo) 70%);
  color: var(--texto);
  font: 400 16px/1.55 var(--fuente);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: var(--tinta); }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(242, 151, 24, 0.22); }
[hidden] { display: none !important; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 640px) { .sin-corte { white-space: nowrap; } }

/* ---------- Escena: luna, horizonte y mar ---------- */

.escena { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.luna {
  position: absolute;
  top: clamp(64px, 12vh, 120px);
  right: clamp(28px, 11vw, 200px);
  width: 34px; height: 34px;
  fill: var(--acento);
  animation: aparecer 1.4s 0.3s var(--salida) backwards;
}
.mar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: max(22vh, 150px);
  background: linear-gradient(to bottom, var(--mar-arriba), var(--mar-abajo));
}
.mar::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--linea-fuerte);
}
.islas { position: absolute; left: 0; bottom: 100%; width: 100%; height: 40px; }
.isla { fill: var(--isla); }
.isla-lejos { fill: var(--isla-lejos); }
.ola {
  position: absolute; left: 0;
  width: 200%; height: 14px;
  fill: none; stroke: var(--ola); stroke-width: 1.4; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  animation: oleaje 26s linear infinite;
}
.ola path { vector-effect: non-scaling-stroke; }
.ola-1 { top: 16%; opacity: 0.7; }
.ola-2 { top: 44%; animation-duration: 34s; animation-direction: reverse; }
.ola-3 { top: 72%; opacity: 0.8; animation-duration: 22s; }
@keyframes oleaje { to { transform: translateX(-50%); } }

/* ---------- Cabecera ---------- */

.cabecera {
  position: relative;
  padding: max(22px, env(safe-area-inset-top)) clamp(20px, 5vw, 56px) 0;
}
.marca {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--tinta);
  text-decoration: none;
}
.marca-ave { width: 30px; height: 30px; fill: var(--acento); }
.marca-nombre {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 48;
}

/* ---------- Portada ---------- */

.portada {
  position: relative;
  flex: 1;
  width: min(100% - 40px, 640px);
  margin: 0 auto;
  padding: clamp(36px, 9vh, 110px) 0 calc(max(22vh, 150px) + 72px);
  text-align: center;
}
.portada > * { animation: subir 0.9s var(--salida) backwards; }
.portada > :nth-child(2) { animation-delay: 0.08s; }
.portada > :nth-child(3) { animation-delay: 0.16s; }
.portada > :nth-child(4) { animation-delay: 0.24s; }

.etiqueta {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 26px;
  padding: 5px 13px 5px 11px;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: var(--blanco);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--suave);
}
.latido {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--acento);
  box-shadow: 0 0 0 0 var(--acento-halo);
  animation: latir 2.2s ease-in-out infinite;
}
@keyframes latir {
  0%, 100% { box-shadow: 0 0 0 0 var(--acento-halo); }
  50% { box-shadow: 0 0 0 6px var(--acento-halo); }
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 450;
  font-size: clamp(34px, 6.4vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--tinta);
  font-variation-settings: 'opsz' 96;
  text-wrap: balance;
}
.entradilla {
  margin: 22px auto 0;
  max-width: 520px;
  font-size: clamp(16px, 1.9vw, 18px);
  color: var(--suave);
  text-wrap: pretty;
}

/* ---------- Lista de espera (la pardela se posa en el borde de arriba del campo) ---------- */

.lista, .hecho { margin: 76px auto 0; max-width: 460px; }
.campo {
  --percha: 0.5;
  position: relative;
  display: flex; align-items: center; gap: 6px;
  height: 60px;
  padding: 6px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 17px;
  background: var(--blanco);
  box-shadow: var(--sombra-m);
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.3s var(--salida);
}
.campo:focus-within {
  border-color: var(--acento-borde);
  box-shadow: var(--sombra-m), 0 0 0 4px var(--acento-halo);
}
.campo.mal { border-color: var(--error); animation: temblar 0.42s var(--salida); }
.campo.mal:focus-within { border-color: var(--error); box-shadow: var(--sombra-m), 0 0 0 4px var(--error-halo); }
@keyframes temblar {
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}
.campo input {
  flex: 1; min-width: 0;
  height: 100%;
  padding: 0 12px 0 14px;
  border: 0; outline: 0;
  background: transparent;
  font: inherit; font-size: 16px;
  color: var(--tinta);
}
.campo input::placeholder { color: var(--tenue); opacity: 0.8; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.apuntar {
  display: inline-flex; align-items: center; gap: 8px;
  height: 100%;
  padding: 0 18px 0 20px;
  border: 0; border-radius: 12px;
  background: var(--acento);
  color: var(--sobre-acento);
  font: 600 15px/1 var(--fuente);
  cursor: pointer;
  transition: transform 0.4s var(--rebote), filter 0.2s;
}
.apuntar:hover { filter: brightness(1.04); }
.apuntar:active { transform: scale(0.96); }
.apuntar svg { transition: transform 0.45s var(--rebote); }
.apuntar:hover svg { transform: translateX(3px); }
.apuntar[aria-busy='true'] { pointer-events: none; }
.apuntar[aria-busy='true'] svg { animation: esperar 0.9s ease-in-out infinite; }
@keyframes esperar { 50% { transform: translateX(4px); opacity: 0.4; } }

.error { min-height: 0; margin: 10px 0 0; font-size: 14px; font-weight: 500; color: var(--error); }
.error:empty { display: none; }
.nota { margin: 14px 0 0; font-size: 14px; color: var(--tenue); }
.enlace {
  padding: 0; border: 0; background: none;
  font: inherit; color: var(--suave);
  text-decoration: underline; text-decoration-color: var(--linea-fuerte); text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.enlace:hover { color: var(--tinta); text-decoration-color: currentColor; }

.hecho { outline: 0; }
.hecho-tarjeta {
  --percha: 0.5;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 60px;
  padding: 0 18px;
  border: 1px solid var(--linea-fuerte);
  border-radius: 17px;
  background: var(--blanco);
  box-shadow: var(--sombra-m);
  animation: brotar 0.6s var(--muelle) backwards;
}
.hecho-tarjeta svg { flex-shrink: 0; color: var(--verde); }
.hecho-tarjeta p { margin: 0; color: var(--texto); }
.hecho-tarjeta strong { color: var(--tinta); font-weight: 600; }
.hecho .nota { animation: subir 0.7s 0.25s var(--salida) backwards; }

/* ---------- Pie ---------- */

.pie {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 0 20px max(18px, env(safe-area-inset-bottom));
  font-size: 13.5px;
  color: var(--tenue);
}

/* ---------- Hoja de privacidad ---------- */

.hoja {
  width: min(100% - 32px, 460px);
  padding: 26px 26px 22px;
  border: 1px solid var(--linea);
  border-radius: 20px;
  background: var(--blanco);
  color: var(--texto);
  box-shadow: var(--sombra-l);
}
.hoja[open] { animation: brotar 0.5s var(--muelle); }
.hoja::backdrop { background: rgba(15, 20, 25, 0.3); backdrop-filter: blur(3px); }
.hoja h2 {
  margin: 0 0 14px;
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 26px;
  line-height: 1.15;
  color: var(--tinta);
}
.hoja ul { margin: 0; padding: 0 0 0 18px; display: grid; gap: 9px; font-size: 15px; }
.hoja li::marker { color: var(--acento); }
.hoja-pie { margin: 16px 0 0; font-size: 13px; color: var(--tenue); }
.boton-secundario {
  display: block; margin: 20px 0 0 auto;
  height: 40px; padding: 0 18px;
  border: 1px solid var(--linea-fuerte); border-radius: 11px;
  background: var(--blanco);
  font: 600 14.5px var(--fuente); color: var(--tinta);
  cursor: pointer;
}
.boton-secundario:hover { background: var(--cielo); }

/* ---------- La pardela vuela por encima de todo ---------- */

.cielo {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
}

@keyframes subir { from { opacity: 0; transform: translateY(14px); } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes brotar { from { opacity: 0; transform: scale(0.96) translateY(6px); } }

@media (max-width: 520px) {
  .lista, .hecho { margin-top: 64px; }
  .campo { --percha: 0.45; }
  .apuntar { padding: 0 14px 0 16px; }
  .apuntar svg { display: none; }
  .hecho-tarjeta { font-size: 15px; }
}

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