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

:root {
  --text:       #1a1a1a;
  --muted:      #666;
  --accent:     #0066cc;
  --bg:         #fff;
  --border:     #e5e5e4;
  --max-width:  680px;
  --font:       "Courier New",sans-serif,"Segoe UI";
  --mono:       "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text:   #e8e8e8;
    --muted:  #999;
    --accent: #4da3ff;
    --bg:     #111;
    --border: #2a2a2a;
  }
}

html {
  font-size: 17px;
  line-height: 1.65;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0 1rem;
  overflow-x: hidden;
}

/* ── Layout ── */

header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ── Header / Nav ── */

header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

nav {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-weight: 600;
  font-size: 1rem;
  margin-right: auto;
  text-decoration: none;
  color: var(--text);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav ul a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

nav ul a:hover,
nav ul a.active {
  color: var(--text);
}

/* ── Footer ── */

footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

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

footer a:hover {
  color: var(--text);
}

/* ── Home ── */

.intro {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

/* ── Post list ── */

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

.post-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 480px) {
  .post-list li {
    flex-direction: row;
    align-items: baseline;
    gap: 1.5rem;
  }
}

.post-list time {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

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

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

/* ── Post ── */

.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  line-height: 1.3;
}

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

.categories a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.categories a:hover {
  color: var(--accent);
}

/* ── Post content ── */

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
}

.post-content a {
  color: var(--accent);
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--border);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--border);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
}

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

.post-content blockquote {
  border-left: 3px solid var(--border);
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: var(--muted);
}

/* ── Post nav ── */

.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.post-nav a {
  color: var(--muted);
  text-decoration: none;
}

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

/* ── Section headings ── */

section h1 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}
