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

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --color-text: #222;
  --color-text-secondary: #737373;
  --color-border: #eaeaea;
  --color-bg: #ffffff;
  --color-accent: #222;
  --color-code-bg: #f7f7f7;
  --max-width: 800px;
  --spacing-unit: 1rem;
}

[data-theme="dark"] {
  --color-text: #e5e5e5;
  --color-text-secondary: #a3a3a3;
  --color-border: #333;
  --color-bg: #1a1a1a;
  --color-accent: #e5e5e5;
  --color-code-bg: #262626;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  padding: 4rem 1.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Icons */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--color-border);
}

.icon-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Post Content Typography */
.post-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
  margin-bottom: 2.5rem;
}

.separator {
  margin: 2rem 0;
  border: 0;
  border-top: 1px dashed var(--color-border);
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.75;
}

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

.post-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

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

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

.post-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.post-content a:hover {
  color: var(--color-text-secondary);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

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

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

/* Header */
.site-header {
  margin-bottom: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Post List */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 2rem;
  display: block;
  transition: opacity 0.2s ease;
}

.post-item:hover {
  opacity: 0.7;
}

.post-item h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.post-item-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 2rem 1rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .site-header {
    margin-bottom: 3rem;
  }
}