:root {
  --bg: #fbfaf7;
  --text: #1f1e1c;
  --muted: #8a867e;
  --link: #1f1e1c;
  --rule: #e6e2da;
  --accent: #b5452b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --text: #e8e5df;
    --muted: #8e8a83;
    --link: #e8e5df;
    --rule: #2c2a27;
    --accent: #e0805f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 36rem; margin: 0 auto; padding: 5rem 1.25rem 6rem; }

a { color: var(--link); text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

header h1 { font-size: 1.5rem; font-weight: 500; margin: 0 0 3rem; letter-spacing: -0.01em; }

.posts { list-style: none; padding: 0; margin: 0; }
.posts li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--rule);
}
.posts li:first-child { border-top: 1px solid var(--rule); }
.posts a { text-decoration: none; }
.posts span { color: var(--muted); font-size: 0.8em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-style: italic; }

nav { margin-bottom: 3.5rem; font-size: 0.9em; }
nav a { text-decoration: none; color: var(--muted); }

article h1 { font-size: 2.1rem; line-height: 1.2; font-weight: 500; margin: 0 0 0.4rem; letter-spacing: -0.015em; }
.date { color: var(--muted); margin: 0 0 2.5rem; font-size: 0.9em; }
article h2 { font-size: 1.25em; font-weight: 500; margin: 2.5rem 0 0.5rem; }
article h3 { font-size: 1.05em; font-weight: 500; margin: 2rem 0 0.5rem; }
article p { margin: 0 0 1.25rem; }
article blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--rule); color: var(--muted); font-style: italic; }
article img { max-width: 100%; height: auto; }
article hr { border: 0; text-align: center; margin: 2.5rem 0; }
article hr::before { content: "* * *"; color: var(--muted); letter-spacing: 0.5em; }
article code { font-size: 0.8em; background: var(--rule); padding: 0.1em 0.3em; border-radius: 3px; }
article pre { overflow-x: auto; background: var(--rule); padding: 1rem; border-radius: 4px; font-size: 0.8em; line-height: 1.5; }
article pre code { background: none; padding: 0; }
article sup a { text-decoration: none; color: var(--accent); }

@media (max-width: 600px) {
  body { font-size: 19px; }
  main { padding: 2.5rem 1rem 4rem; }
  article h1 { font-size: 1.7rem; }
  .posts li { flex-direction: column; gap: 0; }
}

.aside { color: var(--muted); font-size: 0.75em; font-weight: 400; margin-left: 0.5em; font-style: italic; }
article ul, article ol { padding-left: 1.4em; margin: 0 0 1.25rem; }
article li { margin-bottom: 0.35rem; }
article li > ul { margin: 0.25rem 0 0; }
article img { display: block; margin: 2rem auto; border-radius: 4px; }

/* Diagrams: inline SVGs rendered from diagrams/*.jsx */
:root {
  --cds-text-primary: var(--text);
  --cds-text-secondary: var(--muted);
  --cds-chart-axis: #a8a398;
  --cds-chart-grid: #e6e2da;
  --cds-chart-reference-tint: rgba(0, 0, 0, 0.04);
  --cds-chart-categorical-1: #c2552f;
  --cds-chart-categorical-2: #7a5ea8;
  --cds-chart-categorical-3: #2f7d8a;
  --cds-chart-categorical-4: #b08a1e;
  --cds-chart-categorical-5: #5b8a3a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cds-chart-axis: #6c675f;
    --cds-chart-grid: #2c2a27;
    --cds-chart-reference-tint: rgba(255, 255, 255, 0.05);
    --cds-chart-categorical-1: #e8805c;
    --cds-chart-categorical-2: #a98ed6;
    --cds-chart-categorical-3: #5bb0bd;
    --cds-chart-categorical-4: #d6b04a;
    --cds-chart-categorical-5: #8cbd6a;
  }
}
figure.diagram { margin: 2.5rem -2rem; overflow-x: auto; }
figure.diagram svg { display: block; width: 100%; min-width: 620px; height: auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
figure.diagram figcaption { color: var(--muted); font-size: 0.8em; font-style: italic; text-align: center; margin-top: 0.5rem; }
@media (max-width: 760px) {
  /* Phones: span the full screen width and scale to fit instead of scrolling sideways. */
  figure.diagram { margin: 2rem -1rem; overflow: visible; }
  figure.diagram svg { min-width: 0; }
  figure.diagram figcaption { padding: 0 1rem; }
}
.callout { text-align: center; font-size: 1.15em; margin: 1.5rem 0 0.5rem; }
.callout-sep { text-align: center; color: var(--muted); font-style: italic; margin: 0.5rem 0; }
@media (min-width: 1100px) {
  figure.diagram { margin-left: -9rem; margin-right: -9rem; }
}
