:root {
  --color-bg: #ffffff;
  --color-surface: #f6f8fa;
  --color-border: #d0d7de;
  --color-text: #1f2328;
  --color-text-muted: #656d76;
  --color-accent: #0969da;
  --color-accent-hover: #0550ae;
  --color-code-bg: #f6f8fa;
  --color-code-border: #d0d7de;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 860px;
  --nav-height: 56px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

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

/* ── Navigation ─────────────────────────────── */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  text-decoration: none;
  margin-right: 20px;
  white-space: nowrap;
}

nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

/* ── Layout ─────────────────────────────────── */

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

/* ── Header ─────────────────────────────────── */

header {
  text-align: center;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 56px;
}

header h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 16px;
}

header .tagline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Sections ───────────────────────────────── */

section {
  margin-bottom: 56px;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--color-text);
}

p {
  margin-bottom: 16px;
  color: var(--color-text);
}

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

/* ── Lists ──────────────────────────────────── */

ol, ul {
  padding-left: 1.5em;
  margin-bottom: 16px;
}

li {
  margin-bottom: 10px;
  line-height: 1.6;
}

li strong {
  color: var(--color-text);
}

/* ── Code ───────────────────────────────────── */

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 4px;
  padding: 1px 5px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0;
  tab-size: 2;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ── Table ──────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

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

th {
  background: var(--color-surface);
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  font-weight: 600;
}

td {
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.5;
}

td code {
  white-space: nowrap;
}

tr:nth-child(even) td {
  background: #fafbfc;
}

/* ── Steps ──────────────────────────────────── */

.steps {
  list-style: none;
  padding: 0;
  counter-reset: steps;
}

.steps li {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.steps li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 2px;
}

.steps li div {
  flex: 1;
}

/* ── Extension callout ──────────────────────── */

.callout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 20px;
}

.callout p {
  margin-bottom: 12px;
}

.callout a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

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

/* ── Footer ─────────────────────────────────── */

footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

/* ── Responsive ─────────────────────────────── */

@media (max-width: 640px) {
  nav {
    padding: 0 16px;
  }

  .nav-brand {
    margin-right: 12px;
  }

  nav a {
    font-size: 0.8rem;
    padding: 4px 6px;
  }

  main {
    padding: 0 16px 64px;
  }

  header {
    padding: 48px 0 40px;
  }

  pre {
    padding: 16px;
    font-size: 0.8rem;
  }

  .steps li::before {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
}
