@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #F4F5F2;
  --surface: #FFFFFF;
  --ink: #12171D;
  --muted: #3F4A54;
  --faint: #5A6570;
  --line: #DADDD6;
  --field: #C2C8BF;
  --accent: #1C6B4A;
  --on-accent: #FFFFFF;
  --error: #A12A1E;
  --focus: #3E9A70;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0F14;
    --surface: #131920;
    --ink: #E8EAED;
    --muted: #AEB6C2;
    --faint: #8F98A5;
    --line: #232B36;
    --field: #38424F;
    --accent: #4FC08D;
    --on-accent: #0B0F14;
    --error: #FF8A7A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* Hero */
.hero { container-type: inline-size; padding-block: clamp(40px, 6vw, 88px) clamp(40px, 5vw, 64px); display: flex; flex-direction: column; gap: 24px; }
.wordmark { display: flex; align-items: center; gap: 10px; margin: 0 0 clamp(8px, 2vw, 24px); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; flex: none; margin-top: calc((1.55em - 8px) / 2); margin-top: calc((1lh - 8px) / 2); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 80px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 700;
}
/* The hero headline is two lines sized to span the column, so neither wraps at default text spacing.
   14.95: the wider line ("So does Treasury Frameworks AI.") measures 14.42em; re-measure if the copy changes (README).
   Below the 34px floor (phones) the lines wrap, balanced, rather than shrink under the section headings. */
#headline { font-size: clamp(34px, 100cqi / 14.95, 128px); }
#headline span { display: block; text-wrap: balance; overflow-wrap: break-word; }
#headline .brand { color: var(--accent); }
.subline { margin: 0; font-size: clamp(18px, 1.9vw, 24px); color: var(--muted); }

/* Chat */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.chat { padding-block: 0 clamp(64px, 8vw, 112px); display: flex; flex-direction: column; gap: 18px; }
/* The rule separates signing up (hero) from talking to the assistant. */
.chat::before { content: ""; border-top: 1px solid var(--line); margin-bottom: clamp(6px, 1.5vw, 22px); }
.chat > h2 { margin: 0; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.1; letter-spacing: -0.03em; }
.chat-box { max-width: 880px; display: flex; flex-direction: column; gap: 16px; }
.chat-log { max-height: min(60vh, 440px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { margin: 0; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.msg.error { align-self: flex-start; color: var(--error); font-size: 15px; }
.msg.note { align-self: flex-start; color: var(--faint); font-size: 14px; }
.msg.pending::after { content: "…"; color: var(--faint); }
.chat-form { display: flex; flex-direction: column; gap: 10px; }
.chat-form .bar { grid-template-columns: minmax(0, 1fr) auto; }
.chat-form .cell { border-right: 0; }
.chat-form .cf-turnstile { margin-top: -10px; }
.chat-form .cf-turnstile.shown { margin-top: 0; }
.chat-note { margin: -6px 0 0; font-size: 13px; color: var(--faint); }

/* Input bar: the waitlist and the chat share it. Each cell keeps a visible label above its input. */
.bar {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  background: var(--surface); border: 1px solid var(--field); border-radius: 10px; overflow: hidden;
}
.cell { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 8px 16px; border-right: 1px solid var(--line); min-width: 0; }
/* The ring sits on the cell, so it is an outline (kept in forced-colors mode), inset to clear the bar's clipping. */
.cell:focus-within { outline: 2px solid var(--focus); outline-offset: -2px; }
.cell label { font-size: 12px; font-weight: 600; color: var(--muted); }
.cell input, .cell select, .cell textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: transparent;
  border: 0; padding: 0; width: 100%; outline: none;
}
.cell input::placeholder, .cell textarea::placeholder { color: var(--faint); }
.cell select { min-height: 26px; cursor: pointer; }
.cell textarea { resize: none; field-sizing: content; max-height: 8lh; }
/* Without field-sizing the textarea cannot grow, so start it at two lines. */
@supports not (field-sizing: content) { .cell textarea { min-height: 2lh; } }
.bar .btn { margin: 6px; white-space: nowrap; }
/* Four columns only once the role cell can show a whole option. */
@media (max-width: 899px) {
  .signup .bar { grid-template-columns: 1fr; }
  .signup .cell { border-right: 0; border-bottom: 1px solid var(--line); padding-block: 10px; }
  .signup .bar .btn { margin: 8px; }
}

/* Waitlist (in the hero) */
.signup { max-width: 880px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.more summary { cursor: pointer; font-size: 14px; color: var(--muted); width: fit-content; }
.more .opt { color: var(--faint); }
.more textarea {
  margin-top: 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--field); border-radius: 10px; padding: 10px 16px; width: 100%; resize: vertical;
}
.fine { margin: 0; max-width: 640px; font-size: 13px; color: var(--faint); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  font: inherit; font-weight: 600; background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 6px; padding: 11px 22px; min-height: 44px; cursor: pointer;
}
.btn[disabled] { opacity: 0.6; cursor: progress; }
/* Turnstile stays zero-height unless it needs a click; cancel the flex gap it would otherwise add. */
.signup .cf-turnstile { margin-top: -10px; }
.signup .cf-turnstile.shown { margin-top: 0; }
.status { margin: 0; font-size: 15px; }
.status:empty { display: none; }
.status.error { color: var(--error); }
.thanks { max-width: 880px; margin: 8px 0 0; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.thanks strong { display: block; font-size: 19px; margin-bottom: 4px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); }
.site-foot .wrap { padding-block: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 24px; }

/* Legal pages */
.legal { max-width: 720px; padding-block: clamp(40px, 6vw, 80px); }
.legal .back { font-size: 15px; color: var(--muted); }
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); margin-top: 24px; }
.legal .updated { font-family: var(--mono); font-size: 13px; color: var(--faint); margin: 12px 0 36px; }
.legal h2 { font-size: 21px; letter-spacing: -0.01em; margin: 36px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal ul { padding-left: 20px; }
