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

:root {
  --bg: #0f0f13;
  --surface: #1a1a22;
  --surface-raised: #22222e;
  --border: #2a2a38;
  --text: #e4e4ed;
  --text-muted: #9494a8;
  --accent: #a78bfa;
  --accent-dim: #7c5cbf;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Arial', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #c4b5fd;
}

/* === Layout === */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header === */
header {
  border-bottom: 1px solid var(--border);
  padding: 3rem 0 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.header-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.header-links a {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.header-links a:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* === Sections === */
section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-child {
  border-bottom: none;
}

section h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

section p:last-child {
  margin-bottom: 0;
}

section ul {
  color: var(--text-muted);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

section ul li {
  margin-bottom: 0.4rem;
}

section strong {
  color: var(--text);
  font-weight: 600;
}

section code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-raised);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* === Cast Grid === */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cast-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.cast-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cast-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.cast-card p {
  font-size: 0.88rem;
  line-height: 1.5;
}

.note {
  font-size: 0.88rem;
  font-style: italic;
}

/* === Pipeline Stages === */
.pipeline {
  margin-top: 1.5rem;
}

.stage {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.stage-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}

.stage-content {
  flex: 1;
}

.stage-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.stage-content p {
  font-size: 0.95rem;
}

.stage-content ul {
  font-size: 0.95rem;
}

/* === Stack Grid === */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

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

.stack-card p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Diagram === */
.diagram-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  overflow-x: auto;
}

.diagram-box pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre;
}

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 0.25rem;
}

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

/* === Learnings === */
.learning {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.learning h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.learning p {
  font-size: 0.95rem;
}

/* === Formats Grid === */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.format-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
}

.format-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.format-card p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* === CTA === */
.cta-row {
  text-align: center;
  margin: 1.5rem 0;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.cta:hover {
  background: #c4b5fd;
  color: var(--bg);
}

/* === Links Grid === */
.links-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.links-grid a {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.links-grid a:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

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

/* === Responsive === */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  section {
    padding: 2rem 0;
  }

  section h2 {
    font-size: 1.3rem;
  }

  .cast-grid,
  .stack-grid,
  .formats-grid {
    grid-template-columns: 1fr;
  }

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

  .stage {
    flex-direction: column;
    gap: 0.75rem;
  }

  .diagram-box {
    padding: 1rem;
  }

  .diagram-box pre {
    font-size: 0.7rem;
  }
}
