:root {
  --paper: #fbfaf6;
  --ink: #1d1c1a;
  --muted: #6f6b63;
  --rule: #e4e0d6;
  --accent: #b4532a;
  --code: #f1eee6;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161614;
    --ink: #e9e6de;
    --muted: #9c978c;
    --rule: #2f2d29;
    --accent: #e58a5f;
    --code: #22211e;
  }
}
:root[data-theme="dark"] {
  --paper: #161614;
  --ink: #e9e6de;
  --muted: #9c978c;
  --rule: #2f2d29;
  --accent: #e58a5f;
  --code: #22211e;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 19px/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--paper); }

.wrap { max-width: 660px; margin: 0 auto; padding: 0 22px; }

a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Header & footer */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 44px 0 36px; }
.top .name { font-weight: 600; font-size: 21px; text-decoration: none; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 18px; font: 400 14px/1 var(--mono); }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent); }
.theme { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: var(--muted); font: inherit; line-height: 1; }
.theme:hover { color: var(--accent); }
.theme svg { width: 15px; height: 15px; vertical-align: -2px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 72px 0 40px; padding-top: 18px; border-top: 1px solid var(--rule); font: 400 13px/1.4 var(--mono); color: var(--muted); }
.foot a { text-decoration: none; }

/* Home */
.intro { display: flow-root; }
.portrait { float: right; width: 148px; height: 148px; object-fit: cover; margin: 6px 0 12px 26px; border-radius: 4px; filter: saturate(0.9); }
.bio p { margin: 0 0 1em; }
.bio p:first-child { font-size: 21px; line-height: 1.5; }
.links { clear: both; margin: 22px 0 0; font: 400 14px/2 var(--mono); }
.links span { color: var(--rule); margin: 0 9px; }

section { margin-top: 56px; }
.label { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; font: 500 12.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.lede { color: var(--muted); margin: -4px 0 20px; }

.dated { list-style: none; margin: 0; padding: 0; }
.dated li { display: grid; grid-template-columns: 88px 1fr; gap: 16px; padding: 7px 0; }
.dated time { font: 400 13.5px/2.1 var(--mono); color: var(--muted); white-space: nowrap; }
.title { font-weight: 500; }
.more { margin: 10px 0 0; font: 400 14px/1 var(--mono); }
.more a { text-decoration: none; color: var(--muted); }

.pubs { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.pubs li { display: flex; flex-direction: column; padding: 11px 0 11px 34px; position: relative; counter-increment: pub; }
.pubs li::before { content: counter(pub, decimal-leading-zero); position: absolute; left: 0; top: 15px; font: 400 12.5px/1 var(--mono); color: var(--muted); }
.pubs .title { line-height: 1.4; }
.pubs .authors { font-size: 16.5px; color: var(--muted); }
.pubs .authors b { color: var(--ink); font-weight: 500; }
.pubs .venue { font: 400 13.5px/1.9 var(--mono); color: var(--muted); }
.pubs .venue i { font-style: normal; color: var(--ink); }

/* Blog list */
.page-title { font-size: 40px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; margin: 8px 0 10px; }
.posts { list-style: none; margin: 34px 0 0; padding: 0; }
.posts li { padding: 18px 0; border-top: 1px solid var(--rule); }
.posts time { display: block; font: 400 13px/1.8 var(--mono); color: var(--muted); }
.posts .title { font-size: 23px; line-height: 1.3; text-decoration: none; }
.posts p { margin: 6px 0 0; color: var(--muted); }

/* Post */
.back { margin: 0 0 30px; font: 400 14px/1 var(--mono); }
.back a { text-decoration: none; color: var(--muted); }
.post h1 { font-size: 40px; line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 14px; }
.meta { font: 400 13.5px/1 var(--mono); color: var(--muted); margin: 0 0 38px; }
.prose > * { margin: 0 0 1.05em; }
.prose h2 { font-size: 26px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; margin: 2em 0 0.55em; }
.prose h3 { font-size: 21px; font-weight: 600; margin: 1.6em 0 0.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; }
.prose blockquote { margin-left: 0; padding-left: 18px; border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; }
.prose img { display: block; max-width: 100%; height: auto; margin: 30px auto; border-radius: 4px; border: 1px solid var(--rule); background: #fff; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2em 0; }
.prose code { font: 400 0.8em/1 var(--mono); background: var(--code); padding: 2px 5px; border-radius: 3px; }
.prose pre { background: var(--code); padding: 16px 18px; border-radius: 4px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 14px; line-height: 1.55; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; display: block; overflow-x: auto; }
.prose th { font: 500 12px/1.3 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: left; vertical-align: bottom; }
.prose th, .prose td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); }
.prose td { font-variant-numeric: tabular-nums; }
.prose .footnote { font-size: 16px; color: var(--muted); }

@media (max-width: 560px) {
  body { font-size: 18px; }
  .top { padding: 28px 0 26px; flex-direction: column; gap: 12px; }
  .portrait { width: 104px; height: 104px; margin-left: 18px; }
  .bio p:first-child { font-size: 19px; }
  .dated li { grid-template-columns: 1fr; gap: 0; }
  .page-title, .post h1 { font-size: 32px; }
}
