@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ─── Gruvbox Palette ────────────────────────────────────────── */
:root {
  --bg:      #1d2021;
  --bg2:     #282828;
  --bg3:     #32302f;
  --surface: #3c3836;
  --fg:      #ebdbb2;
  --fg2:     #d5c4a1;
  --muted:   #928374;
  --red:     #cc241d;
  --red2:    #cc241d;
  --green:   #b8bb26;
  --yellow:  #fabd2f;
  --orange:  #fe8019;
  --border:  #3c3836;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::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: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

img { display: block; max-width: 100%; }

/* ─── Nav ────────────────────────────────────────────────────── */
.site-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.prompt {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
}
.prompt-user  { color: var(--red); }
.prompt-sep   { color: var(--muted); }
.prompt-path  { color: var(--green); }
.prompt-dollar { color: var(--fg2); }

.nav-links { display: flex; gap: 1.75rem; margin-left: auto; }
.nav-links a {
  color: var(--muted);
  font-size: 1.25rem;
  text-decoration: none;
  transition: color 0.1s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--red); text-decoration: none; }

/* ─── Container ──────────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.avatar img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border: 2px solid var(--red);
  border-radius: 4px;
}
.avatar-placeholder {
  width: 90px;
  height: 90px;
  border: 2px solid var(--red);
  border-radius: 4px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.68rem;
}

.hero-text { flex: 1; }

.site-title {
  color: var(--red);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.typewriter {
  color: var(--fg);
  font-size: 0.84rem;
  white-space: pre-wrap;
  line-height: 1.75;
  min-height: 3.5em;
  margin-bottom: 1rem;
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.1em;
  background: var(--red);
  vertical-align: middle;
  animation: blink 1s step-end infinite;
  margin-left: 1px;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.socials { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.socials a {
  color: var(--muted);
  font-size: 0.74rem;
  border: 1px solid var(--border);
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
}
.socials a:hover { color: var(--red); border-color: var(--red); }

/* ─── Post List (ls style) ───────────────────────────────────── */
.list-header {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.post-entry {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bg2);
  font-size: 0.84rem;
}
.post-entry:last-child { border-bottom: none; }

.post-date  { color: var(--muted); min-width: 88px; font-size: 0.74rem; flex-shrink: 0; }
.post-tag {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  background: var(--surface);
  color: var(--red);
  border-radius: 2px;
  flex-shrink: 0;
}
.post-title { color: var(--fg); flex: 1; text-decoration: none; }
.post-title:hover { color: var(--red); }

.post-diff           { font-size: 0.72rem; flex-shrink: 0; }
.post-diff.easy      { color: var(--green); }
.post-diff.medium    { color: var(--yellow); }
.post-diff.hard      { color: var(--red2); }
.post-diff.insane    { color: var(--red); }

.view-all {
  margin-top: 1.1rem;
  font-size: 0.78rem;
}
.view-all a { color: var(--muted); }
.view-all a:hover { color: var(--red); }

/* ─── Page Title ─────────────────────────────────────────────── */
.page-title {
  color: var(--red);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.page-title::before { content: '# '; }

/* ─── Tags Grid ──────────────────────────────────────────────── */
.tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}
.tag-item {
  border: 1px solid var(--border);
  padding: 0.25rem 0.7rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.1s, border-color 0.1s;
}
.tag-item:hover { color: var(--red); border-color: var(--red); text-decoration: none; }
.tag-count { color: var(--surface); font-size: 0.68rem; margin-left: 0.25rem; }

/* ─── Single Post ────────────────────────────────────────────── */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.65rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.post-meta-tag {
  color: var(--red);
  font-size: 0.68rem;
  background: var(--surface);
  padding: 0.12rem 0.4rem;
  border-radius: 2px;
}
.post-title-single {
  color: var(--fg);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}
.post-description { color: var(--muted); font-size: 0.84rem; margin-top: 0.4rem; }

/* ─── Post Content ───────────────────────────────────────────── */
.post-content { font-size: 0.88rem; line-height: 1.82; }

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--red);
  margin: 2rem 0 0.65rem;
  font-weight: 700;
}
.post-content h1::before { content: '# '; }
.post-content h2::before { content: '## '; }
.post-content h3::before { content: '### '; }
.post-content h4::before { content: '#### '; }

.post-content p          { margin-bottom: 1rem; }
.post-content strong     { color: var(--fg); }
.post-content em         { color: var(--fg2); }

.post-content code {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 0.08rem 0.32rem;
  border-radius: 3px;
  font-size: 0.84em;
  color: var(--green);
  font-family: inherit;
}

.post-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.6;
}
.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--fg);
  font-size: 1em;
}

.post-content blockquote {
  border-left: 3px solid var(--red);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--muted);
  margin: 1rem 0;
  font-style: italic;
}

.post-content ul,
.post-content ol { margin: 0.75rem 0 0.75rem 1.4rem; }
.post-content li { margin-bottom: 0.25rem; }
.post-content li::marker { color: var(--red); }

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

.post-content a { color: var(--red2); }
.post-content a:hover { color: var(--red); }

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

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.83rem;
  overflow-x: auto;
  display: block;
}
.post-content th {
  background: var(--bg2);
  color: var(--red);
  padding: 0.45rem 0.65rem;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 700;
}
.post-content td {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  color: var(--fg2);
}
.post-content tr:nth-child(even) td { background: var(--bg2); }

/* highlight.js overrides */
.post-content .hljs { background: transparent; padding: 0; }

/* ─── Post Tags Footer ───────────────────────────────────────── */
.post-tags {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.post-tag-link {
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.1s, border-color 0.1s;
}
.post-tag-link:hover { color: var(--red); border-color: var(--red); }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2.5rem;
  font-size: 0.8rem;
}
.pagination a, .pagination .page-item {
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.28rem 0.7rem;
  border-radius: 3px;
  text-decoration: none;
  transition: color 0.1s, border-color 0.1s;
}
.pagination a:hover          { color: var(--red); border-color: var(--red); }
.pagination .page-item.active { color: var(--red); border-color: var(--red); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.74rem;
  margin-top: auto;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--red); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { flex-direction: column; gap: 1.25rem; }
  .site-nav { flex-wrap: wrap; gap: 0.5rem; }
  .prompt { font-size: 0.75rem; }
  .post-entry { flex-wrap: wrap; gap: 0.4rem; }
  .post-date { min-width: unset; }
  .container { padding: 1.5rem 1rem; }
}
