/* ============================================================
   BASE Foundry — shared design system
   Ultra-modern, editorial dark theme
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ── Tokens ────────────────────────────────────────────── */
:root {
  --bg:        #07080c;
  --bg-2:      #0b0d14;
  --surface:   #101320;
  --surface-2: #161a2a;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.13);

  --ink:    #f5f7fc;
  --mist:   #aeb6cc;
  --faint:  #717a9c;

  --violet: #7c6cff;
  --iris:   #9a6bff;
  --blue:   #3a6bff;
  --teal:   #2dd4bf;
  --rose:   #ff6b9d;

  --grad-spectrum: linear-gradient(100deg, #7c6cff 0%, #3a6bff 38%, #2dd4bf 100%);
  --grad-iris:     linear-gradient(135deg, #9a6bff, #3a6bff);

  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --container: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Base ──────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle global grain + aurora wash */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 80% -10%, rgba(124,108,255,0.16), transparent 60%),
    radial-gradient(800px 600px at 0% 10%, rgba(45,212,191,0.08), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(58,107,255,0.10), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; background: none; border: none; color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(124,108,255,0.35); color: #fff; }

/* ── Helpers ───────────────────────────────────────────── */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 28px; }
.narrow { max-width: 820px; }
.mono { font-family: var(--mono); }
.serif-i { font-family: var(--serif); font-style: italic; font-weight: 400; }
.spectrum-text {
  background: var(--grad-spectrum);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--faint);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--line-2);
}

/* ── Reveal on scroll ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; }
}

/* ── Nav ───────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: rgba(7,8,12,0.62);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo img { height: 32px; width: auto; border-radius: 8px; display: block; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 13.5px; color: var(--mist); padding: 8px 14px; border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.nav-links a.active { color: var(--ink); }
.nav-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(124,108,255,0.14), rgba(124,108,255,0.04));
}
.nav-badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 rgba(45,212,191,0.6);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(45,212,191,0.5); }
  70%,100% { box-shadow: 0 0 0 7px rgba(45,212,191,0); }
}
@media (max-width: 720px) {
  .nav-links a { padding: 8px 9px; font-size: 13px; }
  .nav-badge span.full { display: none; }
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 22px; border-radius: 11px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform 0.18s var(--ease), box-shadow 0.25s, opacity 0.2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  color: #fff;
  background: var(--grad-iris);
  box-shadow: 0 10px 40px -10px rgba(124,108,255,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 50px -12px rgba(124,108,255,0.7); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  color: var(--mist); border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(255,255,255,0.28); transform: translateY(-2px); }

/* ── Sections ──────────────────────────────────────────── */
section { position: relative; }
.section-pad { padding: 88px 0; }
@media (max-width: 720px) { .section-pad { padding: 64px 0; } }

.h-display {
  font-family: var(--display);
  font-weight: 600; letter-spacing: -0.035em; line-height: 0.98;
}
.h1 { font-size: clamp(46px, 8.5vw, 104px); }
.h2 { font-size: clamp(34px, 5vw, 58px); }
.lede { font-size: clamp(16px, 2.1vw, 20px); color: var(--mist); line-height: 1.65; }

/* ── Footer ────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { font-size: 13px; color: var(--faint); transition: color 0.2s; }
.footer-links a:hover { color: var(--mist); }
.footer-copy { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ── Waitlist form ─────────────────────────────────────── */
.waitlist {
  display: flex; gap: 10px; max-width: 460px; width: 100%;
}
.waitlist input {
  flex: 1; min-width: 0; padding: 14px 16px; border-radius: 11px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-2);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.waitlist input::placeholder { color: var(--faint); }
.waitlist input:focus { outline: none; border-color: rgba(124,108,255,0.6); background: rgba(124,108,255,0.05); }
@media (max-width: 520px) { .waitlist { flex-direction: column; } }

.form-note { margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.form-note.ok { color: var(--teal); }
.form-note.err { color: var(--rose); }

/* ── Small-screen polish (mobile only — desktop unchanged) ─ */
@media (max-width: 600px) {
  .container { padding-inline: 20px; }
  .section-pad { padding: 56px 0; }

  /* nav: tighten so logo + links + badge never crowd */
  .nav-inner { height: 58px; }
  .nav-logo img { height: 28px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 7px 8px; font-size: 12.5px; }
  .nav-badge { padding: 6px 11px; font-size: 10px; letter-spacing: 0.1em; }

  /* slightly smaller display headings so lines don't wrap awkwardly */
  .h2 { font-size: clamp(30px, 8vw, 42px); }

  /* footer: stack into a clean column instead of squeezing one row */
  .footer { padding: 32px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-links { gap: 18px; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .nav-links a { padding: 7px 6px; font-size: 11.5px; }
  .nav-badge { padding: 6px 9px; }
}
