:root {
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --text: #1f2328;
  --text-muted: #59636e;
  --border: #d1d9e0;
  --accent: #0b5394;
  --accent-hover: #073763;
  --code-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #161b22;
    --text: #e6edf3;
    --text-muted: #9198a1;
    --border: #30363d;
    --accent: #6cb2f5;
    --accent-hover: #a3ccf7;
    --code-bg: #161b22;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

.site-nav {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* The official mark is dark monochrome; invert it on dark backgrounds. */
.brand-logo {
  height: 1.75rem;
  width: auto;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .brand-logo { filter: invert(1); }
}

.brand-sub {
  font-weight: 400;
  color: var(--text-muted);
}

.brand-byline {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--accent);
}

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

.content {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.content h1, .content h2, .content h3 {
  line-height: 1.25;
  scroll-margin-top: 1rem;
}

.content h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3rem;
  margin-top: 2.25rem;
}

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

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

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

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

.code-wrap { position: relative; }

.copy-code {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.copy-code:hover,
.copy-code:focus-visible,
.copy-code.copied {
  color: var(--accent);
  border-color: var(--accent);
}

table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

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

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

blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.site-footer a { color: var(--text-muted); }
