/*
 * frAImes coming-soon landing — brand-system styling.
 * Tokens mirror assets/brand/design-system.md (canvas #14161A, electric-blue
 * gradient #00DFFF → #00B0F0, Montserrat). Hex lives here (the CSS/theme layer),
 * never scattered through markup or the Worker TypeScript.
 */
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #14161a;
  --bg-deep: #0f1114;
  --surface: #1c1f26;
  --text: #ffffff;
  --muted: #9aa4ad;
  --accent-start: #00dfff;
  --accent-end: #00b0f0;
  --outline: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.1);
  --space: 16px;
  --radius: 16px;
  --maxw: 640px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  overflow: hidden;
}

/* ---- Ambient backdrop ---------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.glow--one {
  width: 46vmax;
  height: 46vmax;
  top: -14vmax;
  left: -10vmax;
  background: radial-gradient(circle, var(--accent-start), transparent 62%);
  animation: drift1 18s ease-in-out infinite alternate;
}

.glow--two {
  width: 40vmax;
  height: 40vmax;
  bottom: -16vmax;
  right: -12vmax;
  background: radial-gradient(circle, var(--accent-end), transparent 62%);
  opacity: 0.4;
  animation: drift2 22s ease-in-out infinite alternate;
}

/* Faint neural grid */
.grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 72%);
  opacity: 0.35;
}

@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}

@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-5vmax, -4vmax, 0) scale(1); }
}

/* ---- Stage --------------------------------------------------------------- */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  text-align: center;
  animation: rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.wordmark {
  display: block;
  margin: 0 auto;
  width: clamp(160px, 40vw, 220px);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(0, 223, 255, 0.25));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 6px 14px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-start);
  box-shadow: 0 0 0 0 rgba(0, 223, 255, 0.7);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 223, 255, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(0, 223, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 223, 255, 0); }
}

.tagline {
  margin: 24px 0 0;
  font-weight: 700;
  font-size: clamp(38px, 8vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.subline {
  margin: 20px auto 0;
  max-width: 34em;
  font-size: clamp(15px, 2.4vw, 18px);
  line-height: 1.6;
  color: var(--muted);
}

.subline strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Waitlist form ------------------------------------------------------- */
.waitlist {
  margin: 32px auto 0;
  max-width: 520px;
}

.field {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.field:focus-within {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 4px rgba(0, 223, 255, 0.15);
}

.field input {
  flex: 1;
  min-width: 0;
  padding: 14px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.field input::placeholder {
  color: var(--muted);
}

.field input:focus {
  outline: none;
}

.field button {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-start), var(--accent-end));
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.field button:hover {
  filter: brightness(1.06);
}

.field button:active {
  transform: translateY(1px);
}

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

.field button .arrow {
  transition: transform 160ms ease;
}

.field button:hover .arrow {
  transform: translateX(3px);
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.status {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-size: 14px;
  font-weight: 500;
}

.status.is-success {
  color: var(--accent-start);
}

.status.is-error {
  color: #ffb4ab;
}

.foot {
  margin-top: 44px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.foot .dot {
  margin: 0 8px;
}

.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;
}

@media (max-width: 520px) {
  .field {
    flex-direction: column;
  }
  .field button {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow,
  .pulse,
  .stage {
    animation: none;
  }
}
