/* Ziora website
   Layout: a long, quiet Apple-style scroll on white. One 1200px column. Product shots carry the story;
   type does the rest. Colour comes from the app's own tokens (app/lib/theme/tokens.dart); the glossy blue
   is reserved for primary actions. One dark chapter (security) is the only change of ground. */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #f2f5fa;
  --field: #eaf0f8;
  --ink: #0b1a33;
  --ink-2: #33445f;
  --ink-3: #4a5b78;
  --muted: #5e6e88;
  --faint: #98a6bb;
  --line: #e3eaf4;
  --line-soft: #eef2f8;
  --line-strong: #d6e0ee;
  --blue: #1068ee;
  --blue-text: #0a4fc4;
  --blue-tint: #e6efff;
  --blue-soft: #a9cbff;
  --blue-wash: rgba(10, 108, 255, 0.1);
  --red: #c4281c;     --red-ink: #9e1c12;    --red-tint: #fde7e5;
  --orange: #e0621b;  --orange-ink: #9a3a08; --orange-tint: #ffebdd;
  --amber: #b77b00;   --amber-ink: #7a5200;  --amber-tint: #fff3d6;
  --green: #1e8a55;   --green-ink: #11663f;  --green-tint: #e3f5ec;
  --code-kw: #0b4fd1;
  --code-str: #a3431a;
  --code-com: #7d8ca5;
  --code-fn: #7b3fb5;
  --code-num: #0a6f66;
  --code-hl: rgba(16, 104, 238, 0.07);
  --gloss: linear-gradient(180deg, #3d8eff 0%, #1068ee 50%, #0759de 50%, #0249c4 100%);
  --gloss-hover: linear-gradient(180deg, #4f99ff 0%, #1c72f2 50%, #0d61e6 50%, #0550cf 100%);
  --gloss-shadow: 0 1px 2px rgba(0, 50, 140, 0.25), 0 6px 16px rgba(10, 108, 255, 0.24);
  --shot-shadow: 0 1px 1px rgba(11, 26, 51, 0.04), 0 12px 24px -8px rgba(11, 26, 51, 0.1), 0 48px 96px -32px rgba(11, 26, 51, 0.22);
  --card-shadow: 0 1px 2px rgba(11, 26, 51, 0.04), 0 8px 24px -6px rgba(11, 26, 51, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.78);
  /* the dark chapter */
  --inv-bg: #0b1a33;
  --inv-surface: #12233f;
  --inv-ink: #eef3fb;
  --inv-muted: #a3b2cb;
  --inv-line: rgba(255, 255, 255, 0.12);
  --inv-accent: #8bbcff;
  --inv-edge: transparent;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b13;
    --bg-soft: #0b111d;
    --surface: #0f1725;
    --surface-2: #0c1320;
    --surface-3: #0d1524;
    --field: #16213a;
    --ink: #eaf1fb;
    --ink-2: #b7c4da;
    --ink-3: #a2b1c9;
    --muted: #8a9ab4;
    --faint: #5d6f8c;
    --line: #1c2840;
    --line-soft: #152036;
    --line-strong: #27375a;
    --blue: #3d8eff;
    --blue-text: #7fb2ff;
    --blue-tint: #11203b;
    --blue-soft: #2b4b7e;
    --blue-wash: rgba(61, 142, 255, 0.14);
    --red: #ff6b5e;     --red-ink: #ff9d94;    --red-tint: #3a1512;
    --orange: #ff8a3d;  --orange-ink: #ffb27a; --orange-tint: #3a1e0c;
    --amber: #f0b429;   --amber-ink: #ffd27a;  --amber-tint: #35290a;
    --green: #4cc98a;   --green-ink: #7fe0ac;  --green-tint: #0f3220;
    --code-kw: #7fb2ff;
    --code-str: #f0a577;
    --code-com: #6b7b95;
    --code-fn: #c9a2ff;
    --code-num: #5fd0c2;
    --code-hl: rgba(61, 142, 255, 0.1);
    --shot-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 12px 24px -8px rgba(0, 0, 0, 0.5), 0 48px 96px -32px rgba(0, 0, 0, 0.7);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -6px rgba(0, 0, 0, 0.45);
    --nav-bg: rgba(7, 11, 19, 0.78);
    --inv-bg: #0c1424;
    --inv-surface: #121d33;
    --inv-ink: #eef3fb;
    --inv-muted: #9aaac4;
    --inv-line: rgba(255, 255, 255, 0.09);
    --inv-accent: #8bbcff;
    --inv-edge: #1c2840;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b13;
  --bg-soft: #0b111d;
  --surface: #0f1725;
  --surface-2: #0c1320;
  --surface-3: #0d1524;
  --field: #16213a;
  --ink: #eaf1fb;
  --ink-2: #b7c4da;
  --ink-3: #a2b1c9;
  --muted: #8a9ab4;
  --faint: #5d6f8c;
  --line: #1c2840;
  --line-soft: #152036;
  --line-strong: #27375a;
  --blue: #3d8eff;
  --blue-text: #7fb2ff;
  --blue-tint: #11203b;
  --blue-soft: #2b4b7e;
  --blue-wash: rgba(61, 142, 255, 0.14);
  --red: #ff6b5e;     --red-ink: #ff9d94;    --red-tint: #3a1512;
  --orange: #ff8a3d;  --orange-ink: #ffb27a; --orange-tint: #3a1e0c;
  --amber: #f0b429;   --amber-ink: #ffd27a;  --amber-tint: #35290a;
  --green: #4cc98a;   --green-ink: #7fe0ac;  --green-tint: #0f3220;
  --code-kw: #7fb2ff;
  --code-str: #f0a577;
  --code-com: #6b7b95;
  --code-fn: #c9a2ff;
  --code-num: #5fd0c2;
  --code-hl: rgba(61, 142, 255, 0.1);
  --shot-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 12px 24px -8px rgba(0, 0, 0, 0.5), 0 48px 96px -32px rgba(0, 0, 0, 0.7);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -6px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(7, 11, 19, 0.78);
  --inv-bg: #0c1424;
  --inv-surface: #121d33;
  --inv-ink: #eef3fb;
  --inv-muted: #9aaac4;
  --inv-line: rgba(255, 255, 255, 0.09);
  --inv-accent: #8bbcff;
  --inv-edge: #1c2840;
  color-scheme: dark;
}

/* ---------- fonts (self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
img { display: block; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.9em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; border-radius: 6px; }
[id] { scroll-margin-top: 76px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.link { color: var(--blue-text); font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ic { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; white-space: nowrap;
  transition: transform 100ms ease-out, background 140ms ease-out, border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.btn:active { transform: scale(0.97); }
.btn .ic { width: 18px; height: 18px; stroke-width: 2; }
.btn-gloss { color: #fff; background: var(--gloss); box-shadow: var(--gloss-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35); text-shadow: 0 1px 1px rgba(0, 40, 120, 0.35); }
.btn-gloss:hover { background: var(--gloss-hover); }
.btn-line { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--blue-soft); }
.btn-sm { min-height: 32px; padding: 0 13px; border-radius: 8px; font-size: 0.875rem; }

/* ---------- site nav ---------- */
.site-nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-soft);
}
.site-nav .wrap { display: flex; align-items: center; gap: 4px; height: 56px; }
.lockup { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 650; font-size: 1.0625rem; letter-spacing: -0.02em; margin-right: auto; }
.lockup img { width: 26px; height: 26px; }
.beta { font-family: var(--font); font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.02em; color: var(--blue-text); border: 1px solid var(--blue-soft); border-radius: 6px; padding: 1px 6px; }
.site-nav .links { display: flex; align-items: center; gap: 2px; margin-right: 10px; }
.site-nav .links a { padding: 7px 11px; border-radius: 8px; font-size: 0.875rem; color: var(--ink-2); }
.site-nav .links a:hover, .site-nav .links a[aria-current="page"] { color: var(--ink); }
.site-nav .links a[aria-current="page"] { font-weight: 600; }
@media (max-width: 760px) { .site-nav .links { display: none; } }

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 8vw, 104px); }
.hero h1 { font-size: clamp(2.7rem, 6.6vw, 5rem); line-height: 1.02; letter-spacing: -0.04em; font-weight: 600; }
.hero h1 .line { display: block; }
@media (max-width: 760px) { .hero h1 .line { display: inline; } }
.hero-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px 72px; align-items: end; margin-top: 28px; }
.hero-sub { font-size: clamp(1.125rem, 1.7vw, 1.3125rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.hero-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hero-actions .row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.hero-meta { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .hero-body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- product shots ---------- */
.shot {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shot-shadow); overflow: hidden; color: var(--ink); font-size: 12.5px; line-height: 1.45;
}
.hero .shot { margin-top: clamp(48px, 7vw, 80px); }
.shot code { font-size: 1em; }
.sev { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font); font-size: 10px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.sev.crit { background: var(--red-tint); color: var(--red-ink); }
.sev.high { background: var(--orange-tint); color: var(--orange-ink); }
.sev.med { background: var(--amber-tint); color: var(--amber-ink); }
.sev.low { background: var(--blue-tint); color: var(--blue-text); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag.red { background: var(--red-tint); color: var(--red-ink); }
.tag.orange { background: var(--orange-tint); color: var(--orange-ink); }
.tag.amber { background: var(--amber-tint); color: var(--amber-ink); }
.tag.green { background: var(--green-tint); color: var(--green-ink); }
.tag.gray { background: var(--field); color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.mini-gloss { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; color: #fff; background: var(--gloss); box-shadow: var(--gloss-shadow); font-weight: 600; font-size: 12px; text-shadow: 0 1px 1px rgba(0, 40, 120, 0.35); white-space: nowrap; }
.mini-line { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--line-strong); font-weight: 600; font-size: 12px; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.k { color: var(--code-kw); } .s { color: var(--code-str); } .f { color: var(--code-fn); } .c { color: var(--code-com); font-style: italic; } .n { color: var(--code-num); }

/* app top bar */
.ui-top { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ui-top img { width: 20px; height: 20px; }
.ui-top .proj { font-weight: 650; font-size: 13px; letter-spacing: -0.01em; }
.ui-top .sep { color: var(--faint); }
.branch { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface); }
.branch .ic { width: 12px; height: 12px; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: min(320px, 34%); padding: 5px 10px; border-radius: 8px; background: var(--field); color: var(--muted); font-size: 12px; }
.search .ic { width: 14px; height: 14px; }
.search kbd { margin-left: auto; font-size: 10.5px; color: var(--faint); font-family: var(--font); }

/* code review screen */
.ui { display: grid; grid-template-columns: 164px minmax(0, 1fr); height: 500px; }
.ui-stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.v-review { display: grid; grid-template-columns: 180px minmax(0, 1fr) 296px; height: 100%; }
.ui-nav { background: var(--surface-3); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 1px; }
.ui-nav .lbl, .pane-lbl { font-size: 10px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 4px; }
.ui-nav .item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); font-weight: 550; }
.ui-nav .item .ic { width: 15px; height: 15px; color: var(--muted); }
.ui-nav .item.on { background: var(--blue-wash); color: var(--blue-text); font-weight: 650; }
.ui-nav .item.on .ic { color: var(--blue); }
.ui-nav .item .count { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ui-nav .cov { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
.ring { --p: 0.64; width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--blue) calc(var(--p) * 1turn), var(--line-strong) 0); }
.ring::after { content: ""; width: 25px; height: 25px; border-radius: 50%; background: var(--surface-3); }
.ui-nav .cov b { display: block; font-size: 11.5px; }
.ui-nav .cov span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ui-files { border-right: 1px solid var(--line); padding: 8px 6px; background: var(--surface); }
.ui-files .head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 8px 6px; }
.ui-files .head span:last-child { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree li { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.tree li.dir { color: var(--muted); font-family: var(--font); font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.tree li.in { padding-left: 20px; }
.tree li.on { background: var(--blue-wash); color: var(--blue-text); font-weight: 600; }
.tree .st { margin-left: auto; display: inline-flex; }
.tree .chk { width: 12px; height: 12px; color: var(--green); stroke-width: 2.4; }

.ui-code { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.ui-code .head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.ui-code .head code { font-weight: 600; color: var(--ink); font-size: 12px; }
.ui-code .head .lang { color: var(--muted); font-size: 11px; }
.ui-code .head .mini-line { margin-left: auto; }
.lines { padding: 8px 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.75; overflow-x: auto; }
.ln { display: grid; grid-template-columns: 42px 14px max-content; padding-right: 16px; white-space: pre; }
.ln i { font-style: normal; text-align: right; color: var(--faint); padding-right: 6px; font-variant-numeric: tabular-nums; }
.ln b { font-weight: inherit; }
.ln .mark { width: 6px; height: 6px; border-radius: 50%; align-self: center; justify-self: center; }
.ln.hit { background: var(--red-tint); }
.ln.hit .mark { background: var(--red); }
.ln.warn { background: var(--orange-tint); }
.ln.warn .mark { background: var(--orange); }
.ln.hit i, .ln.warn i { color: var(--ink-3); }

.ui-detail { min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.ui-detail h4 { font-size: 14px; letter-spacing: -0.015em; line-height: 1.3; margin-top: 8px; }
.ui-detail .where { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; }
.ui-detail .sec-lbl { font-size: 10px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.sib { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sib div { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 10px; font-family: var(--mono); font-size: 11px; }
.sib div + div { border-top: 1px solid var(--line-soft); }
.sib b { font-weight: 700; color: var(--ink-3); }
.sib span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sib .ok { color: var(--green-ink); }
.sib .no { color: var(--red-ink); font-weight: 700; }
.sib .flag { background: var(--red-tint); }
.ui-detail .fix { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--field); border-radius: 8px; padding: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; }
.seg span { padding: 5px 4px; border-radius: 6px; }
.seg .on { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 2px rgba(11, 26, 51, 0.12); }
.ui-detail .acts { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 520px) { .ui-top .branch, .ui-top .sep { display: none; } .ui-top .mini-gloss { margin-left: auto; } }

/* ---------- chapters ---------- */
.chapter { padding-top: clamp(96px, 12vw, 160px); }
.chapter h2, .h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.06; letter-spacing: -0.032em; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 72px; align-items: start; }
.split p, .prose { font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.split p + p { margin-top: 14px; }
.prose + .prose { margin-top: 16px; }
.split .link { margin-top: 16px; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.chapter .shot, .chapter .figure-row { margin-top: clamp(40px, 5vw, 64px); }
.caption { font-size: 0.875rem; color: var(--muted); margin-top: 16px; max-width: 60ch; }

/* frameworks line */
.frameworks { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 22px; margin-top: clamp(56px, 7vw, 88px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 32px; font-size: 0.9375rem; }
.frameworks dt { color: var(--muted); font-size: 0.8125rem; font-weight: 600; padding-top: 2px; }
.frameworks dd { color: var(--ink-2); }
@media (max-width: 640px) { .frameworks { grid-template-columns: minmax(0, 1fr); } .frameworks dd + dt { margin-top: 10px; } }

/* attack surface table */
.surface-top { display: flex; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.surface-top .tab { padding: 12px 2px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.surface-top .tab.on { color: var(--ink); border-bottom-color: var(--blue); }
.surface-top .tab span { color: var(--faint); font-weight: 500; margin-left: 4px; font-variant-numeric: tabular-nums; }
.surface-top .chips { margin-left: auto; display: flex; gap: 6px; }
.table-scroll { overflow-x: auto; }
.routes { width: 100%; border-collapse: collapse; min-width: 720px; }
.routes th { text-align: left; font-size: 10px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); padding: 10px 14px 6px; white-space: nowrap; }
.routes td { padding: 9px 14px; border-top: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.routes td.m { font-family: var(--mono); font-weight: 700; color: var(--ink-3); font-size: 11.5px; width: 70px; }
.routes td.p { font-family: var(--mono); font-size: 12px; }
.routes td.h { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.routes .auth { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; }
.routes .auth .dot { background: var(--green); }
.routes .auth.none .dot { background: var(--red); }
.routes .auth.weak .dot { background: var(--orange); }
.routes .auth.pub .dot { background: var(--faint); }
.routes .auth.hook .dot { background: var(--amber); }
.routes .auth.none { color: var(--red-ink); font-weight: 700; }
.routes tr.flagged td { background: color-mix(in srgb, var(--red-tint) 55%, transparent); }
.routes td.fl { display: flex; gap: 6px; }

/* data flow */
.figure-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .figure-row { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--card-shadow); overflow: hidden; min-width: 0; font-size: 12.5px; line-height: 1.45; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-head code { font-weight: 600; font-size: 12px; }
.panel-head .right { margin-left: auto; color: var(--muted); font-size: 11.5px; display: inline-flex; gap: 6px; align-items: center; }
.flow { padding: 6px 0 10px; }
.step { display: grid; grid-template-columns: 96px 28px minmax(0, 1fr); padding: 10px 14px 10px 0; }
.step .lbl { text-align: right; padding-right: 4px; padding-top: 1px; line-height: 1.25; font-size: 10px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.step .node { position: relative; display: flex; justify-content: center; padding-top: 4px; }
.step .node::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blue); background: var(--surface); position: relative; z-index: 1; }
.step:not(:last-child) .node::after { content: ""; position: absolute; top: 15px; bottom: -24px; left: 50%; width: 2px; margin-left: -1px; background: var(--blue-soft); }
.step.sink .node::before { border-color: var(--red); background: var(--red); }
.step.sink .lbl { color: var(--red-ink); }
.step .body { min-width: 0; }
.step .loc { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.step pre { font-size: 12px; line-height: 1.5; margin-top: 3px; overflow-x: auto; white-space: pre; color: var(--ink); }
.step .hl { background: var(--code-hl); border-radius: 4px; box-shadow: 0 0 0 2px var(--code-hl); }
.step.sink .hl { background: var(--red-tint); box-shadow: 0 0 0 2px var(--red-tint); }
.note-list { padding: 4px 14px 14px; display: grid; gap: 10px; }
.note-list div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; font-size: 12.5px; }
.note-list dt { color: var(--muted); }
.panel .body-pad { padding: 14px; display: grid; gap: 12px; }
.panel .fix-text { color: var(--ink-2); line-height: 1.55; }
.panel pre.snippet { font-size: 11.5px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; color: var(--ink-2); }

/* agent loop */
.loop { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1040px) { .loop { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .loop > :first-child { grid-column: 1 / -1; } }
@media (max-width: 680px) { .loop { grid-template-columns: minmax(0, 1fr); } }
.loop figcaption { padding: 0 2px; margin-top: 12px; font-size: 0.875rem; color: var(--muted); }
.loop figcaption b { color: var(--ink); font-weight: 600; }
.md { padding: 14px; font-size: 11.5px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.md .h { color: var(--ink); font-weight: 700; }
.md .h3 { color: var(--blue-text); font-weight: 700; }
.md .dim { color: var(--faint); }
.toolnames { display: flex; flex-wrap: wrap; gap: 6px; }
.toolnames code { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--field); color: var(--ink-2); }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tally div { padding: 9px 11px; font-size: 11px; color: var(--muted); font-weight: 600; }
.tally div + div { border-left: 1px solid var(--line); }
.tally b { display: block; font-size: 20px; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; }
.tally .fixed b { color: var(--green-ink); }
.tally .open b { color: var(--orange-ink); }
.openitem { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.openitem b { font-weight: 600; min-width: 0; }
.check-head h4 { font-size: 14px; letter-spacing: -0.015em; }
.check-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* checks spec */
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 56px; margin-top: clamp(48px, 6vw, 72px); }
.checks h3 { font-size: 1.0625rem; letter-spacing: -0.015em; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.checks ul { margin-top: 12px; display: grid; gap: 7px; }
.checks li { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.45; }
.checks li code { color: var(--ink-3); font-size: 0.86em; }
@media (max-width: 960px) { .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .checks { grid-template-columns: minmax(0, 1fr); } }
.plus { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }
.plus b { color: var(--ink); font-weight: 600; }

/* more features */
.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 56px; margin-top: clamp(40px, 5vw, 56px); }
.more dt { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.more dd { color: var(--muted); font-size: 0.96875rem; margin-top: 6px; line-height: 1.55; }
@media (max-width: 960px) { .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .more { grid-template-columns: minmax(0, 1fr); } }

/* ---------- dark security chapter ---------- */
.secure { background: var(--inv-bg); color: var(--inv-ink); border-block: 1px solid var(--inv-edge); margin-top: clamp(96px, 12vw, 160px); padding-bottom: clamp(96px, 12vw, 160px); }
.secure h2 { color: var(--inv-ink); }
.secure .split p { color: var(--inv-muted); }
.secure .link { color: var(--inv-accent); }
.secure-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 48px 72px; margin-top: clamp(48px, 6vw, 72px); align-items: start; }
@media (max-width: 960px) { .secure-grid { grid-template-columns: minmax(0, 1fr); } }
.secure h3 { font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--inv-muted); font-family: var(--font); }
.never { margin-top: 16px; display: grid; }
.never li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--inv-line); }
.never li:last-child { border-bottom: 1px solid var(--inv-line); }
.never .ic { width: 18px; height: 18px; color: var(--inv-accent); margin-top: 3px; stroke-width: 2; }
.never b { display: block; font-weight: 600; color: var(--inv-ink); }
.never span { color: var(--inv-muted); font-size: 0.9375rem; }
.never code, .net code { color: var(--inv-ink); font-size: 0.86em; }
.net { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.9375rem; }
.net th { text-align: left; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--inv-muted); padding: 0 16px 10px 0; }
.net td { padding: 14px 16px 14px 0; border-top: 1px solid var(--inv-line); vertical-align: top; color: var(--inv-muted); }
.net td:first-child { color: var(--inv-ink); font-weight: 600; }
.net tr:last-child td { border-bottom: 1px solid var(--inv-line); }
.net-note { margin-top: 16px; font-size: 0.875rem; color: var(--inv-muted); }

/* ---------- download ---------- */
.dl-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 22px; align-items: center; }
.dl-head img { width: 72px; height: 72px; grid-row: span 2; }
.dl-head p { color: var(--muted); font-size: 1.0625rem; }
.dl-list { margin-top: 40px; border-top: 1px solid var(--line); }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px 32px; align-items: center; padding-block: 22px; border-bottom: 1px solid var(--line); }
.dl-os b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.dl-os .you { display: none; margin-left: 10px; font-size: 0.75rem; font-weight: 600; color: var(--blue-text); vertical-align: 3px; }
.dl-row.is-yours .you { display: inline; }
.dl-os .req { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
.dl-file { font-size: 0.9375rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dl-file .alt { display: block; margin-top: 2px; font-size: 0.875rem; }
.dl-file .soon { color: var(--muted); }
.dl-act .soon-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 0.9375rem; font-weight: 600; white-space: nowrap; }
.dl-sum { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.dl-sum code { color: var(--ink-3); font-size: 0.75rem; overflow-wrap: anywhere; min-width: 0; }
.dl-foot { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 700px) {
  .dl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dl-file { grid-column: 1 / -1; grid-row: 2; }
}
.mobile-note { margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--blue-tint); color: var(--ink-2); font-size: 0.9375rem; }

/* ---------- faq ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 24px 72px; align-items: start; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { width: 18px; height: 18px; color: var(--muted); transition: transform 200ms ease; }
.faq details[open] summary .ic { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding-bottom: 22px; max-width: 62ch; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 48px 40px; margin-top: clamp(96px, 12vw, 160px); background: var(--bg-soft); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.foot-grid .about p { color: var(--muted); font-size: 0.9375rem; margin-top: 12px; max-width: 34ch; }
.foot-grid h4 { font-family: var(--font); font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.foot-grid ul { margin-top: 12px; display: grid; gap: 8px; font-size: 0.9375rem; }
.foot-grid ul a { color: var(--muted); }
.foot-grid ul a:hover { color: var(--ink); }
@media (max-width: 700px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-grid .about { grid-column: 1 / -1; } }
.foot-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 0.8125rem; color: var(--muted); }
.theme-switch { margin: 0; min-width: 0; display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; padding: 2px; background: var(--surface); }
.theme-switch label { position: relative; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-size: 0.8125rem; color: var(--muted); }
.theme-switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.theme-switch label:has(input:checked) { background: var(--field); color: var(--ink); font-weight: 600; }
.theme-switch label:has(input:focus-visible) { outline: 3px solid var(--blue-soft); }

/* ---------- document pages (security, privacy) ---------- */
.doc-hero { padding-top: clamp(56px, 8vw, 96px); padding-bottom: 8px; }
.doc-hero .crumb { font-size: 0.875rem; color: var(--muted); }
.doc-hero .crumb a:hover { color: var(--ink); }
.doc-hero h1 { font-size: clamp(2.4rem, 5.2vw, 3.75rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; margin-top: 14px; }
.doc-hero p { font-size: 1.1875rem; color: var(--ink-2); max-width: 38em; margin-top: 18px; }
.doc-hero .updated { font-size: 0.875rem; color: var(--muted); margin-top: 14px; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px 72px; margin-top: clamp(40px, 6vw, 64px); align-items: start; }
.toc { position: sticky; top: 84px; font-size: 0.875rem; }
.toc p { font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.toc ol { display: grid; gap: 7px; border-left: 1px solid var(--line); }
.toc a { display: block; padding-left: 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); }
.toc a:hover { color: var(--ink); border-left-color: var(--blue); }
@media (max-width: 900px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { position: static; } }
.article { max-width: 720px; min-width: 0; }
.article section + section { margin-top: 64px; }
.article h2 { font-size: 1.75rem; letter-spacing: -0.025em; line-height: 1.2; font-weight: 600; }
.article h3 { font-size: 1.125rem; letter-spacing: -0.015em; margin-top: 28px; }
.article p, .article li { color: var(--ink-2); }
.article p { margin-top: 14px; }
.article ul.bullets { margin-top: 14px; display: grid; gap: 10px; }
.article ul.bullets li { position: relative; padding-left: 20px; }
.article ul.bullets li::before { content: ""; position: absolute; left: 4px; top: 0.7em; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.article code { color: var(--ink); background: var(--field); padding: 1px 5px; border-radius: 5px; font-size: 0.84em; }
.article pre { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 0.8125rem; line-height: 1.6; overflow-x: auto; color: var(--ink-2); }
.article pre code { background: none; padding: 0; color: inherit; }
.article a:not(.btn) { color: var(--blue-text); }
.article a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.article .table-scroll { margin-top: 18px; }
.article table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; min-width: 560px; }
.article th { text-align: left; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0 16px 10px 0; }
.article td { padding: 12px 16px 12px 0; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.article td:first-child { color: var(--ink); font-weight: 600; }
.article tr:last-child td { border-bottom: 1px solid var(--line); }
.diagram { margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: 20px; overflow-x: auto; }
.diagram svg { display: block; min-width: 620px; width: 100%; height: auto; }
.callout { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--blue-tint); color: var(--ink-2); font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: var(--ink-2); --line: var(--line-strong); }
}

/* ---------- architecture diagram ---------- */
.dg-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.2; }
.dg-key { fill: var(--blue-tint); stroke: var(--blue); stroke-width: 1.2; }
.dg-t { fill: var(--ink); font-family: var(--font); font-size: 14.5px; font-weight: 650; }
.dg-s { fill: var(--muted); font-family: var(--font); font-size: 11.5px; }
.dg-m { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.dg-l { fill: var(--ink-2); font-family: var(--font); font-size: 11.5px; font-weight: 600; }
.dg-line { stroke: var(--blue); stroke-width: 1.5; fill: none; }
.dg-arrow { fill: var(--blue); }
.dg-frame { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 4 4; }

/* =====================================================================
   Interactive app preview (hero)
   ===================================================================== */
:where(.shot, .demo-panel, .flow-demo) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
:where(.shot, .demo-panel, .flow-demo) button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-radius: 6px; }
.ui-nav .item { width: 100%; transition: background 140ms ease-out, color 140ms ease-out; }
.ui-nav .item:hover:not(.on) { background: var(--blue-wash); }
.ui-nav .cov b, .ui-nav .cov span { transition: color 200ms; }
.ring { transition: --p 600ms; }
@property --p { syntax: "<number>"; inherits: false; initial-value: 0.64; }
button.mini-gloss { color: #fff; }
button.mini-gloss:active, button.mini-line:active, .ui-nav .item:active, .tree button:active, .frow:active { transform: scale(0.98); }
.mini-gloss.busy { background: var(--field); color: var(--muted); box-shadow: none; text-shadow: none; }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin 700ms linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* view switching */
.view { height: 100%; animation: view-in 260ms cubic-bezier(.2, .8, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* scan bar */
.scanbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 11.5px; }
.scanbar[hidden] { display: none !important; }
.scan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--field); color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.scan-chip .res { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.scan-chip.done { background: var(--green-tint); color: var(--green-ink); }
.scan-chip .ok-ic { width: 12px; height: 12px; stroke-width: 2.6; }
.scan-msg { margin-left: auto; color: var(--muted); font-weight: 500; }

/* tree */
.tree button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 8px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.tree button:hover { background: var(--blue-wash); }
.tree li.file { padding: 0; }
.tree li.file.in button { padding-left: 20px; }
.tree li.file.on button { background: var(--blue-wash); color: var(--blue-text); font-weight: 600; }
.tree li.file.static { padding: 3px 8px; }
.tree li.file.static.in { padding-left: 20px; }

/* code pane */
.ui-code .lines { flex: 1; overflow: auto; scroll-behavior: smooth; }
.ln { transition: background 300ms; }
.ln.hl { background: var(--code-hl); }
.ln.hit { background: var(--red-tint); }
.ln.warn { background: var(--orange-tint); }
.ln .redact { color: var(--faint); letter-spacing: 1px; }
.ui-detail { overflow: auto; }
.ui-detail .empty { color: var(--muted); font-size: 12.5px; }
.seg button { padding: 5px 4px; border-radius: 6px; text-align: center; transition: background 160ms, color 160ms, box-shadow 160ms; }
.seg button.on { background: var(--surface); color: var(--green-ink); box-shadow: 0 1px 2px rgba(11, 26, 51, 0.12); }
.seg button.on[data-triage="fp"] { color: var(--ink-2); }
.seg button.on[data-triage="review"] { color: var(--blue-text); }
.mini-trace { display: grid; gap: 2px; font-size: 11px; }
.mini-trace div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 8px; border-radius: 7px; background: var(--surface-2); }
.mini-trace span { font-size: 9.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.mini-trace code { font-size: 10.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-trace .sink span { color: var(--red-ink); }

/* findings view */
.v-findings { display: flex; flex-direction: column; height: 100%; }
.v-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.v-head h4 { font-size: 14px; letter-spacing: -0.01em; }
.v-head .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.v-head .chips { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.v-head .chips button { padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.v-head .chips button.on { color: var(--blue-text); background: var(--blue-tint); border-color: transparent; }
.frows { overflow: auto; }
.frow { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 92px; gap: 14px; align-items: center; width: 100%; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); transition: background 160ms; }
.frow:hover, .frow.pre { background: var(--code-hl); }
.frow .sev { width: 74px; }
.frow .what { min-width: 0; }
.frow .what b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .what code { font-size: 11px; color: var(--muted); }
.frow .src { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.state { font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); }
.state.confirmed { color: var(--green-ink); }
.state.confirmed::before { background: var(--green); border-color: var(--green); }
.state.fp { color: var(--faint); text-decoration: line-through; }
.stagger > * { animation: row-in 360ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }

/* overview view */
.v-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: 100%; overflow: auto; }
.ov { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ov:nth-child(odd) { border-right: 1px solid var(--line); }
.ov h5 { margin: 0; font-size: 10px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.ov .big { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov .big small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.sevbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; }
.sevbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.ov ul { display: grid; gap: 6px; font-size: 12px; color: var(--ink-2); }
.ov ul li { display: flex; justify-content: space-between; gap: 10px; }
.ov ul li b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ov ul li .bad { color: var(--red-ink); }
.ov .scn { display: flex; align-items: center; gap: 8px; }
.ov .scn .ok-ic { width: 13px; height: 13px; color: var(--green); stroke-width: 2.6; }
.ov .scn span:last-child { margin-left: auto; color: var(--muted); }
.ov .ringbig { --p: 0.64; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--blue) calc(var(--p) * 1turn), var(--line-strong) 0); transition: --p 600ms; }
.ov .ringbig::after { content: ""; width: 50px; height: 50px; border-radius: 50%; background: var(--surface); }
.ov .covrow { display: flex; align-items: center; gap: 14px; }

/* surface view inside the app */
.v-surface { display: flex; flex-direction: column; height: 100%; }
.v-surface .table-scroll { overflow: auto; flex: 1; }
.v-surface .routes { min-width: 560px; }
.routes tr.click { cursor: pointer; }
.routes tr.click:hover td { background: var(--code-hl); }

/* toast */
.toast { position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 5; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 9px; box-shadow: var(--card-shadow); transition: opacity 200ms, transform 200ms; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* hint under the preview */
.demo-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 0.8125rem; color: var(--muted); }
.demo-hint button { font: inherit; color: var(--blue-text); background: none; border: 0; padding: 4px 0; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.demo-hint button .ic { width: 15px; height: 15px; stroke-width: 2; }
.demo-hint .live { display: inline-flex; align-items: center; gap: 8px; }
.demo-hint .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }

@media (max-width: 1120px) { .v-review { grid-template-columns: minmax(0, 1fr) 280px; } .v-review .ui-files { display: none; } }
@media (max-width: 860px) {
  .ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 620px; }
  .ui-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; gap: 4px; }
  .ui-nav .lbl, .ui-nav .cov { display: none; }
  .ui-nav .item { width: auto; white-space: nowrap; }
  .v-review { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .v-review .ui-code { border-right: 0; border-bottom: 1px solid var(--line); }
  .v-review .ui-detail { max-height: 300px; }
  .search { display: none; }
  .v-overview { grid-template-columns: minmax(0, 1fr); }
  .ov:nth-child(odd) { border-right: 0; }
  .frow { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; }
  .frow .sev { width: auto; }
  .frow .what b { white-space: normal; }
  .frow .src, .frow .state { display: none; }
  .scan-msg { margin-left: 0; width: 100%; }
}

/* =====================================================================
   Chapter demos
   ===================================================================== */
.lede-stack { max-width: 720px; }
.lede-stack p { margin-top: 18px; }
.demo-panel { margin-top: clamp(40px, 5vw, 60px); }

/* attack surface panel */
.surface-top .tab { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; font-size: 13px; }
.surface-top .tab:hover:not(.on) { color: var(--ink-2); }
.surface-top .toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.switch { width: 30px; height: 18px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background 160ms; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 200ms cubic-bezier(.3, .7, .2, 1); }
[aria-pressed="true"] .switch { background: var(--blue); }
[aria-pressed="true"] .switch::after { transform: translateX(12px); }
.surface-demo .routes { font-size: 12.5px; }
.routes tr.explain td { white-space: normal; background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.5; padding: 12px 14px 14px; animation: row-in 260ms cubic-bezier(.2, .8, .2, 1); }
.routes tr.explain b { color: var(--ink); }
.routes .chev { width: 14px; height: 14px; color: var(--faint); transition: transform 200ms; vertical-align: -2px; }
.routes tr.open .chev { transform: rotate(90deg); }
.routes td.fl { align-items: center; }
.reach { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.reach::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.reach.yes { color: var(--red-ink); }
.reach.yes::before { background: var(--red); }
.surface-foot { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* data flow chapter */
.flow-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px 72px; align-items: start; }
.flow-grid .sticky { position: sticky; top: 110px; }
@media (max-width: 960px) { .flow-grid { grid-template-columns: minmax(0, 1fr); } .flow-grid .sticky { position: static; } }
.sinks-list { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.sinks-list span { font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.flow-demo .panel-head .modes { margin-left: auto; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--field); border-radius: 8px; padding: 2px; font-size: 11.5px; font-weight: 600; }
.flow-demo .modes button { padding: 4px 10px; border-radius: 6px; color: var(--muted); text-align: center; white-space: nowrap; transition: background 160ms, color 160ms; }
.flow-demo .modes button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 26, 51, 0.12); }
.flow-demo .pane { animation: view-in 260ms cubic-bezier(.2, .8, .2, 1); }
.flow .step .node::before, .flow .step .lbl, .flow .step .body { transition: opacity 300ms, transform 300ms, border-color 300ms, background 300ms; }
.flow .step:not(:last-child) .node::after { transform-origin: top; transition: transform 500ms cubic-bezier(.3, .7, .2, 1); }
.flow.arming .step { opacity: 0.35; }
.flow.arming .step .node::after { transform: scaleY(0); }
.flow.arming .step.lit { opacity: 1; }
.flow.arming .step.lit .node::after { transform: scaleY(1); }
.flow .step { transition: opacity 360ms; }
.flow-verdict { display: flex; align-items: center; gap: 10px; margin: 4px 14px 14px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600; }
.flow-verdict.bad { background: var(--red-tint); color: var(--red-ink); }
.flow-verdict.good { background: var(--green-tint); color: var(--green-ink); }
.flow-verdict .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.diff { font-family: var(--mono); font-size: 12px; line-height: 1.75; padding: 8px 0; overflow-x: auto; }
.diff div { display: grid; grid-template-columns: 40px 18px max-content; padding-right: 16px; white-space: pre; }
.diff i { font-style: normal; text-align: right; color: var(--faint); padding-right: 6px; }
.diff .del { background: var(--red-tint); }
.diff .add { background: var(--green-tint); }
.diff .del em, .diff .add em { font-style: normal; text-align: center; }
.diff .del em { color: var(--red-ink); }
.diff .add em { color: var(--green-ink); }
.diff .del b { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); font-weight: inherit; }
.diff b { font-weight: inherit; }

/* agent stepper */
.stepper { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px 56px; align-items: start; margin-top: clamp(40px, 5vw, 60px); }
@media (max-width: 960px) { .stepper { grid-template-columns: minmax(0, 1fr); } }
.stepper .tabs { display: grid; gap: 4px; }
.stepper .tab { display: grid; gap: 4px; width: 100%; padding: 16px 18px 18px; border-radius: 14px; text-align: left; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; position: relative; transition: background 200ms; }
.stepper .tab:hover { background: var(--bg-soft); }
.stepper .tab.on { background: var(--bg-soft); }
.stepper .tab b { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; color: var(--muted); transition: color 200ms; }
.stepper .tab.on b { color: var(--ink); }
.stepper .tab span { font-size: 0.9375rem; color: var(--muted); line-height: 1.5; display: none; }
.stepper .tab.on span { display: block; }
.stepper .bar { position: absolute; left: 18px; right: 18px; bottom: 8px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; opacity: 0; }
.stepper .tab.on .bar { opacity: 1; }
.stepper .bar i { display: block; height: 100%; width: 0; background: var(--blue); }
.stepper .tab.on.run .bar i { width: 100%; transition: width var(--dur, 6s) linear; }
.stepper .panes { min-width: 0; }
.stepper .pane { animation: view-in 300ms cubic-bezier(.2, .8, .2, 1); }
.log { padding: 10px 0; font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.log div { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; padding: 5px 14px; }
.log em { font-style: normal; color: var(--blue); }
.log .edit em { color: var(--green); }
.log span:last-child { color: var(--muted); }
.pane.play .log div, .pane.play .md-line { animation: row-in 320ms cubic-bezier(.2, .8, .2, 1) both; }
.md-line { display: block; }

/* checks search */
.checks-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: clamp(32px, 4vw, 48px); }
.searchbox { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 360px; padding: 0 12px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.searchbox:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.9375rem; color: var(--ink); }
.searchbox .ic { width: 16px; height: 16px; }
.catchips { display: flex; flex-wrap: wrap; gap: 6px; }
.catchips button { font: inherit; font-size: 0.8125rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); cursor: pointer; transition: background 160ms, color 160ms, border-color 160ms; }
.catchips button:hover { border-color: var(--line-strong); }
.catchips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.checks { margin-top: 36px; }
.checks > div[hidden] { display: none; }
.checks li mark { background: var(--blue-tint); color: var(--blue-text); border-radius: 3px; padding: 0 1px; }
.checks-empty { margin-top: 28px; color: var(--muted); }

/* =====================================================================
   Page motion
   ===================================================================== */
.site-nav { transition: border-color 200ms, background 200ms; }
.site-nav:not(.scrolled) { border-bottom-color: transparent; }
.hero .shot { animation: rise 900ms cubic-bezier(.2, .8, .2, 1) both; transform-origin: 50% 0; }
@keyframes rise { from { transform: translateY(28px) scale(0.985); } to { transform: none; } }
@supports (animation-timeline: view()) {
  .hero .stage { perspective: 1600px; }
  .hero .shot { animation: tilt linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  @keyframes tilt { from { transform: rotateX(14deg) scale(0.96); } to { transform: none; } }
}
.reveal { transition: transform 700ms cubic-bezier(.2, .8, .2, 1); }
.reveal.below { transform: translateY(36px); }
.faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 260ms cubic-bezier(.2, .8, .2, 1), content-visibility 260ms allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
:root { interpolate-size: allow-keywords; }

@media (prefers-reduced-motion: reduce) {
  .view, .stagger > *, .pane, .stepper .pane, .routes tr.explain td, .hero .shot, .flow-demo .pane { animation: none !important; }
  .reveal, .reveal.below { transform: none !important; transition: none !important; }
  .spin { animation: none; }
  .flow.arming .step { opacity: 1; }
  .flow.arming .step .node::after { transform: none; }
}
.ui-detail button.openitem { width: 100%; margin-bottom: 6px; }
.mini-line .chk { width: 12px; height: 12px; color: var(--green); stroke-width: 2.4; }
.tree li.file.on { background: none; }
.md { white-space: pre-wrap; }
.demo-hint button { white-space: nowrap; }
@media (max-width: 600px) {
  .surface-top { flex-wrap: wrap; row-gap: 0; }
  .surface-top .toggle { margin: 2px 0 10px; }
}
