/* TrustGraph landing page.
   Prose in IBM Plex Sans; IBM Plex Mono only for what a machine reads or writes.
   Both are self-hosted from /fonts (SIL OFL 1.1; see web/fonts/LICENSE.txt).
   Structure comes from 1px shared borders, never from cards or shadows.
   One accent (deep green) for the mark, the active experiment and Run. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #2a2c2e;
  --strong: #101113;
  --muted: #676b70;
  --line: #d6d7d9;
  --link: #1f5fbf;
  --accent: #116149;
  --on-accent: #ffffff;
  --code-bg: #f7f7f7;
  --allow: #13703f;
  --wait: #8a5200;
  --deny: #b3261e;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --text: #d4d6d9;
    --strong: #f3f4f5;
    --muted: #999da3;
    --line: #34373c;
    --link: #82b2ff;
    --accent: #45b58b;
    --on-accent: #07140f;
    --code-bg: #18191c;
    --allow: #6fd49b;
    --wait: #f0b65a;
    --deny: #ff8a80;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); overflow-x: hidden; }

.page { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

h1, h2, h3 { color: var(--strong); line-height: 1.25; font-weight: 600; }
b, strong { font-weight: 600; }
h1 { font-size: 1.9rem; letter-spacing: -.015em; margin: 0 0 .6em; max-width: 22ch; }
h2 { font-size: 1.2rem; margin: 0 0 .75em; }
h3 { font-size: 1rem; margin: 0; }
p, ul, ol, pre, figure { margin: 0 0 1em; }
main p, main li { max-width: 68ch; }
.frame p, .frame li { max-width: none; }
ul { padding-left: 1.25em; }
main > section { margin-top: 5.5rem; }
main > #playground { margin-top: 1.5rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

code, pre, .mono, select, textarea, input { font-family: var(--mono); }
code, .mono { font-size: .92em; color: var(--strong); }
pre { font-size: 14px; line-height: 1.6; background: var(--code-bg); padding: 18px 20px; overflow-x: auto; max-width: 100%; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; }
.lead { font-size: 1.1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--bg); padding: 8px; border: 1px solid var(--line); }
.skip:focus { top: 8px; }

/* Header: a full-width rule is the page's signature line. */
.top { border-bottom: 1px solid var(--line); }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--strong); font-weight: 600; padding: 8px 0; }
.mark rect, .mark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.top a { padding: 8px 0; }

/* Intro: the promise beside its picture. */
.intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 56px; align-items: center; padding: 36px 0 8px; }
.intro .lead { margin: 0; }
.hero { margin: 0; overflow-x: auto; }

/* Drawings: thin strokes in the text colour, plus the accent and verdict colours. */
.flow { display: block; width: 100%; height: auto; }
.flow text { font-family: var(--mono); font-size: 12.5px; fill: var(--text); }
.flow .t-name { fill: var(--strong); font-weight: 600; }
.flow .t-sub { fill: var(--muted); }
.flow .t-allow { fill: var(--allow); font-weight: 600; }
.flow .t-deny { fill: var(--deny); font-weight: 600; }
.flow rect { fill: var(--bg); stroke: var(--text); stroke-width: 1; }
.flow .out rect { stroke: var(--accent); stroke-width: 1.5; }
.flow .agent { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.flow .t-agent { fill: var(--accent); text-anchor: middle; font-size: 11.5px; }
.wire, .ink, .deny { fill: none; stroke-width: 1.5; }
.wire, .ink { stroke: var(--text); }
.wire.ok { stroke: var(--allow); }
.wire.bad, .deny { stroke: var(--deny); }
.dash { stroke-dasharray: 3 3; }
.spot { display: block; width: 120px; height: 64px; margin-bottom: 14px; }
.spot .accent { fill: none; stroke: var(--accent); stroke-width: 1.5; }

/* Shared-border grids. */
.grid { display: grid; list-style: none; padding: 0; margin: 1.5em 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px; }
.grid > .cell p { margin: 6px 0 0; }

/* Text beside its artifact. */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.split.pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split.pair > section { margin-top: 0; }
main > .split.pair { margin-top: 5.5rem; }
.split-side pre { margin: 0; }

/* The playground: one frame; rules only between policy | run and the bottom row. */
.frame { border: 1px solid var(--line); }
#playground .frame { margin-top: 1.5rem; }
.frame-head { display: table; margin: -0.75em 0 0 18px !important; padding: 0 8px; background: var(--bg); font-size: 1.05rem; position: relative; }
.frame-head .mono { font-size: 13px; font-weight: 400; color: var(--muted); }
.frame .cell { padding: 22px 24px; min-width: 0; }
.experiments { padding: 10px 24px 4px; }
.row.main { display: grid; grid-template-columns: minmax(0, 34fr) minmax(0, 66fr); }
.row.main > .cell + .cell { border-left: 1px solid var(--line); }
.row.bottom { display: grid; grid-template-columns: minmax(0, 34fr) minmax(0, 66fr); border-top: 1px solid var(--line); }
.row.bottom > .cell + .cell { border-left: 1px solid var(--line); }
.cell-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.cell-head h3 { margin-right: auto; }
.cell-foot { margin-top: 12px; }

/* Experiments: text tabs; the selected one bold with the accent underline. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.tab { border: 0; background: none; padding: 6px 0; min-height: 36px; font-size: 15px; color: var(--text); }
.tab:hover { color: var(--strong); text-decoration: underline; text-underline-offset: 6px; }
.tab[aria-pressed="true"] { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.note { margin: 2px 0 0; min-height: 1.5em; font-size: 13px; color: var(--muted); }

/* Controls. Form controls are native; inline ones read as underlined words. */
select, input, textarea, button { font-size: 14px; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 0; }
select, input { min-height: 36px; padding: 4px 8px; max-width: 100%; }
input[type="number"] { width: 10ch; }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0 8px 0 0; accent-color: var(--accent); }
button { font-family: var(--sans); min-height: 36px; padding: 4px 12px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.plain { border: 0; padding: 4px 0; color: var(--link); background: none; }
button:disabled { opacity: .6; cursor: progress; }

select.inline, .pick > summary {
  appearance: none; -webkit-appearance: none; border: 0; background: none; min-height: 0;
  padding: 0 2px; font: 600 13px/1.8 var(--mono); color: var(--strong); cursor: pointer; field-sizing: content;
  background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat;
  background-size: 100% 1px; background-position: 0 100%;
}
select.inline:hover, .pick > summary:hover { color: var(--accent); }
select.inline option { font-weight: 400; color: var(--text); background: var(--bg); }

.editor { display: block; width: 100%; font-size: 13px; line-height: 1.55; padding: 14px 16px; border: 0; background: var(--code-bg); resize: vertical; tab-size: 2; white-space: pre; overflow: auto; }

/* The run: one sentence per step, the engine's record under it. */
.step { margin-bottom: 14px; }
.sentence { margin: 0; line-height: 1.9; }
.pick { display: inline-block; position: relative; }
.pick > summary { list-style: none; display: inline; }
.pick > summary::-webkit-details-marker { display: none; }
.pick-panel { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 200px; margin-top: 4px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); }
.pick-panel label { display: flex; align-items: center; padding: 4px 0; font: 13.5px var(--mono); white-space: nowrap; cursor: pointer; }
.pick-panel .muted { font-family: var(--sans); font-size: 12.5px; margin-left: 8px; }
.recorded { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.recorded.refused { color: var(--deny); }
.step-count { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.step-count select.inline { font-weight: 400; color: var(--muted); }

.answer { margin-top: 30px; }
.answer p { margin: 0 0 4px; }
.verdict { font-family: var(--mono); font-size: 1.7rem; font-weight: 600; color: var(--strong); margin-bottom: 8px !important; }
.v-allow { color: var(--allow); }
.v-needs_approval { color: var(--wait); }
.v-deny { color: var(--deny); }

.status { font-family: var(--mono); font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.status.ok { color: var(--allow); }
.status.warn { color: var(--wait); }
.status.bad { color: var(--deny); }
.status.pending, .status.offline { color: var(--muted); }
.lines { list-style: none; padding: 0; margin: 0; font-family: var(--mono); font-size: 13.5px; }
.lines li { margin: 0 0 4px; }
.lines .muted { font-family: var(--sans); }
.diag { font-family: var(--mono); text-align: left; border: 0; padding: 2px 0; min-height: 0; background: none; color: var(--deny); }
.diag.warning { color: var(--wait); }
.diag:hover { text-decoration: underline; }
.tag { font-weight: 600; display: inline-block; min-width: 8ch; }
.pass .tag, .narrows .tag { color: var(--allow); }
.fail .tag, .widens .tag, .fail .why { color: var(--deny); }
.alert { color: var(--deny); font-weight: 600; }

details > summary { cursor: pointer; }
.fold > summary { display: flex; gap: 14px; align-items: baseline; padding: 2px 0; }
.fold[open] > summary { margin-bottom: 10px; }
.fold-title { font-weight: 600; color: var(--strong); }
.fold-sum { color: var(--muted); }
.fold-sum.bad { color: var(--deny); }
.explain { margin-top: 14px; }
.explain > summary { padding: 6px 0; color: var(--muted); }
.explain .lines { margin-top: 8px; }

.sim-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
#sim-result pre { margin: 0 0 8px; }
.hit .mark { color: var(--allow); }
.miss { color: var(--muted); }

.foot { border-top: 1px solid var(--line); margin-top: 6rem; padding: 20px 0 56px; color: var(--muted); font-size: 14px; }
.foot a { display: inline-block; padding: 8px 0; }

@media (max-width: 960px) {
  .intro, .split, .split.pair { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .split.pair > section + section { margin-top: 3rem; }
}
@media (max-width: 760px) {
  .row.main, .row.bottom, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .row.main > .cell + .cell, .row.bottom > .cell + .cell { border-left: 0; border-top: 1px solid var(--line); }
  .intro .flow { min-width: 560px; }
  main > section, main > .split.pair { margin-top: 4rem; }
  .frame .cell { padding: 18px 16px; }
  .experiments { padding: 10px 16px 0; }
}
@media (max-width: 480px) {
  .page { padding: 0 16px; }
  h1 { font-size: 1.55rem; }
  pre, .editor { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
