/* ── Fonts ──────────────────────────────────────────────────── */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/fonts/IBMPlexMono-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #131313;
  --bg-code:      #0e0e0e;
  --bg-surface:   #1a1a1a;
  --bg-tag:       #1c201a;

  --border:       #1e1e1e;
  --border-code:  #181818;
  --border-surf:  #242424;

  --text-title:   #d8d8d4;
  --text-prose:   #909090;
  --text-dim:     #717171;
  --text-nav:     #707070;
  --text-brand:   #c0c0bc;
  --text-inline:  #888888;
  --text-tag:     #4a5e46;

  --green:        #6a9e6a;

  --tok-kw:       #c8a258;
  --tok-fn:       #6a9e6a;
  --tok-st:       #7a9eb8;
  --tok-nm:       #b87a7a;
  --tok-tp:       #9e7ab8;
  --tok-mc:       #b8a06a;
  --tok-cm:       #6e6e6e;

  --max-w: 800px;
  --mono: 'IBM Plex Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-prose);
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout ────────────────────────────────────────────────── */
nav, main, footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 56px;
}

.brand {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-brand);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-nav);
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 28px;
  margin-top: 80px;
  border-top: 0.5px solid var(--border);
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-dim);
}

footer a {
  color: var(--text-dim);
  transition: color 0.15s;
}

footer a:hover {
  color: var(--green);
}

.footer-links {
  display: flex;
  gap: 20px;
}

/* ── Section headings ──────────────────────────────────────── */
.section-heading {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

/* ── Homepage ──────────────────────────────────────────────── */
.home-header {
  margin-bottom: 56px;
}

.home-header h1 {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 14px;
}

.bio {
  color: var(--text-prose);
  max-width: 560px;
}

.post-list {
  margin-bottom: 56px;
}

.about-section p {
  margin-bottom: 10px;
}

.about-section a {
  color: var(--green);
  transition: opacity 0.15s;
}

.about-section a:hover {
  opacity: 0.75;
}

/* ── Post list items ───────────────────────────────────────── */
.post-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.post-item:first-of-type {
  border-top: 0.5px solid var(--border);
}

.post-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.post-date {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 84px;
}

.post-title {
  font-family: Georgia, serif;
  font-size: 15px;
  color: var(--text-prose);
  transition: color 0.15s;
}

.post-item:hover .post-title {
  color: var(--text-title);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  margin-left: 100px;
}

/* ── Tags ──────────────────────────────────────────────────── */
.tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-tag);
  background: var(--bg-tag);
  border: 0.5px solid var(--border-surf);
  border-radius: 3px;
  padding: 1px 7px;
}

/* ── Standalone pages (about, etc.) ───────────────────────── */
.standalone-page {
  padding-bottom: 48px;
}

.page-header {
  margin-bottom: 36px;
}

.page-title {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--text-title);
  margin-bottom: 20px;
}

/* ── Post page ─────────────────────────────────────────────── */
.post {
  padding-bottom: 48px;
}

.post-header {
  margin-bottom: 40px;
}

.post-header .post-tags {
  margin-left: 0;
  margin-bottom: 14px;
}

.post-title {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  color: var(--text-title);
  line-height: 1.3;
  margin-bottom: 10px;
}

/* override list item .post-title scoping for the article header */
.post-header .post-title {
  font-size: 28px;
  color: var(--text-title);
}

.post-subtitle {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-style: italic;
}

.post-meta {
  margin-bottom: 20px;
}

.post-meta .post-date {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-dim);
  width: auto;
}

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 0.5px;
  background: var(--border);
  margin: 0;
}

/* ── Post content prose ────────────────────────────────────── */
.post-content {
  margin-top: 36px;
}

.post-content p {
  margin-bottom: 20px;
  color: var(--text-prose);
}

.post-content h2 {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-top: 40px;
  margin-bottom: 16px;
}

/* prefix h2 headings with // */
.post-content h2::before {
  content: "// ";
}

.post-content h3 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-nav);
  margin-top: 28px;
  margin-bottom: 12px;
}

.post-content a {
  color: var(--green);
  transition: opacity 0.15s;
}

.post-content a:hover {
  opacity: 0.75;
}

.post-content ul,
.post-content ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.post-content li {
  margin-bottom: 4px;
}

.post-content strong {
  color: var(--text-title);
  font-weight: 600;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  border-left: 2px solid var(--border-surf);
  padding-left: 16px;
  color: var(--text-dim);
  margin: 24px 0;
  font-style: italic;
}

/* ── Inline code ───────────────────────────────────────────── */
.post-content code {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-inline);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-surf);
  border-radius: 3px;
  padding: 1px 7px;
}

/* ── Code blocks ───────────────────────────────────────────── */
.post-content .highlight code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.highlight {
  background: var(--bg-code);
  border-radius: 5px;
  overflow: hidden;
  margin: 24px 0;
  border: 0.5px solid var(--border-code);
}

.highlight pre {
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0;
}

.highlight code {
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.9;
  background: none;
  border: none;
  padding: 0;
}

/* language label above code block */
.code-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tok-cm);
  padding: 6px 18px;
  border-bottom: 0.5px solid var(--border-code);
}

/* ── Post nav ──────────────────────────────────────────────── */
.post-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 0.5px solid var(--border);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-dim);
}

.post-nav a {
  color: var(--text-dim);
  transition: color 0.15s;
}

.post-nav a:hover {
  color: var(--green);
}

.post-nav-prev { text-align: left; }
.post-nav-center { text-align: center; }
.post-nav-next { text-align: right; }

/* ── Post list page ────────────────────────────────────────── */
.post-list-page {
  padding-bottom: 48px;
}

/* ── Chroma syntax highlighting ────────────────────────────── */
.chroma .k,  .chroma .kd, .chroma .kn, .chroma .kp,
.chroma .kr, .chroma .kc, .chroma .kt { color: var(--tok-kw); }

.chroma .nf, .chroma .nb, .chroma .nc { color: var(--tok-fn); }

.chroma .s,  .chroma .s1, .chroma .s2,
.chroma .sb, .chroma .sc, .chroma .se,
.chroma .si, .chroma .sr, .chroma .ss { color: var(--tok-st); }

.chroma .m,  .chroma .mi, .chroma .mf,
.chroma .mh, .chroma .mo, .chroma .il { color: var(--tok-nm); }

.chroma .n,  .chroma .na, .chroma .nd,
.chroma .ni, .chroma .nn, .chroma .nt { color: var(--tok-tp); }

.chroma .cp, .chroma .cpf             { color: var(--tok-mc); }

.chroma .c,  .chroma .c1, .chroma .cm,
.chroma .cs, .chroma .ch              { color: var(--tok-cm); font-style: italic; }

.chroma .o, .chroma .ow, .chroma .p   { color: var(--text-prose); }
.chroma .w                            { color: var(--text-dim); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .post-row {
    flex-direction: column;
    gap: 2px;
  }

  .post-tags {
    margin-left: 0;
  }

  .post-nav {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}
