/* Layout concept: a request log between console and device; the device's verdict always sits in the right-hand margin. */
:root {
  --ground: #111214;
  --raised: #17191c;
  --sunken: #0b0c0e;
  --line: #2a2d31;
  --fg: #e9e6df;
  --muted: #9a978f;
  --signal: #f2a93b;
  --allow: #52b788;
  --veto: #e5534b;
  --on-signal: #111214;

  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", "Cascadia Mono", Consolas, monospace;

  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: 2.3rem;
  --step-4: clamp(2.4rem, 5vw, 3.7rem);

  --page: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #f5f6f4;
    --raised: #ffffff;
    --sunken: #ebece9;
    --line: #d6d8d4;
    --fg: #16181b;
    --muted: #5b5f65;
    --signal: #a85f00;
    --allow: #1d7a51;
    --veto: #c2362f;
    --on-signal: #ffffff;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #f5f6f4;
  --raised: #ffffff;
  --sunken: #ebece9;
  --line: #d6d8d4;
  --fg: #16181b;
  --muted: #5b5f65;
  --signal: #a85f00;
  --allow: #1d7a51;
  --veto: #c2362f;
  --on-signal: #ffffff;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
code, pre, .mono { font-family: var(--font-mono); }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); font-weight: 700; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; max-width: 62ch; }

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { font-size: var(--step-1); color: var(--muted); }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--fg); }
.brand-mark { font-weight: 600; white-space: nowrap; }
.brand-mark .dot { color: var(--signal); }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--signal); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--fg);
  border-radius: 2px;
  font-weight: 500;
  text-decoration: none;
  background: var(--fg);
  color: var(--ground);
  font-size: 0.95rem;
}
.button:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.button.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.button.ghost:hover { border-color: var(--fg); color: var(--fg); }

/* Sections */
section { padding-block: clamp(3.5rem, 8vw, 6rem); }
section + section { border-top: 1px solid var(--line); }
.section-head { display: grid; gap: 1rem; margin-bottom: 2.5rem; }

/* Hero */
.hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(3rem, 6vw, 4.5rem); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
.hero-copy { display: grid; gap: 1.4rem; align-content: start; }
.hero h1 .verdict { color: var(--signal); }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.4rem; }

/* Demo */
.demo {
  border: 1px solid var(--line);
  background: var(--raised);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.demo-pane { padding: 1.2rem; display: grid; gap: 0.9rem; align-content: start; min-width: 0; }
.demo-pane + .demo-pane { border-top: 1px solid var(--line); }
.pane-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.pane-title .host { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.cmds { display: grid; gap: 0.4rem; }
.cmd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
}
.cmd:hover { border-color: var(--muted); }
.cmd .send { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.cmd:hover .send { color: var(--signal); }
.policy {
  margin: 0;
  padding: 0.9rem;
  background: var(--sunken);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}
.policy .c { color: var(--muted); }
.policy .k { color: var(--fg); }
.policy .s-allow { color: var(--allow); }
.policy .s-ask { color: var(--signal); }
.policy .s-deny { color: var(--veto); }
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: grid;
  gap: 0.3rem;
  max-height: 15.5rem;
  overflow-y: auto;
}
.ledger li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.35rem 0.5rem;
  border-left: 2px solid var(--line);
}
.ledger .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.ledger .what { overflow-wrap: anywhere; }
.ledger .why { display: block; color: var(--muted); }
.ledger .v { font-weight: 600; letter-spacing: 0.04em; }
.ledger li.allow { border-left-color: var(--allow); }
.ledger li.allow .v { color: var(--allow); }
.ledger li.ask { border-left-color: var(--signal); }
.ledger li.ask .v { color: var(--signal); }
.ledger li.veto { border-left-color: var(--veto); }
.ledger li.veto .v { color: var(--veto); }
.ledger li.fresh { animation: arrive 600ms ease-out; }
@keyframes arrive { from { background: var(--sunken); transform: translateX(6px); } to { background: transparent; transform: none; } }
.demo-note { font-size: var(--step--1); color: var(--muted); }

/* Claims: three statements with the verdict in the margin */
.claims { display: grid; gap: 0; border-top: 1px solid var(--line); }
.claim {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem 2rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--line);
}
.claim p { color: var(--muted); }
.claim .tag { font-family: var(--font-mono); font-size: var(--step--1); color: var(--signal); }

/* Steps: a real sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 1rem; counter-increment: step; }
.steps li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--signal);
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { color: var(--muted); }

/* Code */
.code {
  margin: 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  background: var(--sunken);
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}
.code .c { color: var(--muted); }
.code .hl { color: var(--signal); }
.code .ok { color: var(--allow); }
.code .no { color: var(--veto); }

/* Two-column text + figure */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.split > * { min-width: 0; }
.stack { display: grid; gap: 1.1rem; }
.stack p { color: var(--muted); }

/* Mode table */
.modes { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.modes th, .modes td { text-align: left; padding: 0.9rem 0.8rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.modes th { font-weight: 500; }
.modes td { color: var(--muted); }
.mode { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; }
.mode.allow { color: var(--allow); }
.mode.ask { color: var(--signal); }
.mode.deny { color: var(--veto); }
.table-scroll { overflow-x: auto; }

/* Threat model */
.threats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.threats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.threats li { padding-left: 1.6rem; position: relative; color: var(--muted); }
.threats li strong { color: var(--fg); font-weight: 500; }
.threats .yes li::before { content: "+"; position: absolute; left: 0; color: var(--allow); font-family: var(--font-mono); }
.threats .no li::before { content: "\2013"; position: absolute; left: 0; color: var(--veto); font-family: var(--font-mono); }
.threats h3 { margin-bottom: 1rem; }

/* Transcript (agents page) */
.transcript { border: 1px solid var(--line); background: var(--raised); display: grid; }
.turn { padding: 1rem 1.2rem; display: grid; gap: 0.4rem; border-bottom: 1px solid var(--line); }
.turn:last-child { border-bottom: 0; }
.turn .who { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); }
.turn.tool { background: var(--sunken); font-family: var(--font-mono); font-size: 0.82rem; overflow-x: auto; }
.turn.tool .no { color: var(--veto); font-weight: 600; }
.turn.tool .ok { color: var(--allow); font-weight: 600; }

/* Callout */
.incident { display: grid; gap: 1rem; padding: 1.6rem; border: 1px solid var(--line); border-left: 3px solid var(--veto); }
.incident .label { color: var(--veto); }

/* CTA + footer */
.cta { display: grid; gap: 1.2rem; }
.address { font-family: var(--font-mono); font-size: var(--step-1); color: var(--fg); user-select: all; }
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }

.page-head { padding-block: clamp(3rem, 7vw, 4.5rem) clamp(2rem, 5vw, 3rem); display: grid; gap: 1.2rem; }

@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); align-items: start; gap: 3rem; }
  .demo { grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); }
  .demo-pane + .demo-pane { border-top: 0; border-left: 1px solid var(--line); }
  .claim { grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) auto; align-items: baseline; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; }
  .threats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ledger li.fresh { animation: none; }
}
