:root {
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  --nord7: #8fbcbb;
  --nord8: #88c0d0;
  --nord9: #81a1c1;
  --nord10: #5e81ac;
  --nord11: #bf616a;
  --nord12: #d08770;
  --nord13: #ebcb8b;
  --nord14: #a3be8c;
  --nord15: #b48ead;

  --bg: var(--nord0);
  --bg-raise: var(--nord1);
  --bg-panel: var(--nord2);
  --border: var(--nord3);
  --fg: var(--nord4);
  --fg-dim: var(--nord3);
  --link: var(--nord8);
  --link-visited: var(--nord10);
  --accent: var(--nord9);
  --code-bg: var(--nord1);
  --heading: var(--nord6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Victor Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.7;
  font-size: 1rem;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-raise);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-title {
  color: var(--heading);
  font-weight: bold;
  text-decoration: none;
  font-size: 1.15rem;
}
.site-nav { display: flex; gap: 1rem; }
.site-nav a { color: var(--link); text-decoration: none; }
.site-nav a:hover { color: var(--nord6); text-decoration: underline; }

/* Main */
main.wrap { padding-top: 2rem; padding-bottom: 3rem; }

/* Headings */
h1, h2, h3, h4 { color: var(--heading); line-height: 1.3; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
h3 { font-size: 1.15rem; }

/* Links */
a { color: var(--link); }
a:visited { color: var(--link-visited); }
a:hover { color: var(--nord6); }

/* Post list (home + tag pages) */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.post-date {
  color: var(--fg-dim);
  flex-shrink: 0;
  font-size: 0.85rem;
  width: 12ch;
  text-align: right;
}
.post-title { color: var(--nord6); text-decoration: none; }
.post-title:hover { color: var(--link); text-decoration: underline; }

/* Tags */
.tag {
  color: var(--nord14);
  text-decoration: none;
  font-size: 0.85rem;
}
.tag:hover { color: var(--nord6); text-decoration: underline; }
.post-tags { display: inline-flex; gap: 0.4rem; margin-left: auto; flex-shrink: 0; }

/* Tag cloud */
.tag-cloud { list-style: none; padding: 0; }
.tag-cloud-item { padding: 0.25rem 0; }
.tag-cloud-item a { color: var(--nord14); text-decoration: none; }
.tag-cloud-item a:hover { color: var(--nord6); }

/* Single post */
.post-header { margin-bottom: 1.5rem; }
.post-meta { color: var(--fg-dim); font-size: 0.9rem; display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }

.post-content h2 { margin-top: 2rem; }
.post-content h3 { margin-top: 1.5rem; }

/* Typography / code */
.post-content p { margin: 1rem 0; }
.post-content code {
  background: var(--code-bg);
  color: var(--nord13);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
}
.post-content pre code {
  background: none;
  color: var(--nord4);
  padding: 0;
  font-size: 0.9rem;
}

/* Blockquote */
.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-raise);
  color: var(--fg);
}
.post-content blockquote p { margin: 0.5rem 0; }

/* Lists in content */
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content li { margin: 0.35rem 0; }

/* Tables */
.post-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; }
.post-content th { background: var(--bg-panel); }

/* Images */
.post-content img { max-width: 100%; height: auto; border-radius: 4px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--fg-dim);
  font-size: 0.85rem;
}
.site-footer .wrap { padding-top: 1rem; padding-bottom: 1rem; }
.site-footer a { color: var(--link); }

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-nav a {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
}
.post-nav a:hover {
  color: var(--nord6);
  text-decoration: underline;
}
.post-nav .next { text-align: right; }

/* Utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
