* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --text: #1a1a1a;
  --text-body: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --text-faint: #bbb;
  --heading: #111;
  --border: #e8e8e8;
  --card-bg: #ffffff;
  --card-border: #eaeaea;
  --card-hover-bg: #f9f9fb;
  --card-hover-border: #d0d0d0;
  --link: #4a4a9e;
  --link-hover: #2d2d7a;
  --blockquote-bg: #f5f5fa;
  --blockquote-border: #9999cc;
  --caption: #888;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a1a;
    --bg-subtle: #111125;
    --text: #e0e0e0;
    --text-body: #ccc;
    --text-secondary: #888;
    --text-muted: #666;
    --text-faint: #444;
    --heading: #fff;
    --border: #1a1a2e;
    --card-bg: #161628;
    --card-border: #252540;
    --card-hover-bg: #1e1e3a;
    --card-hover-border: #4a4a80;
    --link: #8888cc;
    --link-hover: #aaaaff;
    --blockquote-bg: #0e0e22;
    --blockquote-border: #4a4a80;
    --caption: #666;
  }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-body);
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Navigation ── */
.nav {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.nav a { color: var(--text-secondary); font-size: 0.9rem; }
.nav a:hover { color: var(--heading); }
.nav .site-name { font-weight: 600; color: var(--text); letter-spacing: 0.02em; }

/* ── Blog Index ── */
.blog-header {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}

.blog-header h1 {
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--heading);
  margin-bottom: 0.5rem;
  font-family: 'Georgia', serif;
}

.blog-header .subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.posts {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.post-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: opacity 0.2s;
}

.post-card:first-child {
  flex-direction: column;
  gap: 1rem;
}

.post-card:first-child .post-image {
  width: 100%;
  height: 320px;
  border-radius: 8px;
}

.post-card:hover { opacity: 0.85; }

.post-image {
  width: 200px;
  min-width: 200px;
  height: 134px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-subtle);
}

.post-content { flex: 1; min-width: 0; }

.post-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.4rem;
  line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.post-card:first-child .post-content h2 { font-size: 1.6rem; }

.post-content .excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.6rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.post-content .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Article Page ── */
.article {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.article-header { margin-bottom: 2rem; }

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.article-header .subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
}

.article-header .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-cover {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  margin: 2.5rem 0 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.article-body p {
  margin-bottom: 1.25rem;
  color: var(--text-body);
  font-size: 1.1rem;
}

.article-body ul, .article-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
  color: var(--text-body);
  font-size: 1.1rem;
}

.article-body li { margin-bottom: 0.5rem; }
.article-body strong { color: var(--text); }
.article-body em { color: var(--text-secondary); }

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

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

.article-body blockquote {
  border-left: 3px solid var(--blockquote-border);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  background: var(--blockquote-bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1.15rem;
}

.article-body blockquote p { margin-bottom: 0; }

.article-body img {
  width: 100%;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.article-body .caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--caption);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* ── Footer ── */
.site-footer {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .post-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-image {
    width: 100%;
    height: 200px;
  }

  .post-card:first-child .post-image { height: 220px; }
  .blog-header h1 { font-size: 2rem; }
  .article-header h1 { font-size: 1.7rem; }
  .article-body p, .article-body li { font-size: 1rem; }
}
