:root {
  --bg: #07090d;
  --surface: #0e1219;
  --surface-2: #141a24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #c8cdd5;
  --heading: #eaedf2;
  --muted: #77808e;
  --gold: #c49a2a;
  --blue: #2e6bac;
  --red: #c44332;
  --green: #2a8c5e;
  --verify: #4b8fd4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 80px 80px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: rgba(7, 9, 13, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.64);
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.nav-button,
.pill,
.reset-button {
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: border-color 160ms, color 160ms, background 160ms;
}

.nav-button {
  padding: 0 12px;
}

.nav-button:hover,
.pill:hover,
.reset-button:hover,
.pill.active {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--heading);
}

.nav-button.cta,
.pill.status-strategic_anchor.active {
  border-color: rgba(196, 154, 42, 0.42);
  color: var(--gold);
}

.hero,
.layers,
.site-footer {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  padding: 118px 0 36px;
}

.overline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.overline::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
}

h1 {
  margin: 0 0 18px;
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.06;
}

h1 span,
.accent {
  color: var(--gold);
}

.hero-copy {
  max-width: 690px;
  margin: 0 0 28px;
  font-size: 18px;
}

.hero-copy strong {
  color: var(--heading);
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-bar div {
  padding: 18px 18px 18px 0;
}

.stats-bar strong {
  display: block;
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.stats-bar span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-bar {
  position: sticky;
  z-index: 40;
  top: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 24px;
  background: rgba(7, 9, 13, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter-group:not(:last-of-type)::after {
  content: "";
  width: 1px;
  margin: 0 4px;
  background: var(--border);
}

.pill,
.reset-button {
  flex: 0 0 auto;
  padding: 0 10px;
}

.pill.zone-DEFEND {
  border-color: rgba(196, 67, 50, 0.3);
}

.pill.zone-GOVERN {
  border-color: rgba(196, 154, 42, 0.3);
}

.pill.zone-VERIFY {
  border-color: rgba(46, 107, 172, 0.3);
}

.pill.zone-HUMAN-CORE {
  border-color: rgba(42, 140, 94, 0.3);
}

.filter-count {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.filter-count strong {
  color: var(--heading);
}

.reset-button {
  display: none;
}

.reset-button.visible {
  display: inline-flex;
  align-items: center;
}

.loading {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 32px auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}

.layer-section {
  padding: 48px 0 22px;
  border-bottom: 1px solid var(--border);
}

.layer-section.hidden {
  display: none;
}

.layer-header {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.layer-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid currentColor;
  color: var(--gold);
  opacity: 0.9;
}

.layer-kicker {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.zone-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
}

h2 {
  margin: 4px 0 0;
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-size: clamp(24px, 4vw, 36px);
}

.layer-why,
.layer-quote {
  max-width: 780px;
}

.layer-why {
  margin: 0 0 14px 68px;
  color: var(--muted);
}

.layer-quote {
  margin: 0 0 22px 68px;
  color: rgba(255, 255, 255, 0.48);
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-style: italic;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.topic-card {
  display: flex;
  min-height: 254px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14, 18, 25, 0.76);
  cursor: pointer;
  transition: transform 160ms, border-color 160ms, background 160ms;
}

.topic-card:hover,
.topic-card.highlight {
  transform: translateY(-2px);
  border-color: rgba(196, 154, 42, 0.52);
  background: rgba(20, 26, 36, 0.88);
}

.topic-card.hidden {
  display: none;
}

.card-top,
.metrics,
.keyword-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-top {
  margin-bottom: 16px;
}

.tier-badge {
  display: inline-grid;
  min-width: 34px;
  height: 22px;
  place-items: center;
  border-radius: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
}

.tier-T1 {
  background: rgba(196, 154, 42, 0.16);
  color: var(--gold);
}

.tier-T2 {
  background: rgba(46, 107, 172, 0.16);
  color: #83b7f1;
}

.tier-T3 {
  background: rgba(42, 140, 94, 0.16);
  color: #7bc89f;
}

.tier-T4 {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.status-live {
  background: #2de38a;
  box-shadow: 0 0 14px rgba(45, 227, 138, 0.8);
}

.status-active_research {
  background: var(--gold);
}

.status-seed {
  background: #717b8c;
}

.status-watch {
  background: #4b5360;
}

.status-strategic_anchor {
  background: #f1c85a;
  box-shadow: 0 0 12px rgba(196, 154, 42, 0.45);
}

.code {
  margin-left: auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

h3 {
  margin: 0 0 10px;
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-size: 18px;
  line-height: 1.25;
}

.definition {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 15px;
}

.metrics {
  margin-top: auto;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.metric-bar {
  width: 38px;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.metric-bar span {
  display: block;
  height: 100%;
}

.keyword-list {
  margin-top: 14px;
}

.keyword {
  overflow: hidden;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-overlay,
.panel-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(12px);
}

.search-overlay {
  display: flex;
  justify-content: center;
  padding: 92px 20px 20px;
}

.search-box {
  width: min(720px, 100%);
}

.search-box input {
  width: 100%;
  height: 58px;
  padding: 0 20px;
  border: 1px solid rgba(196, 154, 42, 0.38);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-size: 18px;
}

.search-results {
  overflow: auto;
  max-height: min(580px, calc(100vh - 190px));
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.search-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-meta {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.search-title {
  margin-top: 4px;
  color: var(--heading);
  font-family: "Sora", sans-serif;
  font-weight: 600;
}

.search-def {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.search-hint {
  margin-top: 10px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-align: center;
}

.detail-panel {
  position: fixed;
  z-index: 90;
  top: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  width: min(560px, 100%);
  padding: 72px 28px 28px;
  border-left: 1px solid rgba(196, 154, 42, 0.22);
  background: rgba(10, 13, 19, 0.98);
  box-shadow: -24px 0 80px rgba(0, 0, 0, 0.38);
}

.detail-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
}

.detail-panel h2 {
  font-size: 30px;
}

.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.detail-pill {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.detail-section {
  margin-top: 24px;
}

.detail-section h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.share-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 22px;
  padding: 0 12px;
  border: 1px solid rgba(196, 154, 42, 0.36);
  border-radius: 4px;
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-decoration: none;
}

.site-footer {
  padding: 54px 0 70px;
  color: rgba(255, 255, 255, 0.28);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-align: center;
}

.site-footer p {
  color: rgba(255, 255, 255, 0.48);
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-style: italic;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .site-header {
    padding: 0 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero,
  .layers,
  .site-footer,
  .loading {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-top: 94px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    padding: 10px 14px;
  }

  .filter-count {
    margin-left: 0;
  }

  .layer-header {
    grid-template-columns: 1fr;
  }

  .layer-why,
  .layer-quote {
    margin-left: 0;
  }

  .topic-card {
    min-height: 0;
  }
}
