/* =============================================
   CLEARANCEIQ — Design System
   Dark professional data dashboard
   ============================================= */

/* --- Tokens --- */
:root {
  --bg:          #0B1120;
  --bg-card:     #111827;
  --bg-card-alt: #1a2236;
  --border:      #1F2D45;
  --blue:        #3B82F6;
  --blue-light:  #60A5FA;
  --blue-dim:    rgba(59,130,246,0.12);
  --green:       #10B981;
  --green-dim:   rgba(16,185,129,0.12);
  --amber:       #F59E0B;
  --text-primary:#F1F5F9;
  --text-secondary:#94A3B8;
  --text-muted:  #475569;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Inter', system-ui, sans-serif;
  --radius:      12px;
  --radius-sm:   8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue-light);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* --- Header --- */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  position: sticky;
  top: 0;
  background: rgba(11,17,32,0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

/* --- Hero --- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 40px 56px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.hero-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.hero-number {
  font-family: var(--mono);
  font-size: clamp(64px, 10vw, 96px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-unit {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 200px;
  text-align: left;
  line-height: 1.3;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Loading --- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  gap: 16px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* --- Layout wrapper --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* --- KPI Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: var(--blue);
}

.kpi-card.kpi-accent {
  border-color: var(--blue);
  background: var(--blue-dim);
}

.kpi-value {
  font-size: 40px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.kpi-card.kpi-accent .kpi-value {
  color: var(--blue-light);
}

.mono { font-family: var(--mono); }

.kpi-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

/* --- Insights --- */
.insights-section {
  margin-bottom: 32px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.insight-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

/* --- Chart Sections --- */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chart-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.chart-header {
  margin-bottom: 24px;
}

.chart-wrap { position: relative; }
.chart-wrap--tall { height: 320px; }
.chart-wrap--square { height: 260px; }

/* --- Two Column --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 0;
}

.two-col .chart-section {
  margin-bottom: 0;
}

.two-col {
  margin-bottom: 24px;
}

/* --- Pathway Summary --- */
.pathway-summary {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pathway-item {
  flex: 1;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 80px;
}

.pathway-item .pw-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pathway-item .pw-count {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.pathway-item .pw-pct {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Meta Section --- */
.meta-section {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.meta-block h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.meta-block p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  header { padding: 0 20px; }
  .hero { padding: 48px 20px 40px; }
  main { padding: 0 20px 60px; }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .meta-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .logo-tag { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .hero-unit { max-width: none; text-align: center; }
  .hero-stat { flex-direction: column; align-items: center; gap: 8px; }
}
