/* ============================================
   nanoGPT — Stylesheet
   ============================================ */

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #121214;
  --bg-card: #1a1a1e;
  --bg-card-hover: #222226;
  --border-color: #2a2a2e;
  --border-subtle: #1e1e22;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-purple: #a78bfa;
  --accent-violet: #6366f1;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 960px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-cyan);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(167, 139, 250, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent-purple);
  word-break: break-word;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Utility
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  cursor: default;
}

.nav-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--bg-card);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--accent-purple);
  border: 1px solid var(--border-color);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-gh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-gh:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.06);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  transform: translate(-50%, -20%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 100px;
  font-size: 0.8125rem;
  color: var(--accent-purple);
  font-family: var(--font-mono);
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-violet) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.06);
}

/* ============================================
   Section
   ============================================ */

.section {
  padding: 80px 0;
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

.section-header.centered {
  text-align: center;
}

.section-header.centered p {
  margin: 0 auto;
}

/* ============================================
   Feature Grid (Cards)
   ============================================ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.feature-grid > * {
  min-width: 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s ease;
  min-width: 0;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: #3a3a3e;
}

.card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent-purple);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card pre {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.card pre code {
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ============================================
   Code Block Section (for install / commands)
   ============================================ */

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 24px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.code-body {
  padding: 20px;
  overflow-x: auto;
}

.code-body pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.code-body pre .comment {
  color: var(--text-muted);
  font-style: italic;
}

.code-body pre .cmd {
  color: var(--accent-cyan);
}

.code-body pre .str {
  color: var(--accent-green);
}

.code-body pre .kw {
  color: var(--accent-purple);
}

/* ============================================
   Stats / Numbers Row
   ============================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 60px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

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

/* ============================================
   Table (baselines)
   ============================================ */

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================
   How It Works (numbered steps)
   ============================================ */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.steps-grid > * {
  min-width: 0;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-violet));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

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

/* ============================================
   FAQ / Toggle
   ============================================ */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: #3a3a3e;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: var(--font-sans);
}

.faq-question:hover {
  color: var(--accent-purple);
}

.faq-question .icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-question .icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-answer-inner {
  padding: 0 24px 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

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

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding: 110px 0 56px;
  }

  .code-body {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

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

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-actions {
    flex-direction: column;
  }
}
