/* ════════════════════════════════════════════════════════════
   elah.ai coming-soon page

   Light-only by design: the background is a fixed brand asset with
   its own light palette, so a dark variant would either hide it or
   fight it. Everything is set in black on the gradient's pale
   regions, which stays well above AA at every crop.
   ════════════════════════════════════════════════════════════ */

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

:root {
  --ink: #101010;
  --ink-soft: #3d3d3d;
  --hairline: rgba(16, 16, 16, 0.18);
  --veil: rgba(255, 255, 255, 0.55);
  --focus: #101010;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Fallback tint matches the gradient's palest corner, so a slow
     image load never flashes white-on-white or a dark box. */
  background-color: #f2f8f5;
  background-image: url("/bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Two changes for phones:
   1. background-attachment: fixed is janky on mobile Safari (it
      detaches during rubber-band scroll), and the page never scrolls
      on a phone anyway.
   2. The half-size gradient (5K vs 19K). It upscales invisibly —
      the asset is a soft blur with no edges to soften. The preload
      links in index.html carry matching media attributes so only one
      of the two is ever fetched. */
@media (max-width: 640px) {
  body {
    background-attachment: scroll;
    background-image: url("/bg-small.webp");
  }
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.panel {
  width: min(34rem, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 clamp(1.5rem, 4vw, 2.25rem);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.logo {
  margin: 0;
  line-height: 0;
}

.logo img {
  width: clamp(11rem, 42vw, 16rem);
  height: auto;
}

.tagline {
  margin: clamp(1.75rem, 5vw, 2.5rem) auto 0;
  /* Fits on one line at the panel's full width; text-wrap: balance
     splits it evenly rather than orphaning a word once it can't. */
  max-width: 100%;
  font-size: clamp(1.0625rem, 1rem + 0.6vw, 1.3125rem);
  line-height: 1.45;
  letter-spacing: -0.011em;
  color: var(--ink);
  text-wrap: balance;
}

/* ─── Signup ─────────────────────────────────────────────── */

.signup {
  margin-top: clamp(2rem, 6vw, 3rem);
}

.field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.375rem 0.375rem 1.125rem;
  background: var(--veil);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.field:focus-within {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6875rem 0;
  font: inherit;
  font-size: 1rem; /* 16px — anything smaller makes iOS zoom on focus. */
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}

.field input::placeholder {
  color: rgba(16, 16, 16, 0.42);
}

.field button {
  flex: 0 0 auto;
  padding: 0.6875rem 1.25rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

.field button:hover:not(:disabled) {
  opacity: 0.84;
}

.field button:active:not(:disabled) {
  transform: scale(0.98);
}

.field button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Keyboard focus stays visible even though the inputs drop their own
   outlines — the ring is drawn on the wrapper for the text field and
   on the control itself for the button. */
.field:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.field button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Turnstile renders a fixed-size iframe; centre it and give it the same
   rhythm as the field above. Managed mode usually self-resolves without
   any interaction, so for most visitors this is a brief flash. */
.turnstile {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  min-height: 65px;
}

.status {
  min-height: 1.5rem; /* Reserved so a message never shifts the layout. */
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 200ms ease;
}

.status[data-visible="true"] {
  opacity: 1;
}

.status[data-state="error"] {
  color: #8c1d18;
}

/* Success replaces the form; the panel keeps its height so the page
   doesn't jump underneath the person reading the confirmation. */
.signup[data-state="done"] .field,
.signup[data-state="done"] .visually-hidden {
  display: none;
}

.signup[data-state="done"] .status {
  font-size: 1rem;
  color: var(--ink);
}

/* On success the script moves focus here so it isn't stranded on the
   removed submit button. The element is tabindex="-1", so no keyboard
   user can ever land on it and there is nothing for a focus ring to
   help — and drawn at this width it reads as an empty input box. */
.status:focus,
.status:focus-visible {
  outline: none;
}

/* ─── Utilities ──────────────────────────────────────────── */

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

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