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

:root {
  --bg: #fafafa;
  --fg: #222;
  --muted: #666;
  --accent: #2563eb;
  --border: #e5e7eb;
  --card-bg: #fff;
  --code-bg: #f3f4f6;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  --max-w: 720px;
}

html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .75; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; width: 100%; }

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  background: var(--card-bg);
}
.site-header .container {
  display: flex; justify-content: space-between; align-items: center;
}
.site-title {
  font-size: 1.35rem; font-weight: 700; color: var(--fg);
  letter-spacing: -.02em;
}
.site-title:hover { opacity: 1; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a {
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: color .15s;
}
.site-header nav a:hover { color: var(--fg); opacity: 1; }

/* ===== Post Card ===== */
main { flex: 1; padding: 2.5rem 0; }

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: box-shadow .2s;
}
.post-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.post-card h2 { font-size: 1.35rem; margin-bottom: .35rem; }
.post-card h2 a { color: var(--fg); }
.post-card h2 a:hover { color: var(--accent); opacity: 1; }
.post-meta { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.post-summary { color: var(--muted); font-size: .95rem; }

/* ===== Post Content ===== */
.post-content { padding: 2.5rem 0; }
.post-content h1 { font-size: 2rem; margin-bottom: .5rem; line-height: 1.3; }
.post-content .post-meta { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-content h2 { font-size: 1.5rem; margin: 2rem 0 .75rem; }
.post-content h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul, .post-content ol { margin: 0 0 1.25rem 1.5rem; }
.post-content li { margin-bottom: .35rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .5rem 1.25rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  background: var(--code-bg);
  border-radius: 0 .5rem .5rem 0;
}
.post-content code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: .15em .4em;
  border-radius: .3rem;
  font-size: .88em;
}
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: .5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content img { max-width: 100%; border-radius: .5rem; margin: 1rem 0; }

/* ===== Archive & About ===== */
.page-content { padding: 2.5rem 0; }
.page-content h1 { font-size: 2rem; margin-bottom: 1.5rem; }
.archive-list { list-style: none; }
.archive-list li {
  display: flex; gap: 1rem; padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.archive-date { color: var(--muted); font-size: .88rem; min-width: 5.5rem; font-family: var(--font-mono); }
.archive-title { font-weight: 500; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  background: var(--card-bg);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-header .container { flex-direction: column; gap: .75rem; }
  .post-card { padding: 1.25rem; }
  .post-content h1 { font-size: 1.6rem; }
}
