/* Design tokens — match app terminal palette */
:root {
  --color-bg: #131722;
  --color-surface: #1e222d;
  --color-buy: #089981;
  --color-accent: #2962ff;
  --color-muted: #787b86;
  --color-secondary: #b2b5be;
  --color-body: #d1d4dc;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ───────────────────────────────────────────── */

.page {
  position: relative;
  display: flex;
  height: 100vh;
  width: 100vw;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg);
}

.vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.brand {
  position: absolute;
  left: 1.5rem;
  top: 1.25rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.logo {
  height: 1.75rem;
  width: 1.75rem;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-gray-100);
}

.main {
  position: relative;
  z-index: 10;
  display: flex;
  width: 100%;
  max-width: 480px;
  flex-direction: column;
  padding: 0 1.5rem;
}

.headline {
  margin: 0;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
}

.headline-sub {
  display: block;
  color: #fff;
}

.word-slot {
  display: inline-block;
  overflow: hidden;
  height: 1.2em;
  vertical-align: bottom;
}

.word {
  display: inline-block;
}

.tagline {
  margin: 1rem 0 0;
  max-width: 380px;
  font-size: 15px;
  line-height: 1.625;
  color: var(--color-muted);
}

/* ── Waitlist ─────────────────────────────────────────── */

.waitlist {
  /* Match the email+button row (2.5rem) so success doesn't collapse height */
  margin-top: 2rem;
  min-height: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* display:flex above beats the UA [hidden] rule — force hide */
.waitlist-form[hidden] {
  display: none;
}

.waitlist-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Honeypot — off-screen, not display:none (some bots skip those). */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #f23645;
}

.waitlist-error[hidden] {
  display: none;
}

.waitlist-input {
  height: 2.5rem;
  min-width: 0;
  flex: 1;
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--color-surface);
  padding: 0 0.75rem;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-gray-100);
  outline: none;
  transition: border-color 150ms ease;
}

.waitlist-input::placeholder {
  color: color-mix(in srgb, var(--color-muted) 60%, transparent);
}

.waitlist-input:focus {
  border-color: rgba(255, 255, 255, 0.2);
}

.waitlist-submit {
  position: relative;
  display: inline-flex;
  height: 2.5rem;
  min-width: 9.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  border-radius: 0.375rem;
  background: var(--color-accent);
  padding: 0 1.25rem;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  transition: filter 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.waitlist-submit:hover:not(:disabled) {
  filter: brightness(1.1);
}

.waitlist-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.waitlist-submit:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

/* Loading: keep button solid, swap label for spinner */
.waitlist-submit.is-loading {
  cursor: wait;
  opacity: 1;
  pointer-events: none;
}

.waitlist-submit.is-loading .btn-label {
  visibility: hidden;
}

.waitlist-submit .btn-spinner {
  display: none;
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.waitlist-submit.is-loading .btn-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.waitlist-success {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.waitlist-success[hidden] {
  display: none;
}

.check-icon {
  display: flex;
  height: 1.5rem;
  width: 1.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-buy) 15%, transparent);
  color: var(--color-buy);
}

.check-icon svg {
  height: 0.875rem;
  width: 0.875rem;
}

.success-copy {
  margin: 0;
  font-size: 14px;
  color: var(--color-gray-200);
}

.success-email {
  font-weight: 500;
  color: #fff;
}

/* ── Noise overlay — subtle film grain texture ────────── */

.noise::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Entrance — single, non-bouncy fade ───────────────── */

@keyframes entrance {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.enter {
  animation: entrance 600ms ease-out both;
}

.enter-d1 {
  animation-delay: 80ms;
}
.enter-d2 {
  animation-delay: 160ms;
}
.enter-d3 {
  animation-delay: 240ms;
}

/* ── Scanline — single horizontal line that crawls down ─ */

@keyframes scanline {
  0% {
    top: -1px;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.scanline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(41, 98, 255, 0.15),
    transparent
  );
  animation: scanline 8s linear infinite;
  pointer-events: none;
}

/* ── Word flip — one-shot, bottom to top ──────────────── */

@keyframes word-flip-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.word-flip-in {
  animation: word-flip-in 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Success state ────────────────────────────────────── */

@keyframes check-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.check-in {
  animation: check-in 300ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .enter,
  .word-flip-in,
  .check-in,
  .scanline::before {
    animation: none;
  }
}
