/* ===== Single-column academic — modern minimal ===== */
:root {
  --ink: #1b1b1c;
  --soft: #3f4043;
  --muted: #8a8d92;
  --line: #ececec;
  --bg: #fdfcfa;          /* warm off-white */
  --card: #ffffff;
  --accent: #9a2a2f;      /* Harvard crimson — restrained personal accent */
  --accent-soft: #f6eeee;
  --link: #9a2a2f;
  --chip: #f2f2f0;
  --w: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 600; }
em { font-style: italic; }

/* ===== Top nav ===== */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253,252,250,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav-in {
  max-width: var(--w);
  margin: 0 auto;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 600; font-size: 16px; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { color: var(--accent); text-decoration: none; }
.topnav-links a {
  margin-left: 18px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.topnav-links a:hover { color: var(--accent); text-decoration: none; }

/* ===== Page ===== */
.page { max-width: var(--w); margin: 0 auto; padding: 8px 24px 64px; }

/* ===== Header (photo left, text right) ===== */
.head {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 46px 0 18px;
}
.avatar-wrap {
  flex: 0 0 260px;
  width: 260px;
}
.avatar {
  display: block;
  width: 260px;
  height: auto;               /* keep the full photo, no cropping */
  border-radius: 12px;
  box-shadow: 0 3px 16px rgba(0,0,0,.12);
}
.head-text { min-width: 0; }
.name {
  font-size: 33px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0 0 5px;
}
.title { margin: 0 0 10px; color: var(--soft); font-size: 17px; }
.tagline {
  margin: 0 0 16px;
  color: var(--muted); font-size: 15.5px; font-style: italic;
}
.social { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.social a {
  padding: 5px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: all .15s;
}
.social a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }

/* ===== Sections ===== */
section { padding: 26px 0 6px; scroll-margin-top: 64px; }
h2 {
  font-size: 15px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 16px;
  padding-bottom: 0;
  display: flex; align-items: center; gap: 12px;
}
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
p { color: var(--soft); margin: 0 0 14px; }

/* Job-market highlight */
.jobmarket {
  background: var(--accent-soft);
  border: 1px solid #ecd7d8;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  margin: 0 0 16px;
}
.jobmarket a { color: var(--accent); font-weight: 600; }

/* What I work on */
.works { list-style: none; padding: 0; margin: 0; }
.works li {
  position: relative;
  padding: 8px 0 8px 22px;
  color: var(--soft);
  font-size: 16px;
}
.works li::before {
  content: ""; position: absolute; left: 2px; top: 15px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.works b { color: var(--ink); }

/* Scrollable News box */
.news-scroll {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 12px;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 16px), transparent 100%);
}
.news-scroll::-webkit-scrollbar { width: 8px; }
.news-scroll::-webkit-scrollbar-track { background: transparent; }
.news-scroll::-webkit-scrollbar-thumb { background: #d9d2d2; border-radius: 8px; }
.news-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }
.news-scroll { scrollbar-width: thin; scrollbar-color: #d9d2d2 transparent; }
.news-scroll .news li:first-child { padding-top: 2px; }

/* News / Education / Talks / Awards */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
  color: var(--soft);
}
.news li:last-child { border-bottom: 0; }
.news .date { color: var(--accent); font-weight: 600; font-size: 13.5px; padding-top: 2px; }

/* News timeline (scoped to #news; Talks keeps the plain grid) */
#news .news { position: relative; }
#news .news::before {
  content: ""; position: absolute; left: 5px; top: 5px; bottom: 7px;
  width: 2px; background: var(--line);
}
#news .news li {
  display: block; position: relative;
  padding: 5px 0 14px 26px;
  border-bottom: 0; font-size: 15px;
}
#news .news li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
#news .news .date {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 11.5px; letter-spacing: .02em;
  padding: 2px 9px 1px; border-radius: 20px; margin-bottom: 5px;
}
#news .news li > span:last-child { display: block; color: var(--soft); line-height: 1.55; }

/* Education */
.edu { list-style: none; padding: 0; margin: 0; }
.edu li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.edu li:last-child { border-bottom: 0; padding-bottom: 0; }
.edu-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.edu-inst { font-weight: 600; color: var(--ink); font-size: 16.5px; }
.edu-yr { color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap; }
.edu-sub { color: var(--muted); font-size: 14.5px; margin-top: 3px; }

/* Education with school icons (legacy, unused) */
.edu-list { list-style: none; padding: 0; margin: 0; }
.edu-list li {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.edu-list li:last-child { border-bottom: 0; }
.edu-ico {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
}
.ico-hms  { background: linear-gradient(135deg, #a51c30, #c0474d); }
.ico-ucas { background: linear-gradient(135deg, #1f5f8b, #3d84b8); font-size: 11px; }
.ico-uic  { background: linear-gradient(135deg, #001e62, #16367e); }
.ico-xmu  { background: linear-gradient(135deg, #0a7d6b, #12a488); }
.edu-main { color: var(--soft); font-size: 15.5px; }
.edu-main strong { color: var(--ink); }
.edu-yr { color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Publications */
.pub-note { color: var(--muted); font-size: 14px; margin: -6px 0 16px; }
.star { color: var(--accent); font-weight: 600; }
.pub-group {
  text-transform: uppercase; letter-spacing: 0.09em;
  font-size: 12px; font-weight: 700; color: var(--muted);
  margin: 24px 0 12px;
}
.pub {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.thumb { width: 200px; }
.thumb svg { width: 30px; height: 30px; }   /* legacy, unused */
.thumb img {
  width: 100%;
  height: auto;               /* show the full figure, no cropping */
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.pub-desc { font-size: 14px; line-height: 1.5; color: var(--soft); margin: 3px 0 4px; }
.t-agent { background: linear-gradient(135deg, #2f5d8a, #4b82b8); }
.t-sci   { background: linear-gradient(135deg, #9a2a2f, #c0474d); }
.t-clin  { background: linear-gradient(135deg, #2f7d6b, #46a98d); }
.t-drug  { background: linear-gradient(135deg, #6a4a8a, #8a6bb0); }
.pub-title { font-weight: 600; font-size: 16px; line-height: 1.4; color: var(--ink); }
.pub-authors { font-size: 14px; color: var(--soft); margin: 3px 0; }
.pub-authors b { color: var(--accent); }
.pub-venue { font-size: 14px; color: var(--muted); }
.pub-links { margin-top: 7px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 11px;
  font-size: 12.5px; font-weight: 600;
  color: var(--soft);
  background: var(--chip);
  border-radius: 6px;
}
.btn svg { width: 13px; height: 13px; flex: none; }
.btn:hover { color: #fff; background: var(--accent); text-decoration: none; }

/* Misc */
.misc { margin: 0; }
.misc img {
  width: 100%;
  border-radius: 12px;
  display: block;
  box-shadow: 0 3px 16px rgba(0,0,0,.1);
}
.misc figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

/* Footer */
.footer {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 13.5px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .topnav-links a { margin-left: 12px; font-size: 13px; }
  .head { flex-direction: column; text-align: center; gap: 18px; padding-top: 36px; }
  .avatar-wrap { flex-basis: auto; width: 100%; max-width: 300px; }
  .avatar { width: 100%; }
  .social { justify-content: center; }
  .name { font-size: 28px; }
  .pub { grid-template-columns: 120px 1fr; gap: 14px; }
  .thumb { width: 120px; }
  .news li { grid-template-columns: 76px 1fr; gap: 12px; }
  .edu-list li { grid-template-columns: 40px 1fr; }
  .edu-ico { width: 40px; height: 40px; }
  .edu-yr { grid-column: 2; font-size: 12px; margin-top: -4px; }
}
@media (max-width: 460px) {
  .topnav-links { display: none; }
}
