/* Academic website styling: reference-inspired serif typography and soft sky tones. */
:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #f4f8f3;
  --surface-strong: #edf5f8;
  --ink: #263b35;
  --muted: #61756e;
  --heading: #142f26;
  --link: #377f91;
  --line: #d8e3dd;
  --accent: #4b9bc7;
  --accent-soft: #dceff9;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(24, 61, 50, .045);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #151c20;
  --surface: #1b262b;
  --surface-strong: #223139;
  --ink: #d7e2e5;
  --muted: #a0b3b8;
  --heading: #e5f0ed;
  --link: #82c8e5;
  --line: #34474e;
  --accent: #73bde1;
  --accent-soft: #263f4b;
  --card: #1c272c;
  --shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 19px/1.65 "Crimson Pro", Georgia, serif; transition: background .2s, color .2s; }
h1, h2, h3, h4 { color: var(--heading); font-weight: 600; line-height: 1.2; margin-top: 0; }
h1 { font-size: 2.05rem; margin-bottom: .3rem; }
h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); margin-bottom: 1.15rem; }
h3 { font-size: 1.38rem; margin-bottom: .55rem; }
h4 { font-size: 1.08rem; margin-bottom: .25rem; }
p { margin-top: 0; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
.wrap { width: min(1100px, calc(100% - 48px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--heading); display: inline-flex; align-items: center; gap: 8px; font: 600 .98rem Inter, sans-serif; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: clamp(25px, 5vw, 66px); }
.nav-link { position: relative; display: inline-block; padding: 14px 0 12px; color: var(--ink); font-size: 1rem; }
.nav-link::after { content: ""; position: absolute; height: 3px; left: 0; right: 0; bottom: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .18s ease; }
.nav-link.active { color: var(--heading); }
.nav-link.active::after { transform: scaleX(1); }
.theme-toggle { border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 11px; cursor: pointer; font: 500 .76rem Inter, sans-serif; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon { font-size: 1.05rem; line-height: 1; }
.section { padding-block: 74px; }
.hero { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: clamp(40px, 7vw, 88px); padding-top: 78px; }
.hero-profile { text-align: center; }
.portrait-placeholder {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
}

.portrait-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}
/* .portrait-placeholder { width: 170px; height: 170px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, var(--accent-soft), var(--surface-strong)); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line); } */
.portrait-placeholder span { font: 600 2.8rem Inter, sans-serif; color: var(--heading); }
.role { margin-bottom: 0; font-style: italic; color: var(--muted); }
.institution { color: var(--muted); font-size: .96rem; margin-bottom: 17px; }
.profile-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.profile-link { font: 600 .78rem Inter, sans-serif; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--link); }
.profile-link:hover { background: var(--accent-soft); text-decoration: none; border-color: var(--accent); }
.email-note { margin-top: 17px; font: .79rem Inter, sans-serif; color: var(--muted); overflow-wrap: anywhere; }
.eyebrow { color: var(--link); font: 700 .72rem Inter, sans-serif; letter-spacing: .14em; margin-bottom: 12px; }
.hero-copy > p:not(.eyebrow) { max-width: 780px; }
.advisor { margin-top: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 19px 0 10px; }
.cv-button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 7px; background: var(--accent); color: #fff; font: 600 .82rem Inter, sans-serif; }
.cv-button:hover { background: var(--link); color: #fff; text-decoration: none; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 34px; }
.interest-tags span { font: 500 .72rem Inter, sans-serif; color: var(--link); background: var(--surface); border: 1px solid var(--line); padding: 6px 10px; border-radius: 99px; }
.education-block h3 { font-size: 1.6rem; margin-bottom: 22px; }
.education-item { margin-bottom: 19px; }
.item-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; }
.item-heading h3, .item-heading h4 { margin-bottom: 4px; }
.item-heading span, .card-topline > span:last-child { flex-shrink: 0; font: 600 .73rem Inter, sans-serif; color: var(--muted); }
.education-item p { margin-bottom: 0; }
.section-tint { background: var(--surface); border-block: 1px solid var(--line); }
.timeline { border-left: 2px solid var(--line); margin: 28px 0 0 8px; padding-left: 28px; }
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -36px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--page); box-shadow: 0 0 0 1px var(--line); }
.timeline-item p { max-width: 850px; margin-bottom: 0; }
.section-intro { max-width: 760px; color: var(--muted); margin-bottom: 30px; }
.subsection-title { margin-top: 34px; margin-bottom: 17px; font-size: 1.65rem; }
.projects-heading { margin-top: 48px; }
.research-card { padding: 24px 26px; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 13px; }
.status { background: var(--accent-soft); color: var(--link); border-radius: 5px; padding: 4px 8px; font: 600 .68rem Inter, sans-serif; }
.research-card h3 { max-width: 900px; }
.authors { color: var(--muted); font-size: .94rem; margin-bottom: 10px; }
.publication-link { font-size: .92rem; margin-bottom: 0; }
.other-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 23px; box-shadow: var(--shadow); }
.info-card p { margin-bottom: 10px; }
.info-card ul { padding-left: 21px; margin-bottom: 0; }
.info-card li { margin-bottom: 7px; }
.site-footer { background: var(--page); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding-block: 22px; border-top: 1px solid var(--line); font-size: .9rem; }
.footer-inner p { margin: 0; }
@media (max-width: 780px) {
  body { font-size: 18px; }
  .wrap { width: min(100% - 32px, 620px); }
  .nav { min-height: auto; padding-block: 9px; align-items: flex-start; }
  .nav-right { gap: 10px; align-items: flex-start; }
  .nav-links { gap: clamp(12px, 3vw, 24px); flex-wrap: wrap; justify-content: flex-end; }
  .nav-link { padding: 10px 0 8px; font-size: .91rem; }
  .theme-toggle { margin-top: 5px; }
  .theme-label { display: none; }
  .hero { grid-template-columns: 1fr; gap: 35px; padding-top: 45px; }
  .hero-profile { max-width: 440px; margin-inline: auto; }
  .portrait-placeholder { width: 145px; height: 145px; }
  .portrait-placeholder span { font-size: 2.3rem; }
  .section { padding-block: 52px; }
  .item-heading { display: block; }
  .item-heading span { display: block; margin-top: 5px; }
  .other-grid { grid-template-columns: 1fr; }
  .research-card { padding: 20px; }
}
@media (max-width: 520px) {
  .nav { display: block; }
  .nav-right { justify-content: space-between; align-items: center; margin-top: 7px; }
  .nav-links { justify-content: space-between; flex: 1; gap: 10px; }
  .nav-link { font-size: .88rem; }
  .theme-toggle { flex-shrink: 0; }
}

/* Visitor Flag Counter */
.visitor-counter {
  margin-top: 35px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  text-align: center;
}

.visitor-counter h3 {
  margin-bottom: 15px;
  font-size: 1.35rem;
}

.visitor-counter img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

.arxiv-button {
  display: inline-block;
  padding: 6px 13px;
  border: 1.5px solid #4b9bc7;
  border-radius: 6px;
  color: #287da8;
  font-weight: 600;
  background: #f0f8ff;
  text-decoration: none;
  transition: all 0.2s ease;
}

.arxiv-button:hover {
  background: #dceff9;
  border-color: #287da8;
  text-decoration: none;
}