/* ─────────────────────────────────────────────────────────────────
   Ruleschat — site design system (Drafting Table)

   Tokens, components, and the four redesigned pages (Home, Login,
   Demo, Evals). Cool light paper, blued-steel #2E5C7E as the single
   brand accent (citations, links, primary buttons). The brick
   #A4453B is reserved for the eval-fail status signal only — never
   for emphasis, links, or decoration. One grotesque (Archivo) does
   display + body; mono (Spline Sans Mono) is reserved strictly for
   rule citations & technical labels. No italics anywhere.
   ───────────────────────────────────────────────────────────────── */

:root {
  /* ── Drafting Table palette ── */
  --paper:   #EEF1EF;   /* page background, cool light paper */
  --paper-2: #E2E7E5;   /* recessed surfaces */
  --paper-3: #D6DCDB;   /* hover state */
  --ink:     #1E2A33;   /* primary text */
  --ink-2:   #3D4B56;   /* body prose */
  --muted:   #6A757D;   /* labels, captions */
  --muted-2: #8A949B;
  --hair:    #CFD6D5;   /* hairline borders */
  --hair-2:  #DEE3E2;   /* offset card shadow */

  /* ── Brand accent: blued-steel ── */
  --accent:      #2E5C7E;
  --accent-soft: #6E93AC;

  /* ── Functional status (not for decoration) ── */
  --field:  #4D6A52;   /* connected / expected-answer label */
  --brass:  #A98433;   /* review status */
  --pass:   #3F6B54;   /* eval pass */
  --review: #A98433;   /* eval needs-review */
  --fail:   #A4453B;   /* eval fail — ONLY red allowed */

  --highlight: #FBF6E6;

  /* ── Type ── */
  --display: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --serif: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --sans:  "Archivo", ui-sans-serif, system-ui, sans-serif;
  --mono:  "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ── Container ── */
  --w-content: 1180px;
  --w-text:    820px;
}

/* ─────────── BASE ─────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

/* No italics anywhere — <em> is neutralised; emphasis comes from
   size/weight hierarchy, not italic or an accent-colored punchword. */
em { font-style: normal; color: inherit; }
a.inline-link {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  transition: border-color .15s ease, color .15s ease;
}
a.inline-link:hover { border-bottom-color: var(--accent); }

::selection {
  background: color-mix(in oklch, var(--accent) 25%, var(--paper));
}

.site { min-height: 100vh; display: flex; flex-direction: column; }

/* ─────────── CONTAINER ─────────── */
.wrap {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  position: relative;
}
.wrap-narrow {
  max-width: var(--w-text);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  position: relative;
}

/* ─────────── NAV ─────────── */
.nav {
  border-bottom: 1px solid var(--hair);
  background: color-mix(in oklch, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand-name em {
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}

.nav-links {
  display: flex; align-items: center; gap: 24px;
  font-size: 14px;
  white-space: nowrap;
}
.nav-links a:not(.nav-cta) {
  color: var(--ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-links a:not(.nav-cta):hover { color: var(--ink); }
.nav-links a:not(.nav-cta).active { color: var(--ink); border-bottom-color: var(--accent); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 13px; font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-cta.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.nav-cta .arrow { font-family: var(--mono); transition: transform .15s ease; }
.nav-cta:hover .arrow { transform: translateX(2px); }

/* ─────────── EYEBROW ─────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  white-space: nowrap;
  flex-wrap: wrap;
}
.eyebrow .dot {
  width: 18px; height: 2px;
  background: var(--accent);
  border-radius: 0;
}
.eyebrow .num {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* ─────────── SECTION CHROME ─────────── */
.section {
  padding: 88px 0;
  border-bottom: 1px solid var(--hair);
}
.section.no-border { border-bottom: 0; }
.section.tight { padding: 56px 0; }
.section.alt { background: var(--paper-2); }

/* ─────────── BUTTONS ─────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  letter-spacing: .01em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 84%, black); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-block { display: flex; justify-content: center; width: 100%; }
.btn .arrow { font-family: var(--mono); }

/* ─────────── CITATION CHIP ─────────── */
.cite {
  display: inline-flex; align-items: center;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, var(--paper));
  border: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  border-radius: 2px;
  cursor: pointer;
  margin: 0 1px;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.cite:hover { background: var(--accent); color: var(--paper); }

/* ─────────── FORM FIELDS ─────────── */
.field { display: block; margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.input {
  display: block; width: 100%;
  padding: 11px 14px;
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  border: 1px solid var(--hair);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ink) 12%, transparent);
}

/* ─────────── CARD PANEL ─────────── */
.card-panel {
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 28px 28px 26px;
  box-shadow: 0 1px 0 var(--hair), 14px 14px 0 -1px var(--hair-2);
}

/* ═════════════════════════════════════════════════════════════
   HOME
   ═════════════════════════════════════════════════════════════ */

.hero {
  padding: 96px 0 88px;
  border-bottom: 1px solid var(--hair);
  position: relative;
}
.hex-deco {
  position: absolute;
  right: -40px; top: 40px;
  width: 220px; height: 220px;
  opacity: .07;
  pointer-events: none;
  color: var(--ink);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 72px;
  align-items: start;
}
.hero-head {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 14px 0 28px;
  text-wrap: balance;
}
.hero-head em { font-style: normal; font-weight: inherit; }
.hero-lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 580px;
  margin-bottom: 32px;
  text-wrap: pretty;
}
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

/* Hero specimen (sample Q&A) */
.specimen {
  position: relative;
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  border: 1px solid var(--hair);
  border-radius: 4px;
  box-shadow: none;
  padding: 24px 24px 22px;
  font-size: 14px;
}
.specimen::before {
  content: "EXAMPLE ANSWER";
  position: absolute;
  top: -10px; left: 18px;
  background: var(--paper);
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--accent);
}
.spec-q {
  display: flex; gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--hair);
}
.spec-q .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: .08em;
}
.spec-q .text {
  color: var(--ink);
  line-height: 1.5;
  font-style: normal;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
}
.spec-a { display: flex; gap: 12px; padding-top: 16px; }
.spec-a .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  letter-spacing: .08em;
}
.spec-a .text { color: var(--ink-2); line-height: 1.55; font-size: 14px; }
.spec-a .text strong { color: var(--ink); }

/* Domain section */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.col-head {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  color: var(--ink);
  text-wrap: balance;
}
.col-head em { font-style: normal; }
.prose p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 16px;
  text-wrap: pretty;
}

.board-figure {
  position: relative;
  border: 1px solid var(--hair);
  background: var(--paper-2);
  border-radius: 2px;
  overflow: hidden;
}
.board-figure img {
  display: block; width: 100%; height: auto;
  filter: saturate(.85) contrast(1.02);
}
.board-caption {
  position: absolute;
  left: 14px; bottom: 14px;
  padding: 6px 10px;
  background: var(--paper);
  border: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-2);
}

/* Pipeline section */
.pipeline-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: end;
  margin-bottom: 56px;
}
.pipeline-head .col-head { margin-bottom: 0; }
.pipeline { position: relative; padding: 8px 0 0; }
.pipe-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
.pipe-flow::before {
  content: "";
  position: absolute;
  top: 50px; left: 88px; right: 0;
  height: 1px;
  background: repeating-linear-gradient(to right, var(--hair) 0 4px, transparent 4px 8px);
  z-index: 0;
}
.pipe-node {
  position: relative;
  padding: 0 18px 8px;
  border-left: 1px solid var(--hair);
}
.pipe-node:first-child { border-left: 0; padding-left: 0; }
.pipe-node:last-child { padding-right: 0; }
.pipe-node .hex-wrap {
  position: relative;
  width: 88px; height: 100px;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.pipe-node .hex-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pipe-node .hex-wrap .num {
  position: relative;
  font-family: var(--display);
  font-style: normal;
  font-weight: 700;
  font-size: 26px;
  color: var(--ink);
  z-index: 1;
}
.pipe-node .step-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.pipe-node h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
}
.pipe-node h3 em { font-style: normal; }
.pipe-node p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.pipe-node .tech {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pipe-node .tech span {
  padding: 1px 6px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 2px;
}

/* Agent loop section (home) */
.agent-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: start;
}
.agent-prose p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.agent-tools {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 18px;
}
.agent-tools span {
  padding: 2px 8px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 2px;
}
.trace-card {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--hair-2);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  overflow-x: auto;
}
.trace-card figcaption {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.trace-q { color: var(--ink-2); margin-bottom: 8px; }
.trace-line { white-space: nowrap; }
.trace-line .t-call { color: var(--accent); font-weight: 500; }
.trace-line .t-calc { color: var(--field); font-weight: 500; }
.trace-line .t-args { color: var(--ink-2); }
.trace-line .t-note { color: var(--muted); }
.trace-line .t-note::before { content: "· "; }
.trace-a {
  border-top: 1px solid var(--hair);
  margin-top: 10px;
  padding-top: 10px;
  color: var(--ink);
}
.trace-a .t-verdict {
  color: var(--pass);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.agent-after {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex; gap: 12px; flex-wrap: wrap;
  letter-spacing: .02em;
}
.agent-after .aa-arrow { color: var(--accent-soft); }
@media (max-width: 900px) {
  .agent-grid { grid-template-columns: 1fr; gap: 28px; }
  .trace-card { font-size: 11.5px; }
}

/* ═════════════════════════════════════════════════════════════
   LOGIN
   ═════════════════════════════════════════════════════════════ */

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 56px 0 80px;
}
.auth-col {
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}
.auth-col h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.auth-col h1 em { font-style: normal; }
.auth-col .lede {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 28px;
  text-wrap: pretty;
}
.auth-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 3px solid var(--fail);
  background: color-mix(in oklch, var(--fail) 8%, var(--paper));
  color: var(--ink);
  font-size: 14px;
}
.forgot-row {
  display: flex; justify-content: flex-end;
  margin: -10px 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.forgot-row a {
  color: var(--muted);
  border-bottom: 1px solid color-mix(in oklch, var(--muted) 40%, transparent);
  transition: color .15s ease, border-color .15s ease;
}
.forgot-row a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.or-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  margin: 24px 0;
}
.or-divider::before, .or-divider::after {
  content: ""; height: 1px; background: var(--hair);
}
.or-divider span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
}
.auth-footnote {
  margin-top: 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.auth-footnote a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
  font-style: normal;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
}
.auth-footnote a:hover { border-bottom-color: var(--accent); }

/* ═════════════════════════════════════════════════════════════
   DEMO  (chat surface)
   ═════════════════════════════════════════════════════════════ */

/* Demo banner — ink strip with counter */
.demo-banner {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 0;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
}
.demo-banner .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.demo-banner .left { display: flex; align-items: center; gap: 10px; }
.demo-banner .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
}
.demo-banner .counter b {
  color: #E5C078;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.demo-banner .login-cta {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--paper); opacity: .75;
  border-bottom: 1px solid rgba(255,255,255,.3);
  padding-bottom: 2px;
  transition: opacity .15s ease, border-color .15s ease;
}
.demo-banner .login-cta:hover { opacity: 1; border-bottom-color: var(--accent-soft); }

/* Experimental notice */
.exp-notice {
  background: var(--paper-2);
  border-bottom: 1px solid var(--hair);
  padding: 8px 0;
  position: relative;
}
.exp-notice .wrap {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.exp-notice .label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.exp-notice .see-link {
  color: var(--ink);
  border-bottom: 1px solid var(--ink-2);
  font-size: 13px;
  transition: border-color .15s ease, color .15s ease;
  cursor: pointer;
}
.exp-notice .see-link:hover { border-bottom-color: var(--accent); color: var(--accent); }
.exp-notice .dismiss {
  margin-left: auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px; line-height: 1;
  padding: 4px 8px;
}
.exp-notice .dismiss:hover { color: var(--ink); }

/* Demo main + chat surface */
.demo-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.chat-toolbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
}
.chat-toolbar h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.chat-toolbar h4 em { font-style: normal; }
.model-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
}
.model-pill:hover { border-color: var(--ink-2); }

/* Scroll + welcome */
.chat-scroll { flex: 1; overflow-y: auto; padding: 32px 0 24px; }
.chat-scroll .wrap { max-width: 820px; }

.welcome { padding: 32px 0; text-align: left; }
.welcome .h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.welcome .h2 em { font-style: normal; }
.welcome .desc {
  color: var(--ink-2);
  font-size: 16px;
  margin: 0 0 28px;
  max-width: 580px;
  line-height: 1.6;
}
.welcome .prompt-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.welcome .prompt {
  text-align: left;
  border: 1px solid var(--hair);
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  padding: 14px 16px;
  border-radius: 2px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color .15s ease, background .15s ease;
}
.welcome .prompt:hover { border-color: var(--ink-2); background: var(--paper); }
.welcome .prompt-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.welcome .prompt-q {
  font-family: var(--sans);
  font-style: normal;
  font-size: 15.5px;
  color: var(--ink);
  line-height: 1.4;
}

/* Messages */
.msg { margin-bottom: 26px; }
.msg-meta {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.msg.user .msg-meta { justify-content: flex-end; }
.msg.user .msg-bubble {
  max-width: 78%;
  margin-left: auto;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.55;
}
.msg.assistant .msg-meta { color: var(--accent); }
.msg.assistant .msg-content {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.msg.assistant .msg-content p { margin: 0 0 12px; }
.msg.assistant .msg-content strong { color: var(--ink); font-weight: 600; }
.msg.assistant .msg-content ul,
.msg.assistant .msg-content ol { margin: 0 0 14px 18px; padding: 0; }
.msg.assistant .msg-content li { margin-bottom: 6px; }

.latency-row {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.latency-row .ll-num { color: var(--ink); font-weight: 600; }

/* Input dock */
.input-dock {
  border-top: 1px solid var(--hair);
  background: var(--paper);
  padding: 16px 0 20px;
}
.input-dock .wrap { max-width: 820px; }
.input-frame {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ink-2);
  border-radius: 2px;
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-frame:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 12%, transparent);
}
.input-frame textarea {
  flex: 1; border: 0; outline: 0; background: transparent;
  resize: none;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 0;
  line-height: 1.55;
  max-height: 200px;
}
.send-btn {
  border: 0;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 9px 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: background .15s ease;
}
.send-btn:hover { background: color-mix(in oklch, var(--accent) 84%, black); }

.helper-strip {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
  flex-wrap: wrap;
}
.helper-strip .surprise {
  border: 1px solid var(--hair);
  background: color-mix(in oklch, var(--paper) 50%, white 50%);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .15s ease;
}
.helper-strip .surprise:hover { border-color: var(--ink-2); }
.helper-strip .status {
  margin-left: auto;
  color: var(--field);
  display: flex; align-items: center; gap: 6px;
}
.helper-strip .status .pip {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--field);
}
#connection-status.disconnected { color: var(--fail); }
#connection-status.disconnected .pip { background: var(--fail); }

/* Searching bubble (between user msg and stream) */
.searching-bubble {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
  display: flex; align-items: baseline; gap: 8px;
}
.searching-bubble .searching-dots {
  display: inline-flex; gap: 3px;
}
.searching-bubble .searching-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: dot-pulse 1.2s infinite ease-in-out;
}
.searching-bubble .searching-dots span:nth-child(2) { animation-delay: .2s; }
.searching-bubble .searching-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: .25; }
  40% { opacity: 1; }
}

/* Rate-limit callout */
.rate-limit-message {
  margin: 12px 0 26px;
  padding: 14px 18px;
  border-left: 3px solid var(--brass);
  background: color-mix(in oklch, var(--brass) 10%, var(--paper));
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.rate-limit-message a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 35%, transparent);
}
.rate-limit-message a:hover { border-bottom-color: var(--accent); }

/* Image preview tray (between toolbar and input dock) */
.image-preview {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 12px;
  margin: 0;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.image-preview .image-preview-label { margin-left: auto; }
.image-preview-item { position: relative; display: inline-block; }
.image-preview-item img {
  max-height: 48px; max-width: 64px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--hair);
  display: block;
}
.image-preview-item .image-preview-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 50%;
  font-size: 13px; line-height: 13px;
  color: var(--ink-2);
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
}
.image-preview-item .image-preview-remove:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}
.msg.user .msg-bubble .message-image {
  display: inline-block;
  max-width: 280px; max-height: 200px;
  margin: 8px 6px 0 0;
  border-radius: 2px;
  border: 1px solid var(--hair);
  cursor: zoom-in;
  vertical-align: top;
}

/* PDF Viewer Modal — paper chrome */
.pdf-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.pdf-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 12, 8, .62);
  cursor: pointer;
}
.pdf-modal-content {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  max-width: 1200px;
  width: 100%;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  overflow: hidden;
}
.pdf-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--hair);
}
.pdf-modal-header .kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
  font-weight: 600;
}
.pdf-modal-header h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.pdf-modal-header h3 em { font-style: normal; }
.pdf-modal-close {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--ink-2);
  font-size: 18px; line-height: 1;
  cursor: pointer; border-radius: 2px;
  display: grid; place-items: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pdf-modal-close:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pdf-modal-body {
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--paper);
}
.pdf-controls {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hair);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: .04em;
}
.pdf-controls button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pdf-controls button:hover:not(:disabled) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pdf-controls button:disabled { opacity: .4; cursor: not-allowed; }
.pdf-container {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: var(--paper-2);
  display: flex; justify-content: center;
}
.pdf-container canvas { box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.pdf-loading {
  padding: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* Image lightbox */
.image-lightbox {
  position: fixed; inset: 0;
  background: rgba(15, 12, 8, .85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1001;
  padding: 32px;
}
.image-lightbox img {
  max-width: 95%; max-height: 90vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.image-lightbox .lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .3);
  color: var(--paper);
  font-size: 22px;
  line-height: 1; cursor: pointer;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 2px;
  transition: background .15s ease, border-color .15s ease;
}
.image-lightbox .lightbox-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ═════════════════════════════════════════════════════════════
   EVALS
   ═════════════════════════════════════════════════════════════ */

.evals-masthead {
  padding: 64px 0 48px;
  border-bottom: 2px solid var(--ink);
}
.mast-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: end;
}
.evals-masthead h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: balance;
}
.evals-masthead h1 em { font-style: normal; }
.evals-masthead .lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 620px;
  margin: 0;
  text-wrap: pretty;
}

/* Editorial column: 220px rail | 1fr body */
.ev-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: baseline;
}
.ev-label .eyebrow { margin-bottom: 0; }
.ev-label .ev-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.ev-body .h-section {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: balance;
}
.ev-body .h-section em { font-style: normal; }
.ev-body .table-caption {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 22px;
  letter-spacing: .02em;
}
.ev-body .table-footnote {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
  line-height: 1.6;
}
.ev-body .table-footnote sup { color: var(--accent); }

/* Findings */
.findings { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.findings li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--hair);
}
.findings li:first-child { border-top: 1px solid var(--ink); }
.findings li:last-child { border-bottom: 1px solid var(--hair); }
.findings .num {
  font-family: var(--serif);
  font-style: normal;
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}
.findings .fnd-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--ink);
}
.findings .fnd-body {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* Comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-family: var(--sans);
}
.compare-table thead tr { border-bottom: 1px solid var(--ink); }
.compare-table th {
  padding: 14px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--paper-2);
  text-align: center;
}
.compare-table th.col-model { text-align: left; padding: 14px 16px; }
.compare-table th.col-action { text-align: right; padding: 14px 16px; }
.compare-table tbody tr { border-top: 1px solid var(--hair); }
.compare-table td {
  padding: 14px 12px;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: center;
  vertical-align: top;
}
.compare-table td.col-model {
  text-align: left;
  padding: 14px 16px;
  color: var(--ink);
  vertical-align: top;
}
.compare-table td.col-model .frontier {
  font-family: var(--serif);
  font-style: normal;
  font-size: 10.5px;
  color: var(--accent);
  margin-top: 2px;
  font-weight: 500;
}
.compare-table td.col-model .model-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: .04em;
}
.compare-table td.col-action { text-align: right; padding: 14px 16px; }
.compare-table td.acc { font-weight: 600; }
.compare-table td.cell-good {
  color: var(--pass);
  background: color-mix(in oklch, var(--pass) 16%, var(--paper));
}
.compare-table td.cell-mid {
  color: var(--review);
  background: color-mix(in oklch, var(--review) 16%, var(--paper));
}
.compare-table td.cell-bad {
  color: var(--fail);
  background: color-mix(in oklch, var(--fail) 16%, var(--paper));
}
.compare-table td.col-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.compare-table .view-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease;
}
.compare-table .view-link:hover { background: var(--ink); color: var(--paper); }

/* Badges for sample queries + eval detail */
.ev-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.ev-badge.pass   { color: var(--pass);   background: color-mix(in oklch, var(--pass) 10%, var(--paper)); }
.ev-badge.review { color: var(--review); background: color-mix(in oklch, var(--review) 10%, var(--paper)); }
.ev-badge.fail   { color: var(--fail);   background: color-mix(in oklch, var(--fail) 10%, var(--paper)); }
.qtype-badge {
  display: inline-flex; align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--paper-2);
  color: var(--ink-2);
  border: 1px solid var(--hair);
  border-radius: 2px;
}

/* Sample queries */
.sample-item {
  padding: 20px 0;
  border-top: 1px solid var(--hair);
}
.sample-item:first-of-type { border-top: 1px solid var(--ink); }
.sample-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sample-conf {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.sample-conf b { color: var(--ink); font-weight: 600; }
.sample-q {
  font-family: var(--serif);
  font-style: normal;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.4;
}
.sample-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.col-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}
.col-label.expected { color: var(--field); }
.col-label.got { color: var(--accent); }
.col-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ═════════════════════════════════════════════════════════════
   FOOTER (shared)
   ═════════════════════════════════════════════════════════════ */

footer.site-footer {
  padding: 56px 0 80px;
  border-top: 1px solid var(--hair);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 360px;
}
.footer-col h5 {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-col a {
  font-size: 14px;
  color: var(--ink-2);
  transition: color .15s ease;
}
.footer-col a:hover { color: var(--accent); }
.legal {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  letter-spacing: .02em;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 32px;
}
.legal a {
  color: var(--muted);
  border-bottom: 1px solid color-mix(in oklch, var(--muted) 40%, transparent);
}
.legal a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.legal .right { text-align: right; }

/* Centered footer (used by Login / Demo / Evals — single legal strip) */
.site-footer .legal-center {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  letter-spacing: .02em;
  text-align: center;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ═════════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════════ */

@media (max-width: 880px) {
  .hero-grid,
  .two-col,
  .pipeline-head,
  .footer-grid { grid-template-columns: 1fr; gap: 56px; }
  .pipe-flow { grid-template-columns: repeat(2, 1fr); gap: 32px 0; }
  .pipe-flow::before { display: none; }
  .pipe-node { border-left: 0; padding-left: 0; }
  .ev-grid { grid-template-columns: 1fr; gap: 24px; }
  .sample-cols { grid-template-columns: 1fr; }
  .mast-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 620px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
  .section { padding: 56px 0; }
  .hero { padding: 56px 0 48px; }
  .hex-deco { display: none; }
  .hero-head { font-size: clamp(34px, 9vw, 48px); }
  .nav-links a:not(.nav-cta) { display: none; }
  .nav-cta { padding: 7px 12px; font-size: 12px; }
  .pipe-flow { grid-template-columns: 1fr; gap: 24px; }
  .auth-col { padding: 0 20px; }
  .card-panel { padding: 22px; box-shadow: 0 1px 0 var(--hair), 8px 8px 0 -1px var(--hair-2); }
  .chat-toolbar h4 { font-size: 16px; }
  .msg.user .msg-bubble { max-width: 92%; }
  .latency-row { gap: 12px; }
  .welcome .prompt-list { grid-template-columns: 1fr; }
  .compare-table th, .compare-table td { padding: 10px 6px; font-size: 11px; }
  .pdf-modal { padding: 12px; }
}
