/*
 * Nexus Report Design System
 * Based on 21st.dev component aesthetics
 *
 * Usage: Opus copies this CSS into any report website.
 * Customize: Change --accent color, section content, data values.
 *
 * Structure:
 *   :root variables → base reset → typography → layout →
 *   components (nav, hero, cards, progress, sections, footer) →
 *   dark mode → responsive → animations
 */

/* ── Theme Variables ──────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-card: #ffffff;
  --fg: #000000;
  --fg-muted: #555555;
  --fg-subtle: #888888;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --accent: #00FFA3;
  --accent-soft: rgba(0, 255, 163, 0.15);
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w: 80rem;
  --transition: 200ms ease;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-subtle: #0a0a0a;
  --bg-card: #131313;
  --fg: #ffffff;
  --fg-muted: #a1a1a1;
  --fg-subtle: #666666;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Typography ───────────────────────────────────────────────── */
.text-display {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.text-h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.text-h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.text-body { font-size: 1.125rem; color: var(--fg-muted); line-height: 1.7; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--fg-muted); }
.text-subtle { color: var(--fg-subtle); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.text-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-subtle);
}

.text-stat {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border);
}

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ── Navigation ───────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-subtle);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
}
.nav-link:hover,
.nav-link.active {
  color: var(--fg);
  background: var(--border);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
  width: 3.5rem;
  height: 1.75rem;
  padding: 0.1875rem;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  cursor: pointer;
  border: none;
  position: relative;
  transition: background var(--transition);
}

.theme-toggle-dot {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--fg);
  transition: transform 300ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .theme-toggle-dot {
  transform: translateX(1.75rem);
}

.theme-toggle-icon {
  width: 0.75rem;
  height: 0.75rem;
  fill: var(--bg);
}

/* ── Hero Section ─────────────────────────────────────────────── */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.hero-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-title {
  max-width: 48rem;
  margin: 0 auto 1.5rem;
}

.hero-subtitle {
  max-width: 40rem;
  margin: 0 auto 3rem;
  color: var(--fg-muted);
  font-size: 1.25rem;
  line-height: 1.6;
}

.hero-accent { color: var(--accent); }

/* ── KPI Stats Row ────────────────────────────────────────────── */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.stat-item {
  text-align: center;
  position: relative;
}

.stat-item::before {
  content: '';
  display: block;
  width: 2rem;
  height: 0.1875rem;
  background: var(--accent);
  margin: 0 auto 1rem;
  border-radius: var(--radius-full);
}

.stat-value {
  display: block;
  margin-bottom: 0.25rem;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: 1rem;
}

.card-kpi {
  text-align: center;
  padding: 2rem 1.5rem;
}

.card-kpi .stat-value {
  margin-bottom: 0.5rem;
}

/* ── Progress / Probability Bars ──────────────────────────────── */
.progress-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.progress-value {
  font-size: 0.875rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 0.5rem;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 600ms ease;
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ── Section Headers (sticky) ─────────────────────────────────── */
.section-header {
  position: sticky;
  top: 3.5rem; /* below nav */
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  padding: 1.25rem 0;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}

.section-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-label {
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Timeline ─────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.timeline-dot.muted { background: var(--fg-subtle); }
.timeline-dot.success { background: var(--success); }
.timeline-dot.danger { background: var(--danger); }

/* ── Tags / Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge.warning { background: rgba(234,179,8,0.15); color: var(--warning); }
.badge.danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge.neutral { background: var(--border); color: var(--fg-muted); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  padding: 3rem 0;
  text-align: center;
  color: var(--fg-subtle);
  font-size: 0.8125rem;
  border-top: 1px solid var(--border);
}

.footer a { color: var(--accent); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-row { gap: 2rem; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats-row { gap: 1.5rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 4rem 0 2rem; }
  .nav-links { display: none; }
  .section-header { top: 3.5rem; }
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fade-in-up 0.6s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Scroll-triggered animation (use with IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility ──────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
