:root {
  --bg: #f8faf8;
  --paper: #ffffff;
  --ink: #15202b;
  --muted: #65717d;
  --line: #d9e2df;
  --teal: #086c67;
  --lime: #a4d65e;
  --blue: #1d4f91;
  --red: #b73535;
  --soft: #edf4f1;
  --shadow: 0 18px 45px rgba(21, 32, 43, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(8, 108, 103, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(8, 108, 103, 0.028) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration-color: rgba(29, 79, 145, 0.58);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--teal);
  text-decoration-color: var(--lime);
}

a:focus-visible {
  border-radius: 2px;
  outline: 3px solid rgba(164, 214, 94, 0.72);
  outline-offset: 3px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 248, 0.92);
  backdrop-filter: blur(16px);
}

.site-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.7vw, 22px);
  font-size: 14px;
  font-weight: 700;
}

.topnav a {
  padding: 3px 0;
  border-bottom: 2px solid rgba(8, 108, 103, 0.3);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.topnav a:hover,
.topnav a:focus-visible {
  border-bottom-color: var(--teal);
  color: var(--teal);
  text-decoration: none;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.layout {
  display: grid;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 44px;
}

.profile-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  min-width: 0;
  padding: 34px 0 44px;
}

.portrait-wrap {
  position: relative;
  width: 184px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.portrait-wrap::after {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 76px;
  height: 76px;
  border-right: 5px solid var(--lime);
  border-bottom: 5px solid var(--lime);
  content: "";
}

.portrait-wrap img {
  aspect-ratio: 1;
  object-fit: cover;
}

.profile-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.18;
}

.roman-name {
  margin: 4px 0 14px;
  color: var(--teal);
  font-weight: 800;
}

.identity,
.location {
  margin: 0 0 10px;
  color: var(--muted);
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.profile-links a {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(8, 108, 103, 0.55);
  background: rgba(237, 244, 241, 0.72);
  box-shadow: inset 0 -3px 0 rgba(164, 214, 94, 0.38);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.profile-links a:hover,
.profile-links a:focus-visible {
  border-color: var(--teal);
  background: var(--paper);
  color: var(--blue);
  text-decoration: none;
}

.facts {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.facts div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 650;
}

.content {
  min-width: 0;
  padding: 46px 0 32px;
}

.section-block {
  padding: 34px 0 42px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 84px;
}

.hero {
  padding-top: 58px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 3px 9px;
  background: var(--ink);
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h2 {
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.34;
}

.lead {
  max-width: 820px;
  color: #34434f;
  font-size: clamp(18px, 2vw, 22px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--line);
}

.metrics div {
  min-width: 0;
  padding: 18px;
  background: var(--paper);
}

.metrics strong {
  display: block;
  color: var(--teal);
  font-size: 28px;
  line-height: 1;
}

.metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.section-title {
  display: grid;
  grid-template-columns: minmax(160px, 0.38fr) minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  margin-bottom: 22px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 36px);
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.news-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px dashed var(--line);
}

.news-list time,
.project-item time {
  color: var(--teal);
  font-weight: 900;
}

.news-list p,
.project-item p {
  margin-bottom: 0;
}

.timeline-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.timeline-list article {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
  background: var(--paper);
}

.timeline-list time {
  color: var(--teal);
  font-weight: 900;
}

.timeline-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.supervisor-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 6px 2px;
  border-bottom: 2px solid var(--teal);
  background: rgba(164, 214, 94, 0.24);
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.supervisor-link::after {
  content: "\2197";
  font-size: 0.8em;
  line-height: 1;
}

.supervisor-link:hover,
.supervisor-link:focus-visible {
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
}

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

.compact-grid {
  margin-top: 20px;
}

.research-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(21, 32, 43, 0.04);
}

.research-grid span {
  display: inline-block;
  margin-bottom: 26px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.research-grid p,
.pub-list,
.project-stack,
.two-column-list li,
.contact p {
  color: var(--muted);
}

.year-heading {
  margin: 30px 0 12px;
  padding-left: 12px;
  border-left: 5px solid var(--lime);
  color: var(--teal);
}

.pub-list {
  margin: 0;
  padding-left: 24px;
}

.pub-list li {
  margin-bottom: 16px;
  padding-left: 4px;
}

.pub-list em {
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

.pub-list .me {
  display: inline-block;
  padding: 0 5px;
  border-bottom: 2px solid var(--lime);
  background: rgba(164, 214, 94, 0.18);
  color: var(--teal);
  font-weight: 900;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid rgba(8, 108, 103, 0.35);
  background: #edf8ef;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.project-stack {
  display: grid;
  gap: 16px;
}

.project-item {
  padding: 22px 24px;
  border-left: 4px solid var(--teal);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.project-item h3 {
  margin: 6px 0 8px;
}

.two-column-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.two-column-list > div {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.two-column-list ul {
  margin: 0;
  padding-left: 20px;
}

.two-column-list li {
  margin-bottom: 9px;
}

.contact {
  background:
    linear-gradient(135deg, rgba(164, 214, 94, 0.2), transparent 34%),
    var(--paper);
  padding-right: 28px;
  padding-left: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.contact a,
.footer a {
  padding: 0 2px;
  background: rgba(164, 214, 94, 0.18);
  color: var(--teal);
  font-weight: 900;
  text-decoration-color: var(--teal);
}

.contact a:hover,
.contact a:focus-visible,
.footer a:hover,
.footer a:focus-visible {
  background: rgba(164, 214, 94, 0.42);
  color: var(--blue);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .profile-panel {
    position: static;
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 0 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }

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

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

  .content {
    padding-top: 20px;
  }

  .metrics,
  .research-grid,
  .two-column-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 60px;
  }

  .menu-button {
    display: block;
  }

  .topnav {
    position: absolute;
    top: 60px;
    right: 18px;
    left: 18px;
    display: none;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .topnav[data-open="true"] {
    display: flex;
  }

  .topnav a {
    padding: 10px 8px;
  }

  .layout {
    width: min(100% - 28px, 1180px);
  }

  .profile-panel {
    grid-template-columns: 1fr;
  }

  .portrait-wrap {
    grid-row: auto;
    width: 140px;
  }

  .hero {
    padding-top: 36px;
  }

  .section-title,
  .metrics,
  .research-grid,
  .two-column-list {
    grid-template-columns: 1fr;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline-list article {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact {
    padding-right: 18px;
    padding-left: 18px;
  }

  .footer {
    flex-direction: column;
  }
}
