:root {
  --bg: #0a0a0c;
  --bg-raised: #111115;
  --bg-card: #16161b;
  --border: #222230;
  --border-bright: #2a2a3a;
  --text: #c8c8d0;
  --text-dim: #6a6a78;
  --text-bright: #eeeef2;
  --accent: #4e9eff;
  --accent-glow: #4e9eff33;
  --green: #3dd68c;
  --green-dim: #3dd68c22;
  --purple: #a78bfa;
  --orange: #f59e0b;
  --pink: #f472b6;
  --paren: #9a9ab0;
  --mono: 'JetBrains Mono', monospace;
  --serif: 'Source Serif 4', Georgia, serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}

/* ── Layout ── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Nav ── */
nav {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
nav .links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13px;
}
nav .links a {
  color: var(--text-dim);
  transition: color 0.2s;
}
nav .links a:hover {
  color: var(--text-bright);
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  padding: 100px 0 80px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-bright);
  letter-spacing: -0.03em;
  max-width: 720px;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-sub {
  font-size: 20px;
  line-height: 1.65;
  color: var(--text);
  max-width: 560px;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

/* ── Code blocks ── */
.code-window {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px var(--border),
    0 4px 32px rgba(0,0,0,0.4),
    0 0 120px var(--accent-glow);
  margin-bottom: 48px;
}

.code-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.code-dot:nth-child(1) { background: #ff5f57; }
.code-dot:nth-child(2) { background: #febc2e; }
.code-dot:nth-child(3) { background: #28c840; }
.code-title {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

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

.code-body pre {
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

/* Override highlight.js colors to match inline snippet palette */
.code-body .hljs {
  background: transparent !important;
  padding: 0 !important;
  color: var(--text);
}
.code-body .hljs-keyword,
.code-body .hljs-symbol,
.code-body .hljs-attr { color: var(--purple) !important; }
.code-body .hljs-string { color: var(--green) !important; }
.code-body .hljs-name,
.code-body .hljs-title,
.code-body .hljs-built_in { color: var(--accent) !important; }
.code-body .hljs-comment { color: var(--text-dim) !important; font-style: italic; }
.code-body .hljs-literal { color: var(--orange) !important; }
.code-body .hljs-number { color: var(--text) !important; }
.code-body .hljs-punctuation { color: var(--paren) !important; }

/* ── Section headings ── */
.section-heading {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-sub {
  color: var(--text);
  font-size: 18px;
  max-width: 600px;
  line-height: 1.65;
  margin-bottom: 48px;
}

/* ── Walkthrough ── */
.narrative {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.walkthrough {
  display: grid;
  gap: 0;
}

.walk-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0;
  position: relative;
}

.walk-line {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.walk-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.walk-connector {
  width: 1.5px;
  flex: 1;
  background: var(--border);
  min-height: 20px;
}

.walk-body {
  padding: 4px 0 48px 20px;
}

.walk-step:last-child .walk-connector {
  display: none;
}
.walk-step:last-child .walk-body {
  padding-bottom: 0;
}

.walk-code {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.walk-desc {
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  max-width: 520px;
}

/* ── Examples section ── */
.examples {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.example-block {
  margin-bottom: 64px;
}
.example-block:last-child {
  margin-bottom: 0;
}

.example-label {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.example-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 12px;
  line-height: 1.3;
}

.example-desc {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  max-width: 560px;
  margin-bottom: 28px;
}

/* ── Gallery ── */
.gallery-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-item {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  transition: border-color 0.3s;
}
.gallery-item:hover {
  border-color: var(--border-bright);
}

.gallery-item .name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.gallery-item .desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ── Try it live links ── */
.try-live-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  margin-bottom: 28px;
}
.try-live-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-bright);
  transition: border-color 0.2s, background 0.2s;
}
.try-live-link:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  text-decoration: none;
}
.try-live-link .link-label {
  color: var(--text-dim);
  font-size: 12px;
}

/* ── Feature list ── */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}
.feature-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 17px;
  line-height: 1.65;
}
.feature-list li:last-child {
  border-bottom: none;
}
.feature-list strong {
  color: var(--text-bright);
  font-weight: 600;
}

/* ── Footer ── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}
footer a { color: var(--text-dim); }
footer a:hover { color: var(--text); }

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

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .hero { padding: 60px 0 48px; }
  .code-body pre { font-size: 15px; }
  .code-body { padding: 18px 16px; }
  .gallery { grid-template-columns: 1fr; }
  nav .links { gap: 16px; }
  .walk-step { grid-template-columns: 36px 1fr; }
}
