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

:root {
  --bg: #0d0f0e;
  --bg2: #131614;
  --bg3: #1a1d1b;
  --border: #252927;
  --border2: #2e332f;
  --green: #4ade80;
  --green-dim: #22c55e;
  --green-muted: #16a34a;
  --green-faint: #0f2d1a;
  --text: #d4d8d5;
  --text-muted: #6b7068;
  --text-dim: #4a4f48;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
  pointer-events: none;
  z-index: 1000;
}

/* ── HEADER ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  background: rgba(13,15,14,0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo::before {
  content: '>';
  color: var(--text-muted);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.header-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ── HERO ── */
.hero {
  padding: 4rem 2rem 3rem;
  max-width: 860px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--green); }

.hero p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* ── FILTER BAR ── */
.filter-bar {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-right: 4px;
}

.tag-btn {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 2px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
  text-decoration: none;
}

.tag-btn:hover, .tag-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-faint);
}

/* ── POST COUNT ── */
.post-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 0.75rem 2rem;
  max-width: 860px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.post-count span { color: var(--green-muted); }

/* ── POSTS LIST ── */
.posts-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

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

.post-meta-line {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-date { color: var(--text-muted); }

.post-tag {
  background: var(--green-faint);
  color: var(--green-dim);
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid #16a34a44;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.post-tag:hover { border-color: var(--green-muted); color: var(--green); }

.post-title {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: #e8ebe9;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  text-decoration: none;
  display: block;
}

.post-title:hover { color: var(--green); }

.post-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 0.75rem;
}

.post-readmore {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color 0.15s;
}

.post-readmore:hover { color: var(--green); }
.post-readmore::after { content: '→'; }

/* ── SINGLE POST PAGE ── */
.post-header {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}

.post-header .post-meta-line { margin-bottom: 1rem; }

.post-header h1 {
  font-family: var(--mono);
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.post-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  font-size: 15px;
  color: var(--text);
  line-height: 1.85;
}

.post-body h2 {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: #e8ebe9;
  margin: 2rem 0 0.75rem;
}

.post-body h3 {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.post-body p { margin-bottom: 1.25rem; }

.post-body a { color: var(--green-dim); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--green); }

.post-body ul, .post-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}

.post-body li { margin-bottom: 0.35rem; }

.post-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg3);
  color: var(--green-dim);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border2);
}

.post-body pre {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text);
}

.post-body blockquote {
  border-left: 2px solid var(--green-muted);
  padding-left: 1rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 1.25rem 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-body img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border2);
  margin: 1rem 0;
}

/* Rouge syntax highlighting */
.highlight { background: var(--bg2) !important; }
.highlight .c, .highlight .c1, .highlight .cm { color: #4a7c59; }
.highlight .k, .highlight .kd, .highlight .kn { color: #4ade80; }
.highlight .s, .highlight .s1, .highlight .s2 { color: #86efac; }
.highlight .n, .highlight .na { color: var(--text); }
.highlight .nb { color: #a3e635; }
.highlight .m, .highlight .mi { color: #fde68a; }
.highlight .o { color: var(--text-muted); }

/* ── BACK LINK ── */
.back-link {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 2rem 0;
  display: flex;
}

.back-link::before { content: '←'; }
.back-link:hover { color: var(--green-muted); }

/* ── EMPTY STATE ── */
.empty-state {
  padding: 4rem 0;
  text-align: center;
}

.empty-state pre {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.footer-left span { color: var(--green-muted); }
.footer-right { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  header { padding: 0 1rem; }
  .header-meta { display: none; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .filter-bar, .post-count { padding: 1rem; }
  .posts-container { padding: 0 1rem 3rem; }
  .post-header, .post-body { padding-left: 1rem; padding-right: 1rem; }
  footer { padding: 1.25rem 1rem; }
}
