/* ==========================================================================
   Spaash — shared design system for the public site.

   Dark-first to match the product, with a full light theme that follows the
   visitor's OS preference. Type is a system stack on purpose: the app bundles
   Inter as TTF, and shipping ~600 KB of webfont to a landing page for a
   near-identical grotesque is a bad trade. system-ui renders natively and costs
   nothing.
   ========================================================================== */

:root {
  --blue-400: #5b8dff;
  --blue-500: #3e7bfa;
  --blue-600: #2563eb;

  --bg: #070b14;
  --bg-elevated: #0e1420;
  --surface: #141c2b;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e9eff8;
  --text-muted: #8f9bb3;
  --text-faint: #64748b;

  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-elevated: #f6f8fc;
    --surface: #ffffff;
    --border: rgba(11, 18, 32, 0.09);
    --border-strong: rgba(11, 18, 32, 0.16);
    --text: #0b1220;
    --text-muted: #55637a;
    --text-faint: #8593a8;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0; font-weight: 650; }
h1 { font-size: clamp(2.5rem, 6.5vw, 4.25rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.85rem, 4vw, 2.75rem); letter-spacing: -0.03em; }
h3 { font-size: 1.1rem; }
p  { margin: 0; }

.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--blue-400);
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--blue-500) 10%, transparent);
}
.grad {
  background: linear-gradient(115deg, var(--blue-400), #a78bfa 55%, var(--blue-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; color: var(--text); text-decoration: none; font-size: 1.06rem; }
.mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--blue-400), var(--blue-600));
  color: #fff; font-weight: 750; font-size: 0.95rem;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--blue-500) 42%, transparent);
}
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.93rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 11px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color: #fff;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--blue-600) 38%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px color-mix(in srgb, var(--blue-600) 48%, transparent); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: translateY(-2px); }
.btn-sm { padding: 9px 17px; font-size: 0.88rem; }

/* ── Sections ─────────────────────────────────────────────────────────── */
section { padding: clamp(72px, 11vw, 132px) 0; }
.sec-head { max-width: 680px; margin-bottom: 54px; }
.sec-head h2 { margin: 16px 0 14px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 18px 44px rgba(0,0,0,0.22); }
.card h3 { margin-bottom: 9px; }
.card p { color: var(--text-muted); font-size: 0.95rem; }
.card-ico {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--blue-500) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue-500) 24%, transparent);
}

/* ── Reveal on scroll ─────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 46px 0 56px; }
.foot { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; flex-wrap: wrap; gap: 24px; }
.foot a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.foot a:hover { color: var(--text); }
.foot small { color: var(--text-faint); font-size: 0.85rem; }

/* ── Long-form document pages (privacy, delete-account) ───────────────── */
.doc { max-width: 780px; margin: 0 auto; padding: 60px 24px 90px; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 8px; }
.doc .sub { color: var(--text-faint); margin-bottom: 40px; font-size: 0.92rem; }
.doc h2 { font-size: 1.25rem; margin: 44px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.doc p, .doc li { color: var(--text-muted); }
.doc p { margin: 14px 0; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 7px 0; }
.doc strong { color: var(--text); font-weight: 620; }
.doc a { color: var(--blue-400); }
.doc code {
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 6px; font-size: 0.88em;
}
.doc table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 0.93rem; }
.doc th, .doc td { text-align: left; border: 1px solid var(--border); padding: 10px 12px; vertical-align: top; }
.doc th { background: var(--bg-elevated); color: var(--text); font-weight: 600; }
.callout { border-radius: var(--radius); padding: 15px 18px; margin: 24px 0; border: 1px solid var(--border); background: var(--bg-elevated); }
.callout.warn { border-left: 3px solid #f59e0b; }
.callout.danger { border-left: 3px solid #dc2626; }
.callout p { margin: 0; }
