/* ── Variables ── */
:root {
  --bg: #0f1117;
  --bg-card: #1a1d2e;
  --fg: #e2e8f0;
  --fg-muted: #94a3b8;
  --accent: #7dd3fc;        /* sky blue — feels like a terminal prompt */
  --accent-alt: #a78bfa;    /* violet — secondary accent */
  --border: #2d3748;
  --code-bg: #161b27;
  --green: #86efac;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --max-width: 760px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

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

main { flex: 1; }

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

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

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--green);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-title::before { content: "$ "; color: var(--fg-muted); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--fg-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* ── Post List ── */
.posts-list { padding: 3rem 0; }
.posts-list h1 { margin-bottom: 2rem; font-size: 1.5rem; color: var(--fg-muted); font-weight: 400; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.post-card:hover { border-color: var(--accent); }

.post-card h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.post-card h2 a { color: var(--fg); }
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }

.summary { color: var(--fg-muted); font-size: 0.95rem; margin: 0.75rem 0; }

/* ── Post Meta ── */
.post-meta { font-size: 0.82rem; color: var(--fg-muted); font-family: var(--font-mono); }
.reading-time { opacity: 0.7; }

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(125, 211, 252, 0.1);
  color: var(--accent);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

.tag:hover { background: rgba(125, 211, 252, 0.2); text-decoration: none; }

/* ── Single Post ── */
.post { padding: 3rem 0; }

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

.post-title { font-size: 2rem; line-height: 1.2; margin-bottom: 0.75rem; }

.post-content { max-width: 100%; }

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.post-content h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.post-content h3 { font-size: 1.15rem; color: var(--accent-alt); }

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

.post-content ul, .post-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

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

/* ── Code ── */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--green);
}

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

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Blockquote ── */
.post-content blockquote {
  border-left: 3px solid var(--accent-alt);
  padding: 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--fg-muted);
  background: rgba(167, 139, 250, 0.05);
  border-radius: 0 6px 6px 0;
}

/* ── Tables ── */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.post-content th {
  background: var(--bg-card);
  color: var(--accent);
  font-family: var(--font-mono);
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--border);
}

.post-content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

.post-content tr:hover td { background: var(--bg-card); }

/* ── Back Link ── */
.back-link { color: var(--fg-muted); font-size: 0.9rem; margin-top: 3rem; display: inline-block; }
.back-link:hover { color: var(--accent); }

/* ── Avatar ── */
.post-content img[alt="Derron Knox"] {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--border);
  display: block;
  margin: 0 auto 1.5rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }
.copyright { margin-top: 0.4rem; opacity: 0.5; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .post-title { font-size: 1.5rem; }
  .nav-links { gap: 1rem; }
}
