@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --background: #f8f7f3;
  --text: #202524;
  --muted: #626866;
  --border: #d8d8d2;
  --link: #315f69;
  --focus: #b8c7ca;
  --toggle-background: #e7e7e2;
  --toggle-selected: #ffffff;
  --toggle-shadow: rgb(25 30 28 / 14%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #181a19;
  --text: #e5e7e4;
  --muted: #a5aaa7;
  --border: #3a3d3b;
  --link: #91bbc4;
  --focus: #54737a;
  --toggle-background: #292c2a;
  --toggle-selected: #454a47;
  --toggle-shadow: rgb(0 0 0 / 35%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --background: #181a19;
    --text: #e5e7e4;
    --muted: #a5aaa7;
    --border: #3a3d3b;
    --link: #91bbc4;
    --focus: #54737a;
    --toggle-background: #292c2a;
    --toggle-selected: #454a47;
    --toggle-shadow: rgb(0 0 0 / 35%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

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

::selection {
  background: #dfe8e8;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.75rem;
  transform: translateY(-180%);
  background: var(--text);
  color: var(--background);
  font-size: 0.8rem;
}

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

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 4.5rem;
  width: min(calc(100% - 4rem), 1040px);
  margin: 0 auto;
  padding: 4.5rem 0 3rem;
}

.sidebar {
  position: sticky;
  top: 3rem;
  align-self: start;
  min-width: 0;
  padding-right: 2.25rem;
  border-right: 1px solid var(--border);
}

.profile-photo {
  display: block;
  width: 158px;
  height: 158px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 12px;
}

.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar h1 {
  margin: 0 0 0.65rem;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.role {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 550;
  line-height: 1.55;
}

.affiliation {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.55;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 1.35rem;
}

.profile-links a,
.section-links a {
  font-size: 0.8rem;
  font-weight: 600;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.theme-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 10.5rem;
  padding: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--toggle-background);
}

.theme-toggle-indicator {
  position: absolute;
  z-index: 0;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / 3);
  border-radius: 999px;
  background: var(--toggle-selected);
  box-shadow: 0 1px 3px var(--toggle-shadow);
  transition: transform 180ms ease;
}

.theme-toggle[data-selected="light"] .theme-toggle-indicator {
  transform: translateX(100%);
}

.theme-toggle[data-selected="dark"] .theme-toggle-indicator {
  transform: translateX(200%);
}

.theme-toggle button {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin: 0;
  padding: 0.2rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.67rem;
  line-height: 1.2;
  cursor: pointer;
  transition: color 180ms ease;
}

.theme-toggle button:hover {
  color: var(--text);
}

.theme-toggle button[aria-checked="true"] {
  color: var(--text);
}

.theme-toggle button:focus-visible {
  border-radius: 999px;
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}

.section-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  margin-top: 1.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.section-links a {
  color: var(--muted);
  text-decoration: none;
}

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

.content {
  min-width: 0;
}

section {
  padding: 0 0 2.7rem;
  scroll-margin-top: 2rem;
}

section + section {
  padding-top: 2.7rem;
  border-top: 1px solid var(--border);
}

h2 {
  margin: 0 0 1.15rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

section > p {
  max-width: 68ch;
  margin: 0 0 1rem;
}

section > p:last-child {
  margin-bottom: 0;
}

.publication {
  padding: 0.15rem 0 1.6rem;
  scroll-margin-top: 2rem;
}

.publication + .publication {
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

.publication h3 {
  max-width: 62ch;
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.48;
}

.publication p {
  margin: 0.3rem 0 0;
}

.authors {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.6;
}

.authors strong {
  color: var(--text);
}

.venue {
  color: var(--muted);
  font-size: 0.83rem;
}

.summary {
  max-width: 64ch;
  font-size: 0.91rem;
  line-height: 1.65;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.publication-note,
.all-publications {
  color: var(--muted);
  font-size: 0.8rem;
}

.all-publications {
  margin-top: 1rem !important;
}

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

.news-list li {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1.2rem;
  padding: 0.75rem 0;
}

.news-list li + li {
  border-top: 1px solid var(--border);
}

.news-list time {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.news-list span {
  font-size: 0.9rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 3rem;
    width: min(calc(100% - 3rem), 1040px);
  }

  .sidebar {
    padding-right: 1.5rem;
  }

  .profile-photo {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 640px) {
  .layout {
    display: block;
    width: min(calc(100% - 2.5rem), 680px);
    padding-top: 2.75rem;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    column-gap: 1.35rem;
    padding: 0 0 2.5rem;
    border-right: 0;
  }

  .profile-photo {
    grid-row: 1 / span 4;
    width: 110px;
    height: 110px;
    margin: 0;
  }

  .sidebar h1 {
    margin-top: 0.1rem;
    font-size: 1.65rem;
  }

  .profile-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 0.85rem;
    margin-top: 0.8rem;
  }

  .section-links {
    display: none;
  }

  .theme-picker {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 0.9rem;
  }

  section {
    padding-bottom: 2.25rem;
  }

  section + section {
    padding-top: 2.25rem;
  }
}

@media (max-width: 420px) {
  .layout {
    width: min(calc(100% - 2rem), 680px);
  }

  .sidebar {
    grid-template-columns: 88px minmax(0, 1fr);
    column-gap: 1rem;
  }

  .profile-photo {
    width: 88px;
    height: 88px;
  }

  .sidebar h1 {
    font-size: 1.45rem;
  }

  .role {
    font-size: 0.85rem;
  }

  .affiliation {
    font-size: 0.73rem;
  }

  .profile-links {
    grid-column: 1 / -1;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .theme-toggle-indicator,
  .theme-toggle button {
    transition: none;
  }
}
