/* Landing page inspired by the provided single-page academic design. */
:root {
  --bg: #fdfdfc;
  --bg-alt: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2230;
  --text-soft: #4b5565;
  --muted: #8b94a3;
  --accent: #b31b1b;
  --accent-soft: rgba(179, 27, 27, 0.08);
  --glow: rgba(179, 27, 27, 0.14);
  --accent-2: #4aa3df;
  --border: #e5e8ee;
  --shadow: 0 2px 12px rgba(28, 34, 48, 0.06);
  --shadow-hover: 0 14px 36px rgba(28, 34, 48, 0.13);
  --nav-bg: rgba(253, 253, 252, 0.86);
  --radius: 16px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #0f1420;
  --bg-alt: #131a29;
  --surface: #1a2233;
  --text: #e8ecf4;
  --text-soft: #b3bdce;
  --muted: #7c8699;
  --accent: #f87171;
  --accent-soft: rgba(248, 113, 113, 0.1);
  --glow: rgba(248, 113, 113, 0.17);
  --accent-2: #7cc7ff;
  --border: #2a3447;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(15, 20, 32, 0.86);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }
.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 1001;
  transition: width 0.1s linear;
}
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow); }
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-soft);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle, .nav-burger {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  cursor: pointer;
}
.theme-toggle {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, color 0.2s, transform 0.25s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }
[data-theme="dark"] .icon-moon, .icon-sun { display: none; }
[data-theme="dark"] .icon-sun, .icon-moon { display: block; }
.nav-burger { display: none; border: none; padding: 8px; flex-direction: column; gap: 5px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); transition: 0.25s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(179, 27, 27, 0.28); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(179, 27, 27, 0.34); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: 7px 16px; font-size: 0.85rem; }
.btn-large { padding: 14px 30px; font-size: 1.04rem; }
.btn-ghost { background: transparent; color: var(--accent-2); display: block; margin: 18px auto 0; }

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
  padding: 108px 0 12px;
  position: relative;
  z-index: 2;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  align-items: center;
  gap: 56px;
  position: relative;
  z-index: 1;
}
.hero-kicker {
  color: var(--accent);
  display: grid;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
  text-transform: uppercase;
}
.hero-kicker a { color: inherit; }
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 5.8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.hero-lede {
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 58ch;
  padding-left: 18px;
}
.hl {
  background-image: linear-gradient(var(--glow), var(--glow));
  background-position: 0 72%;
  background-repeat: no-repeat;
  background-size: 0% 45%;
  transition: background-size 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.hl.marked { background-size: 100% 45%; }
.hero-bio { color: var(--text-soft); margin-bottom: 28px; max-width: 62ch; }
.hero-bio strong { color: var(--text); font-weight: 800; }
#work .cv-title a,
#work .cv-title a:hover {
  color: inherit;
}
.pub-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.hero-socials { display: flex; flex-wrap: wrap; gap: 14px; position: relative; z-index: 3; }
.social-link {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text-soft);
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.2s ease, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.social-link:hover { border-color: var(--accent); box-shadow: var(--shadow); color: var(--accent); transform: translateY(-3px); text-decoration: none; z-index: 4; }
.social-link[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  border-radius: 6px;
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  padding: 4px 10px;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 5;
}
.social-link[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.photo-frame { justify-self: center; perspective: 900px; position: relative; width: min(330px, 78vw); }
.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 28px;
  transform: rotate(-3deg) translate(14px, 14px);
  opacity: 0.16;
}
.photo-frame img {
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  box-shadow: var(--shadow-hover);
  display: block;
  object-fit: cover;
  object-position: center;
  position: relative;
  width: 100%;
}
.photo-frame figcaption {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-top: 12px;
  position: relative;
  text-align: center;
}
.section { padding: 28px 0; position: relative; }
.section-alt { background: var(--bg-alt); }
.section-title {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}
.section-title.centered, .contact-text { text-align: center; }
.block-follow { margin-top: 22px; }
.section-note { color: var(--text-soft); margin: 0 0 16px; max-width: 68ch; }
.news-list { display: grid; gap: 14px; list-style: none; }
.news-item {
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: 130px 1fr;
  padding: 18px 20px;
}
.news-date { color: var(--accent); font-family: var(--font-mono); font-size: 0.84rem; font-weight: 700; }
.news-item p { color: var(--text-soft); }
.news-list.wide-label .news-item { grid-template-columns: minmax(168px, 280px) 1fr; }
.news-list.wide-label .news-date { line-height: 1.35; }
.hidden-news { display: none; }
.show-all-news .hidden-news { display: grid; }

.pub-filters { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.filter-btn, .pub-search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 9px 14px;
}
.filter-btn { cursor: pointer; font-weight: 700; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.filter-btn.active, .filter-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pub-search { flex: 1; min-width: 230px; outline: none; }
.pub-search:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(74, 163, 223, 0.16); }
.pub-list { display: grid; gap: 18px; }
.pub-card {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: 148px 1fr;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.pub-card:hover { border-color: rgba(179, 27, 27, 0.34); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.pub-venue-badge {
  align-self: start;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  justify-content: center;
  letter-spacing: 0.02em;
  line-height: 1.25;
  max-width: 100%;
  padding: 8px 10px;
  text-align: center;
}
.venue-bioinformatics { background: rgba(5, 150, 105, 0.12); color: #047857; }
.venue-cvpr { background: rgba(30, 58, 138, 0.14); color: #1e3a8a; }
.venue-icml { background: rgba(234, 88, 12, 0.14); color: #c2410c; }
.venue-aaai { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }
.venue-iclr { background: rgba(245, 158, 11, 0.18); color: #92400e; }
.venue-ismb { background: rgba(13, 148, 136, 0.14); color: #0f766e; }
.venue-naacl { background: rgba(8, 145, 178, 0.14); color: #0e7490; }
.venue-neurips { background: rgba(220, 38, 38, 0.15); color: #991b1b; }
.venue-preprint { background: rgba(107, 114, 128, 0.12); color: var(--muted); }
.venue-submitted { background: rgba(99, 102, 241, 0.14); color: #4338ca; }
[data-theme="dark"] .venue-bioinformatics { color: #6ee7b7; }
[data-theme="dark"] .venue-cvpr { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
[data-theme="dark"] .venue-icml { background: rgba(251, 113, 60, 0.16); color: #fb923c; }
[data-theme="dark"] .venue-aaai { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
[data-theme="dark"] .venue-iclr { background: rgba(250, 204, 21, 0.18); color: #facc15; }
[data-theme="dark"] .venue-ismb { background: rgba(45, 212, 191, 0.16); color: #2dd4bf; }
[data-theme="dark"] .venue-naacl { background: rgba(34, 211, 238, 0.16); color: #67e8f9; }
[data-theme="dark"] .venue-neurips { background: rgba(248, 113, 113, 0.17); color: #fca5a5; }
[data-theme="dark"] .venue-submitted { background: rgba(129, 140, 248, 0.16); color: #a5b4fc; }
.pub-title { font-size: 1.08rem; line-height: 1.35; margin-bottom: 8px; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent-2); }
.pub-authors, .pub-venue { color: var(--text-soft); font-size: 0.94rem; }
.me { color: var(--accent); font-weight: 800; }
.pub-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pub-link {
  background: var(--accent-soft);
  border: none;
  border-radius: 8px;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 10px;
}
.pub-link:hover { text-decoration: none; filter: brightness(0.96); }
.pub-empty { color: var(--muted); padding: 18px 0; }

.cv-module { display: grid; gap: 18px; }
.cv-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.cv-entry-top { align-items: baseline; display: flex; gap: 16px; justify-content: space-between; }
.cv-title { font-size: 1.12rem; line-height: 1.35; }
.cv-entry h4.cv-title { font-size: 1.02rem; }
.cv-aside {
  color: var(--accent);
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 42%;
  text-align: right;
}
.cv-line { color: var(--text-soft); }
.cv-line.em { font-style: italic; }
.cv-points { color: var(--text-soft); margin: 8px 0 0 1.15em; }
.cv-children { display: grid; gap: 12px; margin-top: 16px; }
.cv-children .cv-entry { background: var(--bg-alt); box-shadow: none; }
.cv-fold-toggle {
  align-items: flex-start;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 16px;
  padding: 0;
  text-align: left;
  width: 100%;
}
.cv-fold-main { flex: 1; min-width: 0; }
.cv-fold-chevron { color: var(--accent); flex: none; margin-top: 4px; transition: transform 0.2s ease; }
.cv-fold.is-open > .cv-fold-toggle .cv-fold-chevron { transform: rotate(180deg); }
.cv-fold-panel { display: none; }
.cv-fold.is-open > .cv-fold-panel { display: block; }
.cv-fold-toggle:hover .cv-title { color: var(--accent); }

.timeline { position: relative; }
.timeline::before { background: var(--border); bottom: 0; content: ""; left: 10px; position: absolute; top: 0; width: 2px; }
.timeline-item { display: grid; gap: 24px; grid-template-columns: 22px 1fr; margin-bottom: 22px; position: relative; }
.timeline-dot { background: var(--surface); border: 3px solid var(--accent); border-radius: 50%; height: 22px; margin-top: 18px; position: relative; width: 22px; z-index: 1; }
.timeline-dot.current { background: var(--accent); box-shadow: 0 0 0 7px var(--accent-soft); }
.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.timeline-date { color: var(--accent); font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; }
.timeline-card h3 { font-size: 1.1rem; margin: 6px 0 2px; }
.timeline-org { color: var(--text-soft); font-weight: 700; margin-bottom: 8px; }
.two-col { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
.simple-list { display: grid; gap: 14px; list-style: none; }
.simple-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.muted { color: var(--text-soft); }
.award-list { color: var(--text-soft); display: grid; gap: 8px; list-style: disc; margin: 10px 0 0 1.15em; }
.award-list strong { color: var(--text); font-weight: 800; }
.box-list { display: grid; gap: 14px; list-style: none; }
.box-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  padding: 18px 20px;
}
.box-list strong { color: var(--text); font-weight: 800; }
.after-hours {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-hover);
  display: grid;
  gap: 34px;
  grid-template-columns: 1.45fr 0.8fr;
  overflow: hidden;
  padding: 34px;
  position: relative;
}
.after-hours::before { background: radial-gradient(circle, var(--glow), transparent 62%); content: ""; height: 260px; position: absolute; right: -80px; top: -90px; width: 260px; }
.after-hours-kicker, .mono { color: var(--accent); font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.after-hours h2 { font-family: var(--font-serif); font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; margin: 8px 0 14px; }
.after-hours p { color: var(--text-soft); }
.after-hours-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: grid;
  gap: 10px;
  padding: 24px;
  position: relative;
}
.after-hours-card strong { font-family: var(--font-serif); font-size: 1.2rem; }
.contact-section { overflow: visible; position: relative; z-index: 2; }
.contact-wrap { position: relative; z-index: 1; }
.contact-text { color: var(--text-soft); margin: 0 auto 26px; max-width: 66ch; }
.contact-email { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.contact-socials { justify-content: center; margin-top: 24px; padding-bottom: 12px; }
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; padding: 26px 0; text-align: center; }
.back-to-top {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  bottom: 24px;
  box-shadow: var(--shadow);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  height: 46px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transition: opacity 0.2s, transform 0.2s;
  width: 46px;
  z-index: 900;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { color: var(--accent); transform: translateY(-2px); }
.btt-ring { height: 46px; left: -1px; position: absolute; top: -1px; transform: rotate(-90deg); width: 46px; }
.btt-ring circle { fill: none; stroke: var(--accent); stroke-dasharray: 125.7; stroke-dashoffset: 125.7; stroke-width: 2; }
.toast {
  background: var(--text);
  border-radius: 999px;
  bottom: 28px;
  color: var(--bg);
  font-size: 0.88rem;
  left: 50%;
  opacity: 0;
  padding: 9px 16px;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .nav-links {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    display: none;
    flex-direction: column;
    left: 24px;
    padding: 12px;
    position: absolute;
    right: 24px;
    top: 66px;
  }
  .nav-links.open { display: flex; }
  .nav-burger { display: flex; }
  .hero-inner, .two-col, .after-hours { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-photo { order: -1; }
  .section { padding: 22px 0; }
}

@media (max-width: 620px) {
  .container { padding: 0 18px; }
  .nav-inner { padding: 12px 18px; }
  .nav-actions .btn { display: none; }
  .hero { padding-top: 96px; }
  .pub-card, .news-item { grid-template-columns: 1fr; }
  .cv-entry-top { align-items: flex-start; flex-direction: column; gap: 4px; }
  .cv-aside { max-width: none; text-align: left; }
  .pub-venue-badge { justify-self: start; }
  .contact-email { flex-direction: column; }
  .contact-email .btn { text-align: center; width: 100%; }
}
