﻿:root {
  /* Modern clean color palette */
  --bg: #f8fafc;
  /* Very light slate for clean background */
  --surface: rgba(255, 255, 255, 0.75);
  /* Glass surface */
  --surface-strong: rgba(255, 255, 255, 0.95);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(203, 213, 225, 0.6);
  --border-strong: rgba(203, 213, 225, 0.9);

  /* Brand colors */
  --brand: #2563eb;
  /* Vibrant professional blue */
  --brand-light: #60a5fa;
  --brand-gradient: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);

  /* Status colors */
  --accent: #f59e0b;
  /* Amber */
  --ok: #10b981;
  /* Emerald */
  --danger: #ef4444;
  /* Red */

  /* Effects */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  --shadow-brand: 0 10px 25px -5px rgba(37, 99, 235, 0.25);

  --glass-blur: blur(16px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Background Effects --- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  /* Increased blur for softer look */
  z-index: -3;
  opacity: 0.6;
  pointer-events: none;
  animation: float 20s infinite ease-in-out alternate;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(30px, -30px) scale(1.05);
  }

  100% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

.orb-a {
  width: 600px;
  height: 600px;
  right: -100px;
  top: -150px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.4) 0%, transparent 70%);
}

.orb-b {
  width: 500px;
  height: 500px;
  left: -150px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.2) 0%, rgba(167, 139, 250, 0.2) 50%, transparent 70%);
  animation-delay: -10s;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at top center, black 60%, transparent 100%);
}

/* --- Layout & Typography --- */
h1,
h2,
h3,
h4,
.font-heading {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--brand-light);
}

/* --- Components --- */

/* Header */
.site-header {
  width: min(1200px, calc(100vw - 2rem));
  margin: 1.5rem auto 2rem;
  padding: 0.875rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;

  /* Glassmorphism */
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);

  position: sticky;
  top: 1rem;
  z-index: 50;
  transition: var(--transition);
}

.site-header:hover {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.85);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-badge {
  font-family: "Sora", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  background: var(--brand-gradient);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  box-shadow: var(--shadow-brand);
}

.brand-text {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.top-nav {
  display: flex;
  gap: 1.5rem;
}

.top-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
}

.top-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: var(--transition);
  border-radius: 2px;
}

.top-nav a:hover {
  color: var(--brand);
}

.top-nav a:hover::after {
  width: 100%;
}

/* Main Container */
main {
  width: min(1200px, calc(100vw - 2rem));
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Glass Panel Base */
.glass-panel {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  z-index: 1;
}

/* Hero Section */
.hero {
  padding: clamp(3rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem);
  background: var(--brand-gradient);
  color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.eyebrow {
  display: inline-block;
  font-family: "Sora", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

.hero h1 {
  color: white;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero-copy {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-meta div {
  flex: 1;
  min-width: 200px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
  transition: var(--transition);
}

.hero-meta div:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.hero-meta strong {
  display: block;
  font-size: 1.125rem;
  font-family: "Sora", sans-serif;
  font-weight: 600;
}

.hero-meta small {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
}

/* Sections / Panels */
.panel {
  /* glass-panel base */
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;

  /* panel specifics */
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  z-index: 1;
}

.panel:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.8);
}

.panel-head {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.panel-head h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  position: relative;
}

/* Layout Utilities */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.5rem;
}

/* Generic Cards */
.card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card h3 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card ul {
  padding-left: 1.25rem;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card li {
  margin-bottom: 0.5rem;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.kpi-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: left;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
  opacity: 0.5;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
  opacity: 1;
}

.kpi-card p {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.kpi-card h3 {
  font-size: 2rem;
  color: var(--text-primary);
  font-family: "Sora", sans-serif;
  margin-bottom: 0.25rem;
}

.kpi-card small {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
  gap: 1.5rem;
}

.chart-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-card h3 {
  margin: 0;
}

.chart-card header span {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  flex-grow: 1;
  min-height: 300px;
  max-height: 400px;
}

.canvas-wrap.small {
  min-height: 250px;
}

.chart-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Controls */
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: rgba(248, 250, 252, 0.5);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.control-group select {
  appearance: none;
  background-color: white;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem top 50%;
  background-size: 0.65rem auto;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.control-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.checkbox-group {
  cursor: pointer;
  user-select: none;
}

.checkbox-group input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Metric Lists */
.metric-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.metric-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.metric-list li:last-child {
  border-bottom: none;
}

.metric-list li span {
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metric-list li strong {
  color: var(--text-primary);
  font-family: "Sora", sans-serif;
  font-weight: 600;
}

/* Methodology Flow */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.flow-step {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
  z-index: 1;
}

.flow-step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-light);
}

.flow-step span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--brand-gradient);
  color: white;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.flow-step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.flow-step p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Code & Detail Blocks */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-grid li,
.detail-grid p,
.method-note-card li,
.method-note-card p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-block,
.tree-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  border: 1px solid #1e293b;
  margin-top: 1rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

code {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  background: rgba(15, 23, 42, 0.06);
  color: #c026d3;
  /* Fuchsia for inline code */
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Specific Cards Overrides */
.method-note-card,
.final-summary-card {
  border-left: 4px solid var(--brand);
  background: linear-gradient(to right, rgba(37, 99, 235, 0.05), var(--surface-strong));
}

.source-list {
  padding-left: 1rem;
}

.source-list a {
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--brand);
}

.final-summary-card h4 {
  margin-top: 1.5rem;
  color: var(--brand);
}

.tree-card {
  margin-top: 1.5rem;
}

/* Modal Styles */
.modal {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 90vw;
  width: 650px;
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-close:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.full-tree {
  margin: 0;
  max-height: none;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.5, 0, 0, 1), transform 0.6s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  width: min(1200px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .hero-meta {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .site-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .top-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.6rem;
  }

  .top-nav a {
    font-size: 0.8rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .hero-meta div {
    min-width: 100%;
  }

  .chart-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .control-group {
    width: 100%;
  }

  .control-group select {
    width: 100%;
  }

  .metric-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}