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

/* Variables */
:root {
  --text: #2c2c2c;
  --text-secondary: #6b6b6b;
  --text-tertiary: #999;
  --bg: #faf9f7;
  --bg-card: #fff;
  --border: #e8e6e1;
  --border-light: #f0eeea;
  --accent: #3d3d3d;
  --link: #2c2c2c;
  --link-hover: #000;
  --link-underline: #d4c5a0;
  --link-underline-hover: #2c2c2c;
  --code-bg: #f5f3ef;
  --max-width: 680px;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
#container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
#header {
  padding: 48px 0 40px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.logo a {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #3c9def;
  letter-spacing: -0.02em;
}

.logo a:hover {
  color: var(--link-hover);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
}

nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

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

.nav-social {
  display: none;
}

/* Hamburger menu button */
.menu-toggle {
  display: none;
}

.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  z-index: 10;
}

.menu-button span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Main */
#main {
  padding: 0 0 60px;
}

/* Content */
.content {
  min-width: 0;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Article list */
.article {
  margin-bottom: 40px;
}

.article h2 {
  font-size: 1.5rem;
  line-height: 1.35;
  margin-bottom: 4px;
}

.article h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.article h2 a:hover {
  color: var(--text-secondary);
}

.article-meta {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* Article body (full post) */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 48px 0 16px;
}

.article-body h3 {
  font-size: 1.25rem;
  margin: 40px 0 12px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 20px 20px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  border-left: 3px solid var(--link-underline);
  padding: 4px 24px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  font-size: 0.875em;
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.article-body pre {
  background: var(--code-bg);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body a {
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.15s ease;
}

.article-body a:hover {
  text-decoration-color: var(--link-underline-hover);
}

/* Page header */
.page-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

/* Section headings */
.section-heading {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin: 56px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.section-heading:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* Prose (about page style) */
.prose {
  font-size: 0.9375rem;
  line-height: 1.7;
}

.prose p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.prose p:first-child {
  color: var(--text);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.75rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.prose em {
  font-style: italic;
  color: var(--text);
}

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.15s ease;
}

.prose a:hover {
  text-decoration-color: var(--link-underline-hover);
}

/* Back link */
.back-link {
  font-size: 0.8125rem;
  color: var(--text-tertiary) !important;
  text-decoration: none !important;
}

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

/* Post title */
.post-title {
  font-size: 1.75rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

/* Post body inherits prose but resets first-child */
.prose .article-body {
  font-size: 0.9375rem;
  line-height: 1.8;
}

.prose .article-body p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.prose .article-body p:first-child {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
  margin-bottom: 18px;
}

.prose .article-body h3 {
  font-size: 0.6875rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin: 40px 0 16px;
}

.prose .article-body a {
  color: var(--text);
}

.prose .article-body blockquote {
  border-left: 3px solid var(--link-underline);
  padding: 4px 24px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* Read more */
.read-more {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.read-more:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* Footer */
#footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.social-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.social-links a {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  transition: color 0.15s ease;
}

.social-links a:hover {
  color: var(--text);
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Empty state */
.empty-state {
  color: var(--text-tertiary);
  font-style: italic;
  padding: 60px 0;
  font-size: 0.9375rem;
}

/* Responsive */
@media screen and (max-width: 600px) {
  #header {
    padding: 32px 0 28px;
    flex-wrap: wrap;
  }

  .logo a {
    font-size: 1.125rem;
  }

  /* Show hamburger */
  .menu-button {
    display: flex;
  }

  /* Hide nav by default */
  nav {
    display: none;
    width: 100%;
    order: 3;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid var(--border-light);
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav li {
    border-bottom: 1px solid var(--border-light);
  }

  nav li:last-child {
    border-bottom: none;
  }

  nav a {
    display: block;
    padding: 12px 0;
    font-size: 0.9375rem;
  }

  /* Show social links in mobile menu */
  .nav-social {
    display: list-item;
  }

  /* Toggle open */
  .menu-toggle:checked ~ nav {
    display: block;
  }

  /* Animate hamburger to X */
  .menu-toggle:checked ~ .menu-button span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .menu-toggle:checked ~ .menu-button span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked ~ .menu-button span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  #main {
    padding: 0 0 40px;
  }

  #footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 24px 0 36px;
  }

  .page-title {
    font-size: 1.625rem;
  }

  .article h2 {
    font-size: 1.3rem;
  }
}
