@font-face {
  font-family: "Source Serif";
  src: url(../fonts/source-serif-4.woff2) format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url(../fonts/source-serif-4-italic.woff2) format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #fcfbf8;
  --ink: #1c1b19;
  --muted: #6c6862;
  --rule: #e6e2da;
  --code: #f3f1ec;
  --link: #24508f;
  --mark: #9d3b26;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151413;
    --ink: #e7e4de;
    --muted: #9b968d;
    --rule: #2e2c29;
    --code: #1f1e1c;
    --link: #93b4e6;
    --mark: #e0987f;
  }
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 "Source Serif", Georgia, serif;
  font-optical-sizing: auto;
  text-wrap: pretty; /* no single word left alone on a last line */
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
::selection { background: color-mix(in srgb, var(--link) 22%, transparent); }

/* header & footer */
header.site { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1.5rem; margin-bottom: 2.75rem; }
header.site .name { color: var(--ink); font-size: 1.45rem; font-weight: 620; letter-spacing: -.01em; }
header.site .name:hover { text-decoration: none; }
nav a { color: var(--muted); margin-left: 1.2rem; font-size: .94rem; }
nav a:first-child { margin-left: 0; }
nav a[aria-current] { color: var(--ink); }
footer { margin-top: 4.5rem; color: var(--muted); font-size: .8rem; }

/* headings */
h1, .paper .title { text-wrap: balance; }
h1 { font-size: 1.65rem; font-weight: 620; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .4rem; }
h2 {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 3rem 0 1.1rem; padding-bottom: .35rem; border-bottom: 1px solid var(--rule);
  font-size: 1.15rem; font-weight: 620; color: var(--ink);
}
h2 a { font-size: .9rem; font-weight: 400; }
h3 { font-size: 1.05rem; font-weight: 620; margin: 1.8rem 0 .5rem; }
.lede { color: var(--muted); }
main > .lede + h2 { margin-top: 1.5rem; }

/* home */
.portrait { float: right; width: 9.25rem; margin: .35rem 0 1rem 1.6rem; }
.portrait img { display: block; width: 100%; border-radius: 3px; }
.contact { display: flex; margin: .2rem 0 0; }
.contact a { flex: 1; display: grid; place-items: center; min-height: 2rem; color: var(--muted); }
.contact a:hover { color: var(--link); }
.contact svg { width: 1.2rem; height: 1.2rem; }
details { margin: 0 0 1em; }
summary { cursor: pointer; color: var(--muted); }
summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: .5rem; }

/* lists whose items end in a {date} */
ul:has(> li > .date) { list-style: none; padding: 0; }
ul:has(> li > .date) > li { margin: .45rem 0; }
li:has(> .date) { display: flex; justify-content: space-between; gap: 1.25rem; }
li > .date { flex: none; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* papers */
.paper {
  display: grid; grid-template-columns: 6.6rem 1fr; gap: 0 1rem;
  margin: 0 -.6rem 1.15rem; padding: .35rem .6rem; border-radius: 4px; scroll-margin-top: 1.5rem;
}
.paper > div { min-width: 0; }
.paper:target { animation: flash 2.5s ease-out; }
@keyframes flash { 0%, 35% { background: color-mix(in srgb, var(--mark) 13%, transparent); } }
.venue { padding-top: .1rem; color: var(--muted); font-size: .86rem; font-weight: 600; }
.paper .title { color: var(--ink); font-weight: 600; }
.paper .title:hover { color: var(--link); text-decoration: none; }
.authors, .where { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.authors b { color: var(--ink); font-weight: 600; }
.authors a { color: inherit; }
.authors a:hover { color: var(--link); }
.authors .full, .all-authors .short { display: none; }
.all-authors .full { display: inline; }
.where { font-style: normal; }
.note { color: var(--mark); font-size: .9rem; }
.links { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-top: .15rem; font-size: .84rem; }
.bibtex { display: none; }
.show-bib .bibtex { display: block; }
h2.year { margin-top: 2.5rem; }

/* blog */
.posts { list-style: none; padding: 0; }
.posts li { display: grid; grid-template-columns: 6.6rem 1fr; gap: 0 1rem; margin: 0 0 .7rem; }
.posts time { padding-top: .15rem; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.meta { color: var(--muted); font-size: .86rem; }
article.post h1 { font-size: 1.5rem; }
article.post h2 { display: block; border: 0; padding: 0; margin: 2.2rem 0 .6rem; }
article.post h3 { font-size: 1.05rem; }
.footnotes { margin-top: 2.5rem; color: var(--muted); font-size: .86rem; }
.footnotes hr { border: 0; border-top: 1px solid var(--rule); }

/* text elements */
blockquote { margin: 1.2rem 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--muted); }
code { font: .84em/1.5 var(--mono); background: var(--code); padding: .08em .3em; border-radius: 3px; }
pre { overflow-x: auto; margin: 1rem 0 1.2rem; padding: .85rem 1rem; background: var(--code); border-radius: 4px; font: .78rem/1.55 var(--mono); }
pre code { background: none; padding: 0; font: inherit; }
.codehilite :is([class^="k"], .nt) { color: var(--link); }
.codehilite :is([class^="s"], [class^="m"]) { color: var(--mark); }
.codehilite [class^="c"] { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
table { border-collapse: collapse; font-size: .92rem; }
th, td { padding: .3rem .8rem .3rem 0; border-bottom: 1px solid var(--rule); text-align: left; }

@media (max-width: 34rem) {
  html { font-size: 106.25%; }
  body { padding-top: 2rem; }
  .portrait { width: 6.75rem; margin-left: 1.1rem; }
  .paper, .posts li { grid-template-columns: 1fr; }
  .venue { padding: 0; }
  li:has(> .date) { flex-direction: column; gap: 0; }
}
