:root {
  --surface-1: #faf9f7;
  --surface-2: #ffffff;
  --border: #e4e2dc;
  --border-strong: #c8c5bc;
  --text-primary: #1b1b1a;
  --text-secondary: #4b4a45;
  --text-muted: #8a877e;
  --text-accent: #2f6f4f;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 32px;
}

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

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-primary);
}
.brand:hover { text-decoration: none; }

.brand svg { color: var(--text-primary); flex: none; }

.wordmark {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.wordmark .tld { color: var(--text-muted); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}
.site-nav a { color: var(--text-secondary); }
.site-nav a:hover { color: var(--text-primary); text-decoration: none; }
.site-nav .nav-disabled { color: var(--text-muted); cursor: default; }
.site-nav .icon { color: var(--text-muted); display: inline-flex; }

.tagline {
  margin: 2px 0 20px;
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ---- post list ---- */

.post-item { padding: 14px 0; border-top: 1px solid var(--border); }
.post-item:first-of-type { border-top: none; }

.post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.post-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 3px;
}
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--text-accent); text-decoration: none; }

.post-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}

.post-meta { display: flex; gap: 6px; align-items: center; }
.post-meta .minutes { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 1px 8px;
  white-space: nowrap;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer .contact { display: flex; align-items: center; gap: 6px; }
.site-footer .icon { display: inline-flex; color: var(--text-muted); }
.site-footer .colophon { margin-left: auto; font-family: var(--font-mono); }

/* ---- reading page ---- */

.crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin: 18px 0 8px;
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--text-primary); }

.article-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 8px;
}

.article-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

article { max-width: 64ch; }

article p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0 0 14px;
}

article h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 26px 0 10px;
  line-height: 1.35;
}

article h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 8px;
}

article ul, article ol { margin: 0 0 14px; padding-left: 22px; }
article li { margin: 4px 0; line-height: 1.65; }

article code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-primary);
}

article pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  overflow-x: auto;
}
article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

article blockquote {
  border-left: 2px solid var(--border-strong);
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
article blockquote p { font-size: 14px; margin: 0 0 8px; }
article blockquote p:last-child { margin-bottom: 0; }

.note-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

/* ---- 404 ---- */

.missing {
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin: 48px 0;
}
.missing .code { font-size: 22px; color: var(--text-primary); margin-bottom: 6px; }

@media (max-width: 560px) {
  .wrap { padding: 28px 18px 24px; }
  .site-header { flex-wrap: wrap; }
  .post-meta { flex-wrap: wrap; }
  .site-footer .colophon { margin-left: 0; }
}
