/* Homepage styles (used by _layouts/home.html only). */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --border: #e4e7ec;
  --text: #1d2433;
  --muted: #5b6577;
  --faint: #8a93a3;
  --accent: #1f4e8c;
  --accent-soft: #e8eef7;
  --own: #b4541a;
  --own-soft: #fbefe6;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218;
    --surface: #171b23;
    --border: #262c37;
    --text: #e6e9ef;
    --muted: #a3acbb;
    --faint: #7a8496;
    --accent: #7fa8e0;
    --accent-soft: #1b2738;
    --own: #e89a63;
    --own-soft: #2d2018;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { max-width: 920px; margin: 0 auto; padding: 0 24px; }
main.wrap { min-height: calc(100vh - 180px); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font: 600 18px var(--serif); color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.current { color: var(--accent); }

/* Sections */
main section { padding: 40px 0 8px; }
h2 {
  font: 600 24px/1.3 var(--serif);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
h2.sub { margin-top: 36px; }
h3 { margin: 0; }

/* Hero */
.hero { display: flex; gap: 36px; align-items: center; padding-top: 56px; }
.avatar {
  width: 168px; height: 168px; flex: none;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border);
}
.hero h1 { font: 600 40px/1.15 var(--serif); margin: 0 0 6px; letter-spacing: -0.01em; }
.affil { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 20px; }
.links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.links a:hover { color: var(--accent); text-decoration: none; }
.links i { margin-right: 4px; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat {
  display: flex; flex-direction: column;
  min-width: 132px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text);
}
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-num { font: 600 24px/1.2 var(--sans); font-variant-numeric: tabular-nums; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--muted); max-width: 170px; line-height: 1.35; }
.stat-note { margin: 8px 0 0; font-size: 12px; color: var(--faint); }

.bio { padding-top: 32px; }
.bio p { margin: 0 0 14px; }

/* Research interests */
.areas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.area {
  padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.area-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.area-num { font: 600 13px var(--sans); color: var(--accent); letter-spacing: 0.06em; }
.area h3 { font: 600 18px/1.35 var(--serif); }
.area-summary { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.chip-group {
  width: 100%; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--faint);
}
.chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--accent);
}
.chip small { font-size: 11px; color: var(--faint); font-weight: 400; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip-own { border-color: color-mix(in srgb, var(--own) 45%, var(--border)); background: var(--own-soft); color: var(--own); }
.chip-own:hover { border-color: var(--own); }
.legend { margin: 12px 0 0; font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.chip-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--own-soft); border: 1px solid var(--own); display: inline-block; }

/* Publications */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font: 500 13px var(--sans); color: var(--muted);
  padding: 5px 12px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border); cursor: pointer;
}
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#publications .legend { margin-bottom: 8px; }
.year { font: 600 15px var(--sans); color: var(--faint); margin: 24px 0 8px; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.pub:last-child { border-bottom: 0; }
.badge {
  flex: none; width: 104px; text-align: center; align-self: flex-start; margin-top: 2px;
  padding: 3px 6px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600;
}
.pub-body { min-width: 0; }
.pub-title { display: block; font-weight: 600; color: var(--text); line-height: 1.45; }
.pub-title:hover { color: var(--accent); }
.pub-authors { font-size: 14px; color: var(--muted); margin-top: 3px; }
.pub-authors strong { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.pub-venue { font-size: 14px; color: var(--muted); }
.award { color: var(--own); font-weight: 600; font-style: normal; }
.award::before { content: "★ "; }
.pub-links { margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; }
.pub-links a {
  font-size: 12px; font-weight: 500; padding: 1px 8px;
  border: 1px solid var(--border); border-radius: 5px; color: var(--muted);
}
.pub-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 18px; padding: 7px 0; font-size: 15px; }
.news li.more { display: none; }
.news.open li.more { display: flex; }
.news-date { flex: none; width: 76px; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.show-more {
  margin-top: 8px; font: 500 13px var(--sans); color: var(--accent);
  background: none; border: 0; padding: 0; cursor: pointer;
}

/* Experience / Education */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.timeline li:last-child { border-bottom: 0; }
.tl-main { display: flex; flex-direction: column; }
.tl-org { font-weight: 600; color: var(--text); }
.tl-role { font-size: 14.5px; }
.tl-detail { font-size: 14px; color: var(--muted); }
.tl-dates { flex: none; font-size: 14px; color: var(--faint); font-variant-numeric: tabular-nums; }

.footer {
  margin-top: 56px; padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--faint);
}

/* Inner pages (CV, Blog) */
.page-head { padding: 56px 0 4px; }
.page-head h1 { font: 600 36px/1.2 var(--serif); margin: 0; letter-spacing: -0.01em; }
.page-sub { margin: 8px 0 0; color: var(--muted); }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  font-size: 14px; font-weight: 500;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); filter: none; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { padding: 4px 0; }
.kv span { display: inline-block; width: 120px; font-weight: 600; }
.empty-state {
  margin-top: 32px; padding: 56px 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: 12px; color: var(--muted);
}
.empty-state i { font-size: 28px; color: var(--faint); }
.empty-state p { margin: 12px 0 6px; font-size: 17px; color: var(--text); }
.empty-state a { font-size: 14px; }

/* Small screens */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .brand { display: none; }
  .nav { gap: 18px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; padding-top: 32px; }
  .avatar { width: 120px; height: 120px; }
  .hero h1 { font-size: 32px; }
  .page-head { padding-top: 32px; }
  .page-head h1 { font-size: 28px; }
  .kv span { display: block; width: auto; }
  .areas { grid-template-columns: 1fr; }
  .stats { flex-wrap: nowrap; gap: 8px; }
  .stat { min-width: 0; flex: 1 1 0; padding: 8px 10px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .pub { flex-direction: column; gap: 6px; }
  .badge { width: auto; }
  .news li { flex-direction: column; gap: 0; }
  .timeline li { flex-direction: column; gap: 2px; }
}
