:root {
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --bg: #fafaf8;
  --bg-card: #fff;
  --accent: #c43b2e;
  --accent-hover: #a83226;
  --border: #e5e5e0;
  --max-width: 720px;
  --max-width-wide: 960px;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.site-title:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

/* --- Mobile nav toggle --- */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.2s;
}

/* --- Main content --- */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
}

/* --- Hero / intro --- */

.hero {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 540px;
}

/* --- Post list --- */

.posts-section h2 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-date {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.post-card h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.post-card h3 a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s;
}

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card .excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

.read-more {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* --- Article (single post) --- */

.article-header {
  margin-bottom: 2.5rem;
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.article-meta {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.8rem;
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.1rem 1.25rem;
  margin: 1.75rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.35rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #f0f0ec;
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.article-body pre {
  background: #1a1a1a;
  color: #e0e0e0;
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--accent-hover);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* --- About page --- */

.about-content {
  max-width: var(--max-width);
}

.about-content h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.about-content p {
  margin-bottom: 1.35rem;
  color: var(--text-secondary);
}


/* --- Footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Responsive --- */

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    padding: 1rem 1.25rem;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    font-size: 0.95rem;
  }

  main {
    padding: 2rem 1.25rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .article-header h1 {
    font-size: 1.65rem;
  }
}
