:root {
  --ink: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --accent: #0969da;
  --code-bg: #f6f8fa;
  --chip: #ddf4ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 17px/1.75 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

/* ---------- chrome ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
header.site .brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
header.site .tag { color: var(--muted); font-size: 13px; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- index ---------- */
h1 { font-size: 30px; line-height: 1.3; margin: 0 0 12px; letter-spacing: -0.02em; }
.lede { color: var(--muted); margin: 0 0 36px; }

h2.year {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

ul.posts { list-style: none; margin: 0; padding: 0; }
ul.posts li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f4;
}
ul.posts li a { flex: 1; }
.when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--chip);
  border-radius: 20px;
  padding: 2px 9px;
}

/* ---------- post ---------- */
.post h1 { margin-bottom: 10px; }
.meta {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.meta .repo { font-weight: 600; }

article h2 { font-size: 22px; margin: 36px 0 12px; }
article h3 { font-size: 18px; margin: 28px 0 10px; }
article p { margin: 0 0 18px; }
article ul, article ol { margin: 0 0 18px; padding-left: 26px; }
article li { margin-bottom: 8px; }

article blockquote {
  margin: 0 0 18px;
  padding: 2px 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

/* inline code */
article :not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font: 0.87em/1.4 ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

.back { margin-top: 48px; font-size: 14px; }

/* ---------- code blocks ---------- */
figure.code {
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--code-bg);
}
figure.code figcaption {
  font: 600 11px/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  background: #eef1f4;
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
}
figure.code figcaption .lang {
  float: right;
  font-weight: 500;
  letter-spacing: 0.06em;
  opacity: 0.75;
}
figure.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
}
figure.code code {
  font: 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  tab-size: 4;
  white-space: pre;
}

@media (max-width: 600px) {
  main { padding: 28px 16px 56px; }
  h1 { font-size: 25px; }
  body { font-size: 16px; }
}

/* ---------- highlight.js (GitHub light) ---------- */
.hljs { color: #1f2328; background: transparent; }
.hljs-comment, .hljs-quote { color: #6a737d; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-doctag, .hljs-formula { color: #cf222e; }
.hljs-string, .hljs-meta .hljs-string, .hljs-regexp { color: #0a3069; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable { color: #0550ae; }
.hljs-title, .hljs-title.class_, .hljs-title.function_, .hljs-section { color: #8250df; }
.hljs-type, .hljs-built_in, .hljs-class .hljs-title { color: #953800; }
.hljs-attr, .hljs-attribute, .hljs-property { color: #0550ae; }
.hljs-name, .hljs-selector-id, .hljs-selector-class { color: #116329; }
.hljs-meta { color: #6a737d; }
.hljs-symbol, .hljs-bullet, .hljs-link { color: #e36209; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }
.hljs-deletion { color: #82071e; background: #ffebe9; }
.hljs-addition { color: #116329; background: #dafbe1; }
