/* The embed widget (/embed/<CVE-ID>, embed.mjs). Tokens follow site/styles.css: the light theme's surface and purple,
   and the hero's terminal look for dark (near-black, the faint grid, violet and magenta blooms, the id in mono, red only
   for exploitation). html[data-theme] is dark, light or auto (auto follows prefers-color-scheme). */
@font-face { font-family: "Embed Inter"; font-weight: 700; font-display: swap; src: url(fonts/Inter-Bold.woff) format("woff"); }
@font-face { font-family: "Embed Mono"; font-weight: 700; font-display: swap; src: url(fonts/JetBrainsMono-Bold.woff) format("woff"); }

:root {
  --bg: #ffffff; --text: #101828; --muted: #475467; --subtle: #667085; --edge: #dfe3eb; --rule: #eef0f5;
  --accent: #632ca6; --id: #632ca6; --nick-bg: #f4ecfb; --nick-ink: #4d1f88;
  --kev: #d92d20; --kev-ink: #ffffff; --meter: #c7cdd9; --meter-on: #632ca6;
  --crit: #b42318; --crit-bg: #fef3f2; --high: #b54708; --high-bg: #fffaeb; --med: #8a6a00; --med-bg: #fdf8e3;
  --low: #475467; --low-bg: #eef0f5;
  --backdrop: none; --grid: none;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --head: "Embed Inter", var(--body);
  --mono: "Embed Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #08070b; --text: #f1eff6; --muted: #b4aec4; --subtle: #9d97ae; --edge: rgba(194,168,255,.22); --rule: rgba(194,168,255,.14);
    --accent: #c4b0ff; --id: #c2a8ff; --nick-bg: #c2a8ff; --nick-ink: #08070b;
    --kev: #ff3b30; --kev-ink: #ffffff; --meter: #4b4759; --meter-on: #c4b0ff;
    --crit: #ff6b7f; --crit-bg: rgba(255,107,127,.14); --high: #f39a45; --high-bg: rgba(243,154,69,.14);
    --med: #e6c75a; --med-bg: rgba(230,199,90,.14); --low: #b4aec4; --low-bg: rgba(143,137,163,.16);
    --backdrop: radial-gradient(circle at 0% 100%, rgba(138,92,255,.34), transparent 55%), radial-gradient(circle at 100% 0%, rgba(255,61,203,.2), transparent 45%);
    --grid: linear-gradient(rgba(170,150,240,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(170,150,240,.06) 1px, transparent 1px);
  }
}
:root[data-theme="dark"] {
  --bg: #08070b; --text: #f1eff6; --muted: #b4aec4; --subtle: #9d97ae; --edge: rgba(194,168,255,.22); --rule: rgba(194,168,255,.14);
  --accent: #c4b0ff; --id: #c2a8ff; --nick-bg: #c2a8ff; --nick-ink: #08070b;
  --kev: #ff3b30; --kev-ink: #ffffff; --meter: #4b4759; --meter-on: #c4b0ff;
  --crit: #ff6b7f; --crit-bg: rgba(255,107,127,.14); --high: #f39a45; --high-bg: rgba(243,154,69,.14);
  --med: #e6c75a; --med-bg: rgba(230,199,90,.14); --low: #b4aec4; --low-bg: rgba(143,137,163,.16);
  --backdrop: radial-gradient(circle at 0% 100%, rgba(138,92,255,.34), transparent 55%), radial-gradient(circle at 100% 0%, rgba(255,61,203,.2), transparent 45%);
  --grid: linear-gradient(rgba(170,150,240,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(170,150,240,.06) 1px, transparent 1px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 16px/1.4 var(--body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 100%; padding: 14px 18px 12px;
  border: 1px solid var(--edge); border-radius: 12px; overflow: hidden;
  /* the grid's two layers first, so the sizes line up whether the theme has blooms or not */
  background-color: var(--bg); background-image: var(--grid), var(--backdrop); background-size: 32px 32px, 32px 32px, auto, auto;
}

.idline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.id { font: 700 16px/1.2 var(--mono); color: var(--id); letter-spacing: .01em; }
.nick { padding: 1px 9px 2px; border-radius: 6px; background: var(--nick-bg); color: var(--nick-ink); font: 700 14.5px/1.4 var(--head); }
.title {
  margin: 0; font: 700 clamp(19px, 4vw, 24px)/1.2 var(--head); letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.title.muted { color: var(--muted); }
.note { margin: 0; color: var(--muted); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--rule); }
.fact { min-width: 0; }
.fact dt { font-size: 13px; font-weight: 600; color: var(--subtle); letter-spacing: .02em; }
.fact dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; font-variant-numeric: tabular-nums; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border: 1px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.sev-critical { color: var(--crit); background: var(--crit-bg); }
.sev-high { color: var(--high); background: var(--high-bg); }
.sev-medium { color: var(--med); background: var(--med-bg); }
.sev-low, .sev-none { color: var(--low); background: var(--low-bg); }
.chip.kev { color: var(--kev-ink); background: var(--kev); border-color: var(--kev); }
.chip.kev i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.3); }
.since, .share { font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.no { color: var(--muted); }
.asof { flex-basis: 100%; font-size: 13px; font-weight: 500; color: var(--subtle); }

.prev { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.prev[title] { cursor: help; }
.meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.meter i { display: block; width: 4px; border-radius: 1px; background: var(--meter); }
.meter i:nth-child(1) { height: 5px; } .meter i:nth-child(2) { height: 8px; } .meter i:nth-child(3) { height: 11px; } .meter i:nth-child(n+4) { height: 14px; }
.meter i.on { background: var(--meter-on); }
.prev-unmeasured .meter i, .prev-none .meter i { background: none; border: 1px dashed var(--meter); }
.prev-unmeasured b, .prev-none b { color: var(--muted); font-weight: 600; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: auto; padding-top: 2px; font-size: 13.5px; color: var(--subtle); }
.links, .meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.links a { font-weight: 700; color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.arrow { margin-left: 3px; }
.by { font-weight: 600; text-decoration: none; }
a.by:hover { color: var(--accent); }

/* four facts in a row once they fit, so none sits alone on a second row */
@media (min-width: 600px) { .facts { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 380px) { .card { padding: 12px 14px 10px; } }
/* narrow: the links and the byline share the first line, the data's date goes under them */
@media (max-width: 440px) {
  .meta { display: contents; }
  .updated { order: 3; flex-basis: 100%; }
}
