/* ==========================================================
   Homepage layout: profile fixed on the left, content on the right.
   ========================================================== */
:root {
  --accent: #2458C6;
  --accent-hover: #173E91;
  --accent-soft: #EEF3FD;
  --accent-line: #D7E2F8;
  --ink: #1F2328;
  --body: #343A42;
  --muted: #5F6773;
  --line: #E9ECF0;
  --surface: #FFFFFF;
  --bg-soft: #F7F8FA;
  --font: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--body);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; font-weight: 600; transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; font-family: var(--font); }
p { margin: 0; }
b, strong { color: var(--ink); }
section { scroll-margin-top: 32px; }

/* ---------- page grid ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 56px 32px 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 64px; }
.side-card { position: sticky; top: 48px; }
main section { padding-bottom: 46px; }

/* ---------- profile (left) ---------- */
.avatar { width: 164px; height: 164px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 6px var(--accent-soft); }
.name { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 24px 0 8px; }
.role { color: var(--ink); font-weight: 600; font-size: 15px; }
.org { color: var(--muted); font-size: 14px; }
.mail { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 10px; }

.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.social a {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 18px;
}
.social a:hover { background: var(--accent); color: #FFFFFF; transform: translateY(-2px); }
.social .ai { font-size: 19px; }
.icon-x { display: block; width: 16px; height: 16px; }
.pill .icon-x { width: 12px; height: 12px; }

.snav { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.snav a { color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 12px; padding: 7px 14px; white-space: nowrap; }
.snav a:hover, .snav a.active { color: var(--accent); background: var(--accent-soft); }

/* ---------- sections (right) ---------- */
.sec { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; margin: 0 0 20px; }
.sec::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.bio p { font-size: 15.5px; line-height: 1.8; }
.legend { display: grid; gap: 10px; padding: 14px 18px; margin: -4px 0 22px; border-radius: 16px; background: var(--bg-soft); color: var(--body); font-size: 13px; }
.legend-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 6px 12px; }
.legend-items { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.legend-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend .mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1; }
.legend .badge { min-width: 22px; justify-content: center; padding: 0 7px; }
.legend .mark.ast { padding-top: 5px; font-size: 15px; }

/* ---------- publications ---------- */
.pub { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; padding: 18px; margin: 0 -18px; border-radius: 22px; transition: background .2s ease; }
.pub + .pub { margin-top: 6px; }
.pub:hover { background: var(--bg-soft); }
.pub-img img { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: #FFFFFF; }
.pub-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent); }
.badge.t-C, .badge.t-J { background: var(--accent); color: #FFFFFF; }
.badge.code { background: #F1F3F5; color: var(--muted); }
.badge.hl { gap: 5px; background: #FFF1CC; color: #7A4F00; }
.badge.hl i { font-size: 10px; }
.pub-title { font-size: 16px; font-weight: 700; line-height: 1.42; margin-bottom: 6px; }
.pub-authors { font-size: 14px; color: var(--muted); line-height: 1.6; }
.pub-authors a { color: inherit; font-weight: 500; border-bottom: 1px dashed var(--accent-line); }
.pub-authors a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pub-authors b, .pub-authors u { color: var(--ink); }
.pub-authors u { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pub-venue { font-size: 14px; font-style: italic; color: var(--muted); margin-top: 2px; }
.pub-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--accent-line); background: var(--surface);
  color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill:hover { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.pill i { font-size: 13px; }

/* ---------- education / experience timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 20px 28px; }
.tl li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -6px; width: 2px; background: var(--accent-line); }
.tl li:last-child { padding-bottom: 0; }
.tl li:last-child::before { display: none; }
.tl li::after { content: ""; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; border: 3px solid var(--accent); }
.when { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
.tl .what { font-weight: 700; color: var(--ink); margin-top: 6px; }
.tl .where { color: var(--muted); font-size: 14px; }

/* ---------- services / honors ---------- */
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--bg-soft); font-size: 14.5px; }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; padding: 28px 0 40px; margin-top: 24px; border-top: 1px solid var(--line); }
.foot a { font-weight: 500; }

/* ---------- tablets and phones ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 32px 20px 0; }
  .side, .side-card, main { min-width: 0; }
  .side-card { position: static; text-align: center; }
  .avatar { margin: 0 auto; }
  .mail, .social { justify-content: center; }
  .snav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; border-top: none; padding-top: 0; }
}
@media (max-width: 640px) {
  .pub { grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0 -10px; padding: 14px 10px; }
  .rows li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .legend-row { grid-template-columns: minmax(0, 1fr); }
}
