/* Editorial "threat bulletin" design. Colors and fonts come from /brand.css (config/brand.json). */
:root {
  --bg: var(--brand-paper); --fg: var(--brand-ink); --surface: #fffdf8; --muted: #5d6066;
  --rule: #d8cfbe; --rule-strong: var(--brand-ink); --accent: var(--brand-accent);
  --chip: #efe8da; --danger: var(--brand-danger); --warn: var(--brand-warn); --ok: var(--brand-signal);
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.18);
  --radius: 6px; --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1217; --fg: #ece6da; --surface: #161a21; --muted: #9aa0a8; --rule: #2a2f38; --rule-strong: #ece6da;
  --accent: var(--brand-accent-dark); --chip: #1e232c; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1217; --fg: #ece6da; --surface: #161a21; --muted: #9aa0a8; --rule: #2a2f38; --rule-strong: #ece6da;
  --accent: var(--brand-accent-dark); --chip: #1e232c; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 var(--font-body); }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .4em; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.mono, .cve-id, code, kbd { font-family: var(--font-mono); }
.muted { color: var(--muted); } .small { font-size: .875rem; } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Masthead */
.masthead { border-bottom: 3px double var(--rule-strong); background: var(--bg); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.masthead-top { display: flex; align-items: center; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark svg { width: 30px; height: 30px; color: var(--fg); display: block; }
.logo-word { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; }
.logo-word.small { font-size: 1.25rem; margin: 0; }
.search { flex: 1 1 260px; position: relative; max-width: 460px; }
.search input, .bigsearch input, .filters input { width: 100%; font: inherit; padding: 9px 36px 9px 12px; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); border-radius: var(--radius); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 0 5px; }
.actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.theme-toggle { background: none; border: 1px solid var(--rule); color: var(--fg); border-radius: var(--radius); padding: 7px; cursor: pointer; display: grid; place-items: center; }
.nav { display: flex; gap: 22px; overflow-x: auto; padding-block: 8px 10px; font-size: .9rem; scrollbar-width: none; }
.nav a { text-decoration: none; white-space: nowrap; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }

.btn { display: inline-block; background: var(--fg); color: var(--bg); text-decoration: none; padding: 9px 16px; border-radius: var(--radius); font-weight: 600; font-size: .92rem; border: 1px solid var(--fg); cursor: pointer; font-family: var(--font-body); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--rule); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

main { padding-block: 22px 60px; min-height: 60vh; }
.dateline { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin: 0 0 24px; }
h1.dateline { font-family: var(--font-body); font-weight: 400; line-height: 1.5; letter-spacing: .08em; }
h1.dateline strong { font-weight: 600; color: var(--accent); }
.kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; margin: 0 0 .5em; }
.section-h { font-size: 1.25rem; border-top: 2px solid var(--rule-strong); padding-top: 10px; margin-top: 8px; }
.page-h { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.lede { font-size: 1.15rem; max-width: 70ch; }
.more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--accent); }

/* Lead: threat level + exploited column */
.lead { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; margin-bottom: 40px; }
.level { border-right: 1px solid var(--rule); padding-right: 40px; }
.level-name { font-family: var(--font-display); font-weight: 700; line-height: 1.12; font-size: clamp(3.2rem, 9vw, 6.4rem); margin: 0; letter-spacing: -0.035em; }
.level-1 .level-name { color: var(--ok); } .level-2 .level-name { color: var(--warn); }
.level-3 .level-name { color: var(--accent); } .level-4 .level-name { color: var(--danger); }
.gauge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 18px; max-width: 420px; }
.gauge span { height: 10px; background: var(--chip); border-radius: 2px; }
.level-1 .gauge .on { background: var(--ok); } .level-2 .gauge .on { background: var(--warn); }
.level-3 .gauge .on { background: var(--accent); } .level-4 .gauge .on { background: var(--danger); }
.level-why { font-size: 1.12rem; max-width: 56ch; margin-bottom: 20px; }
.exploited { list-style: none; margin: 0; padding: 0; counter-reset: ex; }
.exploited li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); counter-increment: ex; }
.exploited .cve-id { font-weight: 600; font-size: .9rem; grid-column: 1; }
.exploited .who { font-weight: 600; grid-column: 2; }
.exploited .what { grid-column: 1 / -1; font-size: .92rem; }
.exploited .meta { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; margin-bottom: 36px; }
.cve-list { list-style: none; margin: 0; padding: 0; }
.cve-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.cve-row .cve-id { font-weight: 600; font-size: .9rem; }
.cve-row .cve-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.cve-row .cve-title { grid-column: 1 / 3; font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cve-row .epss, .cve-row .delta { grid-column: 3; grid-row: 1 / 3; justify-self: end; font-size: .85rem; }

.sev { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 3px; background: var(--chip); white-space: nowrap; }
.sev b { font-family: var(--font-mono); font-weight: 600; margin-left: 2px; }
.sev-critical { background: var(--danger); color: #fff; } .sev-high { background: var(--accent); color: #fff; }
.sev-medium { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--fg); }
.sev-low { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.tag { font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 3px; border: 1px solid var(--rule); white-space: nowrap; }
.tag-kev { border-color: var(--danger); color: var(--danger); }
.tag-ransom { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.epss { display: inline-flex; align-items: center; gap: 8px; }
.epss-track { width: 72px; height: 6px; }
.epss-bg { fill: var(--chip); } .epss-fg { fill: var(--muted); } .epss-fg.hot { fill: var(--accent); }
.epss-num { font-family: var(--font-mono); font-size: .8rem; min-width: 3.4em; text-align: right; }
.delta b { font-family: var(--font-mono); color: var(--accent); }

.band { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 2px solid var(--rule-strong); margin: 10px 0 40px; }
.stat { padding: 20px 16px; border-right: 1px solid var(--rule); } .stat:last-child { border-right: 0; }
.stat .num { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.stat .lbl { font-size: .85rem; color: var(--muted); }

.brief-teaser { max-width: 760px; margin-bottom: 40px; }
.brief-teaser h2 { font-size: 1.8rem; } .brief-teaser h2 a { text-decoration: none; }
.clamp { max-height: 9.5em; overflow: hidden; mask-image: linear-gradient(#000 60%, transparent); }
.pitch { background: var(--fg); color: var(--bg); padding: clamp(24px, 5vw, 48px); border-radius: var(--radius); }
.pitch h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); max-width: 22ch; }
.pitch p { max-width: 60ch; opacity: .85; }
.pitch .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.pitch .btn.ghost { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.pitch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.small-pitch { margin-top: 40px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.small-pitch p { margin: 0; }

/* CVE page */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 16px; } .crumbs a { color: var(--muted); }
.cve-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); display: flex; flex-direction: column; gap: 6px; }
.cve-h-title { font-size: .5em; font-weight: 500; font-family: var(--font-display); color: var(--muted); }
.cve-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.summary .lede { font-family: var(--font-display); font-size: clamp(1.15rem, 2.2vw, 1.45rem); line-height: 1.45; border-left: 4px solid var(--accent); padding-left: 18px; margin: 24px 0; max-width: 62ch; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 2px solid var(--rule-strong); margin: 24px 0; }
.fact { padding: 16px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.fact:last-child { border-right: 0; }
.fact .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fact .val { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.fact .sub { font-size: .85rem; color: var(--muted); }
.callout { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); padding: 16px 20px; border-radius: var(--radius); margin: 24px 0; }
.callout h2 { font-size: 1.1rem; }
.prose { max-width: 72ch; }
.prose h3, .prose h2 { font-size: 1.3rem; margin-top: 1.4em; }
.prose-list li, .checklist li { margin-bottom: .5em; }
.checklist { list-style: none; padding: 0; } .checklist li { padding-left: 26px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.checklist.no li::before { content: "✕"; color: var(--danger); }
.table-wrap { overflow-x: auto; margin: 8px 0 24px; border: 1px solid var(--rule); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.ver { display: inline-block; font-family: var(--font-mono); font-size: .8rem; background: var(--chip); padding: 1px 6px; border-radius: 3px; margin: 0 4px 4px 0; }
.refs { padding-left: 1.1em; word-break: break-word; } .refs li { margin-bottom: 4px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 20px 0 8px; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 4px; flex: 1 1 180px; }
.filters label.check { flex-direction: row; align-items: center; flex: 0 0 auto; color: var(--fg); font-size: .9rem; }
.filters input { padding-right: 12px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 20px 0; }
.bigsearch { display: flex; gap: 10px; margin: 16px 0 24px; } .bigsearch input { font-size: 1.1rem; padding: 12px 14px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 6px 10px; background: var(--chip); border-radius: 999px; text-decoration: none; font-size: .9rem; }
.vendor-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.vendor-grid a { display: flex; flex-direction: column; gap: 4px; padding: 14px; background: var(--bg); text-decoration: none; height: 100%; }
.vendor-grid a:hover { background: var(--surface); }
.v-name { font-weight: 600; } .v-n { font-size: .85rem; color: var(--muted); } .vendor-grid .tag { align-self: flex-start; }

.brief-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; }
.brief .prose { font-size: 1.05rem; }
.ai-label { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border-left: 4px solid var(--warn); padding: 10px 14px; border-radius: 4px; font-size: .92rem; }
.ai-label.neutral { border-left-color: var(--rule); background: var(--surface); }
.archive ul { list-style: none; padding: 0; } .archive li { padding: 4px 0; font-family: var(--font-mono); font-size: .9rem; }
.source { border-top: 1px solid var(--rule); padding: 18px 0; } .source.off { opacity: .75; }
.source h2 { font-size: 1.3rem; }
.source dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0 0 12px; }
.source dt { color: var(--muted); font-size: .85rem; } .source dd { margin: 0; word-break: break-word; }
.status-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.status-grid li { border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; border-left-width: 4px; }
.status-grid li.ok { border-left-color: var(--ok); } .status-grid li.bad { border-left-color: var(--danger); }
.placeholder-note { background: var(--chip); padding: 10px 14px; border-radius: 4px; font-size: .9rem; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.plan { border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; background: var(--surface); display: flex; flex-direction: column; }
.plan.featured { border: 2px solid var(--accent); }
.plan .price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; margin: 0; } .plan .price span { font-size: 1rem; color: var(--muted); }
.plan ul { padding-left: 1.1em; flex: 1; } .plan .btn { text-align: center; }
.steps { counter-reset: s; list-style: none; padding: 0; max-width: 760px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 24px 64px; border-left: 1px solid var(--rule); margin-left: 20px; }
.steps li::before { content: counter(s); position: absolute; left: -20px; top: -4px; width: 40px; height: 40px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.steps h2 { font-size: 1.35rem; }
.empty { padding: 60px 0; max-width: 60ch; }

.footer { border-top: 3px double var(--rule-strong); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: .85rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 28px; }
.footer nav { display: flex; flex-direction: column; gap: 6px; }
.attrib p { margin: 0 0 6px; color: var(--muted); font-size: .78rem; }
.fineprint { color: var(--muted); font-size: .78rem; margin-top: 18px; }

@media (max-width: 880px) {
  .lead, .grid-2, .brief-layout, .plans, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .level { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 28px; }
  .band, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2), .fact:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2), .fact:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .source dl { grid-template-columns: minmax(0, 1fr); } .source dt { margin-top: 6px; }
}
@media (max-width: 520px) {
  .actions .btn.ghost { display: none; }
  .cve-row { grid-template-columns: minmax(0, 1fr); } .cve-row .cve-title { grid-column: 1; }
  .cve-row .epss, .cve-row .delta { grid-column: 1; grid-row: auto; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
