/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface-alt: #22263a;
  --border:      #2e3250;
  --accent:      #6c7fff;
  --text:        #e2e4f0;
  --text-muted:  #7c809a;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--font-mono); font-size: 0.875rem; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ─── Page header ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: var(--space-xl); }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
}
.subtitle { color: var(--text-muted); font-size: 0.95rem; }
.page-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  flex-wrap: wrap;
}
.insights-link { font-size: 0.875rem; color: var(--accent); opacity: 0.8; }
.insights-link:hover { opacity: 1; }

/* ─── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumb { font-size: 0.875rem; color: var(--text-muted); }
.breadcrumb:hover { color: var(--text); }

/* ─── Category grid ──────────────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.category-card:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
  text-decoration: none;
}
.category-icon { font-size: 2rem; }
.category-label { font-weight: 600; font-size: 0.95rem; }
.category-description { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Entity grid ────────────────────────────────────────────────────────── */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.entity-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.entity-card:hover {
  border-color: var(--accent);
  background: var(--surface-alt);
  text-decoration: none;
}
.entity-name { font-weight: 600; }
.entity-description { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Sections ───────────────────────────────────────────────────────────── */
.sections { display: flex; flex-direction: column; gap: var(--space-lg); }

/* ─── Insights list ──────────────────────────────────────────────────────── */
.insights-list { display: flex; flex-direction: column; gap: var(--space-lg); }
.empty-state { color: var(--text-muted); font-size: 0.9rem; padding: var(--space-xl) 0; }

/* ─── Staleness badge ────────────────────────────────────────────────────── */
.stale-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 180, 0, 0.12);
  color: #f5c542;
  border: 1px solid rgba(245, 197, 66, 0.3);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: var(--space-lg) var(--space-md); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title-row { flex-direction: column; gap: var(--space-xs); }
}
