:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #111;
  --muted: #666;
  --subtle: #888;
  --border: #ddd;
  --divider: #eee;
  --link: #0366d6;
  --code-bg: #f4f4f4;
  --blockquote-border: #ddd;
  --blockquote-text: #555;
}

[data-theme="dark"] {
  --bg: #1a1a1a;
  --surface: #242424;
  --text: #e5e5e5;
  --muted: #aaa;
  --subtle: #888;
  --border: #333;
  --divider: #2d2d2d;
  --link: #58a6ff;
  --code-bg: #2d2d2d;
  --blockquote-border: #444;
  --blockquote-text: #aaa;
}

body {
  font-family: "Lato", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.container {
  position: relative;
  width: 800px;
  margin: 40px auto;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 17px;
  line-height: 1.7;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
}

.site-title a {
  color: inherit;
}

.site-description {
  color: var(--muted);
  margin: 0 0 32px;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}

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

.post-list .date {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  flex-shrink: 0;
  padding-top: 2px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
}

.post-meta {
  color: var(--subtle);
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  margin-bottom: 24px;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  line-height: 1.3;
}

.post-content > :first-child {
  margin-top: 0;
}

.post-content code {
  font-family: "JetBrains Mono", monospace;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre {
  font-family: "JetBrains Mono", monospace;
  background: var(--code-bg);
  padding: 12px 16px;
  overflow-x: auto;
  border-radius: 6px;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 14px;
}

.post-content blockquote {
  border-left: 3px solid var(--blockquote-border);
  margin: 1em 0;
  padding: 0 1em;
  color: var(--blockquote-text);
}

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content figure {
  margin: 1.5em 0;
  text-align: center;
}

.post-content figcaption {
  font-size: 0.9em;
  color: var(--muted);
  margin-top: 0.5em;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--subtle);
  line-height: 0;
}

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

.theme-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

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