/* Veritan AI — tokens */
:root {
  --ground: #FFFFFF;
  --paper: #FFFFFF;
  --well: #F1F4FA;
  --ink: #14213D;
  --ink-soft: #46516B;
  --indigo: #1F3A93;
  --indigo-deep: #172C70;
  --tint: #DCE3F3;
  --line: #C9D1E0;
  --madder: #B3282D;
  --green: #1E7B4F;
  --amber: #9A6300;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --max: 1200px;
  --radius: 6px;
}

* { 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(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.5rem); font-weight: 700; letter-spacing: -0.025em; font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--madder); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { max-width: var(--max); margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 24px; height: 24px; border-radius: 5px; background: var(--indigo) url("/static/favicon.svg") center / 100% no-repeat; }
.top nav { display: flex; gap: 26px; flex-wrap: wrap; }
.top nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--ink); }

main { max-width: var(--max); margin: 0 auto; padding: 0 24px 80px; }
section { padding: 72px 0 0; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; padding-top: 36px; }
.lede { margin: 18px 0 28px; font-size: 1.08rem; max-width: 34em; color: var(--ink-soft); }

.composer { display: grid; gap: 14px; }
.agent-picker { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.agent-picker legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
.agent-pill { position: relative; }
.agent-pill input { position: absolute; opacity: 0; inset: 0; }
.agent-pill span { display: inline-block; padding: 7px 13px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--well); font-size: 0.95rem; cursor: pointer; }
.agent-pill input:checked + span { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.agent-pill input:focus-visible + span { outline: 3px solid var(--madder); outline-offset: 2px; }
.task-label { font-weight: 600; margin-top: 8px; }
textarea, input { font: inherit; color: var(--ink); background: #FFFFFF; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; width: 100%; resize: vertical; }
textarea:focus, input:focus { border-color: var(--indigo); outline: none; box-shadow: 0 0 0 3px var(--tint); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button { font: inherit; font-size: 0.86rem; color: var(--indigo); background: var(--tint); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; text-align: left; max-width: 100%; }
.examples button:hover { background: #cfd9f0; }
.composer-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.help { color: var(--ink-soft); font-size: 0.9rem; max-width: 30em; }

button.primary, button.ghost { font: inherit; font-weight: 600; border-radius: var(--radius); padding: 12px 20px; cursor: pointer; border: 1.5px solid transparent; }
button.primary { background: var(--indigo); color: #fff; }
button.primary:hover { background: var(--indigo-deep); }
button.primary:disabled { background: var(--line); color: var(--ink-soft); cursor: default; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.ghost:hover { border-color: var(--ink); }

/* Console — the one bold element */
.console { background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(20,33,61,.05), 0 24px 48px -32px rgba(20,33,61,.35); min-height: 560px; display: flex; flex-direction: column; position: sticky; top: 20px; }
.console-band {
  height: 14px;
  background:
    repeating-linear-gradient(135deg, var(--indigo) 0 10px, var(--indigo-deep) 10px 14px, var(--tint) 14px 18px, var(--indigo-deep) 18px 22px);
}
.console-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.console-head h2 { font-size: 1.25rem; }
.console-meta { color: var(--ink-soft); font-size: 0.9rem; text-align: right; }
.console-body { padding: 22px; display: grid; gap: 22px; align-content: start; flex: 1; }
.empty { color: var(--ink-soft); display: grid; gap: 10px; max-width: 34em; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding: 12px 0; position: relative; }
.step::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.step:first-child::before { top: 18px; }
.step:last-child::before { bottom: auto; height: 18px; }
.pip { width: 22px; height: 22px; border-radius: 4px; background: var(--paper); border: 2px solid var(--line); position: relative; z-index: 1; margin-top: 2px; }
.step[data-status="running"] .pip { border-color: var(--madder); background: var(--madder); animation: pulse 1.1s ease-in-out infinite; }
.step[data-status="done"] .pip { border-color: var(--indigo); background: var(--indigo); }
.step[data-status="done"] .pip::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.step[data-status="awaiting_approval"] .pip { border-color: var(--amber); background: #fff; }
.step[data-status="skipped"] .pip { border-style: dashed; }
.step[data-status="failed"] .pip { border-color: var(--madder); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.8); } }
.step-title { font-weight: 600; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.step-title .tool { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; white-space: nowrap; }
.step-why { color: var(--ink-soft); font-size: 0.93rem; margin-top: 2px; }
.step-args { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.step-args li { font-size: 0.8rem; background: var(--tint); color: var(--indigo-deep); border-radius: 999px; padding: 2px 9px; }
.step-args li span { color: var(--ink-soft); }
.step-out { margin-top: 8px; padding: 10px 12px; background: var(--well); border-radius: var(--radius); font-size: 0.95rem; }
.step-out .ms { color: var(--ink-soft); font-size: 0.82rem; margin-left: 8px; font-variant-numeric: tabular-nums; }
.step[data-status="skipped"] .step-out { color: var(--ink-soft); font-style: italic; }
.step[data-status="failed"] .step-out { border-left: 3px solid var(--madder); }

.approval { border: 1.5px solid var(--amber); border-left-width: 6px; border-radius: var(--radius); padding: 16px 18px; background: #FFF9EC; display: grid; gap: 8px; }
.approval h3 { font-size: 1.05rem; }
.approval p { color: var(--ink-soft); font-size: 0.95rem; }
.approval-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

.summary { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 10px; }
.summary p { white-space: pre-line; }
.summary[data-outcome="rejected"] h3::after { content: " (stopped by you)"; color: var(--ink-soft); font-weight: 400; }
.summary[data-outcome="failed"] h3::after { content: " (failed)"; color: var(--madder); font-weight: 400; }
.audit summary { cursor: pointer; font-weight: 600; color: var(--indigo); }
.audit ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 0.9rem; }
.audit li { display: grid; grid-template-columns: 74px 70px 1fr; gap: 10px; color: var(--ink-soft); }
.audit li time { font-variant-numeric: tabular-nums; }
.audit li .actor { font-weight: 600; color: var(--ink); }
.audit li[data-actor="human"] .actor { color: var(--madder); }
.error { color: var(--madder); font-weight: 500; }

/* Agents */
.section-lede { color: var(--ink-soft); max-width: 40em; margin: 14px 0 34px; font-size: 1.08rem; }
.agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.agent-card { background: var(--well); border-color: transparent; border: 1.5px solid var(--line); border-radius: 10px; padding: 26px; display: grid; gap: 12px; align-content: start; }
.agent-card .tagline { font-family: var(--display); font-size: 1.1rem; color: var(--indigo); }
.agent-card p { color: var(--ink-soft); font-size: 0.98rem; }
.agent-card dl { margin: 6px 0 0; display: grid; grid-template-columns: 96px 1fr; gap: 6px 12px; font-size: 0.93rem; }
.agent-card dt { color: var(--ink-soft); }
.agent-card dd { margin: 0; }
.agent-card .try-btn { justify-self: start; margin-top: 6px; }

/* How */
.phases { list-style: none; counter-reset: phase; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.phases li { counter-increment: phase; border-top: 3px solid var(--indigo); padding-top: 14px; color: var(--ink-soft); font-size: 0.98rem; }
.phases li::before { content: counter(phase); display: block; font-family: var(--display); font-weight: 700; font-size: 2rem; color: var(--indigo); line-height: 1; margin-bottom: 10px; }
.phases strong { color: var(--ink); }

/* Trust */
.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 30px; }
.trust-grid h3 { margin-bottom: 8px; }
.trust-grid p { color: var(--ink-soft); }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; }
.contact-copy p { color: var(--ink-soft); margin-top: 14px; max-width: 30em; }
.contact-line { font-weight: 500; }
.contact-line a { font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
.contact-form { display: grid; gap: 14px; background: var(--well); border-color: transparent; border: 1.5px solid var(--line); border-radius: 10px; padding: 26px; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.contact-form button { justify-self: start; }
.form-status { color: var(--green); font-weight: 500; min-height: 1.4em; }
.form-status.err { color: var(--madder); }

.foot { max-width: var(--max); margin: 0 auto; padding: 28px 24px 48px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 0.95rem; }

@media (max-width: 980px) {
  .hero, .contact { grid-template-columns: 1fr; }
  .console { position: static; min-height: 0; }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .agent-grid, .phases { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .top nav { gap: 16px; font-size: 0.95rem; }
  .audit li { grid-template-columns: 64px 1fr; }
  .audit li .action { grid-column: 1 / -1; }
}

/* ---- Deep indigo ground; white paper components ------------------------------------ */
:root {
  --ground: #0F1F4D;
  --ground-2: #16296A;
  --on-ground: #EEF1F8;
  --on-ground-soft: #B9C4E0;
  --focus: #F2C57C;
}
body { background: var(--ground); color: var(--on-ground); }
:focus-visible { outline-color: var(--focus); }
a { color: var(--on-ground); }
.brand { color: var(--on-ground); }
.brand-mark { border: 1.5px solid rgba(255,255,255,.55); background-color: var(--indigo); }
.top nav a { color: var(--on-ground-soft); }
.top nav a:hover { color: var(--on-ground); }
.lede, .help, .section-lede { color: var(--on-ground-soft); }
.agent-picker legend, .task-label { color: var(--on-ground); }
.agent-pill span { background: transparent; border-color: rgba(255,255,255,.38); color: var(--on-ground); }
.agent-pill input:checked + span { background: #fff; border-color: #fff; color: var(--indigo-deep); }
.agent-pill input:focus-visible + span { outline-color: var(--focus); }
textarea, input { background: #fff; border-color: transparent; }
textarea:focus, input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(242,197,124,.35); }
.examples button { background: rgba(255,255,255,.12); color: var(--on-ground); }
.examples button:hover { background: rgba(255,255,255,.22); }
button.primary { background: #fff; color: var(--indigo-deep); }
button.primary:hover { background: var(--tint); }
button.primary:disabled { background: rgba(255,255,255,.25); color: var(--on-ground-soft); }
button.ghost { border-color: rgba(255,255,255,.4); color: var(--on-ground); }
button.ghost:hover { border-color: #fff; }

/* paper components keep the dark-ink palette */
.console, .agent-card, .contact-form { background: var(--paper); color: var(--ink); border-color: transparent; }
.console { box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 32px 64px -32px rgba(0,0,0,.6); }
.console a, .agent-card a, .contact-form a { color: var(--indigo); }
.console button.primary, .contact-form button.primary { background: var(--indigo); color: #fff; }
.console button.primary:hover, .contact-form button.primary:hover { background: var(--indigo-deep); }
.console button.ghost, .agent-card button.ghost { border-color: var(--line); color: var(--ink); }
.console button.ghost:hover, .agent-card button.ghost:hover { border-color: var(--ink); }
.console textarea, .console input, .contact-form textarea, .contact-form input { border-color: var(--line); }
.contact-form textarea:focus, .contact-form input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tint); }
.console :focus-visible, .agent-card :focus-visible, .contact-form :focus-visible { outline-color: var(--madder); }
.agent-card p { color: var(--ink-soft); }
.agent-card .tagline { color: var(--indigo); }
.summary { border-top-color: var(--line); }

/* sections on the ground */
.phases li { border-top-color: var(--tint); color: var(--on-ground-soft); }
.phases li::before { color: var(--focus); }
.phases strong { color: var(--on-ground); }
.trust-grid p { color: var(--on-ground-soft); }
.contact-copy p { color: var(--on-ground-soft); }
.contact-line a { color: var(--on-ground); }
.foot { border-top-color: rgba(255,255,255,.18); color: var(--on-ground-soft); }
.foot a { color: var(--on-ground); }
.skip { background: #fff; color: var(--ink); }
.console-band { background: repeating-linear-gradient(135deg, var(--indigo) 0 10px, #fff 10px 14px, var(--focus) 14px 18px, #fff 18px 22px); }
