:root {
  --ink: #0d1017;
  --ink-raised: #151a23;
  --ink-raised-2: #1b2230;
  --line: #232b3a;
  --line-soft: #1a2130;
  --paper: #e8ecf3;
  --paper-dim: #97a1b2;
  --paper-faint: #6b7688;
  --accent: #8b7dff;
  --accent-ink: #0d1017;
  --radius: 4px;
  --wrap: 1080px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius); z-index: 10; }

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

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 88%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--paper); }
.brand:hover { text-decoration: none; }
.brand-mark { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand-tag { font-family: var(--mono); font-size: 11px; color: var(--paper-faint); text-transform: lowercase; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--paper-dim); font-size: 14px; font-family: var(--mono); }
.nav a:hover { color: var(--paper); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding-block: 56px 32px; max-width: 780px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; }
.hero-title .hl { color: var(--accent); }
.hero-lede { font-size: 17px; color: var(--paper-dim); margin: 0; max-width: 62ch; }
.hero-lede em { color: var(--paper); font-style: normal; border-bottom: 1px solid var(--accent); }

/* ---------- Filters ---------- */
.filters { border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-raised); padding: 16px; margin-bottom: 28px; }
.filter-search { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
#q { flex: 1; background: var(--ink); border: 1px solid var(--line); color: var(--paper); font-family: var(--mono); font-size: 14px; padding: 10px 12px; border-radius: var(--radius); }
#q::placeholder { color: var(--paper-faint); }
.count { font-family: var(--mono); font-size: 12px; color: var(--paper-faint); white-space: nowrap; }
.filter-row { display: flex; align-items: flex-start; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.filter-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--paper-faint); padding-top: 6px; min-width: 74px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 12px; color: var(--paper-dim); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.chip:hover { color: var(--paper); border-color: var(--paper-faint); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--chip, var(--accent)); border-color: transparent; font-weight: 500; }
.chip-cap[aria-pressed="true"] { background: var(--accent); }
.selects { flex-wrap: wrap; align-items: center; }
.selects label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--paper-faint); display: flex; flex-direction: column; gap: 4px; }
.selects select { background: var(--ink); border: 1px solid var(--line); color: var(--paper); font-family: var(--mono); font-size: 13px; padding: 7px 9px; border-radius: var(--radius); text-transform: none; letter-spacing: normal; }
.reset { align-self: flex-end; background: transparent; border: 1px solid var(--line); color: var(--paper-dim); font-family: var(--mono); font-size: 12px; padding: 8px 14px; border-radius: var(--radius); cursor: pointer; }
.reset:hover { color: var(--paper); border-color: var(--paper-faint); }

/* ---------- Grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-raised); padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .14s, transform .14s, background .14s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--ink-raised-2); }
/* Stretched link: the whole card is the click target, title stays the semantic anchor. */
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.card:focus-within { border-color: var(--accent); }
.card-top { display: flex; align-items: center; gap: 10px; }
.sev { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--sev); border: 1px solid color-mix(in srgb, var(--sev) 50%, transparent); border-radius: 3px; padding: 2px 7px; }
.cat { font-family: var(--mono); font-size: 11px; color: var(--paper-faint); }
.card-title { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.card-title a { color: var(--paper); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-summary { margin: 0; font-size: 14px; color: var(--paper-dim); }
.card-tell { margin: 0; font-size: 13px; color: var(--paper-faint); font-style: italic; }
.tell-mark { color: var(--accent); font-style: normal; font-weight: 700; }

/* capability chips (static, display) */
.caps { display: flex; flex-wrap: wrap; gap: 5px; }
.cap { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--paper-dim); background: var(--ink-raised-2); border-radius: 3px; padding: 3px 7px; }

/* classification stamp - the signature element */
.stamp { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.stamp-compact { padding-top: 8px; border-top: 1px dashed var(--line); }
.code { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.02em; padding: 2px 6px; border-radius: 3px; border: 1px solid transparent; white-space: nowrap; }
.code-llm    { color: #b7adff; background: color-mix(in srgb, #8b7dff 16%, transparent); border-color: color-mix(in srgb, #8b7dff 34%, transparent); }
.code-asi    { color: #7fe3d2; background: color-mix(in srgb, #2dd4bf 14%, transparent); border-color: color-mix(in srgb, #2dd4bf 30%, transparent); }
.code-threat { color: #f4c56b; background: color-mix(in srgb, #f2b02e 14%, transparent); border-color: color-mix(in srgb, #f2b02e 30%, transparent); }
.code-atlas  { color: #8fbaff; background: color-mix(in srgb, #60a5fa 14%, transparent); border-color: color-mix(in srgb, #60a5fa 30%, transparent); }
.code-cwe    { color: #9aa6b8; background: color-mix(in srgb, #94a3b8 14%, transparent); border-color: color-mix(in srgb, #94a3b8 28%, transparent); }

.empty { font-family: var(--mono); font-size: 14px; color: var(--paper-dim); padding: 32px 0; text-align: center; }
.linklike { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Detail ---------- */
.back { display: inline-block; font-family: var(--mono); font-size: 13px; color: var(--paper-dim); margin: 24px 0 20px; }
.detail { max-width: 760px; padding-bottom: 40px; }
.detail-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 8px; }
.detail-badges { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.detail-title { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 10px; }
.detail-summary { font-size: 17px; color: var(--paper-dim); margin: 0 0 14px; }
.detail-head .caps { margin-bottom: 12px; }

.sec { padding-block: 22px; border-bottom: 1px solid var(--line-soft); }
.sec:last-child { border-bottom: none; }
.sec h2 { font-family: var(--display); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--paper); margin: 0 0 14px; }
.sec-note { font-family: var(--body); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: normal; color: var(--paper-faint); margin-left: 8px; }

.sec-tells { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: var(--radius); padding-inline: 16px; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.tells { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tells li { font-size: 15px; color: var(--paper); }

.method { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.method li { padding-left: 4px; }
.method li::marker { font-family: var(--mono); color: var(--accent); font-size: 13px; }

.prose { color: var(--paper-dim); }
.prose p { margin: 0 0 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--ink-raised); padding: 1px 5px; border-radius: 3px; color: var(--paper); }
.prose ol, .prose ul { padding-left: 20px; }
.prose strong { color: var(--paper); }

/* payloads */
.payload { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; background: var(--ink); }
.payload figcaption { font-family: var(--mono); font-size: 12px; color: var(--paper-dim); padding: 8px 12px; background: var(--ink-raised); border-bottom: 1px solid var(--line); }
.payload .lang { color: var(--paper-faint); text-transform: uppercase; font-size: 10px; margin-left: 6px; }
.payload pre { margin: 0; padding: 14px 12px; overflow-x: auto; }
.payload code { font-family: var(--mono); font-size: 13px; color: var(--paper); white-space: pre-wrap; word-break: break-word; }
.copy { position: absolute; top: 6px; right: 6px; font-family: var(--mono); font-size: 11px; color: var(--paper-dim); background: var(--ink-raised-2); border: 1px solid var(--line); border-radius: 3px; padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--paper); border-color: var(--accent); }
.copy.is-copied { color: #7fe3d2; border-color: #2dd4bf; }

.sec-def .defenses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sec-def .defenses li { font-size: 15px; color: var(--paper); padding-left: 22px; position: relative; }
.sec-def .defenses li::before { content: "✓"; position: absolute; left: 0; color: #2dd4bf; font-weight: 700; }

.map-rows { display: flex; flex-direction: column; gap: 10px; }
.map-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start; }
.map-k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--paper-faint); padding-top: 3px; }
.map-v { display: flex; flex-wrap: wrap; gap: 5px; }

.refs { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.rel { font-family: var(--mono); font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; color: var(--paper-dim); }
.rel:hover { border-color: var(--accent); color: var(--paper); text-decoration: none; }

/* ---------- Pages ---------- */
.page { max-width: 760px; padding-bottom: 40px; }
.page-title { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; margin: 0 0 12px; }
.page-lede { font-size: 17px; color: var(--paper-dim); margin: 0 0 20px; }
.page.prose h2 { font-family: var(--display); font-size: 20px; color: var(--paper); margin: 28px 0 10px; }
.page.prose p { margin: 0 0 14px; }

/* ---------- Mappings pivot ---------- */
.pivot { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.pivot-btn { font-family: var(--mono); font-size: 12px; color: var(--paper-dim); background: var(--ink-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 13px; cursor: pointer; }
.pivot-btn.is-active { color: var(--accent-ink); background: var(--accent); border-color: transparent; font-weight: 500; }
.matrix { display: flex; flex-direction: column; gap: 8px; }
.matrix-row { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.matrix-code { display: flex; flex-direction: column; gap: 4px; }
.matrix-label { font-size: 12px; color: var(--paper-faint); }
.matrix-hits { display: flex; flex-wrap: wrap; gap: 6px; }
.matrix-hits a { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; color: var(--paper-dim); }
.matrix-hits a:hover { border-color: var(--accent); color: var(--paper); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding-block: 24px; }
.ethics { font-family: var(--mono); font-size: 13px; color: var(--paper); margin: 0 0 6px; }
.muted { font-family: var(--mono); font-size: 12px; color: var(--paper-faint); margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .filters { position: static; }
  .site-header { position: static; }
  .filter-row { flex-direction: column; gap: 8px; }
  .filter-label { min-width: 0; }
  .map-row, .matrix-row { grid-template-columns: 1fr; gap: 6px; }
}
