:root {
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --text: #1c1e21;
  --text-muted: #5b6270;
  --border: #e3e5e9;
  --accent: #3b5bfd;
  --accent-subtle: #eef1ff;
  --max-width: 800px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-subtle: #1c1f24;
    --text: #eceef1;
    --text-muted: #9aa2b1;
    --border: #2a2e35;
    --accent: #7c93ff;
    --accent-subtle: #1e2440;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 48px 0 32px;
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.updated {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Table of contents */

.toc {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  counter-reset: toc-counter;
}

.toc li {
  counter-increment: toc-counter;
  font-size: 0.9rem;
}

.toc li::before {
  content: counter(toc-counter) ". ";
  color: var(--text-muted);
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

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

/* Main content */

main {
  padding: 40px 24px 80px;
}

.lead {
  font-size: 1.08rem;
  color: var(--text-muted);
}

h2 {
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

section:first-of-type h2,
main > section:nth-of-type(1) h2 {
  border-top: none;
  padding-top: 0;
}

h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

p {
  margin: 0.75rem 0;
}

ul {
  margin: 0.75rem 0;
  padding-left: 1.4rem;
}

li {
  margin: 0.35rem 0;
}

code {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.placeholder {
  display: inline-block;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.9rem;
  font-style: italic;
}

/* Table */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

thead {
  background: var(--bg-subtle);
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 600;
  white-space: nowrap;
}

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

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive */

@media (max-width: 600px) {
  .site-header {
    padding: 32px 0 24px;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

  main {
    padding: 32px 20px 60px;
  }

  h2 {
    font-size: 1.2rem;
  }
}
