:root {
  --bg: #fcfcfa;
  --fg: #1c1c1c;
  --muted: #585858;
  --border: #dcdcdc;
  --code-bg: #f3f2ee;
  --link: #0b4f8a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #e6e6e2;
    --muted: #9e9e98;
    --border: #2e2e2c;
    --code-bg: #1f1f1d;
    --link: #7ab8f5;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  max-width: 44rem;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.35rem 0;
  font-size: 1.45rem;
  font-weight: 650;
}

header p, .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

nav {
  margin-top: 0.65rem;
  font-size: 0.94rem;
}

nav a {
  margin-right: 1rem;
}

h2 {
  font-size: 1.18rem;
  margin-top: 2.25rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1.02rem;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

p, ul, ol {
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
}

li {
  margin-bottom: 0.35rem;
}

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

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
}

code {
  background: var(--code-bg);
  padding: 0.12rem 0.32rem;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
}

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

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
}
