/* ============================================================
   Markets Intelligence — Design System
   markets.prasadmali.com
   ============================================================ */

/* 1. RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* 2. DESIGN TOKENS */
:root {
  --bg: #F8F7F4;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F2F0EC;
  --bg-muted: #EDEBE7;

  --accent: #6D28D9;
  --accent-dark: #4C1D95;
  --accent-mid: #7C3AED;
  --accent-light: #EDE9FE;
  --accent-subtle: #F5F3FF;

  --amber: #D97706;
  --amber-dark: #B45309;
  --amber-light: #FEF3C7;
  --amber-subtle: #FFFBEB;

  --sky: #0284C7;
  --sky-dark: #0369A1;
  --sky-light: #E0F2FE;
  --sky-subtle: #F0F9FF;

  --emerald: #059669;
  --emerald-light: #D1FAE5;
  --rose: #E11D48;
  --rose-light: #FFE4E6;

  --text: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #A8A29E;
  --text-inverse: #FAFAF9;

  --border: #E7E5E4;
  --border-strong: #D6D3D1;
  --border-accent: rgba(109,40,217,0.2);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-accent: 0 8px 32px rgba(109,40,217,0.15);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --nav-h: 60px;
  --section-max: clamp(1100px, 88vw, 1600px);
  --section-pad: 64px 24px;
}

[data-theme="dark"] {
  --bg: #0F0E0C;
  --bg-surface: #1A1917;
  --bg-elevated: #242220;
  --bg-muted: #2C2A27;
  --accent-light: #2E1065;
  --accent-subtle: #1A0A3D;
  --amber-light: #451A03;
  --amber-subtle: #1C0A00;
  --sky-light: #0C2340;
  --sky-subtle: #071628;
  --emerald-light: #052E16;
  --rose-light: #4C0519;
  --text: #FAFAF9;
  --text-secondary: #A8A29E;
  --text-muted: #57534E;
  --border: #2C2A27;
  --border-strong: #3C3A37;
  --border-accent: rgba(167,139,250,0.25);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* 3. TYPOGRAPHY */
.font-display   { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.font-h1        { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.font-h2        { font-size: clamp(1.25rem, 2.5vw, 1.5rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }
.font-h3        { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.font-body      { font-size: 1rem; font-weight: 400; line-height: 1.65; }
.font-small     { font-size: 0.875rem; font-weight: 400; line-height: 1.5; }
.font-xs        { font-size: 0.75rem; font-weight: 500; line-height: 1.4; letter-spacing: 0.03em; }
.font-mono      { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.9em; }
.font-label     { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* 4. LAYOUT */
.container { max-width: var(--section-max); margin: 0 auto; padding: 0 24px; }
.section   { padding: var(--section-pad); }
.section + .section { padding-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* 5. NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(248,247,244,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
[data-theme="dark"] .nav { background: rgba(15,14,12,0.85); }

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em;
  color: var(--text);
}
.nav-brand-dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s;
}
.nav-link:hover, .nav-link.active { background: var(--bg-elevated); color: var(--text); }
.nav-link.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-pill {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600;
  background: var(--accent); color: white;
  transition: all 0.15s;
}
.nav-pill:hover { background: var(--accent-dark); transform: translateY(-1px); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 16px; transition: all 0.15s;
}
.theme-toggle:hover { background: var(--bg-muted); color: var(--text); }

/* 6. HERO */
.hero {
  min-height: 360px; padding-top: calc(var(--nav-h) + 40px); padding-bottom: 44px;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 60% 40%, var(--accent-light) 0%, transparent 70%),
              radial-gradient(ellipse 50% 40% at 10% 80%, var(--amber-light) 0%, transparent 60%);
  opacity: 0.6;
}
[data-theme="dark"] .hero-bg { opacity: 0.4; }
.hero-content { position: relative; z-index: 1; max-width: var(--section-max); margin: 0 auto; padding: 0 24px; width: 100%; }

.hero-breadcrumb {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 500; color: var(--text-secondary);
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.hero-breadcrumb a { color: var(--accent); }
.hero-breadcrumb span { color: var(--text-muted); }

.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--accent-light); color: var(--accent);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800;
  line-height: 1.05; letter-spacing: -0.04em;
  color: var(--text); margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text-secondary); max-width: 600px;
  line-height: 1.6; margin-bottom: 40px;
}
.hero-sub strong { color: var(--accent); }

.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
.metric-tile {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.metric-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem; font-weight: 600; line-height: 1;
  color: var(--text); letter-spacing: -0.03em;
}
.metric-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.metric-tile.accent .metric-value { color: var(--accent); }
.metric-tile.amber  .metric-value { color: var(--amber); }
.metric-tile.sky    .metric-value { color: var(--sky); }
.metric-source {
  font-size: 0.65rem; color: var(--text-muted); margin-top: 8px;
  display: flex; align-items: center; gap: 4px;
}
.metric-source a { color: var(--accent); opacity: 0.7; }
.metric-source a:hover { opacity: 1; }

/* 7. SECTION SHELL */
.section-header { margin-bottom: 36px; }
.section-num {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px; opacity: 0.8;
}
.section-title { font-size: clamp(1.3rem, 2.5vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.section-desc { font-size: 0.95rem; color: var(--text-secondary); margin-top: 8px; max-width: 560px; }
.section-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 0 0 60px;
}

/* 8. CARDS */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card.accent-border { border-top: 3px solid var(--accent); }
.card.amber-border  { border-top: 3px solid var(--amber); }
.card.sky-border    { border-top: 3px solid var(--sky); }

/* 9. CHARTS SECTION */
.charts-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
}
.chart-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.chart-card.wide { grid-column: span 2; }
.chart-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.chart-subtitle { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 20px; }
.chart-canvas-wrap { position: relative; }

/* 10. MINDMAP SECTION */
.mindmap-section { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mindmap-container {
  width: 100%; height: 580px; position: relative;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: grab;
}
.mindmap-container:active { cursor: grabbing; }
.mindmap-hint {
  position: absolute; bottom: 12px; right: 16px;
  font-size: 0.7rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  pointer-events: none; z-index: 2;
  background: var(--bg-surface); padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* Mindmap tooltip */
.mm-tooltip {
  position: fixed; z-index: 999;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  max-width: 260px; pointer-events: none;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s;
}
.mm-tooltip.visible { opacity: 1; transform: translateY(0); }
.mm-tooltip-name { font-weight: 700; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
.mm-tooltip-stat {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  font-weight: 600; color: var(--accent); margin-bottom: 6px;
}
.mm-tooltip-detail { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* 11. PLAYERS SECTION */
.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.player-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); display: flex; gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.player-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.player-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
  letter-spacing: -0.02em;
}
.player-info { flex: 1; min-width: 0; }
.player-name { font-weight: 700; font-size: 0.95rem; color: var(--text); margin-bottom: 2px; }
/* Player name as link */
.player-name-row { margin-bottom: 4px; }
.player-name-link {
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  text-decoration: none; transition: color 0.15s;
}
.player-name-link:hover { color: var(--accent); }
/* Market share bar */
.player-share-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.player-share-badge {
  font-size: 0.68rem; font-weight: 600; white-space: nowrap;
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
  background: var(--bg-elevated); padding: 2px 7px;
  border-radius: var(--radius-full); flex-shrink: 0;
}
.player-share-bar {
  flex: 1; height: 3px; background: var(--border);
  border-radius: var(--radius-full); overflow: hidden;
}
.player-share-fill {
  height: 100%; background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.player-segment {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius-full); margin-bottom: 8px;
}
.player-spark { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; font-style: italic; }
.seg-input  { background: var(--amber-light); color: var(--amber-dark); }
.seg-core   { background: var(--accent-light); color: var(--accent); }
.seg-output { background: var(--sky-light); color: var(--sky-dark); }
.seg-multi  { background: var(--bg-elevated); color: var(--text-secondary); }

/* 12. SWOT */
.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.swot-quadrant {
  border-radius: var(--radius-md); padding: 24px; border: 1px solid transparent;
  transition: all 0.2s;
}
.swot-quadrant:hover { transform: scale(1.01); box-shadow: var(--shadow-md); }
.swot-quadrant.strengths  { background: var(--emerald-light); border-color: #A7F3D0; }
.swot-quadrant.weaknesses { background: var(--rose-light); border-color: #FECDD3; }
.swot-quadrant.opportunities { background: var(--sky-light); border-color: #BAE6FD; }
.swot-quadrant.threats    { background: var(--amber-light); border-color: #FDE68A; }
[data-theme="dark"] .swot-quadrant.strengths    { background: rgba(5,150,105,0.12); border-color: rgba(5,150,105,0.25); }
[data-theme="dark"] .swot-quadrant.weaknesses   { background: rgba(225,29,72,0.1); border-color: rgba(225,29,72,0.2); }
[data-theme="dark"] .swot-quadrant.opportunities { background: rgba(2,132,199,0.1); border-color: rgba(2,132,199,0.2); }
[data-theme="dark"] .swot-quadrant.threats       { background: rgba(217,119,6,0.1); border-color: rgba(217,119,6,0.2); }

.swot-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.swot-icon { font-size: 1.3rem; }
.swot-label { font-weight: 800; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.swot-quadrant.strengths  .swot-label { color: #065F46; }
.swot-quadrant.weaknesses .swot-label { color: #9F1239; }
.swot-quadrant.opportunities .swot-label { color: #075985; }
.swot-quadrant.threats    .swot-label { color: #92400E; }
[data-theme="dark"] .swot-quadrant.strengths  .swot-label { color: #6EE7B7; }
[data-theme="dark"] .swot-quadrant.weaknesses .swot-label { color: #FDA4AF; }
[data-theme="dark"] .swot-quadrant.opportunities .swot-label { color: #7DD3FC; }
[data-theme="dark"] .swot-quadrant.threats    .swot-label { color: #FCD34D; }

.swot-items { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.swot-item { display: flex; gap: 8px; font-size: 0.85rem; line-height: 1.5; color: var(--text); }
.swot-item-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; }
.swot-quadrant.strengths  .swot-item-dot { background: #059669; }
.swot-quadrant.weaknesses .swot-item-dot { background: #E11D48; }
.swot-quadrant.opportunities .swot-item-dot { background: #0284C7; }
.swot-quadrant.threats    .swot-item-dot { background: #D97706; }
.swot-quote { font-style: italic; font-size: 0.78rem; opacity: 0.75; margin-top: 2px; display: block; }

/* 13. REGULATORY & TECH CARDS */
.policy-list { display: flex; flex-direction: column; gap: 12px; }
.policy-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px;
  display: flex; gap: 16px; align-items: flex-start;
  transition: all 0.2s;
}
.policy-card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-sm); }
.policy-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.policy-body { flex: 1; }
.policy-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.policy-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.policy-angle {
  font-size: 0.78rem; color: var(--accent); font-style: italic;
  padding: 6px 12px; background: var(--accent-subtle); border-radius: var(--radius-sm);
  display: inline-block; line-height: 1.4;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-full);
  flex-shrink: 0; margin-top: 2px;
}
.status-active  { background: var(--emerald-light); color: #065F46; }
.status-watch   { background: var(--amber-light); color: #92400E; }
.status-monitor { background: var(--sky-light); color: #075985; }
[data-theme="dark"] .status-active  { background: rgba(5,150,105,0.2); color: #6EE7B7; }
[data-theme="dark"] .status-watch   { background: rgba(217,119,6,0.2); color: #FCD34D; }
[data-theme="dark"] .status-monitor { background: rgba(2,132,199,0.2); color: #7DD3FC; }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tech-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  transition: all 0.2s;
}
.tech-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.tech-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }
.tech-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.tech-status {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--radius-full); margin-bottom: 10px;
}
.tech-status.emerging { background: var(--amber-light); color: var(--amber-dark); }
.tech-status.scaling  { background: var(--sky-light); color: var(--sky-dark); }
.tech-status.mainstream { background: var(--emerald-light); color: var(--emerald); }
.tech-desc { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; }
.tech-example { font-size: 0.75rem; color: var(--accent); margin-top: 8px; font-weight: 500; }

/* 14. READING LOG */
.reading-log-section { background: var(--bg-elevated); }
.rl-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.btn-add {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-md);
  background: var(--accent); color: white;
  font-size: 0.85rem; font-weight: 600;
  transition: all 0.15s; flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.btn-add:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(109,40,217,0.25); }
.btn-add svg { width: 16px; height: 16px; }

.rl-empty {
  text-align: center; padding: 60px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg); color: var(--text-muted);
}
.rl-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.rl-empty-text { font-size: 0.9rem; }

.rl-articles { display: flex; flex-direction: column; gap: 14px; }
.rl-article {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px 24px;
  transition: all 0.2s;
}
.rl-article:hover { box-shadow: var(--shadow-md); border-color: var(--border-accent); }
.rl-article-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rl-source { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.rl-date { font-size: 0.75rem; color: var(--text-muted); }
.rl-article-title { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.rl-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rl-tag {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--accent-light); color: var(--accent);
}
.rl-highlights { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; }
.rl-link { font-size: 0.78rem; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; }
.rl-link:hover { text-decoration: underline; }

/* 15. MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-surface); border-radius: var(--radius-xl);
  padding: 32px; max-width: 560px; width: 100%;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  transform: translateY(16px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109,40,217,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-secondary {
  padding: 10px 18px; border-radius: var(--radius-md);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-size: 0.85rem; font-weight: 600; transition: all 0.15s;
}
.btn-secondary:hover { background: var(--bg-muted); }
.btn-primary {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: var(--accent); color: white;
  font-size: 0.85rem; font-weight: 600; transition: all 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }

/* 16. INDEX HUB */
.hub-hero {
  min-height: 600px;
  padding-top: calc(var(--nav-h) + 80px); padding-bottom: 80px;
  position: relative; overflow: hidden;
  display: flex; align-items: center;
}
.hub-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 100%, var(--accent-light) 0%, transparent 60%),
              radial-gradient(ellipse 60% 50% at 10% 20%, var(--amber-light) 0%, transparent 60%);
  opacity: 0.5;
}
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sector-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 22px;
  transition: all 0.2s; position: relative; overflow: hidden;
}
.sector-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--accent-grad, var(--accent));
  transform: scaleX(0); transition: transform 0.3s; transform-origin: left;
}
.sector-card:hover::after { transform: scaleX(1); }
.sector-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.sector-icon { font-size: 1.8rem; margin-bottom: 12px; display: block; }
.sector-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: var(--text); }
.sector-size { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.sector-sub { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.sector-card.populated { border-color: var(--border-accent); }
.sector-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-full);
  background: var(--accent-light); color: var(--accent);
}

/* 17. FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px; text-align: center;
  color: var(--text-muted); font-size: 0.8rem;
}
.footer a { color: var(--accent); }
.footer-inner { max-width: var(--section-max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* 18. SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 19. ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes countUp { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-fade-up { animation: fadeUp 0.5s ease-out forwards; }
.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* 20. IN-PAGE NAV (jump links) */
.page-nav {
  position: sticky; top: var(--nav-h); z-index: 50;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; padding: 0 24px;
}
.page-nav-inner { display: flex; gap: 0; max-width: var(--section-max); margin: 0 auto; }
.page-nav-link {
  padding: 14px 16px; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
.page-nav-link:hover { color: var(--text); }
.page-nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* 21. RESPONSIVE */
@media (max-width: 1024px) {
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .chart-card.wide { grid-column: span 1; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --section-pad: 48px 20px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .swot-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .players-grid { grid-template-columns: 1fr; }
  .mindmap-container { height: 420px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 2rem; }
}

/* 22. SELECTION */
::selection { background: var(--accent-light); color: var(--accent-dark); }

/* 23. SPARK QUOTE */
.spark-quote {
  border-left: 3px solid var(--accent); padding: 12px 16px;
  background: var(--accent-subtle); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem; font-style: italic; color: var(--text-secondary); line-height: 1.55;
  margin: 12px 0;
}
.spark-quote strong { color: var(--accent); font-style: normal; }

/* 24. MINDMAP HOME BUTTON */
.mindmap-container { position: relative; }
.mm-home-btn {
  position: absolute; bottom: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 10;
}
.mm-home-btn:hover {
  background: var(--accent-subtle); color: var(--accent);
  border-color: var(--border-accent);
}

/* 25. POLICY SOURCE LINKS */
.policy-sources { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.policy-source-link {
  font-size: 0.71rem; font-weight: 600;
  color: var(--accent); background: var(--accent-subtle);
  padding: 3px 9px; border-radius: var(--radius-full);
  transition: background 0.15s;
}
.policy-source-link:hover { background: var(--accent-light); }

/* 26. RECENT DEVELOPMENTS */
.developments-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.dev-item {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 20px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dev-item:hover { border-color: var(--border-accent); box-shadow: var(--shadow-md); }
.dev-date {
  font-size: 0.72rem; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); white-space: nowrap;
  min-width: 72px; padding-top: 3px;
  text-align: right;
}
.dev-content { flex: 1; }
.dev-title { font-weight: 700; font-size: 0.9rem; color: var(--text); margin-bottom: 6px; }
.dev-desc { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; }
.dev-tag {
  display: inline-block; font-size: 0.67rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  margin-top: 8px; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--amber-light); color: var(--amber-dark);
}
.dev-tag.tag-policy { background: var(--sky-light); color: var(--sky-dark); }
.dev-tag.tag-market { background: var(--accent-subtle); color: var(--accent); }
.dev-tag.tag-tech { background: var(--emerald-light); color: var(--emerald); }
.dev-link {
  font-size: 0.74rem; font-weight: 600; color: var(--accent);
  margin-top: 6px; display: inline-block;
}
.dev-link:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .dev-item { flex-direction: column; gap: 6px; }
  .dev-date { text-align: left; min-width: unset; }
}
