/* DFIR Reference — Pi Zero 2W friendly: no frameworks, no images, tiny CSS */

:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #243044;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #3d9cf0;
  --accent-dim: #2563a8;
  --ok: #3ecf8e;
  --warn: #e6b84d;
  --err: #f07178;
  --info: #7aa2f7;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem 0.85rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand .tag {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* Main tabs */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

#q {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

#q:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 156, 240, 0.25);
}

#q::placeholder {
  color: var(--muted);
}

.meta-line {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.meta-line kbd {
  font-family: var(--mono);
  font-size: 0.7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

/* Category chips */
.chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0.75rem auto 0;
  padding: 0 0.15rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

/* Layout */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 3rem;
}

.section {
  margin-bottom: 1.75rem;
}

.section.hidden {
  display: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.section-head .count {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.section-desc {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

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

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

th {
  position: sticky;
  top: 0;
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

tr.hidden {
  display: none;
}

tr:hover td {
  background: rgba(61, 156, 240, 0.06);
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

.code {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--info);
  white-space: nowrap;
}

.sev {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
}

.sev-info { background: rgba(122, 162, 247, 0.15); color: var(--info); }
.sev-ok { background: rgba(62, 207, 142, 0.15); color: var(--ok); }
.sev-warn { background: rgba(230, 184, 77, 0.15); color: var(--warn); }
.sev-err { background: rgba(240, 113, 120, 0.15); color: var(--err); }
.sev-crit { background: rgba(240, 113, 120, 0.28); color: #ffb4b8; }

.note {
  color: var(--muted);
  font-size: 0.8rem;
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty.hidden {
  display: none;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

/* Mark matches */
mark {
  background: rgba(230, 184, 77, 0.35);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* Docs layout (cheatsheets / playbooks) */
.docs-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 3rem;
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1rem;
  align-items: start;
}

.doc-nav {
  position: sticky;
  top: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.doc-link {
  appearance: none;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.3;
}

.doc-link:hover {
  background: var(--surface);
  color: var(--text);
}

.doc-link.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.doc-view {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.15rem 1.5rem;
  min-width: 0;
  overflow-x: auto;
}

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

.small {
  font-size: 0.8rem;
}

/* Markdown prose */
.prose h1 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.prose h2 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 650;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.prose h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.prose h4 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--muted);
}

.prose p {
  margin: 0.45rem 0 0.65rem;
}

.prose ul,
.prose ol {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.25rem;
}

.prose li {
  margin: 0.2rem 0;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose strong {
  color: #fff;
  font-weight: 650;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}

.prose pre {
  margin: 0.65rem 0 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #c8d3e6;
}

.md-table-wrap {
  overflow-x: auto;
  margin: 0.65rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.md-table th,
.md-table td {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.md-table th {
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.md-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 720px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .doc-nav {
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
    overflow: visible;
  }

  .doc-link {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 999px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .doc-link.active {
    box-shadow: none;
    background: var(--accent-dim);
    border-color: var(--accent);
    color: #fff;
  }
}

@media (max-width: 560px) {
  html { font-size: 14px; }
  th, td { padding: 0.4rem 0.45rem; }
}
