:root {
  --bg: #0d1117;
  --card-bg: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --tier-a: #10b981;
  --tier-b: #3b82f6;
  --tier-c: #f59e0b;
  --tier-d: #ef4444;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  padding: 2rem 1rem;
  line-height: 1.5;
}
.container { max-width: 1200px; margin: 0 auto; }
header { text-align: center; margin-bottom: 2rem; }
h1 { font-size: 2.2rem; color: #fff; margin-bottom: 0.5rem; }
p.tagline { color: var(--text-muted); font-size: 1.1rem; max-width: 750px; margin: 0 auto 1.5rem; }

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.stat-badge {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.stat-badge strong { color: #fff; }

.controls {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.search-box {
  flex: 1;
  min-width: 250px;
}
.search-box input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 1rem;
}
.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.btn-filter {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-filter:hover { border-color: var(--accent); }
.btn-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.table-container {
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
th {
  background: #1c2128;
  color: #fff;
  padding: 0.9rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;   /* keep "Tier A" on one line */
  line-height: 1.1;
}
.badge-tier-A { background: rgba(16, 185, 129, 0.2); color: var(--tier-a); border: 1px solid var(--tier-a); }
.badge-tier-B { background: rgba(59, 130, 246, 0.2); color: var(--tier-b); border: 1px solid var(--tier-b); }
.badge-tier-C { background: rgba(245, 158, 11, 0.2); color: var(--tier-c); border: 1px solid var(--tier-c); }
.badge-tier-D { background: rgba(239, 68, 68, 0.2); color: var(--tier-d); border: 1px solid var(--tier-d); }

.tech-title { font-weight: 600; color: #fff; text-decoration: none; display: block; margin-bottom: 0.25rem; }
.tech-title:hover { color: var(--accent-hover); text-decoration: underline; }
.tech-id { font-family: monospace; font-size: 0.8rem; color: var(--text-muted); }
.tech-mechanism { color: var(--text); font-size: 0.85rem; margin-top: 0.35rem; }
.target-tag { display: inline-block; background: #21262d; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.78rem; color: #58a6ff; white-space: nowrap; margin: 0.1rem 0; }

footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--accent-hover); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---------- technique pages ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; text-align: left; }
.back { color: var(--accent-hover); text-decoration: none; font-size: 0.9rem; }
.back:hover { text-decoration: underline; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.chip { display: inline-block; background: #21262d; border: 1px solid var(--border); color: var(--text-muted); padding: 0.15rem 0.55rem; border-radius: 6px; font-size: 0.78rem; white-space: nowrap; }
article.prose { max-width: 860px; margin: 0 auto; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; }
.prose h1 { font-size: 1.9rem; color: #fff; margin-bottom: 1rem; line-height: 1.25; }
.prose h2 { font-size: 1.3rem; color: #fff; margin: 2rem 0 0.75rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.05rem; color: #fff; margin: 1.5rem 0 0.5rem; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--accent-hover); }
.prose a:hover { text-decoration: underline; }
.prose code { background: #1c2128; border: 1px solid var(--border); border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.86em; }
.prose pre { background: #010409; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; line-height: 1.45; }
.prose blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--text-muted); margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; margin-bottom: 1rem; }
.prose table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.9rem; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
@media (max-width: 640px) { article.prose { padding: 1.25rem; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); }
.brand { color: var(--text-muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; text-decoration: none; }
.brand:hover { color: var(--text); }
.top-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.38rem 0.85rem 0.38rem 0.75rem; border: 1px solid rgba(139, 92, 246, 0.38); border-radius: 999px; background: rgba(139, 92, 246, 0.1); color: var(--accent-hover); font-size: 0.82rem; font-weight: 600; text-decoration: none; transition: background 0.15s ease, border-color 0.15s ease; }
.top-link svg { width: 14px; height: 14px; opacity: 0.9; }
.top-link:hover { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.65); }
.top-link.active { background: rgba(139, 92, 246, 0.22); border-color: rgba(139, 92, 246, 0.65); color: #fff; }
@media (max-width: 480px) { .brand { font-size: 0.72rem; } .top-link { font-size: 0.78rem; } }
