:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-code: #1c2128;
  --fg: #c9d1d9;
  --fg-strong: #f0f6fc;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #1f6feb;
  --border: #30363d;
  --code-fg: #79c0ff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin: 0;
  line-height: 1.65;
  font-size: 16.5px;
  font-feature-settings: "kern" 1, "liga" 1;
}
.container {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-title {
  font-weight: 600;
  color: var(--fg-strong);
  text-decoration: none;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 1.3rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
}
.site-nav a:hover { color: var(--accent); }

/* Layout */
main {
  padding: 2.2rem 0 3rem;
  min-height: 60vh;
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--fg-strong);
  margin: 1.5em 0 0.55em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
article > header h1 { margin-top: 0; }
h1 { font-size: 1.85rem; font-weight: 700; }
h2 {
  font-size: 1.35rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35em;
}
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 1.0rem; font-weight: 600; color: var(--fg); }

/* Body content */
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin: 0.2em 0; }
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.1s ease;
}
a:hover { border-bottom-color: var(--accent); }
strong { color: var(--fg-strong); font-weight: 600; }
em { color: var(--fg); }

blockquote {
  border-left: 3px solid var(--accent-dim);
  padding: 0.3em 0 0.3em 1.1em;
  color: var(--muted);
  margin: 1.2em 0;
  background: var(--bg-elev);
  border-radius: 0 4px 4px 0;
}
blockquote p { margin: 0.4em 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.3em 0;
}

/* Code */
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--code-fg);
}
pre {
  background: var(--bg-code);
  padding: 1em 1.1em;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1em 0;
  font-size: 0.88em;
  line-height: 1.55;
}
pre code {
  background: none;
  padding: 0;
  color: var(--fg);
  font-size: 1em;
}

/* Rouge syntax highlighting — minimal palette */
.highlight .k, .highlight .kn, .highlight .kc, .highlight .kd { color: #ff7b72; }   /* keyword */
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb { color: #a5d6ff; }   /* string */
.highlight .c, .highlight .c1, .highlight .cm { color: #8b949e; font-style: italic; }/* comment */
.highlight .nf, .highlight .nx { color: #d2a8ff; }                                   /* function */
.highlight .mi, .highlight .mf, .highlight .mh { color: #79c0ff; }                   /* number */
.highlight .nt { color: #7ee787; }                                                   /* tag */
.highlight .na { color: #79c0ff; }                                                   /* attribute */

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 0.94em;
  display: block;
  overflow-x: auto;
}
th, td {
  padding: 0.5em 0.75em;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--bg-elev);
  font-weight: 600;
  color: var(--fg-strong);
}

/* Post listings */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }
.post-meta {
  color: var(--muted);
  font-size: 0.84em;
  margin-bottom: 0.35em;
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.post-title {
  margin: 0 0 0.35em;
  font-size: 1.18rem;
  font-weight: 600;
}
.post-title a {
  color: var(--fg-strong);
  border-bottom: none;
}
.post-title a:hover { color: var(--accent); }
.post-excerpt {
  color: var(--muted);
  margin: 0;
  font-size: 0.96em;
}

/* Article lede (excerpt at top of post) */
.post-lede {
  color: var(--muted);
  font-size: 1.05em;
  font-style: italic;
  margin: 0.4em 0 1.6em;
  padding-bottom: 1em;
  border-bottom: 1px solid var(--border);
}

/* Post nav */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3rem 0 1rem;
  padding: 1.2em 0 0;
  border-top: 1px solid var(--border);
  font-size: 0.93em;
}
.post-nav a { color: var(--muted); }
.post-nav-next { margin-left: auto; text-align: right; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.88em;
  margin-top: 3rem;
}
.site-footer p { margin: 0.25em 0; }
.site-footer .muted { color: #6e7681; font-size: 0.92em; }
.site-footer a {
  color: var(--muted);
  border-bottom-color: var(--border);
}
.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Mobile */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 1.1rem; }
  .site-header { padding: 0.9rem 0; }
  .site-header .container { gap: 0.6rem; }
  .site-nav { margin-left: 0; gap: 0.9rem; flex-wrap: wrap; }
  .site-nav a { font-size: 0.88rem; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.2rem; }
}
