@font-face {
  font-family: Charter;
  font-style: normal;
  font-weight: normal;
  font-stretch: normal;
  font-display: swap;
  src: url('/fonts/charter_regular.woff2') format('woff2');
}

@font-face {
  font-family: Charter;
  font-style: italic;
  font-weight: normal;
  font-stretch: normal;
  font-display: swap;
  src: url('/fonts/charter_italic.woff2') format('woff2');
}

@font-face {
  font-family: Charter;
  font-style: normal;
  font-weight: bold;
  font-stretch: normal;
  font-display: swap;
  src: url('/fonts/charter_bold.woff2') format('woff2');
}

@font-face {
  font-family: Charter;
  font-style: italic;
  font-weight: bold;
  font-stretch: normal;
  font-display: swap;
  src: url('/fonts/charter_bold_italic.woff2') format('woff2');
}

:root {
  --bg:      #ffffff;
  --fg:      #111111;
  --muted:   #555555;
  --rule:    #d8d8d8;
  --link:    #1a5ea8;
  --link-hv: #0e3d72;
  --code-bg: #f4f4f4;

  --font-serif: Charter, Georgia, "Times New Roman", ui-serif, serif;
  --font-sans:  system-ui, -apple-system, sans-serif;
  --font-mono:  ui-monospace, Menlo, Consolas, monospace;

  --size:    20px;
  --lead:    1.6;
  --measure: 64ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #1c1c1e;
    --fg:      #e5e5e7;
    --muted:   #8e8e93;
    --rule:    #3a3a3c;
    --link:    #5e9cf5;
    --link-hv: #86b4f9;
    --code-bg: #2c2c2e;
  }
}

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

html { font-size: var(--size); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  line-height: var(--lead);
}

header .header-inner,
main,
footer .footer-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 2rem;
}

header { padding: 1.75rem 0 1.25rem; }

.header-inner {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

main {
  padding-top: 3rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

footer {
  padding: 1.25rem 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted);
}

.site-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

.site-title:hover { color: var(--link); }

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover { color: var(--link); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: bold;
  line-height: 1.2;
  margin: 2rem 0 0.5rem;
}

h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem;  }
h3 { font-size: 1.05rem; }
h4 { font-size: 1rem; font-style: italic; font-weight: normal; }

p, ul, ol, blockquote, table, pre {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hv);
  text-decoration-color: var(--link-hv);
}

blockquote {
  margin: 0.75rem 0 0.75rem 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

blockquote p:last-child { margin-bottom: 0; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

:not(pre) > code {
  background: var(--code-bg);
  border-radius: 2px;
  padding: 0.1em 0.3em;
}

pre {
  background: var(--code-bg);
  border-left: 2px solid var(--rule);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  margin-bottom: 0.75rem;
}

th, td {
  padding: 0.35rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: bold;
  border-bottom: 2px solid var(--fg);
}

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

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-item:last-child { border-bottom: none; }

.post-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: bold;
  color: var(--link);
  text-decoration: none;
  margin-bottom: 0.1rem;
}

.post-title:hover { text-decoration: underline; }

.post-meta,
.post-meta time {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tags li { margin: 0; }

.tags a {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.tags a:hover { color: var(--link); text-decoration: underline; }

.tag-index-list {
  list-style: none;
  padding: 0;
  columns: 2;
  gap: 1rem;
}

.tag-index-list li { margin-bottom: 0.4rem; }

.tag-count {
  font-family: var(--font-sans);
  font-size: 0.8em;
  color: var(--muted);
}

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

.post-header h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.post-footer {
  margin-top: 2.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
}

.home-intro {
  margin-bottom: 2.5rem;
}

.home-intro p:last-child,
.list-intro p:last-child {
  margin-bottom: 0;
}

.list-header {
  margin-bottom: 1.5rem;
}

.list-header h1 {
  margin-top: 0;
}

.not-found { padding: 4rem 0; }

.not-found h1 {
  font-size: 1.55rem;
  margin-top: 0;
}

.formkit-form {
  margin-top: 64px;
}

.formkit-powered-by-convertkit-container {
  background-color: #333;
}