:root {
  --bg: #fdfdfc;
  --fg: #1f2328;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e7e5e4;
  --accent: #b45309;
  --code-bg: #f5f5f4;
  --tag-bg: #f3f4f6;
  --max: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --faint: #6b7280;
    --line: #2a2e36;
    --accent: #f59e0b;
    --code-bg: #1f232b;
    --tag-bg: #232730;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 1.4rem; font-size: .95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

/* home */
.intro { padding: 3.5rem 0 1.5rem; }
.intro h1 { font-size: 2rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 .75rem; }
.intro p { color: var(--muted); margin: 0; max-width: 34rem; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 2.5rem 0 .5rem; font-weight: 600; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item { padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.post-item:last-child { border-bottom: 0; }
.post-item h2 { font-size: 1.2rem; line-height: 1.4; margin: .15rem 0 .4rem; letter-spacing: -.01em; }
.post-item h2 a { text-decoration: none; }
.post-item p { margin: 0 0 .6rem; color: var(--muted); font-size: .97rem; }
.meta { font-size: .85rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.tags { display: inline-flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .75rem; background: var(--tag-bg); color: var(--muted); padding: .1rem .55rem; border-radius: 999px; }

/* article */
.article-head { padding: 3rem 0 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 2rem; }
.article-head h1 { font-size: 2.05rem; line-height: 1.25; letter-spacing: -.02em; margin: .4rem 0 .9rem; }
.article-head .meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.prose h2 { font-size: 1.35rem; letter-spacing: -.01em; margin: 2.4rem 0 .6rem; line-height: 1.35; }
.prose h3 { font-size: 1.1rem; margin: 1.8rem 0 .4rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose li { margin: .25rem 0; }
.prose blockquote { margin: 1.4rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.4rem; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
code, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .86em; }
:not(pre) > code { background: var(--code-bg); padding: .12em .38em; border-radius: 5px; }
pre { tab-size: 4; background: var(--code-bg); padding: 1rem 1.1rem; border-radius: 8px; overflow-x: auto; line-height: 1.55; margin: 0 0 1.3rem; border: 1px solid var(--line); }
pre code { font-size: .84rem; }
.note { background: var(--code-bg); border-radius: 8px; padding: .9rem 1.1rem; margin: 1.4rem 0; font-size: .95rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .95rem; }
.post-nav a { text-decoration: none; max-width: 48%; }
.post-nav small { display: block; color: var(--faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }

/* footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding-top: 1.5rem; padding-bottom: 2.5rem; font-size: .85rem; color: var(--faint); }
.site-footer a { color: var(--faint); }

.notfound { padding: 5rem 0 2rem; text-align: center; }
.notfound .code { font-size: 4rem; font-weight: 700; letter-spacing: -.03em; color: var(--faint); line-height: 1; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .intro { padding-top: 2.5rem; }
  .intro h1, .article-head h1 { font-size: 1.65rem; }
  .nav { gap: 1rem; }
}
