:root {
  color-scheme: light;
  --text: #223344;
  --heading: #223344;
  --subheading: #334455;
  --link: #295f98;
  --link-hover: #f09228;
  --line: #cccccc;
  --row-line: #f2f2f2;
  --bg: #fdfdfd;
  --surface: #ffffff;
  --button: #1a3a5c;
  --button-active-text: #ffffff;
  --paper-title: #000000;
  --label: #6b7885;
  --note: #637f9f;
  --accent: #9f4d63;
  --notice-bg: #fbf7f9;
  --notice-border: #e7ccd5;
  --footer-bg: #334455;
  --footer-text: #ffffff;
  --media-filter: none;
  --toggle-bg: rgba(253, 253, 253, 0.84);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --text: #d7dde5;
    --heading: #edf2f7;
    --subheading: #cbd5e1;
    --link: #8fbce8;
    --link-hover: #f0b35e;
    --line: #4a5563;
    --row-line: #26313c;
    --bg: #111820;
    --surface: #111820;
    --button: #8fbce8;
    --button-active-text: #0c1117;
    --paper-title: #f4f7fa;
    --label: #96a3b3;
    --note: #9eb4cc;
    --accent: #e7a2b3;
    --notice-bg: #181f28;
    --notice-border: #5c3c49;
    --footer-bg: #0c1117;
    --footer-text: #cbd5e1;
    --media-filter: brightness(0.92);
    --toggle-bg: rgba(17, 24, 32, 0.84);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #d7dde5;
  --heading: #edf2f7;
  --subheading: #cbd5e1;
  --link: #8fbce8;
  --link-hover: #f0b35e;
  --line: #4a5563;
  --row-line: #26313c;
  --bg: #111820;
  --surface: #111820;
  --button: #8fbce8;
  --button-active-text: #0c1117;
  --paper-title: #f4f7fa;
  --label: #96a3b3;
  --note: #9eb4cc;
  --accent: #e7a2b3;
  --notice-bg: #181f28;
  --notice-border: #5c3c49;
  --footer-bg: #0c1117;
  --footer-text: #cbd5e1;
  --media-filter: brightness(0.92);
  --toggle-bg: rgba(17, 24, 32, 0.84);
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Lato", Verdana, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  transition: background-color 180ms ease, color 180ms ease;
}

h1,
h2,
h3,
h4,
h5,
a,
p,
span,
div,
button,
li,
summary {
  font-family: "Lato", Verdana, Helvetica, sans-serif;
  font-weight: normal;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 160ms ease;
}

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

img {
  display: block;
  max-width: 100%;
}

b,
strong {
  font-weight: 700;
}

.container {
  max-width: 890px;
  margin: 48px auto 0;
  padding: 0 16px 64px;
}

.profile {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 75px;
  align-items: center;
  margin-bottom: 48px;
}

.portrait {
  width: 170px;
  height: 220px;
  border-radius: 8px;
  object-fit: cover;
  object-position: 50% 42%;
}

.profile h1 {
  margin: 0;
  color: var(--heading);
  font-size: 2.6em;
  line-height: 1.12;
}

.subtitle {
  margin: 9px 0 12px;
  color: var(--text);
  font-size: 14px;
}

.links {
  margin: 6px 0 12px;
  color: var(--text);
  font-size: 14px;
}

.contact {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.availability {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  padding: 5px 9px 5px 7px;
  border: 1px solid var(--notice-border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  background: var(--notice-bg);
  font-size: 12px;
  line-height: 1.3;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.availability i {
  color: var(--accent);
  font-size: 11px;
}

.availability span {
  overflow-wrap: anywhere;
}

a.btn {
  margin: 0 3px;
}

a.btn:hover {
  color: var(--link-hover) !important;
  text-decoration: none;
}

.theme-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--label);
  background: var(--toggle-bg);
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.theme-toggle:hover {
  color: var(--link);
  border-color: var(--link);
}

.theme-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.section {
  margin-top: 1em;
}

.section h2,
.section-heading {
  margin: 1em 0 0;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--line);
  color: var(--heading);
  font-size: 22px;
  line-height: 1.2;
  transition: border-color 180ms ease, color 180ms ease;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 22px;
}

.section > p {
  margin: 0;
  padding-top: 8px;
  font-size: 14px;
  line-height: 15pt;
}

.news,
.plain-list,
.experience ul {
  margin: 0;
  padding: 8px 0 0 19px;
  font-size: 14px;
  line-height: 18pt;
}

.news li,
.experience li {
  margin: 1px 0;
}

.plain-list {
  padding-left: 0;
  list-style: none;
}

.plain-list li {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  margin: 3px 0;
}

.news span {
  color: var(--text);
}

.plain-list span {
  display: block;
  color: var(--label);
  font-family: "Lato", Verdana, Helvetica, sans-serif;
  font-size: 13px;
  line-height: inherit;
  white-space: nowrap;
}

.education-note {
  margin-top: 1px;
  color: var(--note);
  font-size: 13px;
  font-style: italic;
  line-height: 1.35;
}

.mark {
  color: var(--accent);
}

.pub-filter {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.pub-filter button {
  display: inline-block;
  margin: 2px;
  padding: 3px 9px;
  border: 1.5px solid var(--button);
  border-radius: 2px;
  color: var(--button) !important;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pub-filter button.active {
  color: var(--button-active-text) !important;
  background: var(--button);
  pointer-events: none;
}

.pub-note {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 18pt;
}

.publication {
  display: grid;
  grid-template-columns: 30% 1fr;
  gap: 0;
  align-items: center;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--row-line);
  font-size: 14px;
  transition: border-color 180ms ease;
}

.publication:first-of-type {
  border-top: 1px solid var(--line);
}

.publication:last-of-type {
  border-bottom: 0;
}

.publication.hidden {
  display: none;
}

.publication[hidden] {
  display: none !important;
}

.pub-media {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7pt;
}

.pub-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  filter: var(--media-filter);
  transition: filter 160ms ease, transform 160ms ease;
}

.publication:hover .pub-media img {
  transform: translateY(-1px);
  will-change: transform;
}

.pub-body {
  padding: 12pt 7pt;
  line-height: 18pt;
}

.pub-body h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.28;
}

.pub-body h3 a {
  color: var(--paper-title);
  text-decoration: none;
}

.pub-body h3 a:hover {
  color: var(--paper-title);
  text-decoration: underline;
}

.authors,
.venue,
.pub-links {
  margin: 3pt 0 0;
  font-size: 14px;
  line-height: 18pt;
}

.authors strong,
.authors b {
  font-size: 14px;
}

.venue {
  margin-top: 1pt;
  font-style: italic;
}

.venue span {
  color: var(--accent);
  font-style: normal;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 7pt;
}

.paper-related a {
  display: inline-block;
  margin-top: 2px;
  margin-right: 2px;
  padding: 0 8px;
  border: 1.5px solid var(--link);
  border-radius: 2px;
  color: var(--link);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.8;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.paper-related a:hover {
  border-color: var(--button);
  color: var(--button-active-text);
  background: var(--button);
  text-decoration: none;
  transform: translateY(-1px);
}

.tldr {
  margin-top: 3pt;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.tldr[open] {
  animation: tldr-reveal 150ms ease;
}

.tldr summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}

.tldr summary::-webkit-details-marker {
  display: none;
}

.tldr summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--text);
  transform: translateY(0.5px);
  transition: transform 0.1s ease;
}

.tldr summary::after {
  content: "TL;DR";
}

.tldr[open] summary::before {
  transform: rotate(90deg) translateX(1px);
}

.tldr[open] {
  margin-top: 4pt;
}

@keyframes tldr-reveal {
  from {
    opacity: 0.72;
    transform: translateY(-1px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.experience {
  display: grid;
  grid-template-columns: 24% 1fr;
  gap: 0;
  align-items: center;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--row-line);
  font-size: 14px;
}

.experience:first-of-type {
  border-top: 1px solid var(--line);
}

.experience:last-of-type {
  border-bottom: 0;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10pt;
}

.logo img {
  max-width: 96%;
  max-height: 58px;
  object-fit: contain;
}

.experience div {
  padding: 12pt 7pt;
  line-height: 18pt;
}

.experience h3 {
  margin: 0;
  color: var(--paper-title);
  font-size: 17px;
  line-height: 1.28;
  font-weight: 700;
}

.experience p {
  margin: 1pt 0;
  color: var(--text);
  font-size: 14px;
  line-height: 18pt;
}

.experience ul {
  padding-top: 5pt;
  font-size: 11.5px;
  line-height: 14pt;
  white-space: nowrap;
}

.footer {
  width: 100vw;
  margin: 36px 0 0 calc(50% - 50vw);
  background: var(--footer-bg);
  transition: background-color 180ms ease;
}

.footer p {
  max-width: 968px;
  margin: 0 auto;
  padding: 6px 16px;
  color: var(--footer-text);
  font-size: 10px;
}

@media only screen and (max-width: 1150px) {
  body {
    font-size: 18px;
  }

  .profile {
    display: block;
    text-align: center;
  }

  .portrait {
    width: 132px;
    height: 172px;
    margin: 0 auto 12px;
  }

  a.btn {
    padding: 2px 6px;
    font-size: 14px;
  }

  .experience ul {
    white-space: normal;
  }
}

@media only screen and (max-width: 600px) {
  body {
    font-size: 10.5px;
  }

  .container {
    width: min(100% - 28px, 890px);
    margin-top: 22px;
    padding-left: 0;
    padding-right: 0;
  }

  .profile {
    margin-bottom: 30px;
  }

  .profile h1 {
    font-size: 22.5px;
    line-height: 1.12;
  }

  .subtitle,
  .links,
  .contact {
    font-size: 10px;
  }

  .links {
    max-width: 320px;
    margin: 7px auto 10px;
    line-height: 1.65;
  }

  a.btn {
    margin: 0 1px;
    padding: 1px 3px;
    font-size: 10px;
  }

  .availability {
    max-width: 320px;
    align-items: flex-start;
    padding: 6px 8px;
    font-size: 9px;
    text-align: left;
  }

  .availability span {
    overflow-wrap: normal;
  }

  .section {
    margin-top: 0.9em;
  }

  .section h2,
  .section-heading {
    font-size: 15px;
  }

  .section > p {
    font-size: 10.5px;
    line-height: 1.55;
  }

  .section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 0.45em;
  }

  .pub-filter {
    display: inline-flex;
    flex-wrap: nowrap;
    margin: 0;
  }

  .pub-filter button {
    padding: 3px 7px;
    font-size: 9.5px;
    white-space: nowrap;
  }

  .news,
  .plain-list,
  .experience ul {
    font-size: 10.5px;
    line-height: 1.45;
  }

  .news {
    padding-left: 0;
    list-style: none;
  }

  .news li {
    padding-left: 70px;
    text-indent: -70px;
    margin: 5px 0;
    overflow: visible;
  }

  .news span {
    display: inline-block;
    width: 62px;
    color: var(--label);
    font-size: 9.5px;
    text-indent: 0;
    white-space: nowrap;
  }

  .publication,
  .experience {
    display: block;
  }

  .plain-list li {
    grid-template-columns: 1fr;
    gap: 2px;
    margin: 7px 0;
  }

  .plain-list span {
    justify-self: start;
  }

  .publication {
    padding: 11px 0 13px;
  }

  .pub-media {
    padding: 6px 0 2px;
  }

  .pub-media img {
    width: min(100%, 320px);
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    margin: 4px auto 7px;
  }

  .pub-media img.wide-teaser {
    width: 100%;
  }

  .pub-body,
  .experience div {
    padding: 4px 0 0;
  }

  .pub-body h3,
  .experience h3 {
    font-size: 12px;
    line-height: 1.32;
  }

  .authors,
  .venue,
  .pub-links {
    font-size: 10px;
    line-height: 1.45;
  }

  .authors strong,
  .authors b {
    font-size: 10px;
  }

  .pub-note,
  .tldr {
    font-size: 9.5px;
    line-height: 1.45;
  }

  .paper-related a {
    padding: 1px 7px;
    font-size: 9px;
  }

  .logo img {
    max-width: 70%;
    margin: 12pt auto;
  }

  .experience ul {
    padding-left: 16px;
    font-size: 9px;
    line-height: 1.35;
  }
}
