:root {
  --paper: #fbfaf6;
  --ink: #1b1a17;
  --muted: #6f6b63;
  --rule: rgba(27, 26, 23, 0.16);
  --dot: rgba(27, 26, 23, 0.32);
  --link: #2a4d8f;
  --code-bg: rgba(27, 26, 23, 0.045);
  color-scheme: light;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("/fonts/cmunrm.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("/fonts/cmunbx.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("/fonts/cmunti.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Serif";
  src: url("/fonts/cmunbi.woff") format("woff");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Typewriter";
  src: url("/fonts/cmuntt.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Typewriter";
  src: url("/fonts/cmuntb.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Typewriter";
  src: url("/fonts/cmunit.woff") format("woff");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Computer Modern Typewriter";
  src: url("/fonts/cmuntx.woff") format("woff");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Computer Modern Serif", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(42, 77, 143, 0.16);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-shell {
  width: min(100%, 698px);
  margin: 0 auto;
  padding: 64px 28px 110px;
}

.home-header {
  margin: 6vh 0 0;
  text-align: center;
}

.home-header h1,
.page-header h1,
.article-header h1 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.15;
}

.home-header h1 {
  font-size: 36px;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 17.5px;
}

.dateline {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.abstract {
  max-width: 92%;
  margin: 34px auto 4px;
}

.abstract h2,
.article-abstract h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.abstract-body,
.article-abstract p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.58;
  hyphens: auto;
  text-align: justify;
}

.abstract-body p {
  margin: 0;
}

.section-title {
  margin: 46px 0 14px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 700;
}

.entry-list {
  display: grid;
  gap: 9px;
}

.entry-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
}

.entry-row a {
  color: var(--link);
}

.entry-row span {
  flex: 1;
  min-width: 24px;
  border-bottom: 1px dotted var(--dot);
  transform: translateY(-4px);
}

.entry-row time {
  color: var(--muted);
  font-size: 14.5px;
  font-variant-numeric: oldstyle-nums;
}

.project-list ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list li {
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.5;
}

.project-list a {
  font-family: "Computer Modern Typewriter", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  font-size: 15px;
}

.elsewhere {
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.9;
}

.elsewhere p {
  margin: 0;
}

.elsewhere span {
  display: inline-block;
  min-width: 74px;
  color: var(--muted);
}

.site-footer {
  margin: 64px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.site-footer a {
  color: inherit;
}

.back-link {
  display: inline-block;
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.page-header,
.article-header {
  margin: 2vh 0 0;
  text-align: center;
}

.page-header {
  margin-bottom: 34px;
}

.page-header h1,
.article-header h1 {
  font-size: 30px;
  line-height: 1.2;
}

.page-header p,
.article-header p {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.55;
}

.article-abstract {
  max-width: 92%;
  margin: 30px auto 0;
}

body.article .page-shell {
  width: min(100%, 760px);
  padding-top: 52px;
}

.article {
  max-width: 650px;
  margin: 0 auto;
}

body.article .back-link {
  margin-bottom: 52px;
}

.article-header {
  max-width: 650px;
  margin-inline: auto;
}

.article-header h1 {
  max-width: 620px;
  margin: 0 auto;
  font-size: 34px;
  line-height: 1.12;
}

.article-header p {
  margin-top: 18px;
}

.article-header .dateline {
  margin-top: 16px;
}

.article-abstract {
  max-width: 560px;
  margin-top: 32px;
}

.article-body {
  counter-reset: article-section article-figure;
  margin: 34px auto 0;
  color: var(--ink);
  font-size: 17.8px;
  font-variant-numeric: oldstyle-nums proportional-nums;
  hyphens: auto;
  line-height: 1.62;
  text-align: left;
}

.article-body > * {
  margin-top: 0;
}

.article-body p {
  margin: 0;
}

.article-body > p:first-child {
  margin: 0 0 12px;
  text-indent: 0;
}

.article-body > p:first-child:has(> em:only-child) {
  margin-bottom: 22px;
  text-align: center;
}

.article-body > p:first-child:has(> em:only-child) + p {
  text-indent: 0;
}

.article-body p + p {
  text-indent: 1.7em;
}

.article-body h2 {
  counter-increment: article-section;
  margin: 42px 0 12px;
  color: var(--ink);
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.28;
  text-align: left;
}

.article-body h2::before {
  content: counter(article-section) "\00a0";
  font-variant-numeric: lining-nums tabular-nums;
}

.article-body h2.references-title {
  counter-increment: none;
  margin-top: 46px;
  text-align: center;
}

.article-body h2.references-title::before {
  content: none;
}

.article-body h3 {
  margin: 30px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.article-body ul,
.article-body ol {
  margin: 16px 0 16px 2.1em;
  padding: 0;
  text-align: left;
}

.article-body li + li {
  margin-top: 6px;
}

.article-body blockquote {
  margin: 22px 1.8em;
  color: var(--ink);
  font-size: 0.96em;
  line-height: 1.56;
  text-align: left;
}

.article-body pre {
  margin: 16px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--code-bg);
  color: var(--ink);
  font-family: "Computer Modern Typewriter", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.5;
  text-align: left;
}

.article-body mjx-container[jax="CHTML"][display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15em 0;
}

.article-body code {
  font-family: "Computer Modern Typewriter", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;
  font-size: 0.88em;
}

.article-body :not(pre) > code {
  padding: 0 0.18em;
  border-radius: 2px;
  background: var(--code-bg);
}

.article-body a,
.article-abstract a {
  text-decoration: underline;
  text-decoration-color: rgba(42, 77, 143, 0.34);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-body a.citation-link {
  text-decoration: none;
}

.article-body a.citation-link:hover {
  text-decoration: underline;
}

.article-body figure {
  counter-increment: article-figure;
  width: min(100%, 560px);
  margin: 32px auto;
  text-align: center;
}

.article-body figure a {
  display: block;
}

.article-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}

.article-body figcaption {
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
}

.article-body figcaption::before {
  content: "Figure " counter(article-figure) ". ";
  color: var(--ink);
  font-weight: 700;
}

.article-body hr {
  width: 38%;
  height: 0;
  margin: 34px 0 24px;
  border: 0;
  border-top: 1px solid rgba(27, 26, 23, 0.42);
}

.article-body .references {
  margin-top: 0;
  font-size: 14.5px;
  line-height: 1.45;
  text-align: left;
}

.article-body .references p {
  margin: 0 0 11px 1.75em;
  text-indent: -1.75em;
}

.article-body .references a {
  overflow-wrap: anywhere;
}

.article-body sup,
.footnote-reference {
  font-size: 0.78em;
  line-height: 0;
}

.footnotes,
.footnote-definition {
  margin: 44px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
}

.footnote-definition + .footnote-definition {
  margin-top: 10px;
}

.footnote-definition-label {
  margin-right: 0.45em;
}

.index-list {
  display: grid;
  gap: 22px;
}

.index-list article {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.index-list .meta {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13.5px;
}

.index-list h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.index-list article > p:last-child {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .page-shell {
    padding: 44px 22px 84px;
  }

  .home-header h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 16.5px;
  }

  .abstract,
  .article-abstract {
    max-width: 100%;
  }

  .abstract-body,
  .article-abstract p {
    text-align: left;
  }

  .entry-row {
    gap: 6px;
  }

  .entry-row a {
    max-width: 72%;
  }

  .entry-row span {
    min-width: 12px;
  }

  .page-header h1,
  .article-header h1 {
    font-size: 28px;
  }

  .article-body {
    font-size: 17px;
    text-align: left;
  }
}
