:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #202124;
  --muted: #62666d;
  --line: #deded8;
  --accent: #c000b8;
  --accent-strong: #9a0094;
  --code-bg: #fff0fb;
  --shadow: 0 14px 40px rgba(26, 31, 38, 0.08);
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    "Noto Color Emoji";
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1c1c1d;
  --panel: #232323;
  --text: #f1f1f1;
  --muted: #c7c7c7;
  --line: #3a3a3a;
  --accent: #2698ba;
  --accent-strong: #48b8d8;
  --code-bg: #24323a;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.nav,
.section,
.footer {
  width: min(930px, calc(100% - 30px));
  margin: 0 auto;
}

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

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition:
    max-width 180ms ease,
    opacity 180ms ease,
    margin-right 180ms ease;
}

body.show-brand .brand {
  max-width: 180px;
  opacity: 1;
  margin-right: 18px;
  pointer-events: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-size: 16px;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle,
.nav-toggle {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-color: transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

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

.icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: none;
}

:root[data-theme="dark"] .icon-moon {
  display: block;
}

.nav-toggle {
  display: none;
}

.section {
  padding: 64px 0;
}

.intro {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 270px;
  align-items: start;
  gap: 56px;
  padding-top: 40px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

code {
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.1em 0.25em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

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

h1,
h2,
h3 {
  font-weight: 500;
}

p {
  margin-bottom: 1rem;
}

h1 {
  margin-bottom: 14px;
  font-size: 40px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 20px;
  font-size: 32px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.about-title {
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 500;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 300;
}

.about-list {
  margin: 0 0 1.2rem 1.2rem;
  padding-left: 1rem;
}

.about-list li {
  margin: 0.65rem 0;
}

.about-list strong {
  font-weight: 700;
}

.intro-copy p,
.intro-copy li {
  font-size: 16px;
}

.actions,
.socials,
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.profile {
  margin: 0;
}

.profile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  padding-left: 2px;
  font-size: 16px;
}

.profile-link {
  color: var(--accent);
  white-space: nowrap;
}

.profile-link:hover {
  color: var(--accent-strong);
}

.two-column {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
}

.news-section {
  padding-top: 48px;
}

.news-section h2 {
  margin-bottom: 18px;
  font-size: 32px;
  font-weight: 400;
}

.news-section h2 a {
  color: inherit;
}

.news-section h2 a:hover {
  color: inherit;
  text-decoration: none;
}

.news-scroll {
  --news-visible-items: 5;
  --news-row-height: 44px;
  max-height: calc(var(--news-visible-items) * var(--news-row-height));
  overflow-y: auto;
  padding-right: 4px;
}

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

.news tr {
  vertical-align: top;
}

.news th,
.news td {
  padding: 7px 16px 13px 0;
  border: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.news th {
  width: 20%;
  min-width: 155px;
  font-weight: 700;
  white-space: nowrap;
}

.news td {
  width: 80%;
}

.news-title {
  color: var(--accent);
}

.section-heading {
  max-width: 640px;
  margin-bottom: 24px;
}

.timeline,
.publication-list {
  display: grid;
  gap: 22px;
}

.timeline article,
.publication-list article,
.cv-grid article,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}

.publications,
.service {
  padding-top: 48px;
}

.publications-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 24px;
}

.publications-heading h2,
.service h2 {
  margin-bottom: 0;
  font-size: 32px;
  font-weight: 400;
}

.publications-heading > a {
  font-size: 0.95rem;
  white-space: nowrap;
}

.publications-heading h2 a,
.service h2 a {
  color: inherit;
}

.publications-heading h2 a:hover,
.service h2 a:hover {
  color: inherit;
  text-decoration: none;
}

.publication-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: -10px 0 22px;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

.publication-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 3px;
  flex: 0 0 auto;
}

.publications h3.bibliography {
  margin: 2rem 0 1rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.75rem;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 500;
  text-align: right;
}

.publications h3.bibliography:first-of-type {
  margin-top: 0;
}

.publications ol.bibliography {
  margin: 0;
  padding: 0;
  list-style: none;
}

.publications ol.bibliography li {
  margin-bottom: 1.25rem;
}

.service h2 {
  margin-bottom: 12px;
}

.service-year {
  margin: 1rem 0 0.75rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.45rem;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
  text-align: left;
}

.service-year:first-of-type {
  margin-top: 0;
}

.service-list {
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.service-list li {
  margin: 0 0 0.65rem;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.service-entry {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.service-abbr {
  padding-top: 0.05rem;
}

.service-badge {
  display: inline-block;
  width: 100px;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.service-badge-reviewer {
  background: #6f7782;
}

.service-badge-ac {
  background: #d97706;
}

.service-details {
  color: var(--text);
  font-weight: 400;
}

.service-venue {
  color: inherit;
  text-decoration: none;
}

.service-venue:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.publication-entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.publication-entry .abbr {
  padding-top: 0.2rem;
}

.publication-entry .badge {
  display: inline-block;
  width: 125px;
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.badge-conference {
  background: #2563eb;
}

.badge-workshop {
  background: #b000b8;
}

.badge-preprint {
  background: #64748b;
}

.publication-details .title {
  margin-bottom: 0.2rem;
  color: var(--text);
  font-weight: 700;
}

.publication-details .author,
.publication-details .periodical {
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

.publication-details .author em {
  border-bottom: 1px solid var(--text);
  font-style: normal;
}

.publication-details .author a {
  border-bottom: 1px dashed var(--accent);
}

.publication-details .author a:hover {
  border-bottom-style: solid;
  text-decoration: none;
}

.publication-details .periodical em {
  font-style: italic;
}

.publication-details .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.publication-details .btn {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--text);
  border-radius: 2px;
  padding: 0.16rem 0.85rem;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.publication-details .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.timeline time,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.card a {
  margin-top: auto;
  font-weight: 700;
}

.tag {
  width: fit-content;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.contact {
  text-align: center;
}

.contact p {
  max-width: 620px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
}

.socials {
  justify-content: center;
}

.footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .nav {
    align-items: center;
    padding: 14px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    display: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 14px;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: grid;
    gap: 8px;
  }

  .intro,
  .two-column,
  .grid {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 32px;
    padding-top: 24px;
  }

  .profile {
    max-width: 320px;
  }

  .news th,
  .news td {
    display: block;
    width: 100%;
    padding-right: 0;
  }

  .news th {
    min-width: 0;
    padding-bottom: 2px;
  }

  .news td {
    padding-top: 0;
  }

  .publication-entry {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .publication-entry .badge {
    width: auto;
    min-width: 95px;
  }

  .publications h3.bibliography {
    text-align: left;
  }

  .service-year {
    text-align: left;
  }

  .service-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .service-badge {
    width: auto;
    min-width: 90px;
  }

  .publications-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
