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

:root {
  --bg: #0f1117;
  --bg-surface: #181a20;
  --bg-hover: #1e2028;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #5b9cf5;
  --accent-hover: #7db4ff;
  --border: #2a2d35;
  --radius: 6px;
  --max-width: 800px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* ── Layout ──────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}

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

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ── Typography ──────────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
}

/* ── Cards (for projects & blog posts) ───────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
}

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

.card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  flex: 1;
}

.card .tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Blog ────────────────────────────────────────────────── */
.post-list {
  list-style: none;
  margin-top: 1.5rem;
}

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

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

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

.post-list h3 {
  margin: 0.25rem 0;
}

.post-list p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

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

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  main {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
