@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f7f7f5;
  --fg: #1f2023;
  --muted: #6b6e74;
  --accent: #3a5a8c;
  --code-bg: #ecedef;
  --code-border: #dcdee2;
  --rule: #d8dade;
  --column: 44rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --fg: #d4d6da;
    --muted: #8a8d93;
    --accent: #8aa8d4;
    --code-bg: #1f2124;
    --code-border: #2d3034;
    --rule: #2a2c30;
  }
}

html { font-size: 17px; }
body {
  max-width: var(--column);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  font-family: Charter, Georgia, "Times New Roman", serif;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.9rem;
  margin-top: 0;
  margin-bottom: 2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 1.1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
a:hover { background: var(--code-bg); }

code, pre {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

code {
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  border: 1px solid var(--code-border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.4rem 0;
  box-sizing: border-box;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85em;
}

.back {
  margin-bottom: 2.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
}
.back a {
  color: var(--muted);
  border-bottom: none;
}
.back a:hover {
  color: var(--accent);
  background: none;
}

::selection { background: var(--accent); color: var(--bg); }
