/* === Custom Properties === */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #1a3a5c;
  --border: #eeeeee;
  --border-strong: #1a1a1a;
  --code-bg: #f6f8fa;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --content-width: 720px;
  --padding-x: 32px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #4a8fe7;
  --border: #21262d;
  --border-strong: #e6edf3;
  --code-bg: #161b22;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #4a8fe7;
    --border: #21262d;
    --border-strong: #e6edf3;
    --code-bg: #161b22;
  }
}

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* === Layout === */
.site-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

/* === Navbar === */
.site-nav {
  border-bottom: 2px solid var(--border-strong);
}

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

.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; }

.site-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

/* === Language Switcher === */
.lang-pill {
  color: #fff;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.lang-link {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-decoration: none;
}
.lang-link:hover { color: var(--text); text-decoration: none; }

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
}

/* === Theme Toggle === */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.theme-toggle:hover { color: var(--text); }

/* === Hero === */
.hero {
  padding: 48px 0 40px;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin-bottom: 20px;
}

.accent-bar {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* === Article List === */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.article-list {
  list-style: none;
}

.article-item {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.article-date {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.article-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.article-title a {
  color: var(--text);
  text-decoration: none;
}
.article-title a:hover { text-decoration: underline; }

.article-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Post === */
.post-header {
  padding: 48px 0 40px;
}

.post-date {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.post-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.post-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* === Prose (post content) === */
.prose {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-muted);
}

.prose h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-top: 48px;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.prose h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p { margin-bottom: 16px; }

.prose ul, .prose ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.prose li { margin-bottom: 8px; }

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  font-style: italic;
  color: var(--text-muted);
  margin: 24px 0;
}

.prose code {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85em;
}

.prose pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 24px 0;
}

.prose pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.6;
}

.prose img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 24px 0;
}

.prose a { text-decoration: underline; }
.prose a:hover { color: var(--text); }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.prose strong { color: var(--text); }

/* === Footer === */
.site-footer {
  border-top: 2px solid var(--border-strong);
  padding: 20px 0;
  margin-top: 40px;
}

.site-footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--padding-x);
}

.footer-text {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* === Responsive === */
@media (max-width: 768px) {
  :root {
    --padding-x: 20px;
  }

  .hero-title, .post-title {
    font-size: 28px;
  }

  .article-title {
    font-size: 18px;
  }

  .prose {
    font-size: 16px;
  }
}
