:root {
  --bg: #f7f6f2;
  --ink: #1b1c19;
  --muted: #54554d;
  --line: #d8d4c8;
  --accent: #2c5a4d;
  --code-bg: #efece3;
  --rule: #c9c4b6;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131412;
    --ink: #ecebe4;
    --muted: #a8a69c;
    --line: #2e2f2a;
    --accent: #9ec4b3;
    --code-bg: #1e201c;
    --rule: #3a3b35;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: min(760px, calc(100% - 48px)); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: 10px 14px; z-index: 10; font-size: 14px; text-decoration: none;
}
.skip:focus { left: 16px; top: 16px; }

/* masthead */

.masthead { border-bottom: 1px solid var(--line); }
.masthead .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; padding: 26px 0;
}
.mark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink); text-decoration: none;
}
.mark i {
  width: 11px; height: 11px; background: var(--accent);
  display: inline-block; transform: rotate(45deg);
}
.masthead nav { display: flex; gap: 22px; font-size: 15px; }
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--ink); }

/* home */

.intro { padding: 68px 0 56px; }
h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  max-width: 20ch;
  text-wrap: balance;
}
.lede {
  margin: 22px 0 0;
  max-width: 56ch;
  font-size: 18px;
  color: var(--muted);
}
.dateline {
  margin: 30px 0 0;
  font-size: 14px;
  color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.dateline span { display: inline-flex; align-items: center; gap: 14px; }
.dateline span + span::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: var(--muted); display: inline-block;
}

section { border-top: 1px solid var(--line); padding: 40px 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 0 0 8px;
}
h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px; font-weight: 650;
  letter-spacing: 0.02em;
}
.section-head a { font-size: 14px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--ink); text-decoration: underline; }

.notes { list-style: none; margin: 0; padding: 0; }
.notes li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 8px 26px;
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--line);
}
.notes li:last-child { border-bottom: 0; padding-bottom: 4px; }
.notes time, .post-meta {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.notes time { padding-top: 6px; }
.notes h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.012em;
}
.notes h3 a { color: var(--ink); text-decoration: none; }
.notes h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.notes p { margin: 7px 0 0; color: var(--muted); max-width: 58ch; }
.notes .meta {
  margin-top: 10px; font-size: 13px; color: var(--muted);
  display: flex; gap: 14px; flex-wrap: wrap;
}

.about { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 8px 26px; }
.about h2 { padding-top: 4px; }
.about p { margin: 0 0 14px; color: var(--muted); max-width: 62ch; }
.about p:last-child { margin-bottom: 0; }
.about strong { color: var(--ink); font-weight: 600; }

/* article */

.post-header { padding: 56px 0 32px; border-bottom: 1px solid var(--line); }
.post-header h1 { font-size: 38px; line-height: 1.12; max-width: 24ch; }
.post-meta { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.post-summary { margin: 18px 0 0; max-width: 58ch; font-size: 18px; color: var(--muted); }

.article-body { max-width: 66ch; padding: 36px 0 48px; }
.article-body > p { margin: 0 0 1.05em; }
.article-body > p:first-of-type { font-size: 19px; }
.article-body h2 {
  margin: 2em 0 0.5em;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.article-body ul { margin: 0 0 1.1em; padding-left: 1.15em; }
.article-body li { margin: 0 0 0.35em; }
.article-body li::marker { color: var(--muted); }
.article-body blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}
.article-body blockquote p { margin: 0; }
.article-body pre {
  margin: 1.5em 0;
  padding: 16px 18px;
  background: #efece3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  font: 13.5px/1.6 var(--mono);
  color: #1b1c19;
}
.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #efece3;
  color: #1b1c19;
  padding: 1px 5px;
  border-radius: 4px;
}
.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
@media (prefers-color-scheme: dark) {
  .article-body pre, .article-body code { background: #1e201c; color: #ecebe4; }
  .article-body pre code { background: none; color: inherit; }
}
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }

.post-nav { border-top: 1px solid var(--line); padding: 24px 0 0; font-size: 15px; }
.post-nav a { color: var(--muted); text-decoration: none; }
.post-nav a:hover { color: var(--ink); text-decoration: underline; }

/* footer */

footer { border-top: 1px solid var(--line); }
footer .wrap {
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: baseline; justify-content: space-between;
  padding: 30px 0 48px; font-size: 14px; color: var(--muted);
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
footer .links { display: flex; gap: 20px; }

/* adaptation */

@media (max-width: 620px) {
  .wrap { width: min(100% - 36px, 760px); }
  .masthead .wrap { align-items: center; }
  h1 { font-size: 32px; }
  .post-header { padding: 40px 0 28px; }
  .post-header h1 { font-size: 29px; }
  .notes li, .about { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .notes time { padding-top: 0; }
  .about h2 { padding-top: 0; }
  .dateline { flex-direction: column; gap: 2px; }
  .dateline span + span::before { display: none; }
}

@media print {
  :root { --bg: #fff; --ink: #000; --muted: #333; --line: #bbb; }
  .masthead nav, .skip, footer .links, .post-nav { display: none; }
  body { font-size: 11pt; }
  section, .article-body { break-inside: avoid; }
}

/* error pages */

.error-page { padding: 92px 0 112px; }
.error-page .code {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
  letter-spacing: 0.08em;
}
.error-page h1 { margin-top: 14px; font-size: 38px; max-width: 18ch; }
.error-page p { margin: 18px 0 26px; color: var(--muted); max-width: 46ch; }
.error-page .back { font-size: 15px; }
