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

/* ── Colour tokens ── */
:root {
  --bg:         #f7f5f2;
  --bg-alt:     #edeae6;
  --text:       #1a1a1a;
  --text-muted: #777;
  --text-dim:   #aaa;
  --border:     #dedad5;
  --code-bg:    #edeae6;
}

body.dark {
  --bg:         #2a2a28;
  --bg-alt:     #323230;
  --text:       #e8e4de;
  --text-muted: #8a8680;
  --text-dim:   #5a5754;
  --border:     #3e3d3a;
  --code-bg:    #323230;
}

body {
  font-family: Georgia, serif;
  background: var(--bg);
  color: var(--text);
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  line-height: 1.7;
  transition: background 0.2s, color 0.2s;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* ── Header ── */
header {
  margin-bottom: 56px;
}

header h1 {
  font-size: 1.6rem;
  font-weight: normal;
  letter-spacing: -0.5px;
}

header p.tagline {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

nav {
  margin-top: 18px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 16px;
}

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

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

/* ── Theme toggle ── */
#theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, color 0.2s;
  font-family: Georgia, serif;
}

#theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Section ── */
.section {
  margin-bottom: 52px;
}

.section h2 {
  font-size: 0.75rem;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Post list ── */
.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list .date {
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-family: monospace;
  flex-shrink: 0;
}

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

.post-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Individual post page ── */
.post-header {
  margin-bottom: 40px;
}

.post-header h1 {
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: -0.4px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.post-header .meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: monospace;
}

.post-header .meta .section-tag {
  margin-left: 12px;
  color: var(--text-dim);
}

.post-body {
  font-size: 1rem;
  line-height: 1.85;
}

.post-body p {
  margin-bottom: 1.2em;
}

.post-body h2 {
  font-size: 1.1rem;
  margin: 2em 0 0.6em;
  font-weight: normal;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}

.post-body h3 {
  font-size: 1rem;
  margin: 1.6em 0 0.4em;
  font-weight: bold;
}

.post-body ul, .post-body ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.post-body li {
  margin-bottom: 0.3em;
}

.post-body code {
  font-family: "Courier New", monospace;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.88em;
}

.post-body pre {
  background: var(--code-bg);
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.87em;
  line-height: 1.6;
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  color: var(--text-muted);
  margin-bottom: 1.2em;
}

/* ── Back link ── */
.back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 40px;
}

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

/* ── Footer ── */
footer {
  margin-top: 72px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
