:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #475569;
  --link: #1d4ed8;
  --border: #cbd5e1;
  --code-bg: #f1f5f9;
  --pre-bg: #0f172a;
  --pre-fg: #e2e8f0;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 2rem;
}

.home h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 6vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
}

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

.home-links li { margin: 0.35rem 0; }

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.page-header,
.content-wrap {
  width: min(100%, 56rem);
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.page-header {
  padding-top: 2.5rem;
}

.page-header-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-header-row h1 {
  flex: 1;
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
}

.header-link {
  font-size: 1.25rem;
  white-space: nowrap;
}

.content-wrap {
  margin: 2.5rem 0;
  text-align: left;
}

.prose {
  width: 100%;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(2.25rem, 7vw, 3rem); line-height: 1.1; margin: 0 0 1.5rem; }
.prose h2 { font-size: 1.7em; line-height: 1.2; margin-top: 2.2em; }
.prose h3 { font-size: 1.35em; line-height: 1.3; margin-top: 1.8em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 1.1em 0; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 0.16em; }
.prose img { max-width: 100%; height: auto; border-radius: 0.25rem; }
.prose blockquote { border-left: 4px solid var(--border); padding-left: 1rem; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.45rem 0.65rem; }
.prose code { background: var(--code-bg); border-radius: 0.25rem; padding: 0.1rem 0.25rem; font-size: 0.9em; }
.prose pre { overflow-x: auto; border-radius: 0.5rem; padding: 1rem; background: var(--pre-bg); color: var(--pre-fg); }
.prose pre code { background: transparent; padding: 0; color: inherit; }

.post-date { color: var(--muted); font-size: 0.95rem; }
.post-list { margin-top: 1.5rem; }
.post-snippet { border-bottom: 1px solid var(--border); padding: 1.1rem 0; }
.post-snippet h3 { margin: 0 0 0.35rem; }
.post-snippet p { margin: 0.35rem 0; color: var(--muted); }
.post-snippet small { color: var(--muted); }

.chroma { background: transparent; color: inherit; }
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: #93c5fd; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl { color: #86efac; }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .cp { color: #94a3b8; font-style: italic; }
.chroma .m, .chroma .mi, .chroma .mf { color: #fca5a5; }
.chroma .nf, .chroma .nx { color: #fde68a; }

@media (max-width: 640px) {
  .page-header,
  .content-wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
  .page-header-row { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .header-link { font-size: 1rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e293b;
    --fg: #ffffff;
    --muted: #cbd5e1;
    --link: #93c5fd;
    --border: #475569;
    --code-bg: #334155;
    --pre-bg: #020617;
    --pre-fg: #e2e8f0;
  }
}
