/* headless — marketing site.
 *
 * The design tokens below are LIFTED VERBATIM from web/src/index.css, which is the
 * dashboard's stylesheet. That is the whole point: the landing page and the product
 * must be visibly one thing, so they share a palette, a type stack, a radius and a
 * shadow rather than merely resembling each other. If a token changes in the app,
 * change it here too.
 *
 * Constraints this file is written under, all deliberate:
 *   - NO external requests. No web font, no CDN, no analytics. The system font stack
 *     is the app's font stack, so self-hosting a typeface would make the two LESS
 *     alike, not more. A strict CSP with no third-party origins passes as-is.
 *   - NO build step. This is the stylesheet the browser gets.
 *   - Light and dark, via prefers-color-scheme, exactly as the app does it.
 *   - Every colour used for TEXT clears WCAG AA (4.5:1) against the background it
 *     actually sits on, in BOTH schemes. See the note below — this is the one place
 *     the marketing page deliberately departs from the app's values.
 */

/* ── design tokens (from web/src/index.css) ─────────────────────────────────── */
/*
 * THE ONE DELIBERATE DEVIATION — light-mode text colours are darkened.
 *
 * The app's palette is tuned for 14px UI chrome, where these colours are mostly
 * borders, dots and status badges glanced at, not prose read for a minute. Measured as
 * TEXT against the background it lands on, several of them miss WCAG AA (4.5:1):
 *
 *   #2f80ed accent   white label on the primary button → 3.9:1   (and links on paper)
 *   #2f9e44 green    "Live" pill on its own 8% tint     → 3.2:1
 *   #b8860b amber    "Planned" pill on its own 9% tint  → 2.9:1
 *   #787774 text-dim secondary prose on #f7f7f5 paper   → 4.2:1
 *
 * A landing page is read, at length, by people who may be on a phone in daylight — so
 * each is darkened to clear 4.5:1 while keeping the SAME HUE. Side by side with the
 * dashboard they read as the same blue, the same green, the same ink; a contrast
 * checker sees the difference and passes. DARK MODE IS UNCHANGED: every one of the
 * app's dark values already clears AA against #191919.
 */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5; /* notion paper */
  --bg-elev: #ffffff;
  --hover: #f1f1ef;
  --text: #37352f; /* notion ink */
  --text-dim: #6b6a66; /* app: #787774 — darkened; 5.0:1 on paper, 5.4:1 on white */
  --text-faint: #9b9a97; /* rules, icons and dots only — NEVER words (2.9:1 on white) */
  --border: #ebebea;
  --border-strong: #e0e0de;
  --accent: #1a5fbf; /* app: #2f80ed — darkened; white-on-it 6.1:1, as a link 6.1:1 */
  --green: #1f7a31; /* app: #2f9e44 — darkened; 4.9:1 on its own tint */
  --red: #c92a2a; /* app: #e03131 — darkened; 5.1:1 on its own tint */
  --amber: #8a6206; /* app: #b8860b — darkened; 4.7:1 on its own tint */
  --radius: 6px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(15, 15, 15, 0.06), 0 4px 16px rgba(15, 15, 15, 0.08);

  /* Marketing-only: the page is wider than the app's 1040px content column. */
  --page: 1080px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --bg-soft: #202020;
    --bg-elev: #252525;
    --hover: #2a2a2a;
    --text: #e9e9e7;
    --text-dim: #9b9a97;
    --text-faint: #6f6f6c;
    --border: #2d2d2d;
    --border-strong: #383838;
    --accent: #4c8dff;
    --green: #51cf66;
    --red: #ff6b6b;
    --amber: #e0a73a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* ── base ──────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px; /* the app runs at 14px; a marketing page is read at arm's length */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Belt and braces against a horizontal scrollbar at 375px: nothing here is allowed
     to be wider than the viewport, and if something ever is, it is clipped rather
     than made the user's problem. */
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* One visible, consistent focus ring for every interactive element. Never removed —
   the page has to be operable from the keyboard alone. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

img, svg { max-width: 100%; }

h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 5.2vw, 52px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

code, kbd, pre { font-family: var(--mono); }

/* The skip link: visually hidden until focused, then it lands on top of everything. */
.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 10px 14px; font-weight: 600;
}
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* Section rhythm. Alternating sections take the "paper" background, as the app's
   sidebar does, so the page has the same two-tone feel as the product. */
section { padding: 88px 0; border-top: 1px solid var(--border); }
section.soft { background: var(--bg-soft); }

.eyebrow {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin-bottom: 12px;
}
.lede { font-size: 18px; color: var(--text-dim); max-width: 64ch; margin-top: 16px; }
.section-head { max-width: 68ch; margin-bottom: 40px; }

/* ── header ────────────────────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-inner { display: flex; align-items: center; gap: 20px; height: 58px; }

.brand {
  display: inline-flex; align-items: baseline; gap: 8px;
  color: var(--text); font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; }

.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 6px 10px; border-radius: var(--radius);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.site-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
@media (max-width: 800px) { .site-nav { display: none; } }

/* ── buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
/* In dark mode the accent is a BRIGHT blue (#4c8dff), and white on it is only 3.2:1.
   Dark ink on it is 5.5:1 — so the primary button flips its label colour rather than
   shipping an unreadable one. The fill stays the app's accent either way. */
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #16181d; }
}
.btn.ghost { background: var(--bg-elev); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 7px 13px; font-size: 14px; border-radius: var(--radius); }
.site-inner .btn { margin-left: 0; }
@media (max-width: 800px) { .site-inner .btn { margin-left: auto; } }

/* ── pills / badges (the app's .pill) ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 100px; font-size: 12.5px; font-weight: 500;
  background: var(--bg-soft); color: var(--text-dim); border: 1px solid var(--border);
}
.pill.blue { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pill.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); }
.pill.amber { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 32%, transparent); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* ── hero ──────────────────────────────────────────────────────────────────── */
.hero { padding: 84px 0 76px; border-top: none; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.hero h1 { margin-top: 18px; }
.hero .lede { font-size: 19px; margin-top: 20px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--text-dim); }

/* ── terminal ──────────────────────────────────────────────────────────────── */
/* A real terminal, not a screenshot: it is text, so it scales, it is selectable, it
   is readable by a screen reader, and it costs no image request. */
.term {
  border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden;
  background: var(--bg-elev); box-shadow: var(--shadow);
}
.term-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--bg-soft);
}
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); display: block; }
.term-bar span { margin-left: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }

.term pre {
  margin: 0; padding: 16px 18px;
  font-size: 13px; line-height: 1.75;
  /* A code block must scroll INSIDE itself. If it doesn't, a long line makes the
     whole page scroll sideways on a phone — the single most common way a landing
     page breaks at 375px. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  tab-size: 2;
}
.term code { font-size: inherit; white-space: pre; }

/* Hand-rolled syntax colours. No highlighter library, no build step. */
.term .c { color: var(--text-dim); }            /* comment */
.term .p { color: var(--accent); font-weight: 600; }  /* prompt $ */
.term .k { color: var(--text); font-weight: 600; }    /* command */
.term .s { color: var(--green); }               /* string / value */
.term .o { color: var(--text-dim); }            /* output */
.term .n { color: var(--amber); }               /* number */

/* ── cards ─────────────────────────────────────────────────────────────────── */
/* Four cards, so the track is sized to land 2×2 on a desktop rather than 3-and-an-
   orphan: a 400px minimum only fits two columns in the 1032px content width, which is
   also the width these capability lists want (a third column squeezes them to two words
   a line).

   min(400px, 100%) — NOT a bare 400px — is what keeps that safe on a phone. A bare
   minmax(400px, 1fr) track CANNOT shrink below its 400px minimum, so at 375px it
   overflows the viewport and the whole page scrolls sideways. min(…, 100%) lets the
   track collapse to the container instead. Same fix on .probs and .trust. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 16px; }
.card {
  border: 1px solid var(--border); border-radius: 10px; padding: 22px;
  background: var(--bg-elev);
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.card-head .ic { color: var(--accent); display: inline-flex; flex: 0 0 auto; }
.card h3 { flex: 1; min-width: 0; }
.card > p { color: var(--text-dim); font-size: 14.5px; margin-top: 4px; }

/* A capability list. The check marks are decorative (aria-hidden in the markup); the
   text carries the whole meaning. */
.card ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.card li { display: flex; gap: 9px; font-size: 14.5px; color: var(--text-dim); line-height: 1.5; }
.card li b { color: var(--text); font-weight: 600; }
.card li .tick { color: var(--green); flex: 0 0 auto; margin-top: 3px; }

/* ── problem ───────────────────────────────────────────────────────────────── */
/* Four again — 2×2, for the same reason as .cards, and the same min() guard. */
.probs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); gap: 16px; }
.prob {
  border: 1px solid var(--border); border-left: 3px solid var(--amber);
  border-radius: 10px; padding: 20px 22px; background: var(--bg-elev);
}
.prob h3 { margin-bottom: 6px; }
.prob p { color: var(--text-dim); font-size: 14.5px; }

/* ── trust ─────────────────────────────────────────────────────────────────── */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.trust-item {
  display: flex; gap: 14px;
  border: 1px solid var(--border); border-radius: 10px; padding: 20px; background: var(--bg-elev);
}
.trust-item .ic { color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.trust-item h3 { margin-bottom: 5px; }
.trust-item p { color: var(--text-dim); font-size: 14.5px; }

/* ── roadmap ───────────────────────────────────────────────────────────────── */
/* Everything in here is unbuilt, and the markup says so in words as well as colour —
   a colour-blind reader gets the same message, because each row is literally
   labelled "Planned". */
.road { display: grid; gap: 10px; }
.road-row {
  display: flex; align-items: flex-start; gap: 14px;
  border: 1px dashed var(--border-strong); border-radius: 10px;
  padding: 16px 18px; background: transparent;
}
.road-row .pill { flex: 0 0 auto; margin-top: 1px; }
.road-row div { min-width: 0; }
.road-row b { display: block; font-weight: 600; }
.road-row p { color: var(--text-dim); font-size: 14.5px; margin-top: 2px; }

/* ── FAQ ───────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: 10px; max-width: 78ch; }
.faq details {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev);
  overflow: hidden;
}
.faq summary {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; flex: 0 0 auto;
  color: var(--text-dim); font-family: var(--mono); font-size: 17px; font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { background: var(--hover); }
.faq .answer { padding: 0 20px 18px; color: var(--text-dim); font-size: 15px; }
.faq .answer p + p { margin-top: 10px; }

/* ── waitlist ──────────────────────────────────────────────────────────────── */
.cta { border-top: 1px solid var(--border); }
.cta-card {
  max-width: 640px; margin: 0 auto; text-align: center;
}
.cta-card h2 { margin-bottom: 14px; }
.cta-card > p { color: var(--text-dim); font-size: 17px; }

form.waitlist { margin-top: 32px; text-align: left; display: grid; gap: 14px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 13px; color: var(--text-dim); font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 15px;
  padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); opacity: 0.75; }
form.waitlist .btn { width: 100%; padding: 13px; font-size: 16px; }
.cta-fine { margin-top: 14px; font-size: 13.5px; color: var(--text-dim); text-align: center; }

/* THE NO-JAVASCRIPT PATH.
 *
 * The form is a real <form method="post">, so with JS off the browser posts it and the
 * server answers 303 — to /thanks.html on success, or back to this page with a
 * fragment (#waitlist-invalid, #waitlist-busy, #waitlist-failed) on failure. These
 * alerts are hidden until the fragment names them, at which point :target reveals the
 * right one. No script runs, and the visitor still sees the actual reason.
 *
 * With JS on, main.js intercepts the submit and writes into .js-alert instead, so
 * nobody navigates anywhere. Both paths, one form. */
.alert {
  display: none;
  padding: 12px 15px; border-radius: 8px; font-size: 14.5px; border: 1px solid;
}
.alert:target { display: block; }
.alert.bad { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 7%, transparent); }
.alert.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 32%, transparent); background: color-mix(in srgb, var(--green) 7%, transparent); }

/* The JS alert is driven by a hidden attribute, not :target. */
.js-alert[hidden] { display: none; }
.js-alert { display: block; }

/* ── thanks page ───────────────────────────────────────────────────────────── */
.thanks {
  min-height: 72vh; display: flex; align-items: center; justify-content: center;
  padding: 60px var(--gutter); text-align: center;
}
.thanks-card { max-width: 520px; }
.thanks-icon { color: var(--green); margin-bottom: 20px; display: flex; justify-content: center; }
.thanks h1 { font-size: clamp(26px, 4vw, 34px); }
.thanks p { color: var(--text-dim); margin-top: 16px; font-size: 16.5px; }
.thanks .btn { margin-top: 30px; }

/* ── footer ────────────────────────────────────────────────────────────────── */
footer.site { border-top: 1px solid var(--border); padding: 40px 0; background: var(--bg-soft); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.foot-inner p { color: var(--text-dim); font-size: 14px; }
.foot-links { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); font-size: 14px; }
.foot-links a:hover { color: var(--text); }

/* ── mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  :root { --gutter: 18px; }
  body { font-size: 15.5px; }
  section { padding: 60px 0; }
  .hero { padding: 56px 0 52px; }
  .lede, .hero .lede { font-size: 17px; }
  .hero-cta .btn { width: 100%; } /* thumb-sized targets, not 40%-width ones */
  .term pre { font-size: 12px; padding: 14px; }
  .cta-card > p { font-size: 16px; }
}
