:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #181818;
  --text: #f2f2f2;
  --text-dim: #a0a0a0;
  --text-muted: #666666;
  --border: #2a2a2a;
  --accent: #ff2a2a;
  --accent-hover: #ff5555;
  --product: #ff2a2a;
  --person: #3b82f6;
  --company: #22c55e;
  --vc: #f59e0b;
  --radius: 0;
  --gap: 1.5rem;
  --max-width: 1100px;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-body: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

.container { width: min(var(--max-width), 100% - 2rem); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-bar { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: .04em;
  display: flex; align-items: baseline; gap: .35rem;
}
.brand-suffix {
  font-size: .65em;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: .05rem .25rem;
}
.site-nav { display: flex; gap: 1.75rem; font-weight: 600; font-size: .95rem; }
.site-nav a { color: var(--text-dim); }
.site-nav a:hover { color: var(--text); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  padding: .25rem .6rem;
  cursor: pointer;
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: .75rem;
    display: none;
  }
  .site-nav.open { display: flex; }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}
.footer-meta { margin-top: .5rem; color: #444; }

/* Hero */
.hero {
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  font-weight: 900;
  letter-spacing: -.02em;
}
.hero .lead {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 0 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .8rem 1.4rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 4rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label { margin-top: .6rem; color: var(--text-dim); font-size: .9rem; }

/* Sections */
.section { padding: 4rem 0; }
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 1.5rem;
  display: flex; align-items: baseline; gap: .75rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); border-color: #444; }
.card h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--text-dim); font-size: .95rem; }
.card-meta { color: var(--text-muted); font-size: .8rem; margin-top: .75rem; }

/* Articles list */
.filter-bar {
  display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .8rem 1rem;
  font-size: 1rem;
  outline: none;
}
.search-input:focus { border-color: var(--accent); }
.article-list { display: flex; flex-direction: column; gap: 1rem; }
.article-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.article-item:hover { border-color: #444; }
.article-item h3 { margin: 0 0 .35rem; font-size: 1.2rem; }
.article-item .meta { color: var(--text-muted); font-size: .85rem; margin-bottom: .5rem; }
.article-item .excerpt { color: var(--text-dim); font-size: .95rem; margin: 0; line-height: 1.6; }
.hidden { display: none !important; }

/* Article detail */
.article-header {
  padding: 4rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.article-header h1 { margin: 0 0 1rem; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.2; }
.article-meta { color: var(--text-dim); display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .95rem; }
.article-meta .author { color: var(--accent); font-weight: 700; }
.article-body {
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 2.5rem 0 4rem;
  max-width: 760px;
}
.article-body h1, .article-body h2, .article-body h3 { font-family: var(--font-ui); margin: 2rem 0 1rem; }
.article-body h1 { font-size: 1.6rem; }
.article-body h2 { font-size: 1.35rem; }
.article-body p { margin: 0 0 1.2rem; }
.article-body ul, .article-body ol { margin: 0 0 1.2rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: .4rem; }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.article-body strong { color: #fff; }
.article-body code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: .1rem .35rem;
  font-size: .9em;
}
.article-body a { color: var(--accent); text-decoration: underline; }

.entity-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.entity-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .35rem .7rem;
  font-size: .85rem;
  color: var(--text-dim);
}
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0 4rem;
}
.article-nav a { background: var(--surface); border: 1px solid var(--border); padding: 1rem; }
.article-nav a:hover { border-color: var(--accent); }
.article-nav .label { font-size: .8rem; color: var(--text-muted); }
.article-nav .title { font-weight: 700; margin-top: .25rem; }
@media (max-width: 560px) { .article-nav { grid-template-columns: 1fr; } }

/* Graph page */
.graph-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  min-height: calc(100vh - 64px - 1px);
}
#graph-stage {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #111 0%, #0a0a0a 100%);
  overflow: hidden;
}
#graph-stage svg { width: 100%; height: 100%; display: block; }
.graph-sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.25rem;
}
.graph-controls {
  position: absolute;
  top: 1rem; left: 1rem;
  display: flex; gap: .5rem;
  z-index: 10;
}
.graph-controls button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .4rem .8rem;
  font-size: .85rem;
  cursor: pointer;
}
.graph-controls button:hover { border-color: var(--accent); }
.graph-search {
  position: absolute;
  top: 1rem; right: 1rem;
  z-index: 10;
}
.graph-search input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .5rem .75rem;
  width: 220px;
  font-size: .9rem;
}
.graph-legend {
  position: absolute;
  bottom: 1rem; left: 1rem;
  background: rgba(10,10,10,.85);
  border: 1px solid var(--border);
  padding: .75rem 1rem;
  font-size: .8rem;
  z-index: 10;
}
.legend-dot { display: inline-block; width: 10px; height: 10px; margin-right: .4rem; }

.panel { background: var(--surface-2); border: 1px solid var(--border); padding: 1rem; margin-bottom: 1rem; }
.panel h4 { margin: 0 0 .75rem; font-size: .9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.panel p { margin: 0 0 .5rem; color: var(--text-dim); font-size: .9rem; }
.panel .value { color: var(--text); font-weight: 700; }

.leaderboard-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.leaderboard-tabs button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: .4rem .7rem;
  font-size: .8rem;
  cursor: pointer;
}
.leaderboard-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.leaderboard { display: none; }
.leaderboard.active { display: block; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 28px 1fr 50px;
  gap: .5rem;
  align-items: center;
  padding: .5rem .25rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank { font-family: var(--font-mono); color: var(--text-muted); }
.leaderboard-name { color: var(--text); }
.leaderboard-score { text-align: right; font-family: var(--font-mono); color: var(--accent); }

@media (max-width: 900px) {
  .graph-layout { grid-template-columns: 1fr; grid-template-rows: 60vh auto; }
  .graph-sidebar { border-left: none; border-top: 1px solid var(--border); }
}
