:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --tag-bg: #1f2937;
  --max-width: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Nav */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-logo:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Main */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Hero (homepage) */
.hero { margin-bottom: 2.5rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-muted); font-size: 1.05rem; }

/* Post list */
.posts h1 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.post-summary {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.post-summary h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.post-summary h2 a { color: var(--text); }
.post-summary h2 a:hover { color: var(--accent); }
.post-summary time { color: var(--text-muted); font-size: 0.85rem; }
.post-summary p { color: var(--text-muted); margin-top: 0.4rem; font-size: 0.95rem; }

/* Single post */
.post-header { margin-bottom: 2rem; }
.post-header h1 { font-size: 2rem; line-height: 1.3; margin-bottom: 0.5rem; }
.post-header time { color: var(--text-muted); font-size: 0.9rem; }

.post-content h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
.post-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1rem; }
.post-content ul, .post-content ol { margin: 0 0 1rem 1.5rem; }
.post-content li { margin-bottom: 0.3rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin: 1rem 0;
}
.post-content code {
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}
.post-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
}
.post-content a { text-decoration: underline; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.post-content th { background: var(--bg-secondary); }

/* Tags */
.tags { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.tag {
  background: var(--tag-bg);
  color: var(--text-muted);
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.85rem; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .post-header h1 { font-size: 1.6rem; }
  .nav-links { gap: 1rem; }
}
