:root {
  --text: #263238;
  --muted: #64727a;
  --line: #dbe2e6;
  --link: #2c6f8f;
  --link-dark: #1f5068;
  --accent: #9a3412;
  --background: #ffffff;
  --surface: #f7f9fa;
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: 14px max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--text);
  font-weight: 700;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  font-size: 0.92rem;
}

nav a {
  color: #42515a;
}

.page {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 52px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 24px 24px;
}

.profile {
  position: sticky;
  top: 84px;
  align-self: start;
}

.portrait {
  display: block;
  width: 190px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.profile h1 {
  margin: 24px 0 6px;
  font-size: 1.62rem;
  line-height: 1.2;
}

.role,
.affiliation {
  margin: 0;
  color: var(--muted);
}

.profile-links {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.profile-links a {
  width: fit-content;
  color: var(--link-dark);
  font-weight: 600;
}

.profile-links .email {
  width: fit-content;
  color: var(--text);
  font-weight: 400;
}

.content {
  min-width: 0;
}

.section {
  padding: 0 0 34px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

#research {
  border-bottom: 0;
  margin-bottom: 10px;
}

.section h2 {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  color: #20292e;
  font-size: 1.55rem;
  line-height: 1.25;
}

.section h3 {
  margin: 0 0 8px;
  color: #20292e;
  font-size: 1.03rem;
  line-height: 1.35;
}

.section p {
  margin: 0 0 14px;
}

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

.publication-list {
  margin: 18px 0 0;
  padding-left: 1.4rem;
}

.publication-list li {
  margin-bottom: 22px;
  padding-left: 4px;
}

.publication-list p {
  margin-bottom: 4px;
}

.venue {
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-link {
  display: inline-flex;
  align-items: center;
  vertical-align: text-bottom;
}

.stats-link img {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 4px;
}

.stats-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 24px 56px;
}

.stats-hero {
  margin-bottom: 30px;
}

.stats-back {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 600;
}

.stats-hero h1 {
  margin: 0;
  color: #20292e;
  font-size: 1.8rem;
  line-height: 1.2;
}

.stats-panel {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.stats-panel h2 {
  margin: 0 0 12px;
  color: #20292e;
  font-size: 1.25rem;
  line-height: 1.3;
}

.stats-widget,
.stats-note {
  margin: 0 0 14px;
}

.stats-widget img {
  height: 22px;
}

.flag-counter img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}



@media (max-width: 820px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  nav {
    justify-content: flex-start;
    gap: 12px 16px;
  }

  .page {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 28px;
  }

  .profile {
    position: static;
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 0 22px;
    align-items: start;
  }

  .portrait {
    grid-row: span 5;
    width: 126px;
  }

  .profile h1 {
    margin-top: 2px;
  }

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

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .site-header,
  .page,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .profile {
    display: block;
  }

  .portrait {
    width: 142px;
  }
}
