:root {
  color-scheme: dark;
  --bg: #151515;
  --ink: #eaeaea;
  --muted: #aaa;
  --line: #383838;
  --accent: #eaeaea;
  --link: #b5e853;
  --code: #222;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--link); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
::selection { background: #555; color: #fff; }
.container { width: min(100% - 40px, 760px); margin-inline: auto; }
.skip-link {
  position: absolute;
  left: 20px;
  top: -60px;
  padding: 8px 12px;
  background: var(--link);
  color: #151515;
  z-index: 2;
}
.skip-link:focus { top: 10px; }

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.site-title {
  text-decoration: none;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.055em;
}
.site-header nav { display: flex; gap: 26px; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--accent); }
.site-header nav a[aria-current="page"] { font-weight: 650; }
main { min-height: calc(100vh - 154px); }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--link); text-decoration: none; }

.page-heading { margin: 64px 0 38px; }
.page-heading h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(32px, 5vw, 45px);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.15;
}
.page-heading p {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}
.post-list, .term-list { list-style: none; margin: 0 0 100px; padding: 0; }
.post-list { display: grid; gap: 16px; }
.post-row {
  position: relative;
  padding: 22px 24px;
  border: 1px solid #303030;
  border-radius: 10px;
  background: #1e1e1e;
}
.post-row:hover, .post-row:focus-within { border-color: #4a4a4a; background: #202020; }
.post-row-main { min-width: 0; }
.post-row h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.35;
}
.post-row h3 a { text-decoration: none; }
.post-row h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.post-row h3 a:focus-visible { outline: none; }
.post-row h3 a:focus-visible::after { outline: 2px solid var(--link); outline-offset: 3px; }
.post-row p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.post-row-meta { color: var(--muted); font-size: 12px; }
.post-row-categories::before { content: ' · '; white-space: pre; }
.post-row time {
  color: var(--muted);
  white-space: nowrap;
}
.post-row-tags { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.post-row-tags .tag-chip { padding: 3px 7px; border-radius: 8px; font-size: 12px; }
.home-posts .post-list { margin-top: 36px; margin-bottom: 24px; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-bottom: 90px;
  font-size: 14px;
}
.pagination a { color: var(--link); text-decoration: none; }
.pagination-pages { display: flex; gap: 7px; }
.pagination-pages a,
.pagination-pages span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.pagination-pages span { border-color: var(--accent); color: var(--accent); }
.pagination-step:hover,
.pagination-pages a:hover { color: var(--accent); }

.simple-page { padding-bottom: 30px; }
.simple-page .page-heading { margin-bottom: 32px; }
.simple-page .post-list { margin-bottom: 50px; }
.archive-year { margin-bottom: 42px; }
.archive-year h2 { margin: 0; color: var(--accent); font-size: 17px; }
.archive-year .post-list { margin-top: 16px; margin-bottom: 0; }
.term-list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.term-list a { color: var(--link); text-decoration: none; font-weight: 550; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 90px;
  padding: 0;
  list-style: none;
}
.tag-chip {
  display: inline-block;
  padding: 6px 8px 7px;
  border: 1px solid #4f6733;
  border-radius: 11px;
  color: #b5e853;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}
.tag-chip:hover { border-color: #b5e853; color: #d5f4a0; background: #26301c; }
.tag-post-list { margin: 0 0 40px; padding: 0; list-style: none; }
.tag-post-list li { display: flex; align-items: baseline; gap: 8px; padding: 12px 0; }
.tag-post-list li::before { content: '•'; color: var(--muted); }
.tag-post-list a { color: var(--link); text-decoration: none; }
.tag-post-list a:hover { text-decoration: underline; }
.tag-post-rule { flex: 1; min-width: 10px; border-bottom: 2px dotted var(--line); }
.tag-post-list time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.eyebrow {
  margin: 0 0 8px !important;
  color: var(--muted);
  font-size: 13px !important;
}
.back-link { margin: 0 0 60px; font-size: 14px; }
.back-link a { color: var(--link); text-decoration: none; }

.article-heading { margin-bottom: 46px; }
.article-heading time { display: block; margin-bottom: 13px; color: var(--muted); font-size: 14px; }
.article-heading p { margin-top: 16px; }
.article-footer {
  margin: 64px 0 85px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.article-footer > a { color: var(--link); text-decoration: none; }
.article-tags { margin: 0 0 24px; color: var(--muted); }
.article-tags > span { display: block; margin-bottom: 11px; }
.article-tags .tag-cloud { gap: 8px; margin: 0; }
.article-tags .tag-chip { font-size: 14px; }

.prose {
  overflow-wrap: break-word;
  font-size: 16px;
  line-height: 1.8;
}
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--accent);
  line-height: 1.3;
  letter-spacing: -.03em;
  scroll-margin-top: 24px;
}
.prose h2 { margin: 2.1em 0 .7em; font-size: 28px; }
.prose h3 { margin: 1.8em 0 .6em; font-size: 22px; }
.prose h4 { margin: 1.6em 0 .5em; font-size: 18px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.3em; }
.prose li { margin: .25em 0; }
.prose li > p { margin: .5em 0; }
.prose a { color: var(--link); text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose code {
  padding: .1em .28em;
  border-radius: 3px;
  background: var(--code);
  color: #d4add1;
  font: .86em ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow-wrap: anywhere;
}
.prose pre {
  margin: 1.6em 0;
  padding: 19px 21px;
  overflow-x: auto;
  border-radius: 5px;
  border: 1px solid #383838;
  background: #0b0b0b;
  color: var(--accent);
  font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
.prose pre code { padding: 0; background: none; color: inherit; font: inherit; overflow-wrap: normal; }
.prose .highlight { margin: 1.6em 0; }
.prose .highlight pre { margin: 0; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid #666;
  color: #bbb;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1.7em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}
.prose th, .prose td { min-width: 100px; padding: 8px 11px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--code); }
.prose .footnotes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); font-size: 14px; }
.prose .footnotes ol { padding-left: 20px; }
.prose .highlighter-rouge, .prose .highlight { max-width: 100%; }
.prose mjx-container { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.prose pre .c, .prose pre .c1, .prose pre .cm { color: #999; }
.prose pre .k, .prose pre .kd, .prose pre .kn { color: #c695c0; }
.prose pre .s, .prose pre .s1, .prose pre .s2 { color: #eaeaea; }
.prose pre .mi, .prose pre .mf { color: #eaeaea; }
.prose pre .o { color: #f4bf75; }

@media (max-width: 600px) {
  .container { width: min(100% - 32px, 760px); }
  .site-header { min-height: 66px; gap: 12px; }
  .site-header nav { gap: 12px; }
  .site-header nav a { font-size: 12px; }
  .page-heading { margin: 46px 0 28px; }
  .page-heading p { font-size: 16px; }
  .post-row { padding: 19px 18px; }
  .post-row time { font-size: 12px; }
  .post-row-categories { display: block; }
  .post-row-categories::before { display: none; }
  .post-row h3 { font-size: 19px; }
  .post-list, .term-list { margin-bottom: 70px; }
  .home-posts .post-list { margin-top: 24px; margin-bottom: 22px; }
  .pagination { gap: 15px; margin-bottom: 70px; font-size: 13px; }
  .tag-cloud { gap: 8px; margin-bottom: 70px; }
  .tag-chip { font-size: 14px; }
  .tag-post-list li { display: block; position: relative; padding-left: 15px; }
  .tag-post-list li::before { position: absolute; left: 0; }
  .tag-post-rule { display: none; }
  .tag-post-list time { display: block; font-size: 12px; }
  .prose { font-size: 15px; }
  .prose h2 { font-size: 25px; }
  .prose h3 { font-size: 21px; }
  .prose pre { padding: 15px; font-size: 12px; }
  .article-footer { margin-bottom: 65px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
