:root {
  --bg: #0e0e10;
  --bg-raised: #16161a;
  --bg-hover: #1c1c22;
  --text: #c9c9d0;
  --text-dim: #72727e;
  --accent: #7eb563;
  --accent-dim: #5a8a42;
  --border: #2a2a32;
  --mono: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

nav strong { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); font-weight: 600; }
nav strong span { color: var(--text-dim); }
nav ul { list-style: none; display: flex; gap: 1.8rem; }
nav a { font-family: var(--mono); font-size: 0.78rem; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
nav a:hover, nav a[aria-current] { color: var(--accent); }

/* ── Headings ── */
h1 { font-size: 2.2rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 0.6rem; }
h1 em { font-style: normal; color: var(--accent); }

h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 4rem 0 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}
h2::before { content: '## '; color: var(--accent-dim); }

h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
h3 a { color: var(--text); text-decoration: none; transition: color 0.2s; }
h3 a:hover { color: var(--accent); }

/* ── Paragraphs & inline ── */
p { color: var(--text-dim); margin-bottom: 1rem; font-size: 0.95rem; }
header > p { font-size: 1.05rem; max-width: 560px; margin-bottom: 0; }
em { color: var(--text); }
strong { color: var(--text); font-weight: 600; }
small { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }

code {
  font-family: var(--mono); font-size: 0.85em; background: var(--bg-raised);
  border: 1px solid var(--border); padding: 0.15em 0.45em; border-radius: 4px; color: var(--accent);
}

pre {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem; overflow-x: auto; margin: 1.5rem 0;
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.8; color: var(--text);
}
pre code { background: none; border: none; padding: 0; border-radius: 0; color: inherit; }

kbd {
  font-family: var(--mono); font-size: 0.72rem; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: 4px; padding: 0.25em 0.55em;
  color: var(--accent); display: inline-block; margin: 0.15rem;
}

/* ── Links ── */
a { color: var(--accent); text-decoration-color: var(--accent-dim); text-underline-offset: 3px; transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: #9dd47a; text-decoration-color: #9dd47a; }

/* ── Card links (stretched) ── */
a.card-link { text-decoration: none; color: inherit; }
a.card-link:hover { color: inherit; }
a.card-link::after { content: ""; position: absolute; inset: 0; }

/* ── Articles ── */
article {
  position: relative;
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.8rem; margin-bottom: 1rem; transition: border-color 0.3s, transform 0.3s; cursor: pointer;
}
article:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
article header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.6rem; }
article p { margin-bottom: 0; font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
article footer { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
article footer kbd { font-size: 0.66rem; letter-spacing: 0.02em; }
article footer a { text-decoration: none; position: relative; z-index: 1; }
article footer a:hover kbd { border-color: var(--accent); }

/* ── Full post ── */
article.post-full { cursor: default; }
article.post-full:hover { transform: none; border-color: var(--border); }

/* ── Featured / blockquote ── */
blockquote {
  position: relative;
  background: var(--bg-raised); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 2rem 2rem 2rem 1.8rem; margin: 0 0 2rem;
  cursor: pointer; transition: border-color 0.3s, transform 0.3s;
}
blockquote:hover { border-left-color: var(--accent-dim); transform: translateY(-2px); }
blockquote h3 { font-size: 1.4rem; margin-bottom: 0.8rem; }
blockquote p { margin-bottom: 0.8rem; }
blockquote small { display: flex; align-items: center; gap: 1.2rem; margin-top: 0.5rem; }
blockquote small span { display: inline-block; width: 20px; height: 1px; background: var(--border); }

/* ── Forms & search ── */
form { display: flex; gap: 0.6rem; max-width: 420px; margin: 0 auto; }

input[type="search"] {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.7rem 1rem; font-family: var(--mono); font-size: 0.8rem; color: var(--text); outline: none;
  transition: border-color 0.3s;
}
input[type="search"]::placeholder { color: var(--text-dim); }
input[type="search"]:focus { border-color: var(--accent); }

button {
  background: var(--accent); color: var(--bg); border: none; border-radius: 6px;
  padding: 0.7rem 1.3rem; font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.2s; white-space: nowrap;
}
button:hover { background: #9dd47a; transform: translateY(-1px); }

.search-wrapper { margin: 2rem 0; }
.search-wrapper form { max-width: 100%; }

/* ── Horizontal rules ── */
hr { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

/* ── Footer ── */
body > footer {
  border-top: 1px solid var(--border); padding-top: 2rem; margin-top: 4rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
body > footer p { font-family: var(--mono); font-size: 0.72rem; margin: 0; }
body > footer ul { list-style: none; display: flex; gap: 1.5rem; }
body > footer a { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); text-decoration: none; }
body > footer a:hover { color: var(--accent); }

/* ── Pagination ── */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 1.5rem;
  margin: 3rem 0 1rem; font-family: var(--mono); font-size: 0.8rem;
}
.pagination a {
  color: var(--accent); text-decoration: none; padding: 0.4rem 0.8rem;
  border: 1px solid var(--border); border-radius: 6px; transition: border-color 0.2s, background 0.2s;
}
.pagination a:hover { border-color: var(--accent); background: var(--bg-raised); }
.pagination .current { color: var(--text-dim); }

/* ── Post page ── */
.post-meta {
  font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim);
  margin-bottom: 2rem; display: flex; align-items: center; gap: 1.2rem;
}
.post-meta span { display: inline-block; width: 20px; height: 1px; background: var(--border); }

.post-content { margin: 2rem 0; }
.post-content p { margin-bottom: 1.2rem; line-height: 1.8; }
.post-content h2 {
  font-family: var(--sans); font-size: 1.3rem; font-weight: 600;
  text-transform: none; letter-spacing: normal; margin: 3rem 0 1rem; padding-bottom: 0; border-bottom: none;
}
.post-content h2::before { content: none; }
.post-content h3 { font-size: 1.1rem; margin: 2rem 0 0.8rem; }
.post-content ul, .post-content ol { color: var(--text-dim); font-size: 0.95rem; margin: 0 0 1.2rem 1.5rem; line-height: 1.8; }
.post-content blockquote { margin: 1.5rem 0; }
.post-content img { max-width: 100%; border-radius: 8px; margin: 1.5rem 0; }

.post-tags {
  display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 3rem;
  padding-top: 2rem; border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 1.2rem; }
  nav { flex-direction: column; align-items: flex-start; gap: 1rem; padding-bottom: 1.5rem; }
  nav ul { gap: 1.2rem; }
  h1 { font-size: 1.7rem; }
  article header { flex-direction: column; gap: 0.3rem; }
  form { flex-direction: column; }
  body > footer { flex-direction: column; align-items: flex-start; }
}
