/* ═══════════════════════════════════════════
   WARM ACADEMIC — cream paper, ink, rust accent
═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

:root {
  --bg:        #F5EFE3;  /* cream paper */
  --bg-2:      #FAF6EC;  /* lighter cream for subtle blocks */
  --ink:       #1F1B16;  /* warm near-black */
  --ink-2:     #4A4239;  /* body text */
  --ink-3:     #8C8377;  /* muted */
  --line:      #DDD2BD;  /* warm hairline */
  --link:      #7D4B27;  /* rust / warm brown */
  --link-2:    #5A2E13;  /* darker hover */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.7;
}

::selection { background: #E8D5B0; color: var(--ink); }

/* ───────── Page wrapper ───────── */
.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 36px;
}

.card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

/* ───────── Nav ───────── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 32px 0 30px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

.nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.nav-logo .nav-chinese {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink-3);
}

.nav-links {
  display: flex;
  gap: 34px;
  background: transparent;
  border: none;
  padding: 0;
}

.nav-links a {
  font-size: 14.5px;
  color: var(--ink-2);
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s;
  letter-spacing: 0.1px;
}

.nav-links a:hover { color: var(--link); }

.nav-links a.active {
  color: var(--ink);
  font-weight: 500;
}

/* ───────── Hero ───────── */
.hero {
  padding: 80px 0 64px;
  display: flex;
  gap: 64px;
  align-items: flex-start;
  border-bottom: none;
}

.hero-info { flex: 1; min-width: 0; padding-top: 4px; }

.photo-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-shrink: 0;
  width: 280px;
}

.photo-wrap {
  width: 280px;
  height: 330px;
  border-radius: 3px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.06);
}

.photo-wrap-sm {
  width: 280px;
  height: 210px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.06);
}

.photo {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.photo-fallback {
  display: none;
  width: 100%; height: 100%;
  align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 100px; font-weight: 700; color: var(--bg);
  background: var(--ink);
}

.name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 56px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.4px;
  line-height: 1.05;
}

.chinese {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 28px;
  color: var(--ink-3);
  margin-left: 16px;
  vertical-align: middle;
}

.title-line { margin-top: 14px; }

.title-text {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-2);
  font-style: italic;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
}

.hero-affil { display: none; }

.bio {
  font-size: 16px;
  color: var(--ink-2);
  margin-top: 24px;
  line-height: 1.75;
  max-width: 600px;
}

.bio + .bio { margin-top: 16px; }

.bio a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

.bio a:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

/* ───────── Tags (warm, used only on about page) ───────── */
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
}

.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 2px;
  font-weight: 500;
  letter-spacing: 0.1px;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

.tag.blue, .tag.green, .tag.purple, .tag.red {
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ───────── Social links row ───────── */
.links {
  display: flex;
  gap: 26px;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.link {
  font-size: 14.5px;
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

.link:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

.link-btn {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 8px 18px;
  border-radius: 2px;
  border: none;
  text-decoration: none !important;
  font-size: 13.5px;
  border-bottom: none;
}

.link-btn:hover { background: var(--link-2); border-bottom-color: transparent !important; }

/* ───────── Sections ───────── */
.body-cols {
  display: flex;
  gap: 56px;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding: 68px 0 0;
}

.body-cols.hero-less {
  border-top: none;
  margin-top: 0;
  padding-top: 56px;
}

.col-left { flex: 1; min-width: 0; padding-right: 0; border-right: none; }
.col-right { width: 100%; flex-shrink: 0; padding-left: 0; margin-top: 0; }

/* Research-page sidebar: SMU / NTUST / ITB logos stacked */
.research-sidebar {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: static;
  border-left: 2px solid var(--link);
  padding-left: 22px;
}

.research-logo-cell {
  background: transparent;
  border: none;
  border-radius: 0;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.research-logo-cell img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin-bottom: 32px;
  line-height: 1.1;
}

.section { margin-bottom: 72px; }
.section:last-child { margin-bottom: 0; }

/* ───────── Publications ───────── */
.pub {
  padding: 26px 0;
  border-radius: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.pub:last-child { border-bottom: none; padding-bottom: 0; }
.pub:first-child { padding-top: 0; }

.pub.featured, .pub.muted { background: transparent; border-left: none; padding-left: 0; }

.pub-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.pub.muted .pub-title { font-weight: 700; color: var(--ink-2); }

.pub-authors {
  font-size: 14.5px;
  color: var(--ink-2);
  margin-top: 8px;
  line-height: 1.55;
  font-style: italic;
}

.pub.muted .pub-authors { color: var(--ink-3); }

.pub-meta {
  display: flex; gap: 16px; margin-top: 14px;
  align-items: center; flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge.blue-solid { background: var(--ink); color: var(--bg); }
.badge.yellow     { background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }

.pub-link {
  font-size: 14px;
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
}
.pub-link:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

/* ───────── Experience (kept for about.html) ───────── */
.exp-item {
  display: flex; gap: 24px;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.exp-item:last-child { border-bottom: none; }

.exp-logo {
  width: 90px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; background: var(--bg-2);
  border-radius: 2px; padding: 8px;
}

.exp-logo img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.exp-logo span {
  font-size: 12px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--ink-2);
}

.exp-role {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px; font-weight: 700; color: var(--ink);
  line-height: 1.3;
}
.exp-item.faded   .exp-role { color: var(--ink-2); }
.exp-item.fainter .exp-role { color: var(--ink-3); }

.exp-detail { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.55; font-style: italic; }
.exp-item.faded   .exp-detail { color: var(--ink-3); }

.exp-advisor { font-size: 13.5px; color: var(--ink-3); margin-top: 7px; }
.exp-advisor a {
  color: var(--link); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
}
.exp-advisor a:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

/* ───────── Recent news (newsroom-style) ───────── */
.news-item {
  display: flex; gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.news-item.first { border-top: none; padding-top: 0; }
.news-item.faded .news-text { color: var(--ink-3); }

.news-date {
  display: inline-block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
  background: transparent !important;
  border-radius: 0;
  width: 110px;
  flex-shrink: 0;
  color: var(--ink-3);
  margin-bottom: 0;
}

.news-date.blue, .news-date.purple, .news-date.muted { color: var(--ink-3); }

.news-text { font-size: 15.5px; color: var(--ink); line-height: 1.65; flex: 1; }
.news-text em { font-style: italic; }
.news-text strong { color: var(--ink); font-weight: 600; }

/* ───────── Visitors globe ───────── */
.clustr-wrap {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.clustr-wrap:not(:empty)::before {
  content: 'Visitors';
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  font-style: italic;
  color: var(--ink-2);
}


/* ───────── Footer ───────── */
footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 64px;
  font-style: italic;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

footer a { color: var(--ink-3); text-decoration: none; }
footer a:hover { color: var(--link); }

/* ───────── CV page ───────── */
.cv-wrap { padding: 64px 0 44px; max-width: 760px; }

.cv-header { border-bottom: 1px solid var(--line); padding-bottom: 28px; margin-bottom: 44px; }

.cv-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 52px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.4px; line-height: 1.05;
}

.cv-tagline {
  font-size: 17px; color: var(--ink-2);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400; font-style: italic;
  margin-top: 10px;
}

.cv-contact {
  font-size: 13.5px; color: var(--ink-3); margin-top: 16px;
  display: flex; gap: 24px; flex-wrap: wrap;
}

.cv-contact a {
  color: var(--link); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
}
.cv-contact a:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

.cv-section { margin-bottom: 52px; }

.cv-section-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px; font-weight: 700;
  color: var(--ink); border-bottom: none;
  padding-bottom: 0; margin-bottom: 24px;
  letter-spacing: -0.2px;
}

.cv-entry {
  display: flex; gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.cv-entry:last-child { border-bottom: none; padding-bottom: 0; }
.cv-entry:first-child { padding-top: 0; }

.cv-year {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-3);
  font-weight: 500;
  width: 100px;
  flex-shrink: 0;
  padding-top: 3px;
  line-height: 1.4;
}

.cv-body { flex: 1; }

.cv-role {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 19px; font-weight: 700; color: var(--ink);
  line-height: 1.3;
}

.cv-org { font-size: 14px; color: var(--ink-2); font-weight: 500; margin-top: 4px; font-style: italic; }

.cv-desc { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; }

.cv-pub-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px; font-weight: 700; color: var(--ink);
  line-height: 1.35;
}

.cv-pub-meta { font-size: 13px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.cv-pub-meta a {
  color: var(--link); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid rgba(125, 75, 39, 0.35);
}
.cv-pub-meta a:hover { color: var(--link-2); border-bottom-color: var(--link-2); }

.cv-skills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ───────── Responsive ───────── */
@media (max-width: 760px) {
  .page { padding: 0 22px; }
  body { font-size: 15px; }

  nav { padding: 22px 0; }
  .nav-links { gap: 22px; }
  .nav-logo { font-size: 18px; }
  .nav-links a { font-size: 13.5px; }

  .hero {
    flex-direction: column-reverse;
    gap: 36px;
    padding: 48px 0 48px;
  }

  .photo-stack { width: 100%; flex-direction: row; gap: 14px; }
  .photo-wrap, .photo-wrap-sm { width: 50%; height: 240px; }

  .name { font-size: 42px; }
  .chinese { font-size: 22px; }
  .bio { max-width: 100%; font-size: 15.5px; }

  .body-cols { flex-direction: column; padding-top: 52px; gap: 36px; }
  .research-sidebar {
    width: 100%;
    flex-direction: row;
    position: static;
    gap: 12px;
    border-left: none;
    padding-left: 0;
  }
  .research-logo-cell { flex: 1; height: 70px; padding: 0; }
  .col-right { margin-top: 0; }

  .section-title { font-size: 28px; }
  .section { margin-bottom: 52px; }

  .news-item { flex-direction: column; gap: 4px; padding: 18px 0; }
  .news-date { width: auto; }

  .cv-wrap { padding: 40px 0; }
  .cv-name { font-size: 38px; }
  .cv-section-title { font-size: 24px; }
  .cv-entry { flex-direction: column; gap: 6px; padding: 18px 0; }
  .cv-year { width: auto; }
}
