:root {
  --bg: #faf9f6;
  --ink: #24292f;
  --muted: #6e7681;
  --faint: #d8d5cd;
  --accent: #1a7f37;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.topbar .path {
  font-family: var(--mono);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink);
}
.topbar .path a { text-decoration: none; color: inherit; }
.topbar .path .prompt { color: var(--accent); }
.topbar .path .comment { color: var(--muted); font-weight: 400; }
.topbar nav {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--accent); }
.topbar nav .sep { color: var(--faint); }

/* ---------- home header ---------- */

.bio {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 44rem;
}
.bio a { color: var(--muted); }
.bio a:hover { color: var(--accent); }

/* ---------- sections ---------- */

section { margin-top: 2.75rem; }

h2.section-title {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 1rem;
}
h2.section-title::before {
  content: "# ";
  color: var(--accent);
  font-weight: 400;
}

ul.plain { list-style: none; }

/* dated rows: writing, talks */
ul.dated li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.3125rem 0;
}
ul.dated.cols2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
}
ul.dated.cols2 li { min-width: 0; }
ul.dated .date {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  flex: none;
  width: 3.25rem;
}
ul.dated .entry { flex: 1; min-width: 0; }
ul.dated .entry .desc {
  display: block;
  color: var(--muted);
  font-size: 0.875rem;
}
ul.dated .entry .desc.crop {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.more-link {
  font-family: var(--mono);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
}
.more-link a { color: var(--muted); }
.more-link a:hover { color: var(--accent); }

/* projects */
ul.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem 2.5rem;
}
ul.projects li { font-size: 0.9375rem; }
ul.projects .name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
}
ul.projects .desc { color: var(--muted); }
ul.projects .stars {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
}

/* book panel */
.book {
  border: 1px solid var(--faint);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.375rem 1rem;
  flex-wrap: wrap;
}
.book .title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9375rem;
}
.book .meta {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.75rem;
}
.book .notes {
  color: var(--muted);
  font-size: 0.875rem;
  width: 100%;
}
.book .links {
  font-family: var(--mono);
  font-size: 0.8125rem;
  margin-left: auto;
}

/* subscribe strip */
.subscribe {
  margin-top: 2.75rem;
  padding: 0.875rem 1.25rem;
  border-left: 2px solid var(--accent);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- article (posts and pages) ---------- */

article header { margin-bottom: 2rem; }
article h1.post-title {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
article .post-meta {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
article .post-meta a { color: var(--muted); }
article .post-meta a:hover { color: var(--accent); }

.post-content { max-width: 44rem; }
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
}
.post-content h2 { font-size: 1.375rem; }
.post-content h3 { font-size: 1.125rem; }
.post-content p, .post-content ul, .post-content ol { margin-bottom: 1rem; }
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content img { max-width: 100%; height: auto; border: 1px solid var(--faint); border-radius: 4px; }
.post-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: #f0efe9;
  border-radius: 3px;
  padding: 0.125rem 0.3125rem;
}
.post-content pre {
  background: #f0efe9;
  border: 1px solid var(--faint);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.post-content pre code { background: none; padding: 0; font-size: 0.8125rem; }
.post-content blockquote {
  border-left: 2px solid var(--faint);
  padding-left: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.post-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}
.post-content th, .post-content td {
  text-align: left;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--faint);
  vertical-align: top;
}
.post-content th {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 600;
}

/* archive list */
.archive-year {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.archive-year::before {
  content: "# ";
  color: var(--accent);
  font-weight: 400;
}

/* tags */
ul.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
ul.tags a {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- footer ---------- */

footer.site-footer {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--faint);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: baseline;
}
footer.site-footer a { color: var(--muted); }
footer.site-footer a:hover { color: var(--accent); }
footer.site-footer .sep { color: var(--faint); }
footer.site-footer .copyright { margin-left: auto; }

@media (max-width: 640px) {
  ul.projects { grid-template-columns: 1fr; }
  ul.dated.cols2 { grid-template-columns: 1fr; }
  ul.dated li { flex-wrap: wrap; gap: 0.25rem 1rem; }
  .book .links { margin-left: 0; }
  footer.site-footer .copyright { margin-left: 0; width: 100%; }
}
