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

/* Variables */
:root {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --code-bg: #1c2128;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  --max-width: 760px;
}

/* Base */
html {
  font-size: 16px;
  line-height: 1.6;
}

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

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

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

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.site-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav a {
  color: var(--text-muted);
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* Main */
main.container {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

/* Hero */
.hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Post List */
.recent-posts h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

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

.post-item time {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.post-item h2,
.post-item h3 {
  font-size: 1.2rem;
  margin: 0.25rem 0 0.4rem;
  line-height: 1.3;
}

.post-item h2 a,
.post-item h3 a {
  color: var(--text);
}

.post-item h2 a:hover,
.post-item h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-summary {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

a.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Single Post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Post Content */
.post-content {
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

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

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

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.post-content code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

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

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

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

.post-content img {
  border-radius: 6px;
  margin: 1rem 0;
}

.post-summary img {
  display: none;
}

.post-summary h2, .post-summary h3, .post-summary h4,
.post-summary hr {
  display: none;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

/* Post Navigation */
.post-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.post-nav a {
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .post-nav {
    flex-direction: column;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
