/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --border: rgba(20,30,40,.08);
  --text: #16232b;
  --text-2: #5b6770;
  --text-3: #8a949b;
  --accent: #0f7b73;
  --accent-hover: #0a5f59;
  --accent-soft: #e4f2f0;
  --ink: #0b2f3a;
  --amber: #b45309;
  --amber-soft: #fdf1e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-h: 64px;
  /* type scale, 17px root: 13.6 / 15.3 / 17 / 19 / 24 / 32 / 40 */
  --t-xs: .8rem; --t-sm: .9rem; --t-md: 1rem; --t-lg: 1.125rem; --t-xl: 1.4rem; --t-2xl: 1.9rem; --t-3xl: 2.35rem;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: var(--t-md); line-height: 1.6; color: var(--text); background: var(--bg); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

.link { color: var(--accent); font-weight: 700; }
.link:hover { color: var(--accent-hover); text-decoration: underline; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 4px; z-index: 200; }
.skip:focus { left: 8px; }
.muted { color: var(--text-2); }

/* ── Top bar ────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar__inner { width: 100%; padding: 0 28px; height: var(--nav-h); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: var(--t-lg); letter-spacing: -.01em; color: var(--text); margin-right: auto; }
.brand__mark { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--ink)); color: #fff; display: grid; place-items: center; font-size: var(--t-sm); font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font-size: var(--t-sm); font-weight: 700; color: var(--text-2); transition: background .15s, color .15s; }
.nav a svg { display: none; width: 24px; height: 24px; }
.nav a:hover { background: rgba(20,30,40,.05); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

/* ── Layout ─────────────────────────────────────────────── */
.page { width: 100%; padding: 28px 28px 56px; }
.grid { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 24px; align-items: start; }
@media (min-width: 1600px) { .grid { grid-template-columns: minmax(0,1fr) 460px; } }
.stack { display: grid; gap: 24px; }
.sticky { position: sticky; top: calc(var(--nav-h) + 24px); }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .sticky { position: static; } }

/* ── Cards ──────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card__title { font-size: var(--t-xl); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.card__title::before { content: ""; width: 6px; height: 26px; border-radius: 3px; background: var(--accent); flex-shrink: 0; }
.card__sub { font-size: var(--t-sm); color: var(--text-2); margin: -12px 0 18px; }
.card__footer { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: var(--t-sm); font-weight: 800; color: var(--accent); transition: color .15s; }
.card__footer:hover { color: var(--accent-hover); text-decoration: underline; }
.card__footer svg { width: 18px; height: 18px; transition: transform .15s; }
.card__footer:hover svg { transform: translateX(3px); }
.page-title { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.page-subtitle { font-size: var(--t-sm); color: var(--text-2); margin-top: 6px; }

/* ── Visiting-card hero ─────────────────────────────────── */
.vcard { display: grid; grid-template-columns: 340px minmax(0,1fr) 260px; padding: 0; overflow: hidden; margin-bottom: 24px; }
.vcard__side { position: relative; display: grid; place-items: center; padding: 32px; background: linear-gradient(160deg, var(--ink) 0%, #0f5f66 55%, var(--accent) 100%); }
.vcard__side::before, .vcard__side::after { content: ""; position: absolute; inset: 0; background-repeat: repeat; pointer-events: none; }
.vcard__side::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='220' viewBox='0 0 320 220'%3E%3Cpath d='M0 110c20-70 40-70 60 0s40 70 60 0 40-70 60 0 40 70 60 0 40-70 60 0 40 70 20 0' fill='none' stroke='rgba(255,255,255,.2)' stroke-width='2'/%3E%3C/svg%3E"); background-size: 320px 220px; }
.vcard__side::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='220' viewBox='0 0 520 220'%3E%3Cpath d='M0 120c30-30 60-30 90 0s60 30 90 0 60-30 90 0 60 30 90 0 60-30 90 0 60 30 70 0' fill='none' stroke='rgba(255,255,255,.12)' stroke-width='3'/%3E%3C/svg%3E"); background-size: 520px 220px; background-position: 40px 110px; }
.vcard__photo { position: relative; z-index: 1; width: 240px; height: 240px; border-radius: 24px; object-fit: cover; border: 4px solid rgba(255,255,255,.9); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.vcard__main { padding: 32px 36px; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.vcard__name { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.vcard__headline { font-size: var(--t-lg); font-weight: 700; color: var(--accent); }
.vcard__tagline { font-size: var(--t-md); color: var(--text-2); }
.vcard__meta { font-size: var(--t-sm); color: var(--text-2); }
.vcard__meta a { color: var(--accent); font-weight: 700; }
.vcard__meta a:hover { text-decoration: underline; }
.vcard__stats { display: grid; grid-auto-rows: 1fr; border-left: 1px solid var(--border); background: var(--bg); }
.vcard__stats .stat { display: flex; flex-direction: column; justify-content: center; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.vcard__stats .stat:last-child { border-bottom: 0; }
.stat strong { display: block; font-size: var(--t-xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.stat span { font-size: var(--t-xs); color: var(--text-2); font-weight: 700; }
@media (max-width: 1200px) {
  .vcard { grid-template-columns: 280px minmax(0,1fr); }
  .vcard__photo { width: 200px; height: 200px; }
  .vcard__stats { grid-column: 1 / -1; grid-auto-flow: column; grid-auto-columns: 1fr; grid-auto-rows: auto; border-left: 0; border-top: 1px solid var(--border); }
  .vcard__stats .stat { border-bottom: 0; border-right: 1px solid var(--border); text-align: center; }
  .vcard__stats .stat:last-child { border-right: 0; }
}
.profile__affil { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.affil { display: flex; align-items: center; gap: 12px; font-size: var(--t-sm); font-weight: 700; color: var(--text); padding: 8px 14px 8px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); transition: border-color .15s, background .15s; }
.affil:hover { border-color: var(--accent); background: var(--accent-soft); }
.affil__logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.affil__mono { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: var(--t-xs); font-weight: 800; flex-shrink: 0; }
.profile__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ── Buttons & pills ────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-size: var(--t-sm); font-weight: 800; border: 1px solid transparent; transition: background .15s, color .15s, box-shadow .15s, transform .15s; cursor: pointer; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(15,123,115,.25); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--outline { color: var(--accent); border-color: var(--accent); }
.btn--outline:hover { background: var(--accent-soft); }
.btn--ghost { color: var(--text-2); border-color: var(--border); background: var(--surface); }
.btn--ghost:hover { background: var(--bg); color: var(--text); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: var(--t-sm); font-weight: 700; color: var(--text); }

/* ── Entries (experience / education) ───────────────────── */
.entry { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry__logo { width: 64px; height: 64px; flex-shrink: 0; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 800; color: var(--accent); font-size: var(--t-xs); overflow: hidden; }
.entry__logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.entry__body { min-width: 0; flex: 1; }
.entry__title { font-size: var(--t-lg); font-weight: 800; line-height: 1.3; }
.entry__org { font-size: var(--t-md); font-weight: 600; }
.entry__meta { font-size: var(--t-sm); color: var(--text-2); margin-top: 2px; }
.entry__desc { font-size: var(--t-sm); margin-top: 8px; color: var(--text-2); }
.entry__desc em { color: var(--text); }

/* ── Research grid ──────────────────────────────────────── */
.research { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.project { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: linear-gradient(180deg, var(--surface), var(--bg)); transition: border-color .15s, transform .15s; }
.project:hover { border-color: var(--accent); transform: translateY(-2px); }
.project__icon { color: var(--accent); margin-bottom: 10px; }
.project__icon svg { width: 32px; height: 32px; }
.project h3 { font-size: var(--t-lg); font-weight: 800; margin-bottom: 6px; }
.project__description { font-size: var(--t-sm); color: var(--text-2); }
.project__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.project__stack-item { font-size: var(--t-xs); font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* ── Publications ───────────────────────────────────────── */
.pub-year { font-size: var(--t-xs); font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin: 26px 0 6px; }
.pub-year:first-child { margin-top: 0; }
.pub-item { list-style: none; padding: 16px 0; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: 0; }
.pub-item.hidden { display: none; }
.pub-title { font-size: var(--t-lg); font-weight: 800; line-height: 1.4; }
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { font-size: var(--t-sm); color: var(--text-2); margin-top: 4px; }
.pub-authors strong { color: var(--text); font-weight: 800; }
.pub-venue { font-size: var(--t-sm); margin-top: 2px; font-weight: 700; }
.pub-badge { display: inline-block; font-size: var(--t-xs); font-weight: 800; line-height: 1.7; padding: 0 10px; border-radius: 999px; margin-left: 4px; vertical-align: middle; background: var(--bg); border: 1px solid var(--border); color: var(--text-2); }
.pub-badge--main { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.pub-badge--core { background: var(--ink); border-color: transparent; color: #fff; }
.pub-badge--journal { background: #eef0fb; border-color: transparent; color: #3f4fa0; }
.pub-badge--award { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.pub-badge--review { border-style: dashed; }
.pub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pub-tag { font-size: var(--t-xs); font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--text-2); }
.pub-note { font-size: var(--t-sm); color: var(--text-2); text-align: center; margin-top: 18px; }
.no-results { display: none; text-align: center; padding: 32px 0; color: var(--text-2); }

/* ── Filters ────────────────────────────────────────────── */
.filters { display: grid; gap: 14px; margin-top: 18px; }
.filter-label { display: block; font-size: var(--t-xs); font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.filter-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--t-sm); font-weight: 700; transition: background .15s, color .15s, border-color .15s; }
.filter-btn:hover { background: var(--bg); color: var(--text); border-color: var(--text-3); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-count { font-size: var(--t-xs); color: var(--text-2); margin-left: 8px; }

/* ── News / activity ────────────────────────────────────── */
.news-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-badge { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: var(--t-xs); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.news-card { flex: 1; min-width: 0; }
.news-text { font-size: var(--t-sm); }
.news-text strong { font-weight: 800; }

/* ── Lists & sidebar links ──────────────────────────────── */
.ach-list { list-style: none; padding-left: 0; font-size: var(--t-sm); display: grid; gap: 10px; }
.ach-list li { position: relative; padding-left: 20px; }
.ach-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .7; }
.ach-list strong { font-weight: 800; }
.links { display: grid; gap: 2px; margin: 0 -8px; }
.links a { display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 10px; font-size: var(--t-sm); font-weight: 700; min-height: 46px; transition: background .15s; }
.links a:hover { background: var(--bg); }
.links svg { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.links span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.footer { text-align: center; font-size: var(--t-xs); color: var(--text-2); padding: 8px 16px 32px; }

/* ── Phone: bottom tab bar ──────────────────────────────── */
@media (max-width: 600px) {
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); } /* a blurred ancestor would become the fixed nav's containing block */
  .topbar__inner { padding: 0 16px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; gap: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--border); justify-content: space-around; z-index: 100; }
  .nav a { flex: 1; flex-direction: column; gap: 2px; height: 60px; padding: 0 4px; border-radius: 0; font-size: var(--t-xs); font-weight: 700; }
  .nav a svg { display: block; }
  .nav a.active { background: none; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .page { padding: 12px 10px 24px; }
  .card { padding: 18px; }
  .vcard { grid-template-columns: 1fr; }
  .vcard__side { padding: 24px; }
  .vcard__photo { width: 180px; height: 180px; }
  .vcard__main { padding: 22px 18px; text-align: center; align-items: center; }
  .profile__affil, .profile__actions { justify-content: center; }
  .vcard__stats { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .vcard__stats .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .vcard__stats .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .vcard__stats .stat { border-right: 0; }
  .vcard__stats .stat:nth-child(odd) { border-right: 1px solid var(--border); }
}
