:root {
  --fg: #1c1c1e;
  --muted: #5c5c66;
  --bg: #fdfdfc;
  --rule: #dcdcd6;
  --code-bg: #f2f2ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e1;
    --muted: #a0a09a;
    --bg: #17171a;
    --rule: #3a3a40;
    --code-bg: #232328;
  }
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

#content {
  max-width: 42rem;
  margin-inline: auto;
  padding: 4rem 1.25rem 8rem;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}

h1 {
  font-size: 2rem;
  margin-top: 0;
}

h2 {
  font-size: 1.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}

h3 { font-size: 1.1rem; }

p, ul, ol { margin: 0 0 1.1rem; }

li { margin-bottom: 0.35rem; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

/* The table is wider than prose width on a narrow screen, so it scrolls itself. */
table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.4rem;
  font-size: 0.94rem;
}

th, td {
  border: 1px solid var(--rule);
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--code-bg);
  font-weight: 600;
}

em { color: var(--muted); }

a {
  color: inherit;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}

a:hover { text-decoration-color: currentColor; }

.raw {
  margin: 0 0 2rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Document frontmatter: metadata, so it stays quieter than the body text. */
.frontmatter {
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}

.frontmatter dt {
  font-weight: 600;
}

.frontmatter dd {
  margin: 0 0 0.5rem;
}

.frontmatter dd:last-child {
  margin-bottom: 0;
}
