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

/* Variables */
:root {
  --font-body: 'Georgia', 'Times New Roman', serif;
  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --color-bg: #fafaf9;
  --color-text: #1c1917;
  --color-muted: #78716c;
  --color-accent: #292524;
  --color-border: #d6d3d1;
  --color-link: #1c1917;
  --color-link-hover: #57534e;
  --color-code-bg: #f5f5f4;
  --max-width: 680px;
}

/* Base */
html { font-size: 18px; line-height: 1.7; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Links */
a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--color-link-hover); }

/* Header */
.site-header { margin-bottom: 3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.site-header nav { display: flex; justify-content: space-between; align-items: baseline; }
.site-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.nav-links a { font-family: var(--font-heading); font-size: 0.85rem; color: var(--color-muted); text-decoration: none; }
.nav-links a:hover { color: var(--color-text); }

/* Home */
.intro { margin-bottom: 3rem; }
.intro h1 { font-family: var(--font-heading); font-size: 2.2rem; font-weight: 700; margin-bottom: 0.3rem; }
.tagline { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-muted); margin-bottom: 1rem; }

/* Post list */
.post-list { list-style: none; }
.post-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.post-list li:last-child { border-bottom: none; }
.post-list a { text-decoration: none; font-weight: 500; }
.post-list time { font-family: var(--font-heading); font-size: 0.8rem; color: var(--color-muted); white-space: nowrap; }
.list-subtitle { display: block; font-size: 0.85rem; color: var(--color-muted); }

/* Article */
.post-header { margin-bottom: 2.5rem; }
.post-header h1 { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; line-height: 1.2; margin-bottom: 0.5rem; }
.subtitle { font-family: var(--font-heading); font-size: 1.1rem; color: var(--color-muted); margin-bottom: 0.5rem; }
.meta { font-family: var(--font-heading); font-size: 0.8rem; color: var(--color-muted); display: flex; gap: 1.5rem; }

/* Table of contents */
.toc { margin-bottom: 2.5rem; padding: 1.5rem; background: var(--color-code-bg); border-radius: 4px; }
.toc h2 { font-family: var(--font-heading); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); margin-bottom: 0.75rem; }
.toc ul { list-style: none; padding-left: 0; }
.toc li { padding: 0.15rem 0; }
.toc a { font-family: var(--font-heading); font-size: 0.85rem; text-decoration: none; color: var(--color-muted); }
.toc a:hover { color: var(--color-text); }
.toc ul ul { padding-left: 1.2rem; }

/* Post content */
.post-content h2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.post-content h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.post-content h4 { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.post-content p { margin-bottom: 1.2rem; }
.post-content ul, .post-content ol { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.4rem; }
.post-content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--color-muted);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.post-content pre {
  background: var(--color-code-bg);
  padding: 1.2rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-content pre code { background: none; padding: 0; }
.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }
.post-content hr { border: none; border-top: 1px solid var(--color-border); margin: 2.5rem 0; }

/* Tables */
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.9rem; }
.post-content th, .post-content td { padding: 0.6rem 0.8rem; border: 1px solid var(--color-border); text-align: left; }
.post-content th { font-family: var(--font-heading); font-weight: 600; background: var(--color-code-bg); }

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Hero */
.hero { display: flex; gap: 2.5rem; align-items: center; margin-bottom: 3rem; }
.hero-text { flex: 1; }
.hero-text h1 { font-family: var(--font-heading); font-size: 2.5rem; font-weight: 700; margin-bottom: 0.3rem; }
.hero-image { flex-shrink: 0; }
.hero-image img { width: 160px; height: auto; border-radius: 8px; }
.hero-links { display: flex; gap: 1.2rem; margin-top: 1rem; }
.hero-links a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--color-muted);
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}
.hero-links a:hover { color: var(--color-text); border-color: var(--color-text); }

/* Roles */
.roles { display: grid; gap: 1.5rem; margin-bottom: 3rem; }
.role h3 { font-family: var(--font-heading); font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.role p { font-size: 0.9rem; color: var(--color-muted); line-height: 1.6; }

/* Nav links spacing */
.nav-links { display: flex; gap: 1.5rem; }

/* Section headings */
.recent h2, .list-page h1 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Essential Reading */
.essential-reading { margin-bottom: 3rem; }
.essential-reading h2 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.3rem; }
.section-intro { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 1.5rem; }
.featured-works { display: grid; gap: 1.2rem; }
.featured-work {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.featured-work:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: var(--color-text);
}
.featured-work h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; margin-bottom: 0.2rem; }
.featured-subtitle { display: block; font-family: var(--font-heading); font-size: 0.85rem; color: var(--color-muted); margin-bottom: 0.8rem; }
.featured-work p { font-size: 0.88rem; color: var(--color-muted); line-height: 1.6; margin: 0; }

/* Responsive */
@media (max-width: 600px) {
  html { font-size: 16px; }
  body { padding: 1rem; }
  .post-header h1 { font-size: 1.6rem; }
  .intro h1 { font-size: 1.8rem; }
  .post-list li { flex-direction: column; gap: 0.2rem; }
  .hero { flex-direction: column-reverse; text-align: center; }
  .hero-links { justify-content: center; }
  .hero-image img { width: 120px; }
}
