/* La Carrera de la Rata — estilos compartidos
   Tipografía: Bevan en todo el sitio, la slab serif del sello del logo.
   Al ser una letra de cartel, el texto largo pide más interlínea y menos
   tamaño de lo habitual; los ajustes de abajo están calibrados para eso.
   Paleta: negro de base, grises oscuros para el relieve, hueso para el foco
   y un rojo de marca para los acentos. */

:root {
  --black: #050505;
  --coal: #0d0d0e;
  --graphite: #17181a;
  --edge: #26282b;
  --edge-strong: #3a3d42;
  --bone: #ece8e1;
  --muted: #9a9ca1;
  --faint: #83868c;
  --red: #d7392c;
  --red-soft: #e8594b;
  --danger: #e8594b;
  --ok: #9dbf9a;
  --shell: min(560px, 100%);
  --display: 'Bevan', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  font-family: var(--display);
  font-weight: 400;
  color: var(--bone);
  background-color: var(--black);
  background-image:
    radial-gradient(120% 80% at 50% -10%, #23252a 0%, #111214 38%, #060607 68%, #030304 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Bevan solo tiene un grosor: la jerarquía se hace con tamaño y color,
   nunca con font-weight, que el navegador falsearía engordando los trazos. */
h1, h2, h3, p, label, button, input, a, span, td, th, li {
  font-weight: 400;
}

input, button, select, textarea { font-family: var(--display); }

/* Grano de película: rompe el degradado y le da textura de cartel antiguo. */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 7s steps(6) infinite;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(75% 60% at 50% 42%, transparent 40%, rgba(0,0,0,.72) 100%);
}

@keyframes drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Estructura ---------- */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 0 24px;
}

.panel {
  width: var(--shell);
  text-align: center;
}

.panel > * {
  opacity: 0;
  animation: rise .9s cubic-bezier(.22, .68, .36, 1) forwards;
}
.panel > .eyebrow { animation-delay: .10s; }
.panel > .logo    { animation-delay: .22s; }
.panel > .lead    { animation-delay: .46s; }
.panel > .form    { animation-delay: .62s; }
.panel > .whisper { animation-delay: .82s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

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

.eyebrow {
  margin: 0 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(215, 57, 44, .6);
  animation: beat 2.6s ease-out infinite;
}

@keyframes beat {
  0%        { box-shadow: 0 0 0 0 rgba(215,57,44,.55); opacity: 1; }
  70%, 100% { box-shadow: 0 0 0 11px rgba(215,57,44,0); opacity: .5; }
}

.logo {
  display: block;
  width: min(250px, 58vw);
  height: auto;
  margin: 0 auto 28px;
  filter: drop-shadow(0 0 28px rgba(236, 232, 225, .16));
}

.lead {
  margin: 0 auto 34px;
  max-width: 30ch;
  font-size: clamp(.98rem, .86rem + .6vw, 1.2rem);
  line-height: 1.66;
  letter-spacing: .005em;
  color: #dedad3;
  text-wrap: balance;
}

/* ---------- Formulario ---------- */

.form { margin: 0; }

.field {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(23,24,26,.9), rgba(10,10,11,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 40px -28px rgba(0,0,0,.9);
  transition: border-color .25s ease, box-shadow .25s ease;
}

.field:focus-within {
  border-color: var(--red);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 3px rgba(215,57,44,.16);
}

.field input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 13px 8px 13px 18px;
  border: 0;
  background: transparent;
  font-size: .82rem;
  letter-spacing: .01em;
  color: var(--bone);
  outline: none;
}

.field input[type="email"]::placeholder { color: #6f7176; }

.field button {
  flex: none;
  padding: 0 22px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--bone);
  color: #0a0a0b;
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, transform .12s ease, opacity .2s ease;
}

.field button:hover:not(:disabled) { background: #fff; }
.field button:active:not(:disabled) { transform: scale(.975); }
.field button:disabled { opacity: .5; cursor: not-allowed; }

/* Consentimiento RGPD */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 4px 0;
  text-align: left;
  cursor: pointer;
}

.consent input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent .box {
  flex: none;
  margin-top: 2px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--edge-strong);
  border-radius: 5px;
  background: rgba(255,255,255,.02);
  transition: background .18s ease, border-color .18s ease;
}

.consent .box::after {
  content: "";
  display: block;
  width: 4px;
  height: 8px;
  margin: 2px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg) scale(.4);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
}

.consent input:checked + .box {
  background: var(--red);
  border-color: var(--red);
}
.consent input:checked + .box::after { opacity: 1; transform: rotate(42deg) scale(1); }
.consent input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(215,57,44,.3); }

.consent-text {
  font-size: .62rem;
  line-height: 1.85;
  letter-spacing: .015em;
  color: var(--muted);
}

.consent-text a {
  color: var(--red-soft);
  text-underline-offset: 3px;
  text-decoration-color: rgba(232,89,75,.45);
}
.consent-text a:hover { color: #ff8376; }

/* Trampa anti-bots */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  min-height: 1.2em;
  margin: 14px 0 0;
  font-size: .68rem;
  line-height: 1.6;
  color: var(--muted);
  transition: color .2s ease;
}
.status[data-state="error"]   { color: var(--danger); }
.status[data-state="success"] { color: var(--ok); }

/* Estado final tras el alta */

.done {
  margin: 0;
  padding: 24px 20px;
  border: 1px solid var(--edge);
  border-top: 2px solid var(--red);
  border-radius: 16px;
  background: rgba(255,255,255,.015);
  animation: rise .7s cubic-bezier(.22,.68,.36,1) forwards;
}

.done strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.02rem;
  letter-spacing: .01em;
  color: var(--bone);
}

.done span {
  font-size: .68rem;
  line-height: 1.85;
  color: var(--muted);
}

.whisper {
  margin: 28px 0 0;
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

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

.footer {
  position: relative;
  z-index: 1;
  padding: 24px 0 28px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.footer-links a {
  font-size: .58rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  text-decoration: none;
  transition: color .2s ease;
}

.footer-links a:hover { color: var(--bone); }

/* Acceso discreto al panel: solo el engranaje. */
.footer-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--faint);
  transition: color .25s ease, background .25s ease, transform .5s ease;
}

.footer-admin svg { width: 14px; height: 14px; display: block; }

.footer-admin:hover {
  color: var(--red-soft);
  background: rgba(215,57,44,.1);
  transform: rotate(90deg);
}

.footer-admin:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.footer p {
  margin: 0;
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- Pop-up del pódcast ---------- */

/* Ojo: el navegador oculta un <dialog> cerrado con display:none, pero una regla
   de autor lo pisa siempre. Por eso el display solo se declara en [open]. */
.modal:not([open]) { display: none; }

.modal[open] {
  display: grid;
  place-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 20px;
  border: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow-y: auto;
}

.modal::backdrop {
  background: rgba(3, 3, 4, .82);
  backdrop-filter: blur(6px);
  animation: fade .4s ease forwards;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(440px, 100%);
  margin: auto;
  padding: 34px 28px 28px;
  border: 1px solid var(--edge-strong);
  border-top: 3px solid var(--red);
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% -20%, #1e1f23 0%, #0d0d0f 55%, #08080a 100%);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(0,0,0,.4);
  animation: pop .55s cubic-bezier(.2, .9, .3, 1) forwards;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(26px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.modal-close:hover {
  color: var(--bone);
  border-color: var(--edge-strong);
  background: rgba(255,255,255,.04);
}

/* El sello corre: se balancea y rebota como la rata del logo. */
.modal-logo {
  width: 124px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
  filter: drop-shadow(0 0 26px rgba(236, 232, 225, .2));
  transform-origin: 50% 80%;
  animation: trot 1.5s cubic-bezier(.45, .05, .55, .95) infinite;
}

@keyframes trot {
  0%   { transform: translateY(0)    rotate(-4deg) scale(1); }
  25%  { transform: translateY(-9px) rotate(0deg)  scale(1.03); }
  50%  { transform: translateY(0)    rotate(4deg)  scale(1); }
  75%  { transform: translateY(-9px) rotate(0deg)  scale(1.03); }
  100% { transform: translateY(0)    rotate(-4deg) scale(1); }
}

.modal-tag {
  margin: 0 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--red-soft);
}

.modal-card h2 {
  margin: 0 auto 22px;
  max-width: 22ch;
  font-size: clamp(.95rem, .85rem + .45vw, 1.12rem);
  line-height: 1.6;
  letter-spacing: .005em;
  color: var(--bone);
  text-wrap: balance;
}

.modal-card .field { text-align: left; }
.modal-card .status { text-align: center; }

.modal-skip {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .58rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  cursor: pointer;
  transition: color .2s ease;
}

.modal-skip:hover { color: var(--muted); }

/* ---------- Utilidades y preferencias ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

::selection { background: rgba(215,57,44,.35); }

@media (max-width: 520px) {
  body { padding: 0 16px; }
  .stage { padding: 28px 0 20px; }
  .field { flex-direction: column; border-radius: 18px; padding: 8px; }
  .field input[type="email"] { padding: 12px 14px; text-align: center; }
  .field button { width: 100%; }
  .logo { width: min(172px, 46vw); margin-bottom: 22px; }
  .eyebrow { margin-bottom: 18px; font-size: .58rem; }
  .lead { margin-bottom: 24px; max-width: 24ch; font-size: .92rem; line-height: 1.6; }
  .whisper { margin-top: 20px; }
  .footer-links { gap: 8px 12px; }
  .modal { padding: 14px; }
  .modal-card { padding: 30px 20px 24px; border-radius: 18px; }
  .modal-logo { width: 100px; }
  .modal-card h2 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .pulse, .modal-logo { animation: none; }
  .panel > *, .done, .modal-card { animation: none; opacity: 1; transform: none; filter: none; }
  .footer-admin:hover { transform: none; }
  * { transition-duration: .01ms !important; }
}
