:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --text: #1c1e21;
  --text-muted: #5c6370;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --code-bg: #f3f4f6;
  --max-width: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --bg-subtle: #181b21;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: #2a2f3a;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --code-bg: #1f242d;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", "Rubik", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.75;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0 1.25rem;
  margin-bottom: 2.25rem;
}

.site-header-banner {
  margin-bottom: 1.1rem;
}

.site-header-banner img {
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  display: block;
  border-radius: 8px;
}

.site-title {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
}

.site-title a {
  color: var(--text);
}

.site-description {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-nav {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
}

.site-nav a:hover {
  color: var(--text);
}

/* Posts & Lists */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item:first-child {
  padding-top: 0;
}

.post-list-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  line-height: 1.35;
}

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

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

.post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

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

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

.post-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  line-height: 1.25;
}

.post-content {
  font-size: 1.05rem;
  overflow-wrap: break-word;
}

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

.post-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.post-content figcaption {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.post-content blockquote {
  margin: 1.25rem 0;
  padding: 0.5rem 1rem;
  border-inline-start: 3px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 6px;
  direction: ltr;
  text-align: left;
  font-size: 0.9rem;
}

.post-content code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
  direction: ltr;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}

.post-terms {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.term-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  margin-inline-end: 0.35rem;
  margin-bottom: 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2.25rem 0;
  padding-top: 1rem;
  font-size: 0.95rem;
}

/* Comments */
.comments-section {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.comments-section h2 {
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
}

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

.comment-children {
  list-style: none;
  padding-inline-start: 1.5rem;
  margin: 0.75rem 0 0;
  border-inline-start: 2px solid var(--border);
}

.comment-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.9rem;
}

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

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.comment-body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

/* Terms page */
.terms-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
}

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