/* Nofetch — shared styles.
   No web fonts, no CDN, no external requests of any kind. Everything the
   browser needs to render this site ships from this origin. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-inset: #eceef1;
  --fg: #16191d;
  --fg-muted: #5b6470;
  --border: #dbdfe4;
  --accent: #1a56c4;
  --accent-fg: #ffffff;
  --high: #b3261e;
  --high-bg: #fdeceb;
  --medium: #8a5300;
  --medium-bg: #fdf3e2;
  --low: #4a5560;
  --low-bg: #eef0f3;
  --ok: #12684a;
  --ok-bg: #e6f4ee;
  --radius: 10px;
  --width: 62rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101317;
    --bg-soft: #171b21;
    --bg-inset: #1e242c;
    --fg: #e8eaed;
    --fg-muted: #9aa4b0;
    --border: #2b323b;
    --accent: #6f9dff;
    --accent-fg: #0b0e12;
    --high: #ff9a92;
    --high-bg: #3a1d1b;
    --medium: #f0c076;
    --medium-bg: #362a16;
    --low: #b3bcc6;
    --low-bg: #232931;
    --ok: #7bd6ae;
    --ok-bg: #16302699;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
p { margin: 0 0 1rem; }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--bg-inset); padding: 0.15em 0.4em; border-radius: 4px; }
pre {
  background: var(--bg-inset); padding: 1rem; border-radius: var(--radius);
  overflow-x: auto; border: 1px solid var(--border);
}
pre code { background: none; padding: 0; }

/* ------------------------------------------------------------- header --- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 3.75rem; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--fg); text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.brand .dot {
  width: 0.6rem; height: 0.6rem; border-radius: 50%;
  background: var(--ok); flex: none;
}
.site-nav { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a { color: var(--fg-muted); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); text-decoration: underline; }

/* --------------------------------------------------------------- hero --- */

.hero { padding: 3.5rem 0 2.5rem; }
.hero .lede { font-size: 1.2rem; color: var(--fg-muted); max-width: 46rem; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid currentColor; border-radius: 999px;
  padding: 0.25rem 0.75rem; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 1rem;
}

/* -------------------------------------------------------------- cards --- */

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; background: var(--bg-soft);
  display: flex; flex-direction: column;
}
.card h3 { margin: 0 0 0.4rem; }
.card p { color: var(--fg-muted); font-size: 0.95rem; flex: 1; }
.card a.card-link { font-weight: 600; text-decoration: none; }
.card a.card-link::after { content: " →"; }
.card.soon { opacity: 0.62; }
.card.soon .tag {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-muted); font-weight: 700;
}

/* ---------------------------------------------------------- drop zone --- */

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; background: var(--bg-soft);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--bg-inset); }
.dropzone strong { display: block; font-size: 1.1rem; margin-bottom: 0.35rem; }
.dropzone span { color: var(--fg-muted); font-size: 0.95rem; }
.dropzone input[type=file] { display: none; }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-fg);
  border: 1px solid transparent; border-radius: 8px; padding: 0.6rem 1.1rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.controls {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin: 1.25rem 0; padding: 0.9rem 1.1rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
}
.controls label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.controls .hint { color: var(--fg-muted); font-size: 0.85rem; }

/* ------------------------------------------------------------ results --- */

.result {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 1rem 0; overflow: hidden; background: var(--bg-soft);
}
.result-head {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border);
}
.result-head .name { font-weight: 600; word-break: break-all; }
.result-head .meta { color: var(--fg-muted); font-size: 0.88rem; margin-left: auto; white-space: nowrap; }
.result-body { padding: 1.1rem; }

.finding {
  display: flex; gap: 0.85rem; padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.finding:last-child { border-bottom: 0; }
.finding .sev {
  flex: none; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.2rem 0.5rem; border-radius: 4px; height: fit-content;
  min-width: 4.2rem; text-align: center;
}
.sev-high { background: var(--high-bg); color: var(--high); }
.sev-medium { background: var(--medium-bg); color: var(--medium); }
.sev-low { background: var(--low-bg); color: var(--low); }
.finding .title { font-weight: 600; }
.finding .detail { color: var(--fg-muted); font-size: 0.92rem; }

.clean {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--ok-bg); color: var(--ok);
  padding: 0.75rem 1rem; border-radius: 8px; font-weight: 600;
}

table.kv { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 0.5rem; }
table.kv th, table.kv td { text-align: left; padding: 0.35rem 0.6rem 0.35rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
table.kv th { color: var(--fg-muted); font-weight: 500; width: 40%; }
table.kv td { word-break: break-word; }

details.raw { margin-top: 1rem; }
details.raw summary { cursor: pointer; color: var(--fg-muted); font-size: 0.9rem; }
details.raw[open] summary { margin-bottom: 0.5rem; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.1rem; }

.tipjar {
  margin: 1rem 0 0; padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--fg-muted); font-size: 0.9rem;
}

/* --------------------------------------------------------------- misc --- */

.callout {
  border-left: 3px solid var(--accent); background: var(--bg-soft);
  padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }

.faq { margin-top: 1rem; }
.faq details {
  border-bottom: 1px solid var(--border); padding: 0.85rem 0;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details > *:not(summary) { margin-top: 0.6rem; color: var(--fg-muted); }

.site-footer {
  margin-top: 4rem; border-top: 1px solid var(--border);
  background: var(--bg-soft); padding: 2rem 0; color: var(--fg-muted); font-size: 0.9rem;
}
.site-footer .wrap { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.site-footer nav { margin-left: auto; display: flex; gap: 1.25rem; flex-wrap: wrap; }

.noscript {
  background: var(--medium-bg); color: var(--medium);
  border: 1px solid currentColor; border-radius: var(--radius);
  padding: 1rem; margin: 1.5rem 0;
}

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