/* AgentTrust landing page. No external fonts, no frameworks. */

:root {
  color-scheme: light dark;

  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --border: #e1e4ea;
  --border-strong: #c9ced8;
  --text: #0f172a;
  --text-muted: #4a5468;
  --text-faint: #5f697c;

  --accent: #3b45c4;
  --accent-hover: #2f38a8;
  --accent-contrast: #ffffff;
  --accent-soft: #eef0ff;

  --allow: #067647;
  --allow-bg: #ecfdf3;
  --allow-border: #abefc6;
  --deny: #b42318;
  --deny-bg: #fef3f2;
  --deny-border: #fecdca;
  --approval: #93370d;
  --approval-bg: #fffaeb;
  --approval-border: #fedf89;
  --info: #344054;
  --info-bg: #f2f4f7;
  --info-border: #d0d5dd;

  --code-bg: #0d1220;
  --code-text: #dbe2ee;
  --code-muted: #8d99ae;
  --code-accent: #a5b4ff;
  --code-string: #9be3b5;
  --code-border: #1d2436;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.05);
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --surface: #12151c;
    --surface-2: #191d26;
    --border: #252a35;
    --border-strong: #353b48;
    --text: #e7e9ef;
    --text-muted: #a6adbb;
    --text-faint: #9199a8;

    --accent: #9aa6ff;
    --accent-hover: #b6beff;
    --accent-contrast: #0b0d12;
    --accent-soft: #1b1f3a;

    --allow: #4fd18f;
    --allow-bg: #0f2a1d;
    --allow-border: #1f5a3c;
    --deny: #ff8a80;
    --deny-bg: #2d1414;
    --deny-border: #6b2a26;
    --approval: #fbbf4d;
    --approval-bg: #2b2110;
    --approval-border: #6b4f16;
    --info: #c3c9d5;
    --info-bg: #1c212b;
    --info-border: #353b48;

    --code-bg: #080a10;
    --code-border: #20263a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.125rem;
}

h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

code,
kbd,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  overflow-x: auto;
  max-width: 100%;
}

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

.visually-hidden {
  position: absolute !important;
  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: 12px;
  top: -48px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 16px;
}

@media (min-width: 720px) {
  .container {
    padding-inline: 28px;
  }
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
  white-space: nowrap;
}

.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand-mark-bg {
  fill: var(--accent);
}

.brand-mark-fg {
  fill: none;
  stroke: var(--accent-contrast);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand .tag {
  font-weight: 600;
}

.site-nav ul {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

@media (min-width: 860px) {
  .site-nav ul {
    display: flex;
  }
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding-block: 56px 64px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

@media (min-width: 980px) {
  .hero {
    padding-block: 88px 96px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 56px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--allow);
  flex: none;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 40rem;
  margin-top: 20px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-note {
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--text-faint);
  max-width: 38rem;
}

/* Static decision trace in the hero */
.trace-figure {
  margin: 0;
  min-width: 0;
}

.trace-card {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.trace-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--code-muted);
}

.trace-dots {
  display: inline-flex;
  gap: 6px;
  margin-right: 6px;
}

.trace-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2a3146;
}

.trace-body {
  padding: 14px 16px 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.trace-body .line {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.trace-body .k {
  color: var(--code-muted);
  flex: none;
  width: 6.5em;
}

.trace-body .v {
  min-width: 0;
  overflow-wrap: anywhere;
}

.trace-body .ok {
  color: #6ee7a8;
  flex: none;
}

.trace-body .req {
  color: var(--code-accent);
  overflow-wrap: anywhere;
}

.trace-body .dim {
  color: var(--code-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.trace-body hr {
  border: 0;
  border-top: 1px dashed var(--code-border);
  margin: 10px 0;
}

.trace-verdict {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 6px;
}

.trace-caption {
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin-top: 10px;
}

/* ------------------------------------------------------------------ sections */

.section {
  padding-block: 64px;
  border-top: 1px solid var(--border);
}

@media (min-width: 980px) {
  .section {
    padding-block: 96px;
  }
}

.section-alt {
  background: var(--surface);
}

.section-head {
  max-width: 46rem;
  margin-bottom: 36px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

.section-head p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.grid-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
}

.section-alt .card {
  background: var(--bg);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.card .chip {
  margin-bottom: 12px;
}

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ how it works */

.diagram {
  margin: 0 0 32px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram .diagram-tall {
  max-width: 340px;
  margin-inline: auto;
}

.diagram .diagram-wide {
  display: none;
}

@media (min-width: 760px) {
  .diagram .diagram-wide {
    display: block;
  }

  .diagram .diagram-tall {
    display: none;
  }
}

.diagram figcaption {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-faint);
}

.d-box {
  fill: var(--surface-2);
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.d-box-accent {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.4;
}

.d-frame {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
}

.d-title {
  fill: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
}

.d-sub {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
}

.d-num {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.d-label {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.d-line {
  stroke: var(--text-faint);
  stroke-width: 1.6;
  fill: none;
}

.d-arrowhead {
  fill: var(--text-faint);
}

.d-allow {
  fill: var(--allow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.d-deny {
  fill: var(--deny);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.d-approval {
  fill: var(--approval);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.steps p {
  color: var(--text-muted);
  margin-bottom: 0;
  font-size: 0.9375rem;
}

.callout {
  margin-top: 24px;
  display: grid;
  gap: 8px 20px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

@media (min-width: 860px) {
  .callout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

.callout h3 {
  margin: 0;
}

.callout p {
  color: var(--text-muted);
  margin: 0;
}

/* ------------------------------------------------------------------ demo */

.demo-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text) !important;
  font-size: 0.9375rem !important;
}

.demo-label svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  fill: none;
  stroke: var(--allow);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 1020px) {
  .demo-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 20px;
  }

  .demo-out {
    position: sticky;
    top: calc(var(--header-h) + 12px);
    max-height: calc(100vh - var(--header-h) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.demo-in,
.demo-out {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.panel-head h3 {
  margin: 0;
}

.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: middle;
}

.tag-sim {
  background: var(--approval-bg);
  border-color: var(--approval-border);
  color: var(--approval);
}

.facts {
  margin: 0;
  display: grid;
  gap: 10px;
  font-size: 0.9rem;
}

.facts > div {
  display: grid;
  gap: 2px 12px;
  min-width: 0;
}

@media (min-width: 520px) {
  .facts > div {
    grid-template-columns: 8.5rem minmax(0, 1fr);
  }
}

.facts dt {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 0.8125rem;
}

.facts dd {
  margin: 0;
  min-width: 0;
}

.status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info);
  white-space: nowrap;
}

.tone-allow {
  --tone: var(--allow);
  --tone-bg: var(--allow-bg);
  --tone-border: var(--allow-border);
}

.tone-deny {
  --tone: var(--deny);
  --tone-bg: var(--deny-bg);
  --tone-border: var(--deny-border);
}

.tone-approval {
  --tone: var(--approval);
  --tone-bg: var(--approval-bg);
  --tone-border: var(--approval-border);
}

.tone-info {
  --tone: var(--info);
  --tone-bg: var(--info-bg);
  --tone-border: var(--info-border);
}

.status[class*="tone-"],
.badge[class*="tone-"] {
  color: var(--tone);
  background: var(--tone-bg);
  border-color: var(--tone-border);
}

.mode {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}

.mode legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mode-options {
  display: grid;
  gap: 8px;
}

@media (min-width: 520px) {
  .mode-options {
    grid-template-columns: 1fr 1fr;
  }
}

.mode-option {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 12px 10px 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-size: 0.875rem;
  min-width: 0;
}

.mode-option input {
  position: absolute;
  left: 12px;
  top: 13px;
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mode-option .mono {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-wrap: break-word;
}

.btn-group {
  margin-bottom: 16px;
}

.btn-group:last-child {
  margin-bottom: 0;
}

.btn-group h4 {
  margin-bottom: 8px;
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr));
  gap: 8px;
}

.btn-demo {
  justify-content: flex-start;
  text-align: left;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  min-height: 44px;
  padding: 8px 12px;
  font-size: 0.875rem;
}

.btn-demo:hover:not([disabled]) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-demo[data-group="attack"]:hover:not([disabled]) {
  border-color: var(--deny);
  background: var(--deny-bg);
}

.panel > .note + .btn-group {
  margin-top: 12px;
}

.group-hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.quick-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.quick-result[hidden] {
  display: none;
}

@media (min-width: 1020px) {
  .quick-result {
    display: none;
  }
}

.token-actions {
  margin-top: 8px;
}

.code[hidden] {
  display: none;
}

/* Result */
.result-empty {
  color: var(--text-muted);
  margin: 0;
}

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--info-border);
}

.reason {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.result-title {
  font-size: 0.875rem;
  color: var(--text-faint);
  margin: 0 0 8px;
}

.result-summary {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.pipeline {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 0.875rem;
}

.pipeline li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.pipeline .icon {
  font-family: var(--font-mono);
  font-weight: 800;
  text-align: center;
}

.pipeline .st-ok .icon {
  color: var(--allow);
}

.pipeline .st-fail .icon {
  color: var(--deny);
}

.pipeline .st-wait .icon {
  color: var(--approval);
}

.pipeline .st-skip {
  color: var(--text-faint);
}

.pipeline .st-skip .icon {
  color: var(--text-faint);
}

.pipeline .detail {
  color: var(--text-faint);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

details.block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 10px;
  background: var(--bg);
  min-width: 0;
}

details.block > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.875rem;
  list-style-position: inside;
}

details.block[open] > summary {
  border-bottom: 1px solid var(--border);
}

.block-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.kv-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.code {
  display: block;
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.token {
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.token .seg-h {
  color: #ffb4a8;
}

.token .seg-p {
  color: var(--code-accent);
}

.token .seg-s {
  color: var(--code-string);
}

.note {
  font-size: 0.8125rem;
  color: var(--text-faint);
  margin: 0;
}

.pending-card {
  border: 1px solid var(--approval-border);
  background: var(--approval-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.pending-card + .pending-card {
  margin-top: 8px;
}

.pending-card p {
  margin: 0;
  font-size: 0.875rem;
}

.pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Audit log */
.audit-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.audit-list li {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 2px 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

.audit-list li:last-child {
  border-bottom: 0;
}

.audit-list li.is-new {
  background: var(--accent-soft);
}

.audit-list .t {
  color: var(--text-faint);
}

.audit-list .e {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.audit-list .m {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--text-muted);
  min-width: 0;
}

.audit-list .m span {
  overflow-wrap: anywhere;
}

.audit-empty {
  padding: 12px;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

/* Voice */
.voice-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-bottom: 4px;
}

.vfield {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg);
  min-width: 0;
  font-size: 0.8125rem;
}

.vfield h4 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.vfield p {
  margin: 0;
  overflow-wrap: anywhere;
}

.vfield .mono {
  font-size: 0.8125rem;
}

.vfield-decision {
  border-color: var(--tone-border, var(--border));
  background: var(--tone-bg, var(--bg));
}

/* Fallback walkthrough */
.fallback-msg {
  border: 1px solid var(--approval-border);
  background: var(--approval-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.walkthrough {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.walkthrough li {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.walkthrough .w-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-weight: 600;
}

.walkthrough p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.walkthrough .reason {
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------------ principles */

.principles {
  display: grid;
  gap: 32px;
}

@media (min-width: 980px) {
  .principles {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 56px;
  }
}

.principles-intro p:not(.eyebrow) {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.never-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.never-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.never-list svg {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  fill: none;
  stroke: var(--deny);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.never-list strong {
  display: block;
  margin-bottom: 2px;
}

.never-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.honest {
  margin-top: 8px !important;
  padding: 8px 10px;
  border-left: 3px solid var(--approval);
  background: var(--approval-bg);
  color: var(--text) !important;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem !important;
}

/* ------------------------------------------------------------------ developers */

.dev-note {
  margin-top: 12px;
}

.dev-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 980px) {
  .dev-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.codeblock {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.codeblock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-border);
  color: var(--code-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.codeblock-head .tag {
  background: transparent;
  border-color: var(--code-border);
  color: var(--code-muted);
}

.codeblock pre {
  padding: 14px 16px;
  color: var(--code-text);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.c-com {
  color: var(--code-muted);
}

.c-str {
  color: var(--code-string);
}

.c-kw {
  color: var(--code-accent);
}

.status-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 860px) {
  .status-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.9375rem;
}

.checklist li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.checklist svg {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checklist .done svg {
  stroke: var(--allow);
}

.checklist .wip svg {
  stroke: var(--approval);
}

.checklist .road svg {
  stroke: var(--text-faint);
}

.checklist-sub {
  margin-top: 20px;
}

/* ------------------------------------------------------------------ FAQ */

.faq {
  display: grid;
  gap: 10px;
  max-width: 52rem;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 650;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--text-faint);
  flex: none;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq .answer {
  padding: 0 18px 16px;
  color: var(--text-muted);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ CTA + footer */

.cta-band {
  text-align: left;
}

.cta-band .card {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 28px;
}

@media (min-width: 860px) {
  .cta-band .card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.cta-band h2 {
  margin-bottom: 6px;
}

.cta-band p {
  color: var(--text-muted);
  margin: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 28px 40px;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .audit-list li.is-new {
    animation: flash 1.2s ease-out;
  }

  @keyframes flash {
    from {
      background: color-mix(in srgb, var(--accent) 22%, transparent);
    }
  }
}
