:root {
  --bg: #ffffff;
  --bg-secondary: #f6f8f7;
  --fg: #1a1a1a;
  --fg-muted: #5f6b66;
  --border: #e2e8e4;
  --accent: #006838;
  --accent-fg: #ffffff;
  --card-bg: #ffffff;
  --code-bg: #f3f5f4;
  --link: #006838;
  --shadow: rgba(0, 0, 0, 0.06);
  --max-width: 800px;
}

[data-theme="dark"] {
  --bg: #14181a;
  --bg-secondary: #1b2022;
  --fg: #e8ece9;
  --fg-muted: #9aa6a0;
  --border: #2a3234;
  --accent: #3ddc84;
  --accent-fg: #08110c;
  --card-bg: #1b2022;
  --code-bg: #1f2426;
  --link: #3ddc84;
  --shadow: rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color 0.15s ease, color 0.15s ease;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

h1, h2, h3 { line-height: 1.25; }

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.site-header .logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-header nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover { color: var(--accent); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--fg);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.5rem 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.site-footer a { color: var(--fg-muted); }

/* Generic page content (About page) */
.page-content { padding: 2rem 0; }

/* Post typography (shared by post-content, page-content) */
.post-content, .page-content {
  font-size: 1.05rem;
}

.post-content pre, .page-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.post-content code, .page-content code {
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre code, .page-content pre code {
  background: none;
  padding: 0;
}

.post-content img, .page-content img, .post-card-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.post-meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* Hero */
.hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-logo { flex-shrink: 0; }

.hero-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.5rem;
}

.tagline {
  margin: 0;
  color: var(--fg-muted);
}

/* Post cards */
.post-card {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px var(--shadow);
}

.post-card h2 { margin-top: 0; font-size: 1.15rem; }
.post-card h2 a { text-decoration: none; color: var(--fg); }
.post-card h2 a:hover { color: var(--accent); }

.post-card .excerpt { color: var(--fg-muted); }

.post-card .read-more {
  font-weight: 600;
  text-decoration: none;
}

.post-card-image {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0.75rem 0;
  display: block;
}

.post-card.featured {
  margin: 2rem 0;
  padding: 1.5rem;
}

.post-card.featured h2 { font-size: 1.5rem; }

.post-card.featured .post-card-image {
  max-height: 360px;
}

@media (max-width: 480px) {
  .hero-inner { flex-direction: column; text-align: center; }
}

/* Author card */
.author-card {
  display: flex;
  gap: 1.25rem;
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.author-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-name {
  margin: 0 0 0.35rem 0;
  font-weight: 700;
}

.author-bio {
  margin: 0 0 0.5rem 0;
  color: var(--fg-muted);
}

.author-website {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 480px) {
  .author-card { flex-direction: column; align-items: flex-start; }
}

/* Post navigation (previous/next) */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  max-width: 45%;
}

.post-nav-next {
  margin-left: auto;
  text-align: right;
}

.post-nav-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 600;
}

.post-nav-title {
  color: var(--fg);
  font-weight: 500;
}

.post-nav a:hover .post-nav-title {
  color: var(--accent);
}

@media (max-width: 480px) {
  .post-nav {
    flex-direction: column;
  }
  .post-nav a,
  .post-nav-next {
    max-width: 100%;
    text-align: left;
    margin-left: 0;
  }
}
