/* ══════════════════════════════════════════════
   ILLINOIS AI ECOSYSTEM MAP — Technê AI
   Shared stylesheet for all pages
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Technê AI Palette */
  --purple: #bd47e6;
  --purple-light: #d580f0;
  --purple-glow: rgba(189,71,230,0.15);
  --black: #040101;
  --white: #ffffff;
  --gray-100: #f7f7f8;
  --gray-200: #e4e4e4;
  --gray-300: #afafaf;
  --gray-400: #969696;
  --gray-500: #7d7d7d;
  --deep-purple: #67247d;
  --dark-purple: #431558;
  --darkest: #270d37;

  /* Functional */
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a72;
  --border: #e4e4e4;
  --success: #2d8a56;
  --warning: #d4940a;
  --danger: #c0392b;
  --info: #2563eb;

  /* Status colors */
  --status-enacted: #2d8a56;
  --status-pending: #d4940a;
  --status-committee: #431558;
  --status-stalled: #c0392b;
  --status-2nd-reading: #2563eb;

  /* Typography */
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--purple); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--deep-purple); }

/* ── SITE HEADER ── */
.site-header {
  background: var(--darkest);
  color: var(--white);
  position: relative;
  z-index: 200;
}
.site-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
}
.site-brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-brand-sub {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 2px;
}

/* ── NAVIGATION ── */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.site-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav-inner::-webkit-scrollbar { display: none; }
.site-nav-inner a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.site-nav-inner a:hover {
  color: var(--darkest);
  border-bottom-color: var(--gray-300);
}
.site-nav-inner a.active {
  color: var(--darkest);
  border-bottom-color: var(--purple);
}
.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}
.site-nav-inner a.active .nav-icon,
.site-nav-inner a:hover .nav-icon { opacity: 1; }

/* ── PAGE LAYOUT ── */
.container { max-width: 1320px; margin: 0 auto; padding: 0 40px; }
.page-section { padding: 56px 0; }
.page-section + .page-section { border-top: 1px solid var(--border); }

/* ── SECTION LABELS ── */
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--darkest);
  margin-bottom: 12px;
  line-height: 1.25;
}
.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin-bottom: 36px;
  line-height: 1.7;
}

/* ── STAT CARDS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(39,13,55,0.08);
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--darkest);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card.accent { border-top: 3px solid var(--purple); }
.stat-card.accent .stat-number { color: var(--purple); }

/* ── TABLES ── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: var(--darkest); color: var(--white); }
th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-100); }
td a { font-weight: 500; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-enacted { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-committee { background: #ede9fe; color: var(--dark-purple); }
.badge-stalled { background: #f0d0cc; color: #8b2020; }
.badge-2nd-reading { background: #dbeafe; color: #1e40af; }

/* ── BILL TAGS ── */
.bill-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--dark-purple);
  display: inline-block;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover {
  box-shadow: 0 8px 32px rgba(39,13,55,0.08);
  transform: translateY(-2px);
}
.card-accent {
  position: relative;
  overflow: hidden;
}
.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--purple);
}

/* ── VECTOR CARDS ── */
.vector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 24px;
}
.vector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: box-shadow 0.25s, transform 0.25s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.vector-card:hover {
  box-shadow: 0 8px 32px rgba(39,13,55,0.08);
  transform: translateY(-2px);
}
.vector-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.vector-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.vector-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--darkest);
  margin-bottom: 10px;
  line-height: 1.3;
}
.vector-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.vector-bills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── SEARCH & FILTERS ── */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 260px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  background: var(--surface);
}
.search-input:focus { border-color: var(--purple); }
.filter-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--purple); color: var(--purple); }
.filter-btn.active {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--purple), var(--gray-300));
}
.tl-item {
  position: relative;
  padding-bottom: 36px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -32px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--purple);
}
.tl-item.past::before {
  background: var(--gray-400);
  box-shadow: 0 0 0 2px var(--gray-400);
}
.tl-item.current::before {
  background: var(--purple);
  box-shadow: 0 0 0 2px var(--purple), 0 0 12px rgba(189,71,230,0.4);
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--purple);
  margin-bottom: 4px;
}
.tl-item.past .tl-date { color: var(--gray-500); }
.tl-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--darkest);
  margin-bottom: 6px;
}
.tl-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
}
.tl-bills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ── CHART CONTAINER ── */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
}
.chart-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--darkest);
  margin-bottom: 20px;
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

/* ── HERO ── */
.page-hero {
  background: var(--darkest);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 140%; height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(189,71,230,0.1) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(67,21,88,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 72px 40px 60px;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: rgba(189,71,230,0.15);
  border: 1px solid rgba(189,71,230,0.3);
  color: var(--purple-light);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 4px;
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.15;
  max-width: 800px;
  margin-bottom: 18px;
}
.hero-title em {
  color: var(--purple);
  font-style: italic;
}
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  max-width: 620px;
  line-height: 1.7;
  margin-bottom: 32px;
}
.hero-meta {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta strong { color: rgba(255,255,255,0.85); font-weight: 600; }

/* ── FOOTER ── */
.site-footer {
  background: var(--darkest);
  color: rgba(255,255,255,0.5);
  padding: 36px 40px;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.7;
}
.site-footer strong { color: rgba(255,255,255,0.8); }
.site-footer a { color: var(--purple-light); }

/* ── NETWORK GRAPH ── */
#network-graph {
  width: 100%;
  min-height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.node-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  fill: var(--text);
}

/* ── DETAIL PANEL ── */
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-bill-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--purple);
  background: var(--purple-glow);
  padding: 4px 12px;
  border-radius: 4px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--darkest);
  margin-bottom: 6px;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.detail-meta-item label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.detail-meta-item span {
  font-size: 0.92rem;
  color: var(--text);
}

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-inner { padding: 48px 20px 40px; }
  .container { padding: 0 16px; }
  .page-section { padding: 32px 0; }
  .site-nav-inner { padding: 0 12px; }
  .site-header-inner { padding: 12px 16px; }
  .vector-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .search-input { min-width: 100%; }
  table { font-size: 0.78rem; }
  th, td { padding: 10px 12px; }
  .hero-meta { gap: 12px; flex-direction: column; }
  .hero-title { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  .hero-sub { font-size: 0.95rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail-meta { grid-template-columns: 1fr; }
  .section-title { font-size: 1.4rem; }
  .section-desc { font-size: 0.9rem; margin-bottom: 24px; }
  .site-footer { padding: 28px 16px; font-size: 0.75rem; }

  /* Network graph responsive */
  #network-graph { min-height: 350px; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .site-nav-inner a { padding: 10px 10px; font-size: 0.72rem; }
  .hero-inner { padding: 32px 14px 28px; }
  .hero-badge { font-size: 0.65rem; padding: 4px 10px; }
  .hero-sub { font-size: 0.85rem; }
  .stat-number { font-size: 1.8rem; }
  .stat-label { font-size: 0.7rem; }
  .chart-container { padding: 16px; }
  .detail-panel { padding: 20px 16px; }
  .detail-header { flex-direction: column; }
  .detail-title { font-size: 1.15rem; }

  /* Tables: ensure min-width so they scroll */
  table { min-width: 580px; }
  th, td { padding: 8px 10px; white-space: nowrap; }
  th:nth-child(2), td:nth-child(2) { white-space: normal; min-width: 140px; }
}
