:root {
  --font: 'JetBrains Mono', monospace;
  --max-width: 640px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-secondary: #12121a;
  --text: #e0e0e8;
  --text-muted: #7a7a8a;
  --accent: #5ae0cc;
  --border: #1e1e2a;
  --code-bg: #14141e;
}

[data-theme="light"] {
  --bg: #fafaf8;
  --bg-secondary: #f0f0ee;
  --text: #1a1a2e;
  --text-muted: #6a6a7a;
  --accent: #2a9d8f;
  --border: #e0e0dd;
  --code-bg: #f0f0ee;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.7;
}

/* Header */
.site-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

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

.nav-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  opacity: 1;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: border-color var(--transition), color var(--transition);
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
[data-theme="light"] .icon-sun { display: inline; }
[data-theme="light"] .icon-moon { display: none; }

/* Content */
.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* Home */
.home > p {
  color: var(--text-muted);
  margin-bottom: 3rem;
  font-size: 0.95rem;
}

.home h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  margin-top: 2.5rem;
}

.home h2:first-of-type {
  margin-top: 0;
}

.post-list {
  margin-top: 3rem;
}

.post-item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.post-item a {
  font-size: 0.95rem;
}

/* Pages */
.page h1,
.post-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.post-header time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-header {
  margin-bottom: 2.5rem;
}

/* Post Content */
.post-content h2 {
  font-size: 1.15rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  font-size: 1rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content p {
  margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.4rem;
}

.post-content code {
  font-family: var(--font);
  font-size: 0.85rem;
  background: var(--code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.post-content img {
  max-width: 100%;
  border-radius: 4px;
  margin: 1.5rem 0;
}

/* Page content shares post-content styles */
.page p,
.page ul,
.page ol,
.page blockquote {
  margin-bottom: 1.25rem;
}

.page ul,
.page ol {
  padding-left: 1.5rem;
}

/* Footer */
.site-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .site-header nav {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .post-item {
    flex-direction: column;
    gap: 0.25rem;
  }

  .content {
    padding: 2rem 1.25rem;
  }
}
