/* vulnsearch theme: "operations console" for data, "intelligence bulletin" for reading.
   Loaded after style.css and app.css; overrides look only (no layout logic lives here).
   Fonts: IBM Plex Sans / Mono / Serif, SIL Open Font License 1.1 (public/fonts/OFL.txt). */

@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url("/fonts/ibm-plex-serif-600-normal.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }

/* ---------------------------------------------------------------- tokens: paper (light) */
:root {
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --serif: "Plex Serif", Georgia, "Times New Roman", serif;
  --bg: #f5f3ec; --surface: #fbfaf5; --surface-2: #ece8dd; --border: #d6d0c1; --rule: #16181b;
  --text: #16181b; --muted: #5d6168; --accent: #4a2fb8; --accent-text: #ffffff; --focus: #4a2fb840; --brand-a: #0b7f93;
  --signal: #c8102e; --row-hover: #efebe0;
  --radius: 2px; --shadow: none;
}
/* ---------------------------------------------------------------- tokens: console (dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d12; --surface: #0e131a; --surface-2: #151c26; --border: #222b38; --rule: #c9d2de;
    --text: #e4e8ee; --muted: #8590a2; --accent: #42d3e3; --accent-text: #041015; --focus: #42d3e340; --brand-a: #42d3e3;
    --signal: #ff4d5e; --row-hover: #121924;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d12; --surface: #0e131a; --surface-2: #151c26; --border: #222b38; --rule: #c9d2de;
  --text: #e4e8ee; --muted: #8590a2; --accent: #42d3e3; --accent-text: #041015; --focus: #42d3e340; --brand-a: #42d3e3;
  --signal: #ff4d5e; --row-hover: #121924;
}

body { font-family: var(--sans); font-size: 14.5px; letter-spacing: 0; }
::selection { background: var(--accent); color: var(--accent-text); }

/* ---------------------------------------------------------------- type system */
h1, .hero h1, .page-head h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; max-width: 18ch; }
.page-head h1 { font-size: clamp(24px, 3.2vw, 34px); }
.lede, .page-head p { font-size: 15.5px; }
/* Section labels read like a console header: mono, caps, ruled. */
.panel > h2, .panel-h h2, .section > h2, .panel h2 { font-family: var(--mono); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.mono, .tbl td.num, .tbl .nowrap, .cve-id, .hb-v, .axis, .data-status, .fresh, .note .mono { font-family: var(--mono); }
.tbl { font-size: 13px; }
.tbl th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tbl td a.mono, .cve-id { font-weight: 600; text-decoration: none; }
.tbl td a.mono:hover, .cve-id:hover { text-decoration: underline; }
.note, .hint { font-family: var(--sans); }

/* ---------------------------------------------------------------- masthead (bulletin) */
.masthead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--rule); padding: 18px 0 8px; margin-bottom: 4px; }
.masthead b { color: var(--text); }
.hero { padding: 18px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }

/* ---------------------------------------------------------------- header / nav */
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); }
.main-nav a, .menu-btn { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; border-radius: var(--radius); }
.main-nav a.active, .menu-btn.active { background: transparent; box-shadow: inset 0 -2px 0 var(--accent); color: var(--text); }
.submenu { border-radius: var(--radius); box-shadow: none; border-color: var(--rule); }
.submenu a { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13.5px; }
.nav-toggle, .theme-toggle { border-radius: var(--radius); background: transparent; }
.wordmark { font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; }
.brand img { border-radius: 3px; }

/* ---------------------------------------------------------------- surfaces: ruled, not boxed */
.panel { background: transparent; border: 0; border-top: 2px solid var(--rule); border-radius: 0; padding: 10px 0 0; }
.panel-h { margin-bottom: 8px; }
.tbl-wrap { border-radius: var(--radius); background: var(--surface); }
.tbl th { background: var(--surface); }
.tbl tbody tr:hover { background: var(--row-hover); }
details.panel > summary { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* Stat cards become a ticker strip. */
.cards { gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--border); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.card-stat { background: transparent; border: 0; border-right: 1px solid var(--border); border-radius: 0; padding: 12px 14px; }
a.card-stat:hover { background: var(--row-hover); border-color: var(--border); }
.card-stat .k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.card-stat .v { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.card-stat.crit .v { color: var(--c-CRITICAL); }

/* ---------------------------------------------------------------- controls */
input, select, textarea { border-radius: var(--radius); font-family: var(--sans); background: var(--surface); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 2px var(--focus); }
.search { border-radius: var(--radius); box-shadow: none; background: var(--surface); border-color: var(--rule); }
.btn, .btn-primary, .chip-btn, .pager button, .chip { border-radius: var(--radius); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.btn-primary { font-weight: 600; }
.chip-btn, .chip { text-transform: none; letter-spacing: 0; }
.filters { border-radius: var(--radius); background: var(--surface); }
.tabs button { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tag, .src, .prio { border-radius: var(--radius); font-family: var(--mono); }
.state, .notice, .banner { border-radius: var(--radius); }

/* ---------------------------------------------------------------- severity & KEV */
.sev, .score { border-radius: var(--radius); font-family: var(--mono); }
.sev { font-size: 11.5px; letter-spacing: .02em; }
/* KEV reads as an inked stamp: exploitation is confirmed, it should look different from scores. */
.kev-b, .kev {
  background: transparent !important; color: var(--signal) !important;
  border: 1.5px solid var(--signal); outline: 1px solid var(--signal); outline-offset: 1px;
  border-radius: 1px; font-family: var(--mono); font-weight: 700; font-size: 10.5px; letter-spacing: .12em;
  padding: 0 5px; transform: rotate(-2deg); display: inline-flex; align-items: center; gap: 3px;
}
.kev-b .rw { background: var(--signal); color: var(--bg); border-radius: 0; }
.epss-hi { color: var(--signal); }

/* ---------------------------------------------------------------- charts */
.hb-t { border-radius: 0; height: 6px; }
.hb-f { border-radius: 0; background: var(--text); opacity: .75; }
.dist { border-radius: 0; height: 10px; }
.legend i, .dist-l i { border-radius: 0; }

/* ---------------------------------------------------------------- v1 search results */
.card { border-radius: var(--radius); box-shadow: none; }
.card .score b { font-family: var(--mono); }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--rule); font-size: 12px; }
.site-footer strong { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }

/* ---------------------------------------------------------------- keyboard help */
.kbd-help { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 18px 20px; max-width: 420px; }
.kbd-help::backdrop { background: #0008; }
.kbd-help h2 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.kbd-help dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
kbd { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--border); border-bottom-width: 2px; padding: 0 5px; border-radius: 2px; background: var(--surface-2); }
.kbd-hint { font-family: var(--mono); font-size: 11px; color: var(--muted); }

@media print { .masthead { border-color: #000; } .kev-b, .kev { transform: none; } }

/* ================================================================ readability pass
   Feedback: the first version was tiring to read. Mono is now limited to IDs and numbers,
   labels are sentence case, text is larger with more air, and contrast is softer. */
:root {
  --bg: #f7f6f2; --surface: #fdfcf9; --surface-2: #efede6; --border: #e0ddd4; --rule: #c9c4b8;
  --text: #22262c; --muted: #646a73; --row-hover: #f2f0ea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #12161d; --surface: #161b23; --surface-2: #1c222c; --border: #283040; --rule: #3a4456; --text: #d7dce4; --muted: #929cad; --row-hover: #19202a; }
}
:root[data-theme="dark"] { --bg: #12161d; --surface: #161b23; --surface-2: #1c222c; --border: #283040; --rule: #3a4456; --text: #d7dce4; --muted: #929cad; --row-hover: #19202a; }

body { font-size: 15.5px; line-height: 1.65; }
p, .desc { max-width: 78ch; }

/* Labels and headings: sentence case sans, no letter-spacing. */
.panel > h2, .panel-h h2, .section > h2, .panel h2, details.panel > summary,
.card-stat .k, .tbl th, .tabs button, .main-nav a, .menu-btn, .btn, .btn-primary, .pager button,
.masthead, .site-footer strong, .kbd-help h2 {
  font-family: var(--sans); text-transform: none; letter-spacing: 0;
}
.panel > h2, .panel-h h2, .section > h2, .panel h2 { font-size: 16px; font-weight: 600; }
.card-stat .k { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-stat .v { font-size: 28px; letter-spacing: -0.02em; }
.card-stat .s { font-size: 12.5px; }
.main-nav a, .menu-btn { font-size: 14px; font-weight: 500; }
.btn, .btn-primary, .pager button { font-size: 13.5px; font-weight: 550; }
.masthead { font-size: 13px; padding: 16px 0 8px; }
.site-footer strong { font-size: 13px; }

/* Tables: calmer and roomier. Mono only for CVE IDs and numbers. */
.tbl { font-size: 14px; }
.tbl th { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; }
.tbl td { padding: 11px 12px; line-height: 1.5; }
.tbl .nowrap { font-family: var(--sans); }
.tbl td a.mono, .cve-id, .tbl td.num, .card-stat .v { font-family: var(--mono); }
.tbl td a.mono { font-weight: 600; font-size: 13.5px; }

/* Softer structure: thin rules, more space between sections. */
.panel { border-top: 1px solid var(--rule); padding-top: 14px; }
.section { margin: 34px 0; }
.cards { border-top: 1px solid var(--rule); }
.hero h1 { font-size: clamp(28px, 4vw, 40px); }

/* Badges: quieter, no rotation. */
.kev-b, .kev { transform: none; outline: 0; border-width: 1px; letter-spacing: .06em; font-size: 11px; padding: 1px 6px; }
.sev { font-size: 12px; padding: 2px 8px; }
.hb-f { opacity: .55; }

/* ================================================================ functional colour on tables
   Rows carry a thin left edge in their severity colour (KEV overrides with the signal red), so the
   eye can scan for what matters. CSS-only via :has(); browsers without :has() simply show no edge. */
.tbl tbody tr td:first-child { box-shadow: inset 3px 0 0 transparent; }
.tbl tbody tr:has(.sev-LOW) td:first-child { box-shadow: inset 3px 0 0 var(--c-LOW); }
.tbl tbody tr:has(.sev-MEDIUM) td:first-child { box-shadow: inset 3px 0 0 var(--c-MEDIUM); }
.tbl tbody tr:has(.sev-HIGH) td:first-child { box-shadow: inset 3px 0 0 var(--c-HIGH); }
.tbl tbody tr:has(.sev-CRITICAL) td:first-child { box-shadow: inset 3px 0 0 var(--c-CRITICAL); }
.tbl tbody tr:has(.kev-b) td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.tbl thead th { background: var(--surface-2); border-bottom: 1px solid var(--rule); }
.tbl-wrap { border-color: var(--border); }
/* Section rules pick up the brand colour (cyan in dark, purple in light). */
.panel { border-top: 2px solid var(--accent); }
.cards { border-top: 2px solid var(--accent); }
