/* SAMWISE marketing site — dark-first, Swiss-minimal, terminal aesthetic.
   Tokens per ui-ux-pro-max design system (Trust & Authority / Minimalism). */

:root {
  /* Neutrals: achromatic carbon, not slate. Darkness comes from lightness
     alone so the single chromatic element on screen has nowhere to hide. */
  --bg: #08090a;
  --surface: #0f1011;
  --surface-2: #161718;
  --border: #23252a;
  --border-2: #383b3f;

  /* Four text tiers, not two. */
  --text: #ffffff;
  --text-2: #d0d6e0;
  --text-muted: #8a8f98;
  --text-dim: #62666d;

  /* Accent is unchanged. What changed is how rarely it is spent:
     primary CTA, focus ring, live/positive data, brand tick. Nothing else. */
  --accent: #22c55e;
  --accent-strong: #4ade80;
  --accent-ink: #04150b;
  --warn: #f59e0b;
  --danger: #ef4444;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Weights: nothing above 590, ever. Presence comes from size and tracking. */
  --w-title: 510;
  --w-label: 510;
  --w-body: 400;

  /* Four radii, controls always tighter than surfaces. */
  --r-control: 6px;
  --r-surface: 12px;
  --r-badge: 4px;
  --r-pill: 9999px;

  /* Hairline instead of shadow: the ring sits inside the radius and stays crisp. */
  --ring: inset 0 0 0 1px var(--border);

  --space-05: 4px; --space-1: 8px; --space-15: 12px; --space-2: 16px;
  --space-3: 24px; --space-4: 48px; --space-5: 64px; --space-6: 96px;
  --maxw: 1120px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --border: #e4e4e2;
  --border-2: #cfcfcc;
  --text: #08090a;
  --text-2: #33363b;
  --text-muted: #6b6f76;
  --text-dim: #8f939a;
  /* Darker than the dark-theme green on purpose: white on #16a34a is only
     3.30:1, below the 4.5:1 AA floor for a 13-14px button label. #15803d
     gives 5.02:1 and lifts the focus ring and .pos text to 4.81:1 as well. */
  --accent: #15803d;
  --accent-strong: #166534;
  --accent-ink: #ffffff;
  color-scheme: light;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: var(--w-body);
  line-height: 1.5;
  letter-spacing: -0.011em;
  /* Inter's single-storey a, straight-tail l, slashed zero. */
  font-feature-settings: 'cv01' 1, 'ss03' 1, 'zero' 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--text); font-weight: var(--w-title); text-wrap: balance; }
strong, b { color: var(--text); font-weight: var(--w-label); }

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Available to assistive tech, absent from the visual design. Used for section
   headings that the layout does not show but the document outline needs. */
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; z-index: 1000; border-radius: 0 0 var(--r-control) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-3); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 52px;
}
.brand {
  font-weight: var(--w-label); letter-spacing: -0.01em; font-size: 15px;
  color: var(--text); display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { text-decoration: none; }
/* The brand mark, inline SVG so it needs no network request and inherits the
   theme. Same artwork as the favicon (data/scripts/build_brand_assets.py). */
.brand .tick {
  width: 18px; height: 18px; color: var(--accent);
  display: inline-block; flex-shrink: 0;
}
/* The glyph is knocked out of the accent tile in the page background colour, so
   it tracks the theme. Set here rather than as SVG fill="var(--bg)" attributes,
   which browsers do not reliably resolve. */
.brand .tick .knock { fill: var(--bg); }
.brand .tick .stem { fill: none; stroke: var(--bg); }
/* Uploaded lockup, one variant per theme. build_brand_assets.py writes both
   PNGs beside the HTML. .brand starts in .no-logo showing the inline tick above,
   and the images take over only once both have loaded, so an un-run build or a
   half-finished upload never leaves the header empty. */
.brand .logo { height: 20px; width: auto; display: block; flex-shrink: 0; }
.brand .logo-light { display: none; }
:root[data-theme="light"] .brand .logo-dark { display: none; }
:root[data-theme="light"] .brand .logo-light { display: block; }
.brand .brand-fallback { display: none; align-items: center; gap: 9px; }
.brand.no-logo .logo { display: none; }
.brand.no-logo .brand-fallback { display: inline-flex; }
.nav-links {
  display: flex; gap: var(--space-3); align-items: center;
  margin-left: auto;
}
.nav-links a {
  color: var(--text-muted); font-size: 13px; font-weight: var(--w-label);
  padding: 8px 2px;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); }
/* The nav CTA is a .btn living inside .nav-links, and `.nav-links a` (0,1,1)
   outranks `.btn-primary` and `.nav-cta` (0,1,0). Without these two rules the
   button inherits --text-muted on green (1.43:1) and `padding: 8px 2px`, so it
   renders as grey-on-green and squashed. Keep the `.nav-links` prefix. */
.nav-links a.nav-cta { color: var(--accent-ink); padding: 0 14px; }
.nav-links a.nav-cta:hover { color: var(--accent-ink); background: var(--accent-strong); }
.nav-cta {
  margin-left: var(--space-2);
  min-height: 30px; padding: 0 14px; font-size: 13px;
  /* Dead declaration, kept only so nobody re-adds it expecting a pill: `.btn`
     sets border-radius later in this file at the same specificity (0,1,0), so
     the button actually renders at --r-control (6px) like every other button.
     Move the rule below `.btn` if a pill is ever genuinely wanted. */
  border-radius: var(--r-pill);
}
.nav-toggle, .theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-2);
  border-radius: var(--r-control); cursor: pointer;
  min-width: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle { margin-left: var(--space-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute; top: 52px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: var(--space-2) var(--space-3) var(--space-3);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; min-height: 44px; display: flex; align-items: center; font-size: 15px; }
  /* Touch targets stay at 44px on small screens. */
  .nav-cta { margin: var(--space-2) 0 0; min-height: 44px; font-size: 15px; }
  .nav-links a.nav-cta { padding: 0 18px; }
  .nav-toggle, .theme-toggle { min-width: 44px; min-height: 44px; }
  .theme-toggle { margin-left: var(--space-2); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 36px; padding: 0 16px;
  border-radius: var(--r-control); font-weight: var(--w-label); font-size: 14px;
  letter-spacing: -0.006em;
  cursor: pointer; border: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-2); color: var(--text); }
.btn-lg { min-height: 40px; padding: 0 20px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding: var(--space-6) 0 var(--space-5); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5); align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

/* Eyebrow is a label, not code: sans, and neutral rather than accent. */
.eyebrow {
  font-size: 11px; font-weight: var(--w-label); letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--text-dim);
  margin: 0 0 var(--space-2);
}
h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.02; letter-spacing: -0.028em;
  margin: 0 0 var(--space-2); font-weight: var(--w-title);
}
.hero-sub {
  color: var(--text-muted); font-size: 18px; max-width: 54ch;
  line-height: 1.5; letter-spacing: -0.016em;
  margin: 0 0 var(--space-3);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.hero-note {
  margin-top: var(--space-2); font-size: 13px; color: var(--text-muted);
}

/* ---------- Terminal mock ---------- */
/* Separation by hairline, not shadow. The inset ring sits inside the radius
   so the edge stays crisp instead of smearing on a near-black canvas. */
.term {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-surface);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted); font-size: 12px;
}
.term-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.term-bar .dot.on { background: var(--accent); }
.term-body { padding: 14px 16px 18px; overflow-x: auto; }
.term table { border-collapse: collapse; width: 100%; min-width: 430px; }
.term th, .term td {
  text-align: left; padding: 7px 12px 7px 0;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.term th {
  color: var(--text-muted); font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
.term td { border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent); }
.pos { color: var(--accent-strong); }
.warn { color: var(--warn); }
/* Badges carry a fill, not a border. */
.tag {
  display: inline-block; padding: 1px 7px; border-radius: var(--r-badge);
  font-size: 11px; color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.tag-live { color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tag-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.term-caption {
  padding: 8px 16px 12px; color: var(--text-muted); font-size: 11.5px;
  font-family: var(--sans);
}
.term-tree { margin-top: 12px; color: var(--text-muted); line-height: 1.75; }
.term-tree b { color: var(--text); font-weight: var(--w-label); }

/* ---------- Proof bar ---------- */
.proof {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-3) 0;
}
.proof-items {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  justify-content: space-between; align-items: center;
}
.proof-item { display: flex; align-items: baseline; gap: 10px; }
.proof-item .num {
  font-family: var(--mono); font-size: 22px; font-weight: 500;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.proof-item .lbl { color: var(--text-muted); font-size: 13.5px; max-width: 24ch; }

/* ---------- Sections ---------- */
section { padding: var(--space-6) 0; }
.section-head { max-width: 640px; margin-bottom: var(--space-4); }
h2 {
  font-size: clamp(26px, 3.2vw, 36px); line-height: 1.1;
  letter-spacing: -0.024em; margin: 0 0 var(--space-2);
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 17px; }

/* Problem */
.problem { background: var(--surface); border-bottom: 1px solid var(--border); }
.problem-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3);
}
@media (max-width: 900px) { .problem-grid { grid-template-columns: 1fr; } }
.problem-card {
  border: 1px solid var(--border); border-radius: var(--r-surface);
  padding: var(--space-3); background: var(--bg);
}
.problem-card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -0.014em; }
.problem-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.problem-card .k {
  color: var(--text-dim); font-weight: var(--w-label);
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
  display: block; margin-bottom: 10px;
}

/* Pipeline / product show */
.stage {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-5); align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.stage:last-of-type { border-bottom: none; }
.stage:nth-of-type(even) .stage-copy { order: 2; }
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; gap: var(--space-3); }
  .stage:nth-of-type(even) .stage-copy { order: 0; }
}
/* The pipeline genuinely is a sequence, so the numbering stays. It just
   stops shouting: neutral, sans, label weight. */
.stage-num {
  color: var(--text-dim); font-size: 11px; font-weight: var(--w-label);
  text-transform: uppercase;
  letter-spacing: 0.13em; margin-bottom: 10px; display: block;
}
.stage h3 { font-size: 24px; margin: 0 0 10px; letter-spacing: -0.022em; }
.stage p { color: var(--text-muted); margin: 0 0 12px; }
.stage ul { color: var(--text-muted); margin: 0; padding-left: 18px; font-size: 14.5px; }
.stage li { margin-bottom: 6px; }

/* Personas */
.personas { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (max-width: 900px) { .persona-grid { grid-template-columns: 1fr; } }
.persona {
  border: 1px solid var(--border); border-radius: var(--r-surface);
  padding: var(--space-3); background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
}
.persona h3 { margin: 0; font-size: 18px; letter-spacing: -0.016em; }
.persona p { margin: 0; color: var(--text-muted); font-size: 14.5px; flex: 1; }
.persona .mini {
  font-size: 11px; color: var(--text-dim); font-weight: var(--w-label);
  letter-spacing: 0.13em; text-transform: uppercase;
}

/* Methodology */
.method-chain {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 14px;
  margin: var(--space-3) 0;
}
.method-chain .step {
  border: 1px solid var(--border); border-radius: var(--r-control);
  padding: 8px 14px; background: var(--surface);
}
.method-chain .arrow { color: var(--text-muted); }
.method-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 900px) { .method-cols { grid-template-columns: 1fr; } }
.method-cols p { color: var(--text-muted); font-size: 15px; margin-top: 0; }
.unverified-demo {
  font-family: var(--mono); font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--r-surface);
  background: var(--surface); padding: var(--space-2) var(--space-3);
  line-height: 1.9;
}
.unverified-demo .u { color: var(--warn); font-weight: var(--w-label); }
.unverified-demo .c { color: var(--text-muted); }

/* Sample */
.sample { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sample-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--space-5); align-items: center; }
@media (max-width: 980px) { .sample-grid { grid-template-columns: 1fr; } }
.doc-mock {
  border: 1px solid var(--border); border-radius: var(--r-surface);
  background: var(--bg); padding: var(--space-3);
  font-size: 13.5px; color: var(--text-muted); line-height: 1.8;
}
/* Filename heading is code-adjacent, so mono earns its place here. */
.doc-mock .doc-mock-title,
.doc-mock h4 {
  margin: 0 0 6px; color: var(--text); font-size: 15px;
  font-family: var(--mono); letter-spacing: 0;
  /* The title is a <p>, not a heading: the whole mock is role="img" and an
     h4 under an h2 broke the outline. Restate the weight the h1-h4 rule gave. */
  font-weight: var(--w-title);
}
.doc-mock hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.doc-mock .cite { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* Pricing */
.pricing-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: var(--space-3);
  justify-content: center;
}
@media (max-width: 900px) { .pricing-grid { grid-template-columns: 1fr; } }
.plan {
  border: 1px solid var(--border); border-radius: var(--r-surface);
  padding: var(--space-4); background: var(--surface);
  display: flex; flex-direction: column; gap: var(--space-2);
}
/* The flag is the highlight; the border does not need to shout as well. */
.plan.featured { border-color: var(--border-2); position: relative; }
.plan .flag {
  position: absolute; top: -12px; left: var(--space-4);
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: var(--w-label); padding: 2px 12px;
  border-radius: var(--r-pill); letter-spacing: 0.02em;
}
.plan h3 { margin: 0; font-size: 20px; letter-spacing: -0.018em; }
.plan .price {
  font-family: var(--mono); font-size: 38px; font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -0.028em;
}
.plan .price small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan ul { margin: 0; padding: 0; list-style: none; flex: 1; }
.plan li {
  padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  font-size: 14.5px; color: var(--text-muted);
  display: flex; gap: 10px; align-items: flex-start;
}
.plan li svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--text-dim); }
.plan .note { font-size: 12.5px; color: var(--text-muted); }

/* FAQ */
.faq details {
  border: 1px solid var(--border); border-radius: var(--r-surface);
  background: var(--surface); margin-bottom: var(--space-2);
}
.faq summary {
  cursor: pointer; padding: var(--space-2) var(--space-3);
  color: var(--text);
  font-weight: var(--w-label); font-size: 15.5px; min-height: 44px;
  letter-spacing: -0.014em;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); color: var(--text-muted); font-size: 18px;
}
.faq details[open] summary::after { content: "\2212"; }
.faq .faq-body { padding: 0 var(--space-3) var(--space-3); color: var(--text-muted); font-size: 14.5px; }

/* Final CTA + form */
.final { text-align: center; }
.final .section-head { margin-left: auto; margin-right: auto; }
.access-form {
  max-width: 520px; margin: var(--space-3) auto 0;
  display: flex; flex-direction: column; gap: var(--space-2); text-align: left;
}
.access-form label { font-size: 14px; font-weight: var(--w-label); color: var(--text); }
/* Inputs recede into the surface rather than sitting on top of it. */
.access-form input, .access-form select {
  width: 100%; min-height: 44px; padding: 0 14px;
  background: color-mix(in srgb, var(--text) 2%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: var(--r-control); color: var(--text); font-size: 15px;
  font-family: var(--sans);
}
.access-form input::placeholder { color: var(--text-dim); }
.access-form input:focus, .access-form select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
/* Honeypot: off-screen rather than display:none, because some bots skip
   fields that are not rendered at all. Never focusable by a real user. */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden;
}
.form-msg { font-size: 14px; min-height: 20px; margin: 0; }
.form-msg.ok { color: var(--accent-strong); }
.form-msg.err { color: var(--danger); }
.field-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* Footer */
footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: var(--space-5) 0 var(--space-4);
  font-size: 14px; color: var(--text-muted);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-4); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
footer h3,
footer h4 { color: var(--text-2); font-size: 11px; font-weight: var(--w-label); text-transform: uppercase; letter-spacing: 0.13em; margin: 0 0 12px; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 8px; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }
.disclaimer {
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px solid var(--border); font-size: 12.5px; line-height: 1.7;
}

/* Reveal animation (JS adds .in; disabled under reduced motion) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 350ms ease-out, transform 350ms ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
