:root {
  --bg: #f8f8f5;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #202328;
  --muted: #666c73;
  --line: #dfe2e3;
  --accent: #244d63;
  --accent-soft: #e8eef1;
  --max: 1120px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(36,77,99,.065), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  opacity: .72;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(248,248,245,.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner,
main,
.footer-inner {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: .015em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .93rem;
}

nav a.active,
nav a:hover {
  color: var(--text);
}

main {
  flex: 1;
  padding: 76px 0 88px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 64px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
}

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--text);
  font-weight: 600;
}

h1 {
  margin: 0;
  font-size: clamp(3.1rem, 7vw, 6.4rem);
  line-height: .98;
  letter-spacing: -.04em;
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -.025em;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.role {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--muted);
}

.institution {
  margin: 5px 0 0;
  color: var(--muted);
}

.lead {
  max-width: 720px;
  margin: 36px 0 0;
  font-size: 1.08rem;
  color: #3c4147;
}

.quick-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
  background: rgba(255,255,255,.62);
  color: var(--text);
}

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

.math-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.92), rgba(232,238,241,.74));
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 50px rgba(31,48,58,.05);
}

.math-card::before,
.math-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(36,77,99,.13);
  border-radius: 50%;
  width: 310px;
  height: 160px;
  transform: rotate(24deg);
}

.math-card::before {
  top: 30px;
  right: -100px;
}

.math-card::after {
  bottom: 35px;
  left: -100px;
  transform: rotate(-18deg);
}

.formula {
  position: relative;
  z-index: 2;
  margin: auto 0;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.6;
  color: var(--accent);
}

.formula small {
  display: block;
  margin-top: 18px;
  font-family: var(--sans);
  font-style: normal;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.section {
  margin-top: 88px;
}

.section-rule {
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
}

.news-list,
.publications-list {
  display: grid;
  gap: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.news-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.page-intro {
  max-width: 760px;
  margin-bottom: 64px;
}

.page-intro h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
}

.page-intro p {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

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

.research-card {
  min-height: 250px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.58);
}

.research-card p {
  margin: 0;
  color: var(--muted);
}

.publication {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.publication-title {
  font-family: var(--serif);
  font-size: 1.24rem;
  margin: 0;
}

.publication-meta {
  margin: 7px 0 0;
  color: var(--muted);
}

.pub-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.pub-links a {
  font-size: .9rem;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pub-tags span {
  font-size: .77rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
}

.teaching-year {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 30px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.teaching-year h3 {
  margin: 0;
}

.teaching-year ul {
  margin: 0;
  padding-left: 18px;
}

.note-box {
  margin-top: 50px;
  border-left: 3px solid var(--accent);
  background: rgba(232,238,241,.55);
  padding: 20px 22px;
  color: #424950;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: .88rem;
}

.footer-inner a {
  color: var(--muted);
}

@media (max-width: 850px) {
  .hero,
  .research-grid {
    grid-template-columns: 1fr;
  }

  .math-card {
    min-height: 300px;
  }

  .header-inner {
    align-items: flex-start;
    padding: 18px 0;
    flex-direction: column;
    gap: 12px;
  }

  nav {
    justify-content: flex-start;
    gap: 14px 18px;
  }

  .teaching-year {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 540px) {
  .header-inner,
  main,
  .footer-inner {
    width: min(calc(100% - 28px), var(--max));
  }

  main {
    padding-top: 54px;
  }

  h1 {
    font-size: 3.2rem;
  }

  .footer-inner {
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    padding: 28px 0;
  }
}
.talks-list {
  padding-left: 1.4rem;
  margin-top: 16px;
}

.talks-list li {
  margin-bottom: 6px;
  padding-left: 6px;
}

/* Dark mode */

body.dark-mode {
  --bg: #17191c;
  --surface: rgba(30, 33, 37, 0.85);
  --text: #eeeeea;
  --muted: #a8adb3;
  --line: #353a40;
  --accent: #8fb6c9;
  --accent-soft: #25343c;
}

body.dark-mode {
  background:
    radial-gradient(
      circle at top right,
      rgba(143, 182, 201, 0.08),
      transparent 28rem
    ),
    var(--bg);
}

body.dark-mode .site-header {
  background: rgba(23, 25, 28, 0.88);
}

body.dark-mode .lead {
  color: #cdd1d5;
}

body.dark-mode .math-card {
  background:
    linear-gradient(
      145deg,
      rgba(34, 38, 42, 0.96),
      rgba(28, 38, 44, 0.86)
    );
}

body.dark-mode .research-card {
  background: rgba(30, 33, 37, 0.72);
}

body.dark-mode .button-link {
  background: rgba(30, 33, 37, 0.8);
  color: var(--text);
}

body.dark-mode .button-link.primary {
  background: var(--accent);
  color: #17191c;
}

.theme-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  padding: 0 4px;
  font-family: inherit;
}

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

.photo-card {
  overflow: hidden;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 18px 50px rgba(31,48,58,.05);
}

.profile-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

@media (max-width: 850px) {
  .photo-card {
    min-height: 300px;
  }

  .profile-photo {
    min-height: 300px;
  }
}
