/* =========================================================================
   Shengqiong Wu — homepage styles (shared by all pages)
   Pure CSS. Edit the THEME variables below to restyle everything.
   ========================================================================= */

:root {
  --bg:        #fdfcfa;   /* page background (warm off-white)            */
  --surface:   #ffffff;   /* cards / raised blocks                       */
  --text:      #232020;   /* primary text                               */
  --muted:     #6b6560;   /* secondary text, dates, captions            */
  --rule:      #e7e2db;   /* hairlines and borders                      */
  --accent:    #5276a5;   /* muted steel blue — links, year markers     */
  --accent-soft: #dde6f0; /* faint accent tint for backgrounds          */

  --sidebar-w: 300px;     /* left column width                          */
  --main-w:    800px;     /* reading column max width                   */
  --gap:       48px;      /* space between the two columns              */
  --page-pad:  24px;      /* horizontal inset for layout + nav          */
  --navh:      58px;      /* fixed top navigation bar height            */
  --layout-top: calc(var(--navh) + 44px); /* below fixed nav; match sidebar sticky */
  --serif:     "Newsreader", Georgia, "Times New Roman", serif;
  --space:     clamp(48px, 8vw, 80px); /* vertical rhythm between sections */
}

/* ============================ BASE ============================ */
* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  overflow-y: scroll; /* same page width whether content overflows or not */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
a:hover { border-bottom-color: var(--accent); }

p { margin: 0 0 1.1em; }
strong { font-weight: 600; }

/* ============================ FIXED TOP NAV ============================ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navh);
  display: flex;
  align-items: center;
  background: rgba(253, 252, 250, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--rule);
  z-index: 100;
}
.topnav .nav-inner {
  width: 100%;
  max-width: calc(var(--sidebar-w) + var(--gap) + var(--main-w));
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  gap: var(--gap);             /* same gap as the two-column layout below */
  overflow-x: auto;            /* scroll if too narrow, instead of wrapping */
  white-space: nowrap;
  scrollbar-width: none;       /* Firefox */
}
.topnav .nav-inner::-webkit-scrollbar { display: none; } /* WebKit */

/* name sits over the sidebar column; links begin at the main column edge */
.topnav .nav-brand {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  border: none;
}
.topnav .nav-brand:hover { color: var(--accent); }
.topnav .nav-links {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.topnav a.navlink {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: .01em;
  border: none;
  padding: 4px 0;
}
.topnav a.navlink:hover,
.topnav a.navlink.active { color: var(--accent); }
.topnav a.navlink.active { font-weight: inherit; }

/* ============================ TWO-COLUMN LAYOUT ============================ */
.layout {
  display: flex;
  gap: var(--gap);
  max-width: calc(var(--sidebar-w) + var(--gap) + var(--main-w));
  margin: 0 auto;
  padding: var(--layout-top) var(--page-pad) 0;
  align-items: flex-start;
}

/* anchor targets clear the fixed bar */
section[id] { scroll-margin-top: calc(var(--navh) + 16px); }

/* ---- LEFT: sticky profile ---- */
.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: var(--layout-top);
}
.sidebar .portrait {
  display: block;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 22px rgba(0,0,0,.12);
  margin: 0 0 22px;
}
.sidebar h1 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.sidebar .zh { color: var(--muted); font-weight: 400; font-size: .78em; }
.sidebar .role {
  color: var(--muted);
  font-size: 17px;
  margin: 0 0 16px;
  line-height: 1.5;
}
.sidebar .role span:empty { display: none; }

.social {
  --social-slot: 26px;
  --social-gap: 8px;
  display: grid;
  grid-template-columns: repeat(6, var(--social-slot));
  column-gap: var(--social-gap);
  align-items: center;
  justify-content: start;
  width: fit-content;
  margin-bottom: 26px;
}
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--social-slot);
  height: var(--social-slot);
  color: var(--muted);
  border: none;
}
.social a:hover { color: var(--accent); }
.social a:nth-child(4) { transform: translateX(-3px); }
.social a:nth-child(5) { transform: translateX(-6px); }
.social a:nth-child(6) { transform: translateX(-9px); }
.social a i {
  display: block;
  width: var(--social-slot);
  font-size: 20px;
  line-height: var(--social-slot);
  text-align: center;
}
.social a i::before {
  display: inline-block;
  width: 1em;
  text-align: center;
}
.social .icon-xhs {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin: 0;
  transform: translateY(-1px);
}
.social a:hover .icon-xhs { opacity: 0.88; }

.sidebar-exp {
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.sidebar-exp h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.sidebar-exp ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-exp li {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.sidebar-exp li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sidebar-exp .org {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}
.sidebar-exp .exp-detail {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.sidebar-exp .when {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- RIGHT: main content ---- */
.main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--main-w);
  padding-bottom: 96px;
}

/* ============================ SECTIONS & HEADINGS ============================ */
section { padding-top: var(--space); }
.main > section:first-child { padding-top: 0; }
#news { padding-top: clamp(28px, 4vw, 44px); }

.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 24px;
}
#education .section-title,
#honors .section-title,
#professional-service .section-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}

/* ============================ RESEARCH AREAS (About) ============================ */
.areas { list-style: none; margin: 6px 0 1.2em; padding: 0; }
.areas li {
  position: relative;
  padding: 7px 0 7px 24px;
  font-size: 17px;
  line-height: 1.55;
  border-bottom: 1px solid var(--rule);
}
.areas li:last-child { border-bottom: none; }
.areas li::before {           /* small bronze diamond marker */
  content: "";
  position: absolute;
  left: 2px; top: 16px;
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
}
.areas .area-name { display: block; font-weight: 600; color: var(--accent); }
.areas .area-works { display: block; margin-top: 3px; font-size: 15px; color: var(--muted); }
.areas .area-works a { color: var(--muted); }
.areas .area-works a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* section header row: title on the left, a "view all" link on the right */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.section-head .section-title { margin-bottom: 0; }
.view-all {
  font-size: 14px;
  letter-spacing: .02em;
  white-space: nowrap;
  border: none;
}
.view-all:hover { border-bottom: 1px solid var(--accent); }

/* ============================ REPRESENTATIVE WORK ============================ */
.repwork h3 {
  font-size: 19px;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  margin: 0 0 16px;
}
.work {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.work:last-child { border-bottom: 1px solid var(--rule); }
.work .media { width: 100%; border-radius: 4px; overflow: hidden; }
.work .media img,
.work .media video { width: 100%; display: block; border-radius: 4px; }
.work .body { font-size: 17px; line-height: 1.6; }
.work .body .name { font-weight: 600; }
.work .body .meta { color: var(--muted); font-size: 15px; font-style: italic; }
.work .body .links a { font-size: 15px; margin-right: 2px; }
.underline-key { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* homepage blocks below Representative Work */
.rep-plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rep-plain-list li {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 6px;
}
.rep-plain-list li:last-child { margin-bottom: 0; }
.rep-plain-list strong { font-weight: 600; color: var(--text); }

.edu-rows { list-style: none; margin: 0; padding: 0; }
.edu-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.75;
}
.edu-row:last-child { margin-bottom: 0; }
.edu-row-main { flex: 1 1 12rem; min-width: 0; }
.edu-row-main strong { font-weight: 600; }
.edu-detail { color: var(--muted); margin-left: 0.4em; }
.edu-detail a { color: var(--muted); }
.edu-detail a:hover { color: var(--accent); }
.edu-row .edu-when {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

.rep-bullets {
  margin: 0;
  padding: 0 0 0 1.35em;
  list-style: disc;
}
.rep-bullets li {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 10px;
  padding-left: 4px;
}
.rep-bullets li:last-child { margin-bottom: 0; }
.rep-bullets strong { font-weight: 600; color: var(--text); }
.rep-muted { color: var(--muted); }
.honors-empty { margin: 14px 0 0; font-size: 15px; }
.rep-bullets:not(:empty) + .honors-empty { display: none; }

/* ============================ NEWS ============================ */
.news-box {
  --news-visible-rows: 3;
  --news-row-height: 4.15rem;
  max-height: calc(var(--news-visible-rows) * var(--news-row-height));
  overflow-y: auto;
  padding-right: 14px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16.5px;
  line-height: 1.55;
}
.news-list li:last-child { border-bottom: none; }
.news-list .date {
  color: var(--accent);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  white-space: nowrap;
}
.news-box::-webkit-scrollbar { width: 8px; }
.news-box::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 4px; }

/* ============================ PUBLICATIONS ============================ */
.pub-year {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 34px 0 14px;
}
.pub-year:first-child { margin-top: 0; }
.pub-year .y { font-size: 22px; font-weight: 600; color: var(--text); }
.pub-year .rule { flex: 1; height: 1px; background: var(--rule); }

.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16.5px;
  line-height: 1.6;
}
.pub-list li:last-child { border-bottom: none; }
.pub-list .title { font-style: italic; }
.pub-list .venue { display: inline-block; font-weight: 600; color: var(--accent); }
.pub-list .badge { font-size: 13.5px; color: var(--muted); }
.pub-list a { font-size: 14.5px; }

/* corresponding-author email marker */
.corr {
  font-size: 11px;
  color: var(--accent);
  margin-left: 2px;
  position: relative;
  top: -2px;            /* slight superscript lift */
}

/* ============================ SERVICES / TWO-COL BLOCKS ============================ */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.services-stack { display: flex; flex-direction: column; gap: 26px; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li {
  position: relative;
  padding: 5px 0 5px 20px;
  font-size: 16.5px;
  line-height: 1.5;
}
.svc-list li::before {       /* small bronze diamond marker */
  content: "";
  position: absolute;
  left: 1px; top: 13px;
  width: 6px; height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}
.svc-list .svc-meta { color: var(--muted); font-size: 15px; }
.block h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.block p { font-size: 16.5px; color: var(--text); line-height: 1.65; margin: 0; }

/* ============================ OUTPUT ============================ */
.dl { list-style: none; margin: 0 0 8px; padding: 0; }
.dl li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16.5px;
  line-height: 1.55;
}
.dl li:last-child { border-bottom: none; }
.dl .when { color: var(--muted); font-size: 14.5px; padding-top: 2px; }
/* wider label column for long entries (e.g. teaching terms) */
.dl.dl-wide li { grid-template-columns: 200px 1fr; }
.dl.dl-wide .when { white-space: nowrap; }
@media (max-width: 600px) { .dl.dl-wide li { grid-template-columns: 120px 1fr; } .dl.dl-wide .when { white-space: normal; } }
.subhead { font-size: 16px; font-weight: 600; font-style: italic; margin: 28px 0 10px; color: var(--text); }
.subhead:first-child { margin-top: 0; }

/* live GitHub star count (filled in by the script in output.html) */
.repo-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}
.repo-stars i { font-size: 11px; }

/* ============================ AWARDS ============================ */
.awards { list-style: none; margin: 0; padding: 0; }
.awards li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 16.5px;
}
.awards li:last-child { border-bottom: none; }
.awards .yr { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ============================ CONTACT ============================ */
.contact p { font-size: 17px; }
.contact .big-mail { font-size: clamp(20px, 4vw, 26px); font-weight: 500; }

/* ============================ VISITOR COUNTER (inside footer) ============================ */
.visitors { color: var(--muted); font-size: 14px; }
.visitors i { font-size: 12px; margin-right: 5px; color: var(--accent); }
.visitors .sep { margin: 0 8px; opacity: .45; }

/* ============================ FOOTER ============================ */
.main footer {
  margin-top: var(--space);
  padding: 26px 0 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
}
/* index footer: counter on the left, copyright on the right */
.main footer.footer-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================ RESPONSIVE ============================ */
@media (max-width: 860px) {
  .layout { flex-direction: column; gap: 36px; padding-top: calc(var(--navh) + 32px); }
  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    text-align: center;
  }
  .sidebar .portrait { margin-left: auto; margin-right: auto; }
  .social { justify-content: center; }
  .main { max-width: 100%; }
  /* on small screens the nav scrolls horizontally; name shrinks to its text */
  .topnav .nav-inner { gap: 22px; padding: 0 20px; }
  .topnav .nav-brand { flex: 0 0 auto; width: auto; }
  .topnav .nav-links { gap: 18px; }
  .topnav a.navlink { font-size: 15px; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .work { grid-template-columns: 1fr; gap: 14px; }
  .work .media { max-width: 280px; }
  .cols2 { grid-template-columns: 1fr; gap: 24px; }
  .news-list li { grid-template-columns: 70px 1fr; gap: 12px; }
}
