:root {
  --bg: #1a1a2e;
  --bg-code: #16213e;
  --text: #c8c8d0;
  --text-muted: #8888a0;
  --heading: #e0e0ec;
  --accent: #e2b714;
  --link: #7eb8da;
  --link-hover: #a8d8f0;
  --border: #2a2a4a;
  --inline-code-bg: #232345;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Liberation Sans', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  padding: 2rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}

h1 {
  color: var(--heading);
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

h1 a {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

h2 {
  color: var(--heading);
  font-size: 1.3rem;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  color: var(--heading);
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

.site-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1rem 0 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88em;
}

:not(pre) > code {
  background: var(--inline-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre code {
  background: none;
  padding: 0;
}

ul, ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

li {
  margin-bottom: 0.3rem;
}

li s {
  color: var(--text-muted);
}

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

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Post list (home page) */
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  margin-bottom: 1.8rem;
}

.post-list .post-title {
  font-size: 1.2rem;
  color: var(--heading);
}

.post-list .post-title a {
  color: var(--heading);
  border-bottom: none;
}

.post-list .post-title a:hover {
  color: var(--accent);
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.post-summary {
  font-size: 0.95rem;
  color: var(--text);
}

.tag {
  display: inline-block;
  background: var(--inline-code-bg);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.15em 0.55em;
  border-radius: 3px;
  margin-left: 0.3rem;
}

/* Single post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-bottom: 0.4rem;
}

.post-content h2:first-child {
  margin-top: 0;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--link-hover);
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 1.2rem 1rem;
  }
  h1 { font-size: 1.5rem; }
}

/* Pagination */
.pagination {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 2.5rem;
  padding: 0;
}

.pagination li a,
.pagination li span {
  display: inline-block;
  padding: 0.3em 0.65em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.88rem;
  transition: color 0.2s, border-color 0.2s;
}

.pagination li a:hover {
  color: var(--link-hover);
  border-color: var(--link-hover);
}

.pagination li.active span,
.pagination li.active a {
  color: var(--accent);
  border-color: var(--accent);
}

.pagination li.disabled span {
  color: var(--border);
  border-color: var(--border);
  cursor: default;
}