/* =============================================================================
   Vela — public marketing site
   Hand-crafted design system, built from docs/company/web_design_pov.md §16.
   Editorial-light chrome + the cockpit's own fonts/accent so the brand and the
   embedded dark demo read as one system. No Node, no Tailwind — one CSS file,
   zero runtime deps. Self-hosted WOFF2 (no CDN). Codename "Vela".
   ============================================================================= */

/* ---- Fonts (self-hosted; mirror the cockpit — Geist + JetBrains Mono, no Inter) */
@font-face { font-family:"Geist"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Geist"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../fonts/geist-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Geist"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../fonts/geist-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---- Tokens (web POV §16) --------------------------------------------------- */
:root {
  /* Editorial-light palette — premium near-white, ink that isn't pure black. */
  --bg:            #fcfcfd;
  --bg-subtle:     #f4f5f8;   /* alternating section wash */
  --surface:       #ffffff;
  --border:        #e7e8ee;
  --border-strong: #d7d9e2;
  --ink:           #161821;   /* primary text */
  --ink-secondary: #4b505d;
  --ink-tertiary:  #888e9c;

  /* Single accent — the cockpit's indigo (chip-thesis-active) so brand ↔ demo cohere. */
  --accent:        #5e6ad2;
  --accent-hover:  #4d58c0;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(94, 106, 210, 0.08);
  --accent-line:   rgba(94, 106, 210, 0.22);

  /* Signed-number state (used sparingly; most numbers live in the dark demo). */
  --num-pos:       #1a8f5e;
  --num-neg:       #d2564f;

  /* The dark cockpit surface (the embedded demo frame) — mirrors the cockpit. */
  --cockpit-bg:    #0b0d12;
  --cockpit-border:#222634;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Type scale — 1.25 modular, 16px base. */
  --fs-hero: clamp(2.5rem, 1.45rem + 4vw, 4rem);   /* big hero only */
  --fs-xxl:  3rem;     --lh-xxl: 1.07;
  --fs-xl:   2.375rem; --lh-xl:  1.12;
  --fs-lg:   1.875rem; --lh-lg:  1.18;
  --fs-md:   1.5rem;   --lh-md:  1.25;
  --fs-body: 1rem;     --lh-body:1.6;
  --fs-sm:   0.875rem; --lh-sm:  1.5;
  --fs-xs:   0.75rem;

  /* Spacing — 4px base scale. */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;

  --maxw: 1120px;        /* page container */
  --measure: 42rem;      /* prose reading column (~672px, ~66 chars) */
  --radius: 14px;
  --radius-sm: 8px;

  /* Motion. */
  --motion-fast: 120ms; --motion-normal: 220ms; --motion-slow: 360ms;
  --ease-standard: cubic-bezier(0.3, 0, 0.2, 1);
  --ease-enter:    cubic-bezier(0, 0, 0.38, 0.9);

  --shadow-sm: 0 1px 2px rgba(16,18,33,0.05), 0 1px 1px rgba(16,18,33,0.04);
  --shadow-md: 0 8px 30px rgba(16,18,33,0.08), 0 2px 8px rgba(16,18,33,0.05);
  --shadow-cockpit: 0 40px 80px -24px rgba(16, 18, 40, 0.45), 0 12px 32px -12px rgba(16,18,40,0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); }

/* ---- Layout ----------------------------------------------------------------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.section { padding-block: clamp(56px, 9vw, 112px); }
.section--subtle { background: var(--bg-subtle); border-block: 1px solid var(--border); }
.measure { max-width: var(--measure); }
.center { text-align: center; margin-inline: auto; }

/* ---- Typography ------------------------------------------------------------- */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.022em; color: var(--ink); }
h1 { font-size: var(--fs-hero); line-height: 1.04; }
h2 { font-size: clamp(1.75rem, 1.1rem + 2.4vw, var(--fs-xl)); line-height: var(--lh-xl); }
h3 { font-size: var(--fs-md); line-height: var(--lh-md); letter-spacing: -0.015em; }
p  { margin: 0; }

.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: var(--fs-xs);
  font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.25rem); line-height: 1.5; color: var(--ink-secondary); }
.muted { color: var(--ink-tertiary); }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { margin-bottom: var(--s4); }
.section-head .lead { max-width: 40rem; }
.center.section-head .lead { margin-inline: auto; }

/* tabular figures wherever numbers appear in body copy */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num-pos { color: var(--num-pos); } .num-neg { color: var(--num-neg); }

/* ---- Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 48px; padding-inline: var(--s6); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: 500;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-standard),
              border-color var(--motion-fast) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--ink-tertiary); }
.btn-lg { height: 52px; padding-inline: var(--s8); font-size: 1rem; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* ---- Nav -------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: 60px; display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: var(--s8); width: 100%; }
.brand { display: inline-flex; align-items: center; gap: var(--s3); font-weight: 600; letter-spacing: -0.01em; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), #4ea0e8); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15); }
.brand-codename { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-tertiary);
  border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; }
.nav-links { display: flex; gap: var(--s6); margin-left: auto; align-items: center; }
.nav-links a { font-size: var(--fs-sm); color: var(--ink-secondary); transition: color var(--motion-fast); }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ---- Hero ------------------------------------------------------------------- */
.hero { padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero .eyebrow { margin-bottom: var(--s5); }
.hero h1 { max-width: 16ch; margin-bottom: var(--s6); }
.hero .lead { max-width: 36rem; margin-bottom: var(--s8); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.hero-fineprint { margin-top: var(--s5); font-size: var(--fs-xs); color: var(--ink-tertiary); }

/* ---- The cockpit "device" frame (holds the embedded demo / its screenshot) -- */
.cockpit-frame {
  margin-top: clamp(40px, 6vw, 72px);
  border-radius: var(--radius); overflow: hidden;
  background: var(--cockpit-bg); border: 1px solid var(--cockpit-border);
  box-shadow: var(--shadow-cockpit);
}
.cockpit-chrome {
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px 14px; border-bottom: 1px solid var(--cockpit-border);
  background: #0e1118;
}
.cockpit-dot { width: 11px; height: 11px; border-radius: 999px; background: #2b303d; }
.cockpit-url { margin-left: var(--s3); font-family: var(--font-mono); font-size: var(--fs-xs); color: #5e6371; }
.cockpit-body { display: block; width: 100%; }
.cockpit-body img { width: 100%; display: block; }
.cockpit-iframe { width: 100%; min-height: 460px; border: 0; display: block; background: var(--cockpit-bg); }
.cockpit-cap { font-size: var(--fs-xs); color: var(--ink-tertiary); text-align: center; margin-top: var(--s4); }

/* Inline cockpit teaser — the graceful pre-generation state of the hero frame.
   Dark, cockpit-flavored, INTERFACE ONLY (provenance + structure, never returns).
   Replaced by an <iframe src="/demo/"> of the M5-wired demo once generated. */
.teaser { font-family: var(--font-mono); color: #e8e8ea; padding: 0; }
.teaser-strip { display: flex; align-items: center; gap: 20px; padding: 14px 18px;
  border-bottom: 1px solid var(--cockpit-border); background: #0e1118; }
.teaser-stat { display: flex; flex-direction: column; line-height: 1.25; }
.teaser-stat .k { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #5e6371; }
.teaser-stat .v { font-size: 14px; color: #e8e8ea; font-variant-numeric: tabular-nums; }
.teaser-chip { margin-left: auto; font-size: 11px; color: #16c47f; background: rgba(22,196,127,0.12);
  border-radius: 5px; padding: 3px 9px; }
.teaser-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.teaser-rows th { text-align: left; font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
  color: #5e6371; font-weight: 500; padding: 9px 18px; border-bottom: 1px solid var(--cockpit-border); }
.teaser-rows th.r, .teaser-rows td.r { text-align: right; }
.teaser-rows td { padding: 10px 18px; border-bottom: 1px solid #161a23; color: #c8ccd4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.teaser-rows tr:last-child td { border-bottom: 0; }
.teaser-sym { color: #e8e8ea; font-weight: 500; }
.teaser-dot { color: #16c47f; font-size: 9px; margin-right: 6px; }
.teaser-strat { color: #5e6ad2; background: rgba(94,106,210,0.14); border-radius: 4px; font-size: 10px; padding: 1px 5px; margin-left: 6px; }
.teaser-prov { color: #5e6371; font-size: 11px; }
.teaser-leg td { color: #888e9c; background: #0e1118; font-size: 12px; }
.teaser-leg .twig { color: #5e6371; margin-right: 6px; }
@media (max-width: 560px) { .teaser-rows .hide-sm { display: none; } .teaser-strip { gap: 14px; } }

/* ---- The gap (toy ↔ institution) -------------------------------------------- */
.tiers { display: grid; gap: var(--s4); grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }
.tier { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s6); box-shadow: var(--shadow-sm); }
.tier h3 { font-size: 1.0625rem; margin-bottom: var(--s2); }
.tier .tier-eg { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-tertiary);
  text-transform: none; letter-spacing: 0; margin-bottom: var(--s3); }
.tier p { font-size: var(--fs-sm); color: var(--ink-secondary); }
.tier--vela { border-color: var(--accent-line); background:
  linear-gradient(var(--surface), var(--surface)) padding-box,
  linear-gradient(135deg, var(--accent-line), transparent) border-box; }
.tier--vela h3 { color: var(--accent); }

/* ---- Moat / feature grid ---------------------------------------------------- */
.grid-3 { display: grid; gap: var(--s4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.feat { padding: var(--s6); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feat-k { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent);
  letter-spacing: 0.04em; margin-bottom: var(--s3); }
.feat h3 { font-size: 1.0625rem; margin-bottom: var(--s2); }
.feat p { font-size: var(--fs-sm); color: var(--ink-secondary); }

/* ---- Honesty: where we are vs where we're going ----------------------------- */
.status-grid { display: grid; gap: var(--s4); grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .status-grid { grid-template-columns: 1fr; } }
.status-card { padding: var(--s6); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.status-card .eyebrow { margin-bottom: var(--s4); }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.status-list li { display: flex; gap: var(--s3); font-size: var(--fs-sm); color: var(--ink-secondary); }
.status-list .tick { color: var(--num-pos); flex: none; font-family: var(--font-mono); }
.status-list .next { color: var(--accent); flex: none; font-family: var(--font-mono); }

/* ---- Trust band ------------------------------------------------------------- */
.trust { display: grid; gap: var(--s4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }
.trust-item h3 { font-size: 1rem; margin-bottom: var(--s2); }
.trust-item p { font-size: var(--fs-sm); color: var(--ink-secondary); }
.trust-item .trust-k { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-tertiary); margin-bottom: var(--s2); }

/* ---- Pricing thesis --------------------------------------------------------- */
.price-rail { display: flex; align-items: stretch; gap: var(--s4); flex-wrap: wrap; }
.price-card { flex: 1 1 220px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s6); background: var(--surface); }
.price-card--pro { border-color: var(--accent-line); }
.price-tier { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-tertiary); }
.price-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 500; margin-block: var(--s2); }
.price-num small { font-size: var(--fs-sm); color: var(--ink-tertiary); font-weight: 400; }
.price-card p { font-size: var(--fs-sm); color: var(--ink-secondary); }

/* ---- Waitlist --------------------------------------------------------------- */
.waitlist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px); box-shadow: var(--shadow-md); }
.wait-form { display: flex; flex-direction: column; gap: var(--s4); margin-top: var(--s8); }
.field label { display: block; font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--s2); }
.field input, .field textarea {
  width: 100%; font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 13px 14px; transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint { font-size: var(--fs-xs); color: var(--ink-tertiary); margin-top: var(--s2); }
.wait-form .btn { width: 100%; }
.wait-note { font-size: var(--fs-xs); color: var(--ink-tertiary); margin-top: var(--s4); text-align: center; }
.wait-ok { display: none; padding: var(--s6); border-radius: var(--radius-sm); background: var(--accent-soft);
  font-size: var(--fs-sm); color: var(--ink); }
.wait-ok.show { display: block; }

/* ---- Footer + disclaimer ---------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding-block: var(--s12); }
.footer-inner { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: center; justify-content: space-between; }
.footer .brand { color: var(--ink-secondary); }
.disclaimer { margin-top: var(--s6); font-size: var(--fs-xs); color: var(--ink-tertiary); max-width: 52rem; line-height: 1.6; }

/* ---- Reveal-on-scroll (sole motion; reduced-motion safe) -------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--motion-slow) var(--ease-enter),
  transform var(--motion-slow) var(--ease-enter); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
