/* ── Reset & base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:      #1a1a1a;
  --ink-2:    #555;
  --ink-3:    #888;
  --paper:    #faf9f7;
  --rule:     #e5e2dc;
  --accent:   #1a1a1a;
  --tag-bg:   #f0ede8;
  --font-serif: 'Lora', Georgia, serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;
  --measure:  680px;
  --gap:      2rem;
}

html { font-size: 18px; }

body {
  font-family: var(--font-serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ─────────────────────────────────────────── */
header, main, footer {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { flex: 1; padding-top: 1.75rem; padding-bottom: 4rem; }

/* ── Header / nav ───────────────────────────────────── */
header { padding-top: 2rem; padding-bottom: 2rem; }

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

/* ── Homepage intro ─────────────────────────────────── */
.intro {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.intro p {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.7;
  font-style: italic;
}

/* ── Post list ──────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0; }

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

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

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-2);
  background: var(--tag-bg);
  padding: 0.15em 0.55em;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-item h2 {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.post-item h2 a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.15s;
}

.post-item h2 a:hover { opacity: 0.55; }

.post-excerpt {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.6;
  font-style: italic;
}

/* ── Pagination ─────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.pagination a, .pagination span {
  padding: 0.3em 0.7em;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 2px;
}

.pagination a:hover { background: var(--tag-bg); }
.pagination .active span { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Single post ────────────────────────────────────── */
.post { max-width: 100%; }

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.post-header h1 {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 0.6rem;
  margin-bottom: 0.75rem;
}

.post-deck {
  font-size: 1rem;
  color: var(--ink-2);
  font-style: italic;
  line-height: 1.6;
}

/* ── Post body typography ───────────────────────────── */
.post-content { font-size: 1rem; }

.post-content p { margin-bottom: 1.4rem; }

.post-content h2 {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.post-content h3 {
  font-size: 1rem;
  font-weight: 500;
  margin: 2rem 0 0.5rem;
}

.post-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.55; }

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}

.post-content li { margin-bottom: 0.3rem; }

.post-content blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--ink-2);
  font-style: italic;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--tag-bg);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

.post-content pre {
  background: #f4f1ec;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.4rem;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 2px;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4rem;
  font-size: 0.88rem;
}

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

.post-content th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

/* ── Post footer ────────────────────────────────────── */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.15s;
}

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

/* ── List title ─────────────────────────────────────── */
.list-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

/* ── About page ─────────────────────────────────────── */
.about h1 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  html { font-size: 16px; }
  .post-header h1 { font-size: 1.4rem; }
}
