:root {
  --bg: #09090b;
  --bg-alt: rgba(15, 15, 17, 0.85);
  --surface: rgba(18, 18, 20, 0.9);
  --surface-strong: rgba(28, 28, 32, 0.95);
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --primary: #8b5cf6;
  --primary-strong: #a78bfa;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --border: rgba(255, 255, 255, 0.06);
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  --glow: 0 0 60px rgba(139, 92, 246, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.12), transparent),
              radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.08), transparent),
              radial-gradient(ellipse 40% 30% at 0% 100%, rgba(16, 185, 129, 0.05), transparent),
              var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
  position: relative;
  overflow-x: hidden;
}

/* Subtle grid pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Navigation */
nav {
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(3, 7, 18, 0.45);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo:hover {
  transform: translateY(-1px);
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3), var(--glow);
  transition: box-shadow 0.3s ease;
}

.logo:hover .logo-mark {
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4), 0 0 80px rgba(139, 92, 246, 0.2);
}

.logo-wordmark {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--text-main);
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.2s ease;
}

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--text-main);
}

/* Main Content */
main {
  flex: 1;
  width: 100%;
  padding: 4rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero {
  text-align: left;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}

.hero-text {
  animation: fadeUp 0.8s ease-out forwards;
}

.hero-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: var(--shadow), var(--glow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-kpi:hover {
  transform: translateY(-4px);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.6), 0 0 80px rgba(139, 92, 246, 0.2);
}

.hero-kpi::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  top: -80px;
  right: -80px;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 999px;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #e4e4e7 40%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 550px;
}

/* Buttons */
.cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--text-main);
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3);
  text-decoration: none;
  font-size: 1rem;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(139, 92, 246, 0.45);
}

.btn:active {
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Metrics */
.metric {
  font-size: 3.5rem;
  font-weight: 700;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.metric small {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.gradient-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

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

.icon-chip {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.1));
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.stat-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 0 40px rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Model Pills */
.stacked-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.model-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.model-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Tool Badges */
.tool-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.tool-badge:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

/* Progress */
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 1rem;
}

.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0;
  transition: width 1s ease;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

/* Inputs */
input, .input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  width: 100%;
  font-size: 1rem;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.key-display {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
  color: var(--primary-strong);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(22, 242, 179, 0.15);
  color: var(--success);
}

.badge-danger {
  background: rgba(255, 95, 143, 0.15);
  color: var(--danger);
}

/* Shimmer animation */
.shimmer {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 1.6s infinite;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: auto;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

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

/* Responsive */
@media (max-width: 768px) {
  nav {
    padding: 0.75rem 1.25rem;
  }

  .nav-content {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .cta-row {
    width: 100%;
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .metric {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .logo-mark {
    width: 34px;
    height: 34px;
  }

  .hero-kpi {
    padding: 1.5rem;
  }

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

  table {
    font-size: 0.8rem;
  }

  code {
    font-size: 0.75em;
  }
}

/* Docs-specific styles (included here for consistency) */
.docs-section {
  margin-bottom: 3rem;
}

.code-block {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}

.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  margin: 1rem 0;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: #fde047;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
