/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ──────────────────────────────────── */
:root {
  --max-w:   960px;
  --text:    #1a1a1a;
  --muted:   #6b6b6b;
  --faint:   #a0a0a0;
  --link:    #3b5ea6;
  --border:  #e8e8e8;
}

/* ── Base ────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Main ────────────────────────────────────── */
main {
  max-width: var(--max-w);
  width: clamp(70vw, calc(var(--max-w) - 10vw), 90vw);
  margin: 0 auto;
  padding: 0 0 72px;
}

/* ── Section layout ──────────────────────────── */
section {
  padding: 32px 0;
}

section:first-of-type {
  padding-top: 52px;
}

h2 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  margin-bottom: 24px;
}

/* ── About ───────────────────────────────────── */
.bio-header {
  display: flex;
  gap: 36px;
  align-items: center;
  margin-bottom: 28px;
  padding-left: clamp(0px, calc(10vw - 2rem), calc(var(--max-w) / 10));
}

.bio-photo {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.bio-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.35);
  transform-origin: center 30%;
}

.bio-name h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.name-cn {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-left: 6px;
}

.bio-desc {
  font-size: 14.5px;
  color: #383838;
  line-height: 1.7;
}

.social { display: flex; gap: 18px; flex-wrap: wrap; }

.social a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--link);
}

/* ── Publication & talk entries ──────────────── */
.pub { margin-bottom: 20px; }
.pub:last-child { margin-bottom: 0; }

.pub-row1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-title {
  font-size: 14.5px;
  font-weight: 500;
  flex: 1;
  min-width: 200px;
  line-height: 1.45;
}

.pub-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.pub-row2 {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

.pub-row2 em { font-style: italic; color: var(--text); }
.pub-row2 sup { font-size: 10px; }
.pub-row2 a { color: inherit; }
.pub-row2 a:hover { text-decoration: underline; }

/* ── Badges ──────────────────────────────────── */
/*
  Colors drawn from PANTONE 2025 palette (Mocha Mousse year),
  desaturated to low-contrast tints for minimal visual weight.

  pdf    → Mocha Mousse tint   (#9A7B4B family)
  code   → Verdant tint        (#7FAE66 family)
  slides → Forget-Me-Not tint  (#A8C7D9 family)
  talk   → Cayenne muted tint  (#C0614A family)
  doi    → Latte tint          (#C8A882 family)
*/
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.6;
  text-decoration: none;
}

.badge:hover { filter: brightness(0.93); text-decoration: none; }

.badge-pdf    { background: #f0ebe4; color: #9a7a52; }
.badge-code   { background: #e7ede5; color: #5e8258; }
.badge-slides { background: #e5edf4; color: #547aa8; }
.badge-talk   { background: #f4ebe8; color: #a8685c; }
.badge-doi    { background: #edeae3; color: #8a7960; }

/* ── Expand / collapse ───────────────────────── */
/* Add data-featured to a .pub entry in HTML to show it in the collapsed list. */
.pub-list.collapsed .pub:not([data-featured]) { display: none; }

.teaching-table.collapsed tr:not([data-featured]) { display: none; }

#teaching-btn { margin-top: 16px; }

.footnote {
  font-size: 12px;
  color: var(--faint);
  margin-top: 6px;
  margin-bottom: 12px;
}

.show-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.show-btn:hover {
  border-color: #aaa;
  color: var(--text);
}

/* ── Services ────────────────────────────────── */
.svc-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.svc-table tr + tr td { padding-top: 8px; }

.svc-table td {
  padding-bottom: 8px;
  vertical-align: top;
  border-bottom: 1px solid #f2f2f2;
}

.svc-table tr:last-child td { border-bottom: none; }

.svc-role {
  color: var(--muted);
  white-space: nowrap;
  padding-right: 24px;
  font-size: 13px;
  width: 200px;
}

.svc-year {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
  width: 80px;
}

/* ── Awards ──────────────────────────────────── */
.award {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
  flex-wrap: wrap;
  align-items: baseline;
}

.award:last-child { border-bottom: none; }

.award-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  min-width: 240px;
}

.award-detail {
  font-size: 13px;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  width: min(92vw, var(--max-w));
  margin: 0 auto;
}

.footer-inner {
  font-size: 12.5px;
  color: var(--faint);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 580px) {
  .bio-header { gap: 16px; }

  .svc-role { width: auto; white-space: normal; }

  .pub-row1 { flex-direction: column; gap: 6px; }
  .pub-badges { flex-wrap: wrap; }
}
