:root {
  --bg: #fdfdfb;
  --fg: #1c1c1c;
  --muted: #6b6b6b;
  --rule: #e5e5e0;
  --link: #1d4ed8;
  --link-hover: #1e3a8a;
  --code-bg: #f3f3ee;
  --measure: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f10;
    --fg: #e6e6e3;
    --muted: #9a9a92;
    --rule: #232425;
    --link: #80a8ff;
    --link-hover: #aac2ff;
    --code-bg: #181a1c;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.5vw + 0.6rem, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 4vw, 1.5rem);
}

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

.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.site-title {
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  font-size: 1.05em;
}
.site .rss {
  font-size: 0.85em;
  color: var(--muted);
  text-decoration: none;
}
.site .rss:hover { color: var(--link); }

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--rule);
  align-items: baseline;
}
.post-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85em;
  flex: 0 0 auto;
}
.post-list a {
  text-decoration: none;
  color: var(--fg);
}
.post-list a:hover { color: var(--link); text-decoration: underline; }
.post-list .empty { color: var(--muted); display: block; }

article h1 {
  font-size: 1.6em;
  line-height: 1.2;
  margin: 0 0 0.25rem;
}
article .meta {
  color: var(--muted);
  font-size: 0.85em;
  margin: 0 0 1.25rem;
}
article .body p { margin: 0 0 1em; }
article .body h2 { font-size: 1.2em; margin: 1.5em 0 0.4em; }
article .body h3 { font-size: 1.05em; margin: 1.4em 0 0.3em; }
article .body code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
article .body pre {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.9em;
}
article .body pre code { background: transparent; padding: 0; }
article .body blockquote {
  margin: 1em 0;
  padding: 0.1em 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}
article .body img { max-width: 100%; height: auto; }

/* Landing page */
body.landing main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.landing h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 1rem;
}
body.landing .links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
body.landing .links a {
  font-size: 1.1em;
}
