/* ── Page frame ─────────────────────────────────────────── */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--page-pad);
}

@supports (min-height: 100svh) {
  body {
    min-height: 100svh;
  }
}

/* ── Atmosphere: glow + vignette (behind content) ───────── */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 38%, var(--glow), transparent 65%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 130% 110% at 50% 50%, transparent 52%, var(--bg-deep) 125%);
}

/* ── Atmosphere: grain (above content, static) ──────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' 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: 140px 140px;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  display: flex;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--cream);
  transition: color var(--transition);
}

.brand:hover {
  color: var(--cream-bright);
}

.brand-logo {
  display: block;
  flex: none;
  width: 20px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--cream);
}

.site-nav a[aria-current="page"] {
  color: var(--cream);
}

.site-nav a[aria-current="page"]::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cream);
}

/* ── Main column ────────────────────────────────────────── */

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--max-width));
  margin-inline: auto;
  padding-block: clamp(40px, 6vh, 72px);
  text-align: center;
}

/* ── Badge pill ─────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cream);
  opacity: 0.85;
}

/* ── Headline & subline ─────────────────────────────────── */

.headline {
  margin-top: clamp(28px, 5vh, 44px);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 13vw, 152px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--cream-bright);
}

.headline em {
  font-style: italic;
}

.subline {
  margin-top: clamp(20px, 3.5vh, 30px);
  max-width: 34ch;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: balance;
}

/* ── Waitlist form (fused pill) ─────────────────────────── */

.waitlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: clamp(32px, 5.5vh, 48px);
}

.pill {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  height: 56px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  transition: opacity 250ms ease;
}

.pill input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px 0 18px;
  background: transparent;
  border-radius: var(--radius-pill);
  color: var(--cream);
  font-size: 16px;
}

.pill input::placeholder {
  color: var(--faint);
}

.pill button {
  flex-shrink: 0;
  height: 100%;
  padding: 0 22px;
  background: var(--cream);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition:
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.pill button:hover {
  background: var(--cream-bright);
  box-shadow: 0 2px 14px rgba(12, 11, 10, 0.45);
}

.pill button:active {
  transform: scale(0.98);
}

.pill button:disabled {
  cursor: default;
  opacity: 0.75;
}

/* Focus: ring on the pill while the input is focused (with
   a plain input ring as fallback where :has() is missing). */

.pill input:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

@supports selector(.pill:has(input)) {
  .pill input:focus-visible {
    outline: none;
  }

  .pill:has(input:focus-visible) {
    outline: 2px solid var(--cream);
    outline-offset: 3px;
  }
}

.form-microcopy {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--faint);
  transition: opacity 250ms ease;
}

.is-leaving {
  opacity: 0;
}

.form-status {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 15px;
  line-height: 1.55;
  color: var(--cream);
}

.form-status a {
  color: inherit;
}

.form-status.form-confirm {
  margin-top: 0;
  font-size: clamp(17px, 2vw, 19px);
}

.honeypot {
  display: none;
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--cream-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-sep {
  color: var(--faint);
}

/* ── Entrance motion (once, JS-gated, reduced-motion safe) ── */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .is-ready .reveal {
    animation: rise 600ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
  }

  .is-ready .reveal-badge    { animation-delay: 0ms; }
  .is-ready .reveal-headline { animation-delay: 80ms; }
  .is-ready .reveal-subline  { animation-delay: 160ms; }
  .is-ready .reveal-form     { animation-delay: 240ms; }
  .is-ready .reveal-frame    { animation-delay: 320ms; }
}

/* ── Responsive: < 560px ────────────────────────────────── */

@media (max-width: 559px) {
  .pill {
    flex-direction: column;
    height: auto;
    gap: 12px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }

  .pill input {
    flex: none;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
  }

  .pill button {
    width: 100%;
    height: 54px;
  }

  /* Container is no longer a visible pill — ring goes back
     to the input itself. */
  .pill:has(input:focus-visible) {
    outline: none;
  }

  .pill input:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 3px;
  }

  .site-footer {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    text-align: center;
  }
}
