/* Academic-homepage style (single page, profile card + sections), no build step. */
:root {
  --primary: #1565c0;
  --primary-soft: #e3eefb;
  --text: #2b2b2b;
  --muted: #6b6f76;
  --border: #e6e8eb;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --card: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --badge-bg: #eef2f7;
  --badge-text: #33415c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #64a8f0;
    --primary-soft: #16263a;
    --text: #e3e5e8;
    --muted: #9aa1ab;
    --border: #2a2f36;
    --bg: #14171b;
    --bg-alt: #1a1e23;
    --card: #1c2026;
    --nav-bg: rgba(20, 23, 27, 0.92);
    --shadow: none;
    --badge-bg: #252b33;
    --badge-text: #c9d1dc;
  }
}
:root[data-theme="dark"] {
  --primary: #64a8f0;
  --primary-soft: #16263a;
  --text: #e3e5e8;
  --muted: #9aa1ab;
  --border: #2a2f36;
  --bg: #14171b;
  --bg-alt: #1a1e23;
  --card: #1c2026;
  --nav-bg: rgba(20, 23, 27, 0.92);
  --shadow: none;
  --badge-bg: #252b33;
  --badge-text: #c9d1dc;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: "Lato", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brand { font-family: "Montserrat", "Lato", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 16px;
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 6px 9px; border-radius: 6px; white-space: nowrap;
  color: var(--text); font-family: "Montserrat", sans-serif; font-size: 0.86rem; font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }
.theme-toggle, .menu-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; width: 34px; height: 34px; cursor: pointer; font-size: 0.95rem;
}
.menu-toggle { display: none; }
@media (max-width: 1180px) {
  .menu-toggle { display: inline-block; }
  .nav-links {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 12px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 4px; }
}

/* ---------- Sections ---------- */
section { padding: 64px 0; }
section:nth-of-type(even) { background: var(--bg-alt); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.section-grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: 32px; }
.section-title h2 { font-size: 1.75rem; font-weight: 700; margin: 0 0 6px; }
.section-title p { color: var(--muted); margin: 0; font-size: 0.95rem; }
@media (max-width: 860px) {
  section { padding: 44px 0; }
  .section-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- About / profile ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: 40px; align-items: start; }
.profile { text-align: center; }
.avatar {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--card); box-shadow: 0 0 0 1px var(--border), var(--shadow);
}
.profile h1 { font-size: 1.85rem; margin: 18px 0 4px; line-height: 1.25; }
.profile .role { font-size: 1.05rem; color: var(--text); margin: 0; }
.profile .org { color: var(--muted); margin: 2px 0 0; font-size: 0.98rem; }
.social { list-style: none; padding: 0; margin: 16px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.25rem; color: var(--primary);
}
.social a:hover { background: var(--primary-soft); text-decoration: none; }
.cv-btn {
  display: inline-block; margin-top: 14px; padding: 7px 18px; border-radius: 999px;
  border: 1px solid var(--primary); color: var(--primary); font-family: "Montserrat", sans-serif;
  font-size: 0.85rem; font-weight: 600;
}
.cv-btn:hover { background: var(--primary); color: #fff; text-decoration: none; }
.bio h2 { font-size: 1.75rem; margin: 0 0 12px; }
.bio p { margin: 0 0 14px; }
.bio-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.bio-cols h3 { font-size: 1.1rem; margin: 0 0 8px; }
.icon-list { list-style: none; padding: 0; margin: 0; }
.icon-list li { display: flex; gap: 10px; margin-bottom: 8px; line-height: 1.45; }
.icon-list i { color: var(--primary); margin-top: 4px; width: 16px; text-align: center; flex-shrink: 0; }
.icon-list .meta { display: block; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .bio-cols { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.news li:last-child { border-bottom: none; }
.news .date { font-weight: 700; color: var(--text); font-size: 0.93rem; }
@media (max-width: 520px) { .news li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Publications ---------- */
.pub-group { margin-bottom: 26px; }
.pub-group h3 { font-size: 1.05rem; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.pub {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.pub .title { font-weight: 700; font-size: 1.02rem; line-height: 1.45; margin: 0 0 4px; }
.pub .authors { margin: 0; font-size: 0.95rem; color: var(--muted); }
.pub .authors strong { color: var(--text); }
.pub .venue { margin: 2px 0 0; font-size: 0.92rem; font-style: italic; font-weight: 700; color: var(--text); }
.pub .summary { margin: 8px 0 0; font-size: 0.93rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 600;
  background: var(--badge-bg); color: var(--badge-text); font-family: "Montserrat", sans-serif;
}
.badge.status { background: var(--primary-soft); color: var(--primary); }
a.badge:hover { text-decoration: none; filter: brightness(0.95); }

/* ---------- Experience timeline ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; margin-bottom: 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -26px; top: 7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
}
.exp-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; box-shadow: var(--shadow); }
.exp-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.exp-head h3 { font-size: 1.05rem; margin: 0; }
.exp-head .when { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.exp-card .where { margin: 0; color: var(--muted); font-size: 0.95rem; }
.exp-card ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.94rem; }
.exp-card ul li { margin-bottom: 3px; }
.timeline .exp-card ul li::before { content: none; }

/* ---------- Awards grid ---------- */
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.award { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.award .a-title { font-weight: 700; margin: 0; line-height: 1.4; font-size: 0.98rem; }
.award .a-org { color: var(--muted); margin: 4px 0 0; font-size: 0.9rem; line-height: 1.4; }
.award .a-year { display: inline-block; margin-top: 8px; font-size: 0.8rem; font-weight: 700; color: var(--primary); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.skills h3 { font-size: 0.98rem; margin: 0 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 0.85rem; }
@media (max-width: 640px) { .skills { grid-template-columns: 1fr; } }

/* ---------- Contact / footer ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.contact-list i { color: var(--primary); width: 20px; text-align: center; }
footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 0.88rem; text-align: center; }

/* ---------- Hugging Face accounts ---------- */
.hf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.hf-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.hf-head { display: flex; align-items: center; gap: 12px; }
.hf-logo { font-size: 1.9rem; line-height: 1; }
.hf-head h3 { margin: 0; font-size: 1.12rem; }
.hf-meta { display: block; color: var(--muted); font-size: 0.86rem; line-height: 1.45; margin: 2px 0 0; }
.hf-list { list-style: none; margin: 12px 0 0; padding: 0; }
.hf-list li { padding: 10px 0; border-top: 1px dashed var(--border); font-size: 0.95rem; line-height: 1.45; }
.hf-list .badges { margin-top: 6px; }
@media (max-width: 400px) { .hf-grid { grid-template-columns: 1fr; } }

/* ---------- Robustness: a11y, no-JS, motion, print ---------- */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip-link:focus { left: 12px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.no-js .theme-toggle, .no-js .menu-toggle { display: none; }
@media (max-width: 860px) {
  .no-js .nav-links { display: flex; position: static; flex-direction: row; flex-wrap: wrap; border: 0; padding: 0; background: none; }
  .no-js .nav-inner { height: auto; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
}
.footer-links { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; font-size: 1.1rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { text-decoration: none; }
.no-js .to-top { display: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .navbar, .theme-toggle, .menu-toggle, .to-top, .skip-link, .cv-btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  section { padding: 14px 0; background: #fff !important; break-inside: avoid; }
  .pub, .exp-card, .award, .hf-card { box-shadow: none; border-color: #ccc; }
  a { color: #000; }
}

/* ---------- Project cards ---------- */
a.proj { color: var(--text); display: block; transition: border-color 0.15s, transform 0.15s; }
a.proj:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); }
a.proj .a-title i { color: var(--muted); }
