:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --link: #1d4ed8;
  --rule: #e4e4e7;
  --code-bg: #f4f4f5;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --text: #e4e4e7;
    --muted: #9b9ba3;
    --link: #8ab4ff;
    --rule: #2a2a2f;
    --code-bg: #1c1c20;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--font);
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.125rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.5rem; }
article h2 { font-size: 1.3rem; }

p, ul, ol, pre, table, blockquote, figure { margin: 0 0 1rem; }

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

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

pre code { background: none; padding: 0; font-size: 0.875rem; }

table { border-collapse: collapse; display: block; overflow-x: auto; }
th, td { padding: 0.4rem 0.75rem 0.4rem 0; border-bottom: 1px solid var(--rule); text-align: left; }

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 2.5rem 0 2.5rem;
}

.site-name { font-weight: 600; color: var(--text); text-decoration: none; }

.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover,
.site-header nav a[aria-current] { color: var(--text); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }

/* Home and lists */

.intro p:first-child { font-size: 1.1875rem; }

.lede, .meta, time { color: var(--muted); }

.list { list-style: none; padding: 0; }
.list li { padding: 0.3rem 0; }

.posts li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.posts time {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.products li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
}

.products span { color: var(--muted); }

.post-header { margin-bottom: 2rem; }
.post-header .meta { margin: 0; }

.back { margin-top: 3rem; }

.portrait {
  display: block;
  width: 112px;
  height: 112px;
  margin: 1.5rem 0;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 30rem) {
  .site-header { padding: 1.5rem 0 2rem; }
  .products li { grid-template-columns: 1fr; gap: 0; }
}
