:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --accent: #2563eb;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #e5e7eb;
  --code-bg: #f3f4f6;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #e5e5e5;
  --accent: #3b82f6;
  --muted: #9ca3af;
  --card: #1a1a1a;
  --border: #2a2a2a;
  --code-bg: #1f1f1f;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.container { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

nav { 
  border-bottom: 1px solid var(--border); 
  padding: 1rem 0; 
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.nav-inner { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.logo { 
  font-weight: 700; 
  font-size: 1.25rem; 
  color: var(--text); 
  text-decoration: none; 
  letter-spacing: -0.02em;
}

.nav-links { 
  display: flex; 
  gap: 1.5rem; 
}

.nav-links a { 
  color: var(--muted); 
  text-decoration: none; 
  font-size: 0.9rem; 
  transition: color 0.2s;
}

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

.theme-toggle { 
  background: none; 
  border: 1px solid var(--border); 
  padding: 0.4rem 0.8rem; 
  border-radius: 0.375rem; 
  cursor: pointer; 
  color: var(--text); 
  font-size: 1rem;
  line-height: 1;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

header { 
  padding: 4rem 0 2rem; 
}

h1 { 
  font-size: 2.5rem; 
  margin-bottom: 0.5rem; 
  letter-spacing: -0.02em; 
  font-weight: 800;
}

.subtitle { 
  color: var(--muted); 
  font-size: 1.15rem; 
  max-width: 600px;
}

.posts { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
  padding: 2rem 0; 
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.75rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); 
}

.post-card h2 { 
  font-size: 1.35rem; 
  margin-bottom: 0.5rem; 
  color: var(--text); 
  font-weight: 700;
}

.post-card h2 a { 
  text-decoration: none; 
  color: inherit; 
  transition: color 0.2s;
}

.post-card h2 a:hover { 
  color: var(--accent); 
}

.meta { 
  color: var(--muted); 
  font-size: 0.85rem; 
  margin-bottom: 0.75rem; 
  display: flex;
  gap: 0.75rem;
}

.excerpt { 
  color: var(--muted); 
  line-height: 1.7; 
  font-size: 1rem;
}

.tag {
  display: inline-block;
  background: var(--code-bg);
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  margin-top: 1rem;
  margin-right: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

footer { 
  border-top: 1px solid var(--border); 
  padding: 2.5rem 0; 
  margin-top: 2rem; 
  text-align: center; 
  color: var(--muted); 
  font-size: 0.85rem; 
}

/* Article page styles */
article h1 { 
  font-size: 2.2rem; 
  margin: 2rem 0 1rem; 
  font-weight: 800;
  letter-spacing: -0.02em;
}

article h2 { 
  font-size: 1.4rem; 
  margin: 2.5rem 0 1rem; 
  color: var(--text); 
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

article h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
  font-weight: 600;
}

article p { 
  margin-bottom: 1.25rem; 
  font-size: 1.05rem;
  line-height: 1.75;
}

article ul, article ol { 
  margin: 1rem 0 1.5rem 1.5rem; 
}

article li { 
  margin-bottom: 0.5rem; 
  line-height: 1.7;
}

article strong {
  color: var(--text);
  font-weight: 600;
}

pre {
  background: var(--code-bg);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: "Fira Code", "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}

code {
  font-family: "Fira Code", "Consolas", "Monaco", "Courier New", monospace;
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

pre code { 
  background: none; 
  padding: 0; 
  border: none;
}

.profile { 
  display: flex; 
  gap: 1.5rem; 
  align-items: center; 
  margin: 3rem 0 2rem; 
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
}

.avatar {
  width: 80px; 
  height: 80px; 
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: white; 
  font-size: 1.5rem; 
  font-weight: 700; 
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.bio h3 { 
  margin-bottom: 0.25rem; 
  font-size: 1.25rem;
}

.bio p { 
  color: var(--muted); 
  font-size: 0.95rem; 
  line-height: 1.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  h1 { font-size: 1.75rem; }
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .profile { flex-direction: column; text-align: center; }
  article h1 { font-size: 1.6rem; }
  pre { padding: 0.75rem; font-size: 0.8rem; }
}
