:root {
  --bpm: 95;
  --beat: calc(60s / var(--bpm));
  --bg: #0a0a0a;
  --gold: #e6b422;
  --white: #ffffff;
}

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

html, body { margin: 0; background: var(--bg); }

body {
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }
a:hover { color: var(--white); }

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

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(#e6b42226 1.5px, transparent 1.5px);
  background-size: 26px 26px;
  overflow: hidden;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pill {
  font-family: 'Rubik Mono One', sans-serif;
  font-size: 13px;
  background: var(--white);
  color: var(--bg);
  padding: 10px 16px;
  border: 3px solid var(--bg);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--gold);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 48px 0 32px;
  text-align: center;
}

/* ---------- Character stage ---------- */

.stage {
  width: 100%;
  max-width: 280px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 300px;
}

.halo {
  position: absolute;
  left: 50%; top: 50%;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, #e6b422aa 0%, #b8860b44 40%, #0a0a0a00 70%);
}

.spark { position: absolute; }

.character {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
}

.bubble {
  /* A la izquierda de la cabeza y un poco por encima, dejando hueco. */
  position: absolute;
  left: -150px;
  top: -24px;
  max-width: 190px;
  background: var(--white);
  color: var(--bg);
  border: 3px solid var(--bg);
  border-radius: 22px;
  padding: 14px 18px;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .02em;
  rotate: -6deg;
  box-shadow: 6px 6px 0 var(--gold);
  z-index: 3;
}

/* La forma de la flecha la calcula main.js para que apunte a la boca.
   El origen (0,0) es la esquina exterior del bocadillo (de ahí el -3px del borde). */
.bubble-tail {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 1px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

/* ---------- Logo + copy ---------- */

.logo {
  position: relative;
  z-index: 2;
  margin: -120px 0 0;
  font-family: 'Pirata One', serif;
  font-weight: 400;
  font-size: clamp(96px, 14vw, 184px);
  line-height: .85;
  background: linear-gradient(180deg, #fff8d6 0%, #f5d77a 30%, #b8860b 52%, #ffe9a3 66%, #9a6f00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(4px 4px 0 #3d2d00) drop-shadow(0 4px 16px #000000);
  transform-origin: 50% 60%;
}

.tagline {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  max-width: 560px;
}

/* ---------- Form ---------- */

.signup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 620px;
}

.signup-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.signup input {
  flex: 1 1 220px;
  min-width: 0;
  height: 56px;
  padding: 0 22px;
  border: 3px solid var(--white);
  border-radius: 999px;
  background: #161616;
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
}
.signup input::placeholder { color: #8f8f8f; }
.signup input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.signup-cta {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.btn {
  height: 56px;
  padding: 0 26px;
  border: 3px solid var(--bg);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3c0, var(--gold) 50%, #a87800);
  color: var(--bg);
  font-family: 'Rubik Mono One', sans-serif;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 5px 5px 0 var(--white);
  cursor: pointer;
}
.btn:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }
.btn:active { box-shadow: 2px 2px 0 var(--white); translate: 3px 3px; }

.fineprint {
  font-size: 15px;
  color: #bdbdbd;
  text-align: center;
}

/* ---------- Animation ---------- */

@keyframes pulse   { 0% { transform: scale(1) } 12% { transform: scale(1.04) } 100% { transform: scale(1) } }
@keyframes nod     { 0%,100% { transform: translateY(0) rotate(-1.5deg) } 50% { transform: translateY(6px) rotate(1.5deg) } }
@keyframes sway    { 0%,100% { transform: rotate(-1.2deg) } 50% { transform: rotate(1.2deg) } }
@keyframes swing   { 0%,100% { transform: rotate(4deg) } 50% { transform: rotate(-4deg) } }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.6) rotate(0deg) } 50% { opacity: 1; transform: scale(1.1) rotate(45deg) } }
@keyframes glow    { 0% { opacity: 1; transform: scale(1.05) } 15% { opacity: .45; transform: scale(.95) } 100% { opacity: 1; transform: scale(1.05) } }

.beat  { animation: pulse var(--beat) ease-out infinite; }
.nod   { animation: nod var(--beat) ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.sway  { animation: sway calc(var(--beat) * 2) ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.swing { animation: swing calc(var(--beat) * 2) ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0; }
.spark { animation: twinkle calc(var(--beat) * 2) ease-in-out infinite; }
.halo  { animation: glow var(--beat) ease-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .beat, .nod, .sway, .swing, .spark, .halo { animation: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 40px; }
  /* En móvil no hay sitio al lado de la cabeza: el personaje sigue centrado
     y el bocadillo sube un poco más, arriba a la izquierda de la cabeza. */
  .bubble {
    left: -31px;
    top: -58px;
    max-width: 148px;
    padding: 11px 13px;
    border-radius: 18px;
    text-wrap: balance;
    font-size: 15px;
    letter-spacing: 0;
  }
  .tagline { font-size: 22px; }
  .signup-cta { flex: 1 1 100%; }
  .btn { white-space: normal; }
}

/* Móviles muy estrechos (≤ 359px): bocadillo algo más pequeño para que quepa. */
@media (max-width: 359px) {
  .bubble {
    left: -4px;
    top: -56px;
    max-width: 132px;
    padding: 10px 11px;
    font-size: 13px;
  }
}
