:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #4f46e5;
  --accent-text: #4338ca;
  --code-bg: #f1f5f9;
  --callout-bg: #eef2ff;
  --callout-border: #c7d2fe;
  --callout-text: #3730a3;
}

html.dark {
  --bg: #020617;
  --surface: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #1e293b;
  --accent: #818cf8;
  --accent-text: #c7d2fe;
  --code-bg: #1e293b;
  --callout-bg: #1e1b4b;
  --callout-border: #3730a3;
  --callout-text: #c7d2fe;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}
.brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--accent);
  text-decoration: none;
}
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

/* Article */
.article {
  padding: 8px 0 72px;
}
.eyebrow {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 10px;
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.lead {
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 12px;
}
.byline {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
}
h2 {
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 52px 0 14px;
}
h3 {
  font-size: 20px;
  margin: 32px 0 10px;
}
p {
  margin: 0 0 18px;
}
ul,
ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
li {
  margin: 6px 0;
}
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

code {
  font-family: ui-monospace, 'SF Mono', Consolas, Menlo, monospace;
  background: var(--code-bg);
  color: var(--accent-text);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
  white-space: nowrap;
}

/* Multi-line code blocks. */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
}
pre code {
  background: none;
  color: var(--text);
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  white-space: pre;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 16px;
}
th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  color: var(--callout-text);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 24px;
}
.callout p:last-child {
  margin-bottom: 0;
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  margin: 4px 0 8px;
}
.cta:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 24px 0 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}
.site-footer a {
  color: var(--muted);
}
.site-footer a:hover {
  color: var(--accent);
}
