:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --ink: #292824;
  --muted: #67645e;
  --accent: #63513b;
  --link: var(--ink);
  --honor: #9c3f62;
  --rule: #ded9d0;
  --link-rule: #a59c8f;
  --selection: #e5ddce;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #20201e;
  --ink: #e9e5dd;
  --muted: #b5b0a6;
  --accent: #d4bc96;
  --link: var(--ink);
  --honor: var(--accent);
  --rule: #45423c;
  --link-rule: #8e8679;
  --selection: #514939;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Newsreader", "Baskerville", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

::selection { background: var(--selection); }

.page {
  max-width: 740px;
  margin: 0 auto;
  padding: 78px 28px 32px;
}

.site-header { position: relative; margin-bottom: 34px; }
.site-header h1 { padding-right: 56px; }

.theme-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--rule); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle svg { width: 22px; height: 22px; }
.sun-icon { display: none; }
:root[data-theme="dark"] .sun-icon { display: block; }
:root[data-theme="dark"] .moon-icon { display: none; }

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: -0.8px;
  line-height: 1.2;
}

.affiliation {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.separator {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-inline: 0.3em;
  border-radius: 50%;
  background-color: currentColor;
  vertical-align: middle;
}

p + p { margin-top: 17px; }

.biography > p,
.research > p,
.summary,
.personal > p {
  text-align: justify;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-rule);
}

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

.research-topics a {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.research-papers {
  margin: 6px 0;
  padding-left: 1.1em;
  list-style-type: circle;
}

.research-papers li + li { margin-top: 6px; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-radius: 1px;
}

.contact {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.8;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 6px;
}

main > section + section { margin-top: 42px; }

h2 {
  margin-bottom: 15px;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.25px;
}

.publication-list, .paper-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.publication-list > li {
  padding: 24px 0 28px;
  border-top: 1px solid var(--rule);
}

.publication-list > li:last-child { padding-bottom: 0; }

.publication-note {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.venue {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin-bottom: 9px;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.15px;
  text-wrap: pretty;
}

h3 a { color: inherit; text-decoration: none; }
h3 a:hover { text-decoration: underline; }

.authors {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.authors a { text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.authors strong { color: var(--ink); font-weight: 600; }

.award,
.software-impact {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.award { color: var(--honor); }
.software-impact { color: var(--accent); }

.summary {
  margin-top: 13px;
  font-size: 18px;
  line-height: 1.4;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 13px;
  font-size: 14px;
  line-height: 1.4;
}

.personal p { font-size: 18px; }

footer {
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

@media (max-width: 600px) {
  body { font-size: 18px; }
  .page { padding: 42px 24px 24px; }
  h1 { font-size: 36px; }
  .site-header { margin-bottom: 28px; }
  h3 { font-size: 19px; }
  main > section + section { margin-top: 34px; }
}

@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #fff;
    --ink: #292824;
    --muted: #67645e;
    --accent: #63513b;
    --link: var(--ink);
    --honor: var(--accent);
    --rule: #ded9d0;
  }
  html { background: white; }
  .theme-toggle { display: none; }
  .page { max-width: none; padding: 0; }
  body { font-size: 12pt; }
  .skip-link { display: none; }
  article { break-inside: avoid; }
  a { text-decoration: none; }
  footer { margin-top: 24px; }
}
