/* ═══════════════════════════════════════════════════════════
   SITE-TOKENS.CSS — L1 Design System (Frozen)
   Constitutional design anchor: MakcikGPT Primer Dark
   Agents MUST NOT modify without sovereign approval.
   ═══════════════════════════════════════════════════════════ */

/* ── COLOR TOKENS ── */
:root {
  --bg: #0a0a0a;
  --bg-alt: #111111;
  --bg-card: #1a1a1a;
  --bg-hover: #242424;
  --border: #2a2a2a;
  --border-light: #1e1e1e;
  --fg: #f0f0f0;
  --fg-muted: #9a9a9a;
  --fg-subtle: #666666;

  /* Primary triad — orthogonal identity */
  --red: #e0301e;
  --blue: #1f3fd4;
  --yellow: #f2b705;

  /* Topic colors — derived from primary triad */
  --gov: #3B82F6;       /* AI Governance — blue family */
  --inst: #8B5CF6;      /* Institutions — purple */
  --agent: #F59E0B;     /* Agent Systems — yellow family */
  --phys: #10B981;      /* Physical Reality — green */
  --energy: #EF4444;    /* Energy & Economics — red family */
  --origin: #6B7280;    /* Origin — gray */

  /* Typography */
  --body: 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --display: 'Inter', sans-serif;

  /* Spacing */
  --wrap-max: 960px;
  --wrap-pad: 24px;
  --section-gap: 56px;
  --card-radius: 10px;
  --badge-radius: 20px;
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
::selection { background: var(--yellow); color: var(--bg); }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── LAYOUT ── */
.wrap { max-width: var(--wrap-max); margin: 0 auto; padding: 0 var(--wrap-pad); }

/* ── TOPBAR ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
}
.topbar-links { display: flex; gap: 4px; }
.topbar-links a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--fg-muted);
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.topbar-links a:hover { color: var(--fg); background: var(--bg-hover); }
.topbar-links a.active { color: var(--yellow); font-weight: 700; }
.topbar-links a.mcp-portal {
  margin-left: 8px;
  padding: 4px 12px;
  border: 1px solid var(--yellow);
  border-radius: 6px;
  color: var(--yellow);
  font-weight: 700;
  background: rgba(242, 183, 5, 0.06);
  transition: all 0.15s;
}
.topbar-links a.mcp-portal:hover { background: rgba(242, 183, 5, 0.15); color: var(--fg); }
.topbar-sig {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-subtle);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.topbar-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.topbar-dot.r { background: var(--red); }
.topbar-dot.b { background: var(--blue); }
.topbar-dot.y { background: var(--yellow); }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-subtle);
  padding: 12px 0 0;
  letter-spacing: 0.04em;
}
.breadcrumb a { color: var(--fg-muted); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--yellow); }
.breadcrumb .sep { margin: 0 6px; opacity: 0.4; }

/* ── HERO ── */
.hero { padding: 64px 0 48px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 12px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.hero-tags span {
  padding: 4px 10px;
  border-radius: var(--badge-radius);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: var(--bg-alt);
}

/* ── STATS ROW ── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.stat {
  background: var(--bg-card);
  padding: 20px 16px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
  display: block;
}

/* ── QUOTE ── */
.quote {
  position: relative;
  padding: 24px 28px;
  border-radius: var(--card-radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
}
.quote p {
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--fg);
  font-style: italic;
}
.quote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-subtle);
  letter-spacing: 0.06em;
  font-style: normal;
}

/* ── SECTION HEADERS ── */
.sec { margin-top: var(--section-gap); }
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.sec-head h2 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sec-head .line { flex: 1; height: 1px; background: var(--border); }

/* ── BADGES ── */
.badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--badge-radius);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge.r { background: rgba(224, 48, 30, 0.15); color: var(--red); }
.badge.b { background: rgba(31, 63, 212, 0.15); color: var(--blue); }
.badge.y { background: rgba(242, 183, 5, 0.15); color: var(--yellow); }
.badge.g { background: rgba(16, 185, 129, 0.15); color: var(--phys); }
.badge.p { background: rgba(139, 92, 246, 0.15); color: var(--inst); }
.badge.muted { color: var(--fg-muted); background: var(--bg-hover); }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 20px;
  transition: all 0.15s;
}
.card:hover { background: var(--bg-hover); border-color: var(--fg-subtle); }

/* ── ARTICLE LIST ── */
.article-list {
  list-style: none;
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-card);
}
.article-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.article-list li:last-child { border-bottom: none; }
.article-list li:hover { background: var(--bg-hover); }
.article-list a {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
  transition: color 0.15s;
}
.article-list a:hover { color: var(--blue); }
.article-list time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-subtle);
  white-space: nowrap;
}
.article-list .num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  min-width: 32px;
  color: var(--fg-subtle);
}

/* ── CHIP (series marker) ── */
.chip {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--badge-radius);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* ── ORTHOGONAL GEOMETRY MARKERS ── */
.geo { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.geo-square { width: 10px; height: 10px; border-radius: 1px; }
.geo-diamond { width: 8px; height: 8px; border: 2px solid; transform: rotate(45deg); background: transparent; }
.geo-axis { width: 14px; height: 0; border-top: 2px solid; position: relative; }
.geo-axis::after { content: ''; position: absolute; top: -5px; right: -1px; width: 2px; height: 8px; border-left: 2px solid; border-color: inherit; }
.geo-grid { width: 10px; height: 10px; border: 1.5px solid; border-radius: 1px; position: relative; }
.geo-grid::after { content: ''; position: absolute; top: 3px; left: -1px; right: -1px; height: 1px; border-top: 1px solid; border-color: inherit; }
.geo-grid::before { content: ''; position: absolute; left: 3px; top: -1px; bottom: -1px; width: 1px; border-left: 1px solid; border-color: inherit; }
.geo-frame { width: 10px; height: 10px; border: 2px solid; border-radius: 0; }
.geo-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── TOPIC FILTER BUTTONS ── */
.topic-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0; }
.topic-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topic-btn:hover { border-color: var(--fg-subtle); color: var(--fg); }
.topic-btn.active { border-color: var(--yellow); color: var(--yellow); background: rgba(242, 183, 5, 0.05); }
.topic-btn .count { opacity: 0.5; font-size: 10px; }

/* ── SEARCH ── */
.search {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--bg-card);
}
.search input {
  flex: 1;
  border: none;
  padding: 14px 18px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--fg);
  outline: none;
}
.search input::placeholder { color: var(--fg-subtle); }
.search .go {
  padding: 14px 20px;
  background: var(--bg-hover);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  letter-spacing: 0.06em;
  border-left: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.search .go:hover { color: var(--fg); background: var(--border); }

/* ── EMPTY STATE ── */
.empty {
  display: none;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  background: var(--bg-card);
  padding: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-muted);
}
.empty.show { display: block; }

/* ── FOOTER ── */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-subtle);
}
.site-footer a { color: var(--fg-muted); transition: color 0.15s; }
.site-footer a:hover { color: var(--blue); }
.footer-dots { display: flex; align-items: center; gap: 6px; }
.footer-dots .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ── TOPIC LEFT-BORDER on cards ── */
.card[data-topic="governance"] { border-left: 3px solid var(--gov); }
.card[data-topic="institutions"] { border-left: 3px solid var(--inst); }
.card[data-topic="agents"] { border-left: 3px solid var(--agent); }
.card[data-topic="physical"] { border-left: 3px solid var(--phys); }
.card[data-topic="energy"] { border-left: 3px solid var(--energy); }
.card[data-topic="origin"] { border-left: 3px solid var(--origin); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar-sig { display: none; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 0 32px; }
  .stat { padding: 14px; }
  .article-list li { flex-wrap: wrap; }
}
