@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --bg-card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 10px;
  --max-w: 760px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  background: rgba(13,17,23,0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
}
nav {
  max-width: calc(var(--max-w) + 4rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; list-style: none; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* Main */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* Hero */
.hero {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
}

/* Tags filter */
.tags-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.tag {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-family: var(--mono);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}
.tag:hover, .tag.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88,166,255,0.08);
}

/* Post list */
.post-list { display: flex; flex-direction: column; gap: 1.25rem; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.post-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.post-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  line-height: 1.5;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.post-meta .date::before { content: '📅 '; }
.post-meta .read::before { content: '⏱ '; }

/* Blog post */
.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.post-header .meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}
.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* Content styles */
.prose {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.8;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 700;
  line-height: 1.3;
  margin: 2rem 0 1rem;
  letter-spacing: -0.3px;
}
.prose h1 { font-size: 1.8rem; }
.prose h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.prose h3 { font-size: 1.15rem; color: var(--accent); }
.prose p { margin-bottom: 1.2rem; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(88,166,255,0.4); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { margin: 1rem 0 1.2rem 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--accent-green);
}
.prose pre {
  background: var(--bg-alt) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88rem;
  color: inherit;
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.prose img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Affiliate box */
.affiliate-box {
  background: var(--bg-alt);
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.affiliate-box .emoji { font-size: 1.5rem; }
.affiliate-box p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.affiliate-box a {
  color: var(--accent-orange);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }

/* CTA */
.cta-section {
  background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(63,185,80,0.05));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 3rem 0;
  text-align: center;
}
.cta-section h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.cta-section p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 640px) {
  nav { padding: 0; }
  .nav-links { gap: 1rem; }
  main { padding: 2rem 1.25rem 4rem; }
  .hero h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.5rem; }
}
