:root {
  --bg-primary: #0a0b0f;
  --bg-secondary: #12131a;
  --bg-card: #161820;
  --bg-card-hover: #1a1c26;
  --border: #1e2030;
  --border-hover: #2a2d42;
  --text-primary: #e8e9ed;
  --text-secondary: #8b8fa3;
  --text-muted: #5a5e73;
  --accent-blue: #4f8ff7;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a78bfa;
  --accent-pink: #f472b6;
  --gradient-hero: linear-gradient(135deg, #4f8ff7 0%, #22d3ee 50%, #34d399 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* LOADING SCREEN */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  text-align: center;
}

.globe-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader p {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.05em;
}

/* NAVBAR */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: rgba(10, 11, 15, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

#navbar.scrolled {
  background: rgba(10, 11, 15, 0.95);
  box-shadow: var(--shadow-md);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  color: var(--accent-cyan);
  font-size: 18px;
}

.nav-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.nav-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.08);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}

.nav-year { color: var(--text-muted); }
.nav-separator { color: var(--text-muted); }
.nav-year.highlight { color: var(--accent-cyan); }

/* HERO */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(79, 143, 247, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(34, 211, 238, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(52, 211, 153, 0.04) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 860px;
  padding: 0 24px;
}

.hero-overline {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

#hero h1 {
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.hero-stat-unit {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-left: 2px;
}

.hero-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  animation: float 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* SECTIONS */
section {
  padding: 100px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-overline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.card-wide {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.card-badge.warning {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
}

.chart-container {
  position: relative;
  height: 280px;
}

.card-wide .chart-container {
  height: 320px;
}

/* STAT ROW */
.card-stat-row {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px 24px;
}

.mini-stat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.mini-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.mini-stat-icon.rise {
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-green);
}

.mini-stat-icon.decline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.mini-stat-icon.neutral {
  background: rgba(79, 143, 247, 0.1);
  color: var(--accent-blue);
}

.mini-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.mini-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* TIPPING POINTS */
.tipping-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  position: relative;
}

.tp-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--risk);
  border-radius: 4px;
  opacity: 0.08;
  z-index: 0;
}

.tp-item.high .tp-bar { background: var(--accent-red); }
.tp-item.medium .tp-bar { background: var(--accent-amber); }

.tp-name {
  font-size: 13px;
  color: var(--text-secondary);
  z-index: 1;
  padding: 8px 0 8px 12px;
}

.tp-value {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
  z-index: 1;
  padding-right: 12px;
}

.tp-item.high .tp-value { color: var(--accent-red); }
.tp-item.medium .tp-value { color: var(--accent-amber); }

/* TIMELINE */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.tl-item:last-child { border-bottom: none; }

.tl-year {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  min-width: 56px;
  flex-shrink: 0;
}

.tl-event {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* RISK MATRIX */
.risk-matrix {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.risk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}

.risk-level {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.risk-level.critical { background: var(--accent-red); box-shadow: 0 0 8px rgba(239,68,68,0.4); }
.risk-level.high { background: var(--accent-amber); box-shadow: 0 0 8px rgba(245,158,11,0.3); }
.risk-level.medium { background: var(--accent-blue); }

.risk-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.risk-prob {
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

/* SUMMARY */
.card-summary {
  background: linear-gradient(135deg, rgba(79,143,247,0.05), rgba(34,211,238,0.05), rgba(52,211,153,0.03));
  border-color: rgba(34,211,238,0.15);
}

.card-summary h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.summary-item {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
}

.summary-icon {
  display: block;
  font-size: 20px;
  color: var(--accent-cyan);
  margin-bottom: 10px;
}

.summary-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.summary-desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 32px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

.footer-right {
  font-size: 12px;
  color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-meta { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .card-stat-row {
    grid-column: span 1;
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 32px; }
}

@media (max-width: 640px) {
  section { padding: 60px 16px; }
  .card-stat-row { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .hero-stat-value { font-size: 32px; }
  .footer-content { flex-direction: column; gap: 16px; }
}

/* ANIMATIONS */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
