/* Vulnsift documentation. vulnsift.com's colours, type and mark; no framework, no script,
   nothing loaded from elsewhere. The colour tokens are the landing page's own
   (tests/unit/test_docs_site.py holds them to it). */

:root {
  color-scheme: light dark;

  --bg: #f8f7f2;
  --surface: #ffffff;
  --sunk: #f0eee6;
  --ink: #14171a;
  --soft: #3a4148;
  --muted: #5f6770;
  --rule: #dfdcd2;
  --accent: #0b6b53;
  --accent-strong: #08553f;
  --accent-soft: #e2f0eb;
  --on-accent: #ffffff;
  --header: rgb(248 247 242 / 86%);

  --critical: #c2352b;
  --critical-ink: #8f1d15;
  --critical-bg: #fce9e5;
  --high: #d9741a;
  --high-ink: #8a4706;
  --high-bg: #fdeeda;
  --medium: #cfa81f;
  --medium-ink: #6b5300;
  --medium-bg: #faf2cc;
  --low: #98a1ab;
  --low-ink: #4c5660;
  --low-bg: #eceef0;

  /* Clay: what a person has to watch for. */
  --clay: #a94f27;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f11;
    --surface: #14181b;
    --sunk: #101315;
    --ink: #ecebe6;
    --soft: #c8ccd0;
    --muted: #969ea7;
    --rule: #272c31;
    --accent: #5fd1aa;
    --accent-strong: #7fe0bd;
    --accent-soft: #12261f;
    --on-accent: #06251c;
    --header: rgb(12 15 17 / 84%);

    --critical: #f0685c;
    --critical-ink: #ffb4a8;
    --critical-bg: #3a1613;
    --high: #f29a45;
    --high-ink: #ffc58f;
    --high-bg: #38230f;
    --medium: #e3c350;
    --medium-ink: #f0d97c;
    --medium-bg: #30280c;
    --low: #6f7882;
    --low-ink: #b4bcc4;
    --low-bg: #1f2428;

    --clay: #ec9a72;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem; /* a heading a link jumps to clears the header */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure,
pre {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent);
}

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

.wrap {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.skip {
  position: absolute;
  z-index: 20;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

/* Buttons and chips, as on vulnsift.com and in the app */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--on-accent);
}

.button-small {
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 0.92rem;
}

.chip {
  display: inline-block;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: var(--low-bg);
  color: var(--low-ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.chip-critical {
  background: var(--critical-bg);
  color: var(--critical-ink);
}

.chip-high {
  background: var(--high-bg);
  color: var(--high-ink);
}

.chip-medium {
  background: var(--medium-bg);
  color: var(--medium-ink);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: var(--header);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

.site-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-size: 1.15rem;
  font-weight: 680;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.brand-docs {
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 620;
  letter-spacing: 0;
}

.mark-noise {
  fill: currentColor;
  opacity: 0.3;
}

.mark-sieve {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mark-kept {
  fill: var(--accent);
}

.site-link {
  display: none;
  color: var(--soft);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

@media (min-width: 36rem) {
  .site-link {
    display: inline;
  }
}

/* The page: the contents beside the text on a wide screen, above it on a narrow one */

.docs {
  display: grid;
  gap: 1.5rem;
  padding-block: 1.75rem 4rem;
}

.docs-nav {
  display: none;
}

.contents {
  display: grid;
  gap: 0.15rem;
  padding: 0;
  list-style: none;
}

.contents a {
  display: block;
  padding: 0.35rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--soft);
  font-size: 0.95rem;
  text-decoration: none;
}

.contents a:hover {
  background: var(--sunk);
  color: var(--ink);
}

.contents a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 620;
}

.docs-menu {
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}

.docs-menu > summary {
  padding: 0.6rem 0.9rem;
  color: var(--soft);
  font-weight: 620;
  cursor: pointer;
}

.docs-menu[open] > summary {
  border-bottom: 1px solid var(--rule);
}

.docs-menu .contents {
  padding: 0.5rem 0.5rem 0.6rem 0;
}

@media (min-width: 56rem) {
  .docs {
    grid-template-columns: 13.5rem minmax(0, 1fr);
    gap: 3.5rem;
    padding-block: 2.75rem 5rem;
  }

  .docs-menu {
    display: none;
  }

  .docs-nav {
    display: block;
    position: sticky;
    top: 5.5rem;
    align-self: start;
  }
}

/* The text */

.docs-main {
  min-width: 0;
  max-width: 46rem;
}

.docs-main > * + * {
  margin-top: 1.1rem;
}

.docs-main h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.docs-main h2 {
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: 1.4rem;
  font-weight: 680;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.docs-main h3 {
  margin-top: 1.8rem;
  font-size: 1.08rem;
  font-weight: 660;
  line-height: 1.3;
}

.docs-main h2 + *,
.docs-main h3 + * {
  margin-top: 0.6rem;
}

.lede {
  color: var(--soft);
  font-size: 1.2rem;
  line-height: 1.55;
}

.docs-main ul:not([class]),
.docs-main ol:not([class]) {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.3rem;
}

.docs-main ul:not([class]) {
  list-style: disc;
}

.docs-main ol:not([class]) {
  list-style: decimal;
}

.docs-main li::marker {
  color: var(--muted);
}

strong {
  font-weight: 650;
}

code {
  padding: 0.08rem 0.35rem;
  border-radius: 5px;
  background: var(--sunk);
  font-family: var(--mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.command {
  padding: 0.85rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--sunk);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word; /* at a space where it can, so that no option is split in two */
  /* One click selects all of it, ready to copy. */
  user-select: all;
  -webkit-user-select: all;
  cursor: copy;
}

.command code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.document {
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
}

.document code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.muted {
  color: var(--muted);
}

/* A remark beside the text */

.note {
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.note-warn {
  border-left-color: var(--clay);
}

.note > * + * {
  margin-top: 0.5rem;
}

/* Tables */

.table {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  font-weight: 600;
}

.table-plain td:first-child {
  font-weight: inherit;
}

/* Where a change goes: at once stands out, a digest is quieter, and not at all is quietest. */
td.now {
  color: var(--accent-strong);
  font-weight: 620;
}

td.later {
  color: var(--soft);
}

td.never {
  color: var(--muted);
  text-align: center;
}

/* A table of where things go, on a phone: each row a block, each cell under its column's
   name, so that it is read down and not scrolled across. */
@media (max-width: 40rem) {
  .matrix thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .matrix tr {
    display: grid;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--rule);
  }

  .matrix tbody tr:last-child {
    border-bottom: 0;
  }

  .matrix td {
    padding: 0;
    border-bottom: 0;
  }

  .matrix td[data-label] {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    gap: 0.75rem;
    text-align: left;
  }

  .matrix td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 400;
  }
}

/* Cards: the front page's way into each part */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 0.9rem;
  padding: 0;
  list-style: none;
}

.cards a {
  display: grid;
  gap: 0.3rem;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--accent);
  color: inherit;
}

.cards strong {
  font-size: 1.02rem;
}

.cards span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.cards .card-first {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cards .card-first strong {
  color: var(--accent-strong);
}

/* A flow: from the server to what reaches you, one box to a stage */

.flow {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow li {
  position: relative;
  display: grid;
  align-content: start; /* a short box in a row of tall ones keeps its text together */
  gap: 0.25rem;
  padding: 0.95rem 1rem 0.95rem 3.1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  counter-increment: flow;
}

.flow li::before {
  content: counter(flow);
  position: absolute;
  top: 0.95rem;
  left: 1rem;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.flow strong {
  font-size: 1rem;
}

.flow span {
  color: var(--soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

@media (min-width: 46rem) {
  .flow-across {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .flow-across li {
    padding: 2.9rem 1rem 1rem;
  }

  /* An arrow between one stage and the next. */
  .flow-across li + li::after {
    content: "";
    position: absolute;
    top: 1.55rem;
    left: -0.72rem;
    width: 0.55rem;
    height: 0.55rem;
    border-top: 2px solid var(--muted);
    border-right: 2px solid var(--muted);
    transform: rotate(45deg);
  }
}

/* Steps: what to do, in order */

.steps {
  display: grid;
  gap: 1.1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding-left: 2.75rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.steps > li > * + * {
  margin-top: 0.55rem;
}

.steps h3 {
  margin-top: 0.15rem;
}

/* Terms and what they mean */

.terms {
  display: grid;
  gap: 0.2rem 1.25rem;
}

.terms dt {
  font-weight: 650;
}

.terms dd {
  margin-bottom: 0.6rem;
  color: var(--soft);
}

@media (min-width: 40rem) {
  .terms {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  .terms dd {
    margin-bottom: 0;
  }
}

/* Questions and their answers */

.question {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}

.question + .question {
  margin-top: 0.6rem;
}

.question > summary {
  padding: 0.85rem 1.1rem;
  font-weight: 640;
  cursor: pointer;
}

.question[open] > summary {
  border-bottom: 1px solid var(--rule);
}

.question > div {
  padding: 0.85rem 1.1rem 1rem;
}

.question > div > * + * {
  margin-top: 0.6rem;
}

/* Previous and next page */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 0.9rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.pager a {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-weight: 620;
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--accent);
  color: inherit;
}

.pager span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.pager-next {
  text-align: right;
}

.pager-next:only-child {
  grid-column: -2;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-row {
  display: grid;
  gap: 0.6rem;
  padding-block: 1.75rem 2rem;
}

.footer-row p {
  max-width: 52rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}
