:root {
  /* Layout controls: tune page width here. */
  --page-max-width: 980px;
  --content-width: 900px;
  --page-padding-top: 30px;
  --page-padding-inline: 24px;
  --page-padding-bottom: 64px;
  --page-padding-inline-mobile: 20px;
  --hero-aside-width: 240px;
  --hero-main-gap: 42px;
  --avatar-size: 210px;
  --avatar-size-tablet: 176px;
  --avatar-size-mobile: 148px;
  --hero-contact-font-size: 12px;
  --hero-contact-line-height: 1.65;
  --hero-name-size: 48px;
  --hero-title-size: 19px;
  --body-text-size: 17px;
  --body-line-height: 1.75;
  --section-title-size: 31px;
  --section-gap: 40px;
  --card-gap: 20px;
  --card-padding-y: 14px;

  --bg: #f4f6f9;
  --panel: #ffffff;
  --text: #1f2937;
  --text-strong: #111827;
  --muted: #5f6e82;
  --line: #d7dee9;
  --link: #2f63b6;
  --link-hover: #234f95;
  --accent-soft: #eef3fc;
  --btn-border: #cfd7e2;
  --btn-border-hover: #b6c3d6;
  --btn-text: #253247;
  --btn-bg: #fafcff;
  --media-border: #d7deea;
  --placeholder-border: #c6ceda;
  --placeholder-text: #8b95a5;
  --placeholder-bg: #f0f3f8;
  --author-text: #5e6c7b;
  --venue-text: #1f2937;
  --venue-name: #000000;
  --focus-ring: #9eb8e2;
  --shadow-soft: 0 8px 24px rgba(31, 41, 55, 0.05);
}

/*
Quick theme switch:
Set body class to one of these names in index.html:
- theme-mist
- theme-white
- theme-paper
- theme-sage
- theme-sky
- theme-graphite
*/

body.theme-mist {
  --bg: #f4f6f9;
}

body.theme-white {
  --bg: #ffffff;
  --text: #1f2933;
  --text-strong: #0f172a;
  --muted: #697386;
  --line: #e4e8ef;
  --link: #235ea6;
  --link-hover: #1b4f8d;
  --accent-soft: #f4f7fc;
  --btn-border: #d8dfea;
  --btn-border-hover: #bec9d9;
  --btn-text: #253247;
  --btn-bg: #ffffff;
  --media-border: #dfe6f1;
  --placeholder-border: #d2dbe8;
  --placeholder-text: #8a95a8;
  --placeholder-bg: #f6f8fc;
  --author-text: #606d80;
  --venue-text: #293241;
  --venue-name: #111827;
  --focus-ring: #a8bfdc;
}

body.theme-paper {
  --bg: #f7f3eb;
}

body.theme-sage {
  --bg: #edf4ef;
}

body.theme-sky {
  --bg: #edf3fb;
}

body.theme-graphite {
  --bg: #eceff3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: var(--page-padding-top) var(--page-padding-inline) var(--page-padding-bottom);
}

.hero {
  padding-bottom: 18px;
  margin-bottom: var(--section-gap);
}

.hero-top,
.hero-main,
#research,
#students,
#talks,
#experience,
#publications,
#contact,
.footer-note {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.hero-name {
  margin: 0;
  font-size: var(--hero-name-size);
  line-height: 1.02;
  letter-spacing: 0.2px;
  font-weight: 600;
  color: var(--text-strong);
}

.hero-title {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--hero-title-size);
}

.hero-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.hero-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero-nav a:hover {
  color: var(--link);
  border-color: var(--link);
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--hero-aside-width);
  gap: var(--hero-main-gap);
  align-items: start;
}

.hero-greeting {
  font-size: 48px;
  line-height: 1.18;
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.hero-main p {
  margin: 0 0 15px;
  font-size: var(--body-text-size);
  line-height: var(--body-line-height);
}

.hero-main p,
.hero-contact,
.project-authors,
.project-venue,
.project-excerpt,
.project-links,
.pub-filters,
.simple-block p,
#contact p {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.hero-main p,
.hero-main p a {
  font-size: var(--body-text-size);
}

.hero-main p a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.hero-main p a:hover {
  color: var(--link-hover);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-actions a {
  text-decoration: none;
  border: 1px solid var(--btn-border);
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--btn-text);
  background: var(--btn-bg);
  font-size: 13px;
  font-weight: 500;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.hero-actions a:hover {
  border-color: var(--btn-border-hover);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.hero-right {
  justify-self: end;
  width: 100%;
  max-width: var(--hero-aside-width);
}

.hero-right img {
  width: min(100%, var(--avatar-size));
  height: min(100%, var(--avatar-size));
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  margin: 0 0 12px;
}

.hero-contact {
  margin: 0;
  color: var(--muted);
  font-size: var(--hero-contact-font-size);
  line-height: var(--hero-contact-line-height);
}

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

h3.section-title {
  margin: 0 0 12px;
  font-size: var(--section-title-size);
  font-weight: 600;
  color: var(--text-strong);
}

ul.research-list {
  margin: 0 0 20px;
  padding-left: 22px;
  font-size: 16px;
}

ul.research-list li {
  margin-bottom: 5px;
}

.pub-filters {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 18px;
}

#publications,
#contact {
  margin-top: var(--section-gap);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-item {
  display: flex;
  gap: var(--card-gap);
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding: var(--card-padding-y) 0 18px;
}

.project-image {
  flex: 0 0 250px;
}

.project-image img,
.project-image .placeholder {
  width: 250px;
  height: 152px;
  border-radius: 8px;
  display: block;
}

.project-image img {
  object-fit: cover;
  border: 1px solid var(--media-border);
}

.project-image .placeholder {
  border: 1px dashed var(--placeholder-border);
  color: var(--placeholder-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--placeholder-bg);
}

.project-info strong {
  display: block;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--text-strong);
}

.project-authors {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--author-text);
}

.project-venue {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: var(--venue-text);
  line-height: 1.35;
  margin-bottom: 10px;
}

.project-venue i {
  font-style: normal;
}

.venue-name {
  font-weight: 400;
  color: var(--venue-name);
}

.current-author {
  font-weight: 700;
  color: inherit;
}

.project-excerpt {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

.project-links a {
  display: inline-block;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.project-links a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.project-links a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
}

.simple-block {
  margin: 18px 0 10px;
}

.simple-block p,
#contact p {
  margin: 4px 0 0;
  font-size: 16px;
  color: var(--muted);
}

#contact a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

@media (max-width: 880px) {
  .hero-name {
    font-size: 34px;
  }

  .hero-greeting {
    font-size: 36px;
  }

  .hero-main p {
    font-size: 16px;
  }

  .container {
    padding-left: var(--page-padding-inline-mobile);
    padding-right: var(--page-padding-inline-mobile);
  }

  .hero-right img {
    width: min(100%, var(--avatar-size-tablet));
    height: min(100%, var(--avatar-size-tablet));
  }
}

@media (max-width: 700px) {
  .hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-main {
    display: block;
  }

  .hero-right {
    margin-top: 12px;
  }

  .hero-right img {
    width: min(100%, var(--avatar-size-mobile));
    height: min(100%, var(--avatar-size-mobile));
  }

  .project-item {
    flex-direction: column;
  }

  .project-image img,
  .project-image .placeholder {
    width: 100%;
    max-width: 320px;
    height: 190px;
  }

  .project-info strong {
    font-size: 17px;
  }

  .project-links {
    font-size: 13px;
    gap: 14px;
  }
}
