@font-face {
  font-family: Atkinson;
  src: url(/assets/atkinson-regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Atkinson;
  src: url(/assets/atkinson-semibold.woff2) format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Atkinson Mono;
  src: url(/assets/atkinson-mono.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --raised: #fffefa;
  --ink: #1f1f1e;
  --muted: #656761;
  --faint: #696c65;
  --line: #d5d3ca;
  --line-soft: #e2e0d8;
  --accent: #2b727e;
  --critical: #b3261e;
  --high: #b14a0a;
  --medium: #8a6700;
  --low: #2a6f7a;
  --none: #6e706a;
  --unscored: #8b8d86;
  --rejected: #8b8d86;
  --multiple: #63539c;
  --logo-filter: none;
  --sans: Atkinson, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: Atkinson Mono, ui-monospace, SFMono-Regular, Menlo, monospace;
  --page: 960px;
  --gutter: clamp(16px, 5vw, 40px);
  --badge-width: 96px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18191a;
  --raised: #1f2022;
  --ink: #ebeae4;
  --muted: #a4a59f;
  --faint: #8d8f89;
  --line: #34363a;
  --line-soft: #2a2c2f;
  --accent: #6bb7c2;
  --critical: #f2776d;
  --high: #f0a061;
  --medium: #ddc05a;
  --low: #6bb7c2;
  --none: #9a9c96;
  --unscored: #777974;
  --rejected: #777974;
  --multiple: #ab9de2;
  --logo-filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #18191a;
    --raised: #1f2022;
    --ink: #ebeae4;
    --muted: #a4a59f;
    --faint: #8d8f89;
    --line: #34363a;
    --line-soft: #2a2c2f;
    --accent: #6bb7c2;
    --critical: #f2776d;
    --high: #f0a061;
    --medium: #ddc05a;
    --low: #6bb7c2;
    --none: #9a9c96;
    --unscored: #777974;
    --rejected: #777974;
    --multiple: #ab9de2;
    --logo-filter: invert(1);
  }

  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Icons and icon-only controls */

.icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover {
  color: var(--ink);
}

#theme .icon {
  transition: color .2s, filter .2s;
}

@media (hover: hover) {
  #theme:hover .icon {
    color: var(--accent);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 50%, transparent));
  }
}

.icon-btn-edge {
  margin-right: -12px;
}

.icon-btn-small .icon {
  width: 16px;
  height: 16px;
}

#copy[data-copied] {
  color: var(--accent);
}

#refresh[aria-busy="true"] .icon {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: block;
  padding-block: 6px;
}

.brand img {
  display: block;
  width: 124px;
  height: auto;
  filter: var(--logo-filter);
}

/* Intro */

main {
  flex: 1;
  padding-block: 40px 56px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 36px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.feed-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2px;
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

.feed-url a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

/* Controls */

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-submit {
  position: absolute;
  top: 0;
  left: 0;
}

.search-icon {
  width: 18px;
  height: 18px;
}

.search input,
.select select {
  height: 44px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search input {
  width: 100%;
  padding: 0 14px 0 44px;
}

.search input::placeholder {
  color: var(--faint);
  opacity: 1;
}

.search input:focus-visible,
.select select:focus-visible {
  border-color: var(--accent);
  outline-offset: 0;
  border-radius: 8px;
}

.select {
  position: relative;
  flex: none;
}

.select select {
  padding: 0 38px 0 12px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Status and notices */

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status-count {
  color: var(--accent);
}

.status-count:empty {
  display: none;
}

.notice {
  margin: 14px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.notice-error {
  border-left-color: var(--critical);
  color: var(--ink);
}

/* Findings */

.activity {
  margin-top: 20px;
}

.activity:focus {
  outline: none;
}

.events {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  transition: opacity 0.15s ease;
}

.events[aria-busy="true"] {
  opacity: 0.6;
}

.event {
  --sev: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--badge-width);
  column-gap: 24px;
  align-items: start;
  min-height: 68px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.event[data-severity="critical"] { --sev: var(--critical); }
.event[data-severity="high"] { --sev: var(--high); }
.event[data-severity="medium"] { --sev: var(--medium); }
.event[data-severity="low"] { --sev: var(--low); }
.event[data-severity="multiple"] { --sev: var(--multiple); }

.event-main {
  min-width: 0;
}

.event-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.kind {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.kind:empty {
  display: none;
}

.cve-id {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cve-id:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}

.event-time {
  margin-left: auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.event-title {
  margin: 4px 0 0;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-title a {
  text-decoration: none;
}

.event-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--line);
}

.event-summary {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.event-details {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--faint);
}

.event-details p {
  margin: 0;
}

.event-severity {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.event-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--badge-width);
}

.event-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 6px 4px;
  border: 1px solid color-mix(in srgb, var(--sev) 35%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--sev) 10%, transparent);
  color: color-mix(in srgb, var(--sev) 55%, var(--ink));
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.score-number {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

#sync.stale { color: var(--medium); }
.coverage-copy { padding-block: 40px 60px; max-width: 800px; }
.coverage-copy h2 { margin-top: 32px; }
.coverage-copy p { line-height: 1.65; color: var(--muted); }

.event[data-severity="rejected"] .event-title,
.event[data-severity="rejected"] .cve-id {
  color: var(--muted);
}

.event[data-severity="rejected"] .cve-id {
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}

.empty {
  margin: 0;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
}

/* Pagination */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 4px;
  margin-top: 24px;
}

.page-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-step,
.page-list a,
.page-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  height: 44px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
}

.page-step:first-child {
  margin-left: -10px;
}

.page-step .icon {
  width: 16px;
  height: 16px;
}

.page-step:hover:not(:disabled),
.page-list a:hover,
.page-list button:hover {
  color: var(--ink);
}

.page-list [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
}

.page-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-gap {
  display: inline-flex;
  align-items: center;
  min-width: 24px;
  height: 44px;
  justify-content: center;
  color: var(--faint);
}

.page-count {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-count:empty {
  display: none;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 18px 26px;
  font-size: 13px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
}

.footer-brand {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  display: inline-block;
  padding-block: 4px;
}

.footer-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--faint);
}

/* Narrow screens */

@media (max-width: 600px) {
  main {
    padding-block: 28px 40px;
  }

  .controls {
    flex-wrap: wrap;
    margin-top: 22px;
  }

  .search {
    flex-basis: 100%;
  }

  .select {
    flex: 1 1 auto;
  }

  .select select {
    width: 100%;
  }

  .event {
    --badge-width: 80px;
    column-gap: 12px;
    padding: 14px 0;
  }

  .event-time {
    flex-basis: 100%;
    margin-left: 0;
    white-space: normal;
    text-wrap: balance;
  }

  .page-step span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .page-step:first-child {
    margin-left: -12px;
  }

  .page-count {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #refresh[aria-busy="true"] .icon {
    animation: none;
  }

  .events {
    transition: none;
  }

  #theme .icon { transition: none; }
}

@media (forced-colors: active) {
  #theme .icon,
  #theme:hover .icon { filter: none; }

  .event-score {
    border-color: CanvasText;
    color: CanvasText;
  }

  .icon-btn,
  .page-step {
    border: 1px solid transparent;
  }
}
