:root {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --fg: #e4e4e2;
  --muted: #8a8d93;
  --faint: #5d6067;
  --accent: #f5b841;
  --accent-soft: rgba(245, 184, 65, 0.12);
  --rule: #23262d;
  --code-bg: #181a20;
  --max: 44rem;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main, .site-header, .site-footer { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-title {
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--accent); }
.site-header nav a {
  margin-left: 1.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.site-header nav a:hover { color: var(--accent); }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: #ffd380; }

h1, h2, h3, h4 { line-height: 1.22; color: #eee; letter-spacing: -0.015em; }
h1 { font-size: 2rem; margin-top: 0; margin-bottom: 0.4rem; }
h2 { font-size: 1.4rem; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; margin-top: 1.6rem; }

p { margin: 0 0 1em; }

time { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

pre, code, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; font-size: 0.92em; }
pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--rule);
  line-height: 1.5;
  font-size: 0.88rem;
}
pre code { background: none; padding: 0; font-size: inherit; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.25rem 1rem;
  color: var(--muted);
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1.25rem auto;
}

ul, ol { padding-left: 1.4rem; }
li { margin: 0.2rem 0; }

/* ---------- Home index ---------- */
.home .lede { color: var(--muted); margin-bottom: 2.5rem; font-size: 1.05rem; }
.year-heading {
  margin-top: 3rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--faint);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  align-items: baseline;
  border-bottom: 1px solid transparent;
}
.post-list li + li { border-top: 1px solid var(--rule); }
.post-list-item { display: flex; flex-direction: column; gap: 0.2rem; }
.post-list-title {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
}
.post-list-title:hover { color: var(--accent); }
.post-list-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Post page ---------- */
.post-header { margin: 1rem 0 2rem; }
.post-header h1 { margin-bottom: 0.4rem; }
.post-tags {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  flex-wrap: wrap;
}
.post-tags li {
  font-size: 0.72rem;
  border: 1px solid var(--rule);
  padding: 0.1rem 0.55rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.post-tags li a { color: var(--muted); text-decoration: none; }
.post-tags li a:hover { color: var(--accent); }

.old-post-warning {
  margin-top: 1.2rem;
  padding: 0.65rem 0.95rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 0.88rem;
  color: var(--muted);
  border-radius: 0 3px 3px 0;
}

.post-body > :first-child { margin-top: 0; }
.post-body h2:first-of-type { margin-top: 2rem; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 3.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.post-nav a {
  display: flex;
  flex-direction: column;
  padding: 0.8rem 0.95rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.post-nav a:hover { border-color: var(--accent); color: var(--accent); }
.post-nav .nav-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.post-nav .nav-title { font-size: 0.95rem; line-height: 1.35; }
.post-nav .next { text-align: right; }

/* ---------- Tag pages ---------- */
.tag-cloud .tags {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  margin-top: 1.5rem;
}
.tag-cloud .tags li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-elev);
  transition: border-color 0.15s;
}
.tag-cloud .tags li:hover { border-color: var(--accent); }
.tag-cloud .tags li a { color: var(--fg); text-decoration: none; }
.tag-cloud .tags li a:hover { color: var(--accent); }
.tag-cloud .tags .count { color: var(--faint); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.tag-page .crumb { color: var(--muted); font-size: 0.9rem; }
.tag-page .crumb a { color: var(--muted); text-decoration: none; }
.tag-page .crumb a:hover { color: var(--accent); }
.tag-page h1 em { color: var(--accent); font-style: normal; }
.tag-page .lede { color: var(--muted); margin: 0 0 1.75rem; font-size: 0.95rem; }

/* ---------- About page ---------- */
.about .about-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 2.5rem;
}
.about .about-photo {
  width: 12rem;
  height: 12rem;
  border-radius: 6px;
  object-fit: cover;
  margin: 0;
  border: 1px solid var(--rule);
}
.about .kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-size: 0.75rem;
  margin: 0;
}
.about h1 { margin: 0.2rem 0 0.1rem; font-size: 2.1rem; }
.about .alias { color: var(--muted); margin-top: 0; margin-bottom: 1rem; }
.about h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); border-bottom: 1px solid var(--rule); padding-bottom: 0.35rem; margin-top: 3rem; }
.about h3 { font-size: 1rem; color: var(--fg); margin-top: 1.75rem; margin-bottom: 0.5rem; }

.about .timeline {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  border-left: 1px solid var(--rule);
}
.about .timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0 0.6rem 1.25rem;
  align-items: baseline;
}
.about .timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.9rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}
.about .timeline .year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}
.about .timeline strong { color: var(--fg); font-weight: 600; }

.about .social-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0 0 0.5rem;
}
.about .social-list li { margin: 0; }
.about .social-list a {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-elev);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.88rem;
}
.about .social-list a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .about .about-intro { grid-template-columns: 1fr; }
  .about .about-photo { width: 9rem; height: 9rem; }
  .about .timeline li { grid-template-columns: 3rem 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  margin: 4.5rem auto 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 0.82rem;
}
.site-footer a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.65rem; }
  .site-header { padding-top: 1.5rem; padding-bottom: 1rem; }
  .post-list li { grid-template-columns: 1fr; gap: 0.2rem; padding: 0.7rem 0; }
  .post-list li time { font-size: 0.82rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
}

/* Prism: a11y dark-ish tweak (works over the plugin default) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7c8290; }
.token.punctuation { color: #c3c3c3; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #ffb86c; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #b0e995; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #ffcd6b; }
.token.atrule, .token.attr-value, .token.keyword { color: #f5b841; }
.token.function, .token.class-name { color: #7fd1ff; }
.token.regex, .token.important, .token.variable { color: #f472b6; }
