:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #1f6feb;
  --green: #3fb950;
  --code-bg: #1c2128;
  --max-width: 720px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Layout ── */

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

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

section:last-of-type { border-bottom: none; }

/* ── Hero ── */

.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero h1 code {
  background: var(--surface);
  padding: 0.1em 0.3em;
  border-radius: 6px;
  font-size: 0.9em;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
}

.hero .cta {
  display: inline-flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity 0.15s;
}

.btn:hover { text-decoration: none; opacity: 0.85; }

.btn-primary {
  background: var(--accent-dim);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ── Code block ── */

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 1.5rem 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ── Section headings ── */

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ── Why grid ── */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

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

.why-card h3 {
  color: var(--green);
  margin-bottom: 0.35rem;
}

.why-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Steps ── */

.steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent-dim);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.step-content h3 { margin-bottom: 0.2rem; }
.step-content p { color: var(--text-muted); font-size: 0.9rem; }

/* ── Format table ── */

.format-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.format-table th,
.format-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.format-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.format-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* ── Install table ── */

.install-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.install-table th,
.install-table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.install-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.install-table td:first-child { font-weight: 600; white-space: nowrap; }

.install-table code {
  font-size: 0.8rem;
  word-break: break-all;
}

/* ── Footer ── */

footer {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Responsive ── */

@media (max-width: 600px) {
  .hero { padding: 4rem 0 3rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero .subtitle { font-size: 1.05rem; }
  section { padding: 3rem 0; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  #writing .why-grid { grid-template-columns: 1fr; }
  pre { padding: 1rem; font-size: 0.8rem; }
  .install-table code { font-size: 0.75rem; }
}
