:root {
  --theme: #b509ac;
  --theme-dark: #85077f;
  --text: #111;
  --muted: #555;
  --border: #e3e3e3;
  --surface: #f7f7f7;
  --max-width: 930px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family:
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  flex-direction: column;
}

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

a:hover,
a:focus-visible {
  color: var(--theme-dark);
  text-decoration: underline;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: var(--theme);
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 57px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.nav {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 500;
}

.brand:hover,
.brand:focus-visible {
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: var(--theme);
  text-decoration: none;
}

.menu-button {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button span,
.menu-button::before,
.menu-button::after {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  content: "";
}

.page {
  flex: 1;
  padding-block: 3rem 2.5rem;
}

.page-title {
  margin: 0 0 0.15rem;
  font-size: clamp(2rem, 5vw, 2.55rem);
  font-weight: 400;
  line-height: 1.2;
}

.page-title strong {
  font-weight: 700;
}

.subtitle,
.lead {
  color: var(--muted);
}

.subtitle {
  margin: 0.35rem 0 1rem;
}

.lead {
  max-width: 46rem;
  margin: 0.35rem 0 2rem;
}

h2 {
  margin: 2rem 0 0.8rem;
  font-size: 1.75rem;
  font-weight: 400;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
}

p {
  margin: 0 0 1rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 185px;
  gap: 2rem;
  align-items: start;
}

.bio strong {
  font-weight: 650;
}

.profile-photo {
  width: 185px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.profile-meta {
  margin-top: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

.profile-meta span {
  display: block;
}

.profile-links {
  display: flex;
  margin-top: 0.7rem;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.86rem;
}

.profile-email {
  display: block;
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.home-news {
  width: 80%;
  margin-top: 0.5rem;
}

.home-news h2 {
  margin-top: 0;
}

.news-frame {
  max-height: 13rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.news-list {
  width: 100%;
  border-collapse: collapse;
}

.news-list th,
.news-list td {
  padding: 0.55rem 0.25rem;
  vertical-align: top;
  text-align: left;
}

.news-list th {
  width: 20%;
  min-width: 112px;
  font-weight: 650;
  white-space: nowrap;
}

.selected-publications {
  width: 80%;
  margin-top: 1.4rem;
}

.selected-publications h2 {
  margin: 0 0 0.25rem;
}

.selected-publications .publication {
  grid-template-columns: 58px minmax(0, 1fr);
  padding: 0.65rem 0;
}

.selected-publications .publication-title {
  font-size: 0.96rem;
}

.selected-publications .authors,
.selected-publications .venue {
  margin-bottom: 0.1rem;
  font-size: 0.84rem;
}

.year-heading {
  margin: 2.1rem 0 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.5rem;
  font-weight: 400;
}

.publication {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.venue-badge {
  display: inline-block;
  align-self: start;
  padding: 0.25rem 0.45rem;
  border-radius: 3px;
  color: #fff;
  background: var(--theme);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.publication-title {
  margin-bottom: 0.25rem;
  font-weight: 650;
  line-height: 1.35;
}

.authors,
.venue,
.publication-note {
  margin-bottom: 0.25rem;
}

.authors,
.venue {
  font-size: 0.92rem;
}

.publication-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.paper-links {
  display: flex;
  margin-top: 0.45rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.button-link {
  display: inline-block;
  padding: 0.18rem 0.52rem;
  border: 1px solid var(--theme);
  border-radius: 3px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.button-link:hover,
.button-link:focus-visible {
  color: #fff;
  background: var(--theme);
  text-decoration: none;
}

.cv-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.primary-button {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--theme);
  border-radius: 3px;
  white-space: nowrap;
}

.primary-button:hover,
.primary-button:focus-visible {
  color: #fff;
  background: var(--theme);
  text-decoration: none;
}

.cv-toolbar {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.cv-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.zoom-button {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.zoom-button:hover,
.zoom-button:focus-visible {
  border-color: var(--theme);
  color: var(--theme);
}

#cv-zoom-level {
  min-width: 3.2rem;
  color: #fff;
  text-align: center;
  font-size: 0.9rem;
}

.pdfjs-frame {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 620px;
  padding: 0 1rem 1rem;
  border: 1px solid var(--border);
  overflow: auto;
  background: #525659;
  scrollbar-gutter: stable;
}

.pdf-frame-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  margin: 0 -1rem 1rem;
  padding: 0.55rem 1rem;
  align-items: center;
  background: rgb(49 52 54 / 96%);
  box-shadow: 0 2px 6px rgb(0 0 0 / 25%);
}

.pdf-page {
  display: block;
  margin: 0 auto 1rem;
  background: #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / 30%);
}

.pdf-page:last-child {
  margin-bottom: 0;
}

.pdf-status {
  margin: 1rem;
  color: #fff;
  text-align: center;
}

.cv-section {
  margin-top: 2rem;
}

.cv-section > h2 {
  margin-bottom: 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.cv-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1.5rem;
  padding: 0.75rem 0;
}

.cv-entry + .cv-entry {
  border-top: 1px solid #f0f0f0;
}

.cv-entry-title {
  font-weight: 650;
}

.cv-entry h2.cv-entry-title {
  margin: 0;
  font-size: 1.05rem;
}

.cv-entry-subtitle,
.cv-entry-detail,
.cv-entry p {
  margin: 0.12rem 0 0;
}

.cv-entry-subtitle,
.cv-entry-detail,
.cv-date {
  color: var(--muted);
  font-size: 0.92rem;
}

.cv-date {
  text-align: right;
  white-space: nowrap;
}

.cv-entry ul {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0 1.2rem;
  padding: 0;
}

.tag-list {
  display: flex;
  margin: 0.5rem 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.tag-list li {
  padding: 0.28rem 0.55rem;
  border-radius: 3px;
  background: var(--surface);
}

.all-news {
  max-width: 52rem;
}

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

.site-footer {
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
}

.page-home .page {
  padding-block: 2.8rem 1rem;
}

@media (min-width: 801px) and (min-height: 800px) {
  .page-home {
    min-height: 100vh;
  }

  .page-home .page {
    min-height: calc(100vh - 104px);
  }

  .page-home .site-footer {
    min-height: 47px;
  }
}

@media (min-width: 801px) {
  .page-home .brand {
    visibility: hidden;
  }
}

@media (max-width: 800px) {
  .container {
    width: min(calc(100% - 2rem), var(--max-width));
  }

  .menu-button {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 57px;
    right: 0;
    left: 0;
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 5px 12px rgb(0 0 0 / 8%);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.65rem 0;
  }

  .page {
    padding-block: 2rem;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .profile {
    grid-row: 1;
    justify-self: center;
    text-align: center;
  }

  .profile-photo {
    width: min(230px, 70vw);
  }

  .home-news,
  .selected-publications {
    width: 100%;
  }

  .bio {
    grid-row: 2;
  }

  .publication {
    grid-template-columns: 55px minmax(0, 1fr);
    gap: 0.75rem;
  }

  .cv-header {
    display: block;
  }

  .primary-button {
    margin-top: 0.75rem;
  }

  .cv-toolbar {
    align-items: flex-start;
  }

  .cv-toolbar .primary-button {
    margin-top: 0;
  }

  .pdfjs-frame {
    height: 50vh;
    min-height: 360px;
    padding: 0 0.5rem 0.5rem;
  }

  .pdf-frame-toolbar {
    margin: 0 -0.5rem 0.5rem;
    padding: 0.45rem 0.5rem;
  }
}

@media (max-width: 520px) {
  .news-list,
  .news-list tbody,
  .news-list tr,
  .news-list th,
  .news-list td {
    display: block;
  }

  .news-list tr {
    padding: 0.45rem 0;
  }

  .news-list th,
  .news-list td {
    width: auto;
    min-width: 0;
    padding: 0.1rem 0;
    white-space: normal;
  }

  .cv-entry {
    grid-template-columns: 1fr;
  }

  .cv-date {
    text-align: left;
  }

  .publication {
    grid-template-columns: 1fr;
  }

  .venue-badge {
    justify-self: start;
  }
}

@media print {
  .site-header,
  .site-footer,
  .primary-button,
  .page {
    padding: 0;
  }

  a {
    color: inherit;
  }
}
