/* ==========================================================================
   Tianhe Wang — site styles
   Standalone stylesheet. Does not depend on Minimal Mistakes / Academic Pages.
   ========================================================================== */

:root {
  --ink:          #000000;
  --ink-soft:     #000000;   /* reference sets body copy to pure black, not grey */
  --ink-muted:    #666666;
  --nav-ink:      #222222;   /* nav links are the one thing it sets to #222 */
  --rule:         rgba(0, 0, 0, .12);  /* neutral, not blue-tinted: the reference's only rule is black */
  --accent:       #d7edfb;   /* pale sky blue — the single accent */
  --accent-deep:  #8cc7e8;
  --bg:           #ffffff;
  --footer-bg:    #000000;

  --wrap:         1024px;
  --gutter:       clamp(1.25rem, 5vw, 5rem);

  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* ---------- Skip link (accessibility) ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Present for screen readers and search engines, absent on screen — the name
   is already in the header, so the page does not repeat it visually. */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

/* The reference draws one rule on the whole page: a black hairline under the
   nav, inset to the content column rather than running edge to edge. */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 84px;
  border-bottom: 1px solid #000;
}

.brand {
  font-size: 1.6rem;
  letter-spacing: normal;
  white-space: nowrap;
}
.brand strong { font-weight: 700; }
.brand span   { font-weight: 700; }

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--nav-ink);
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.nav a:hover,
.nav a:focus-visible { color: var(--ink); border-bottom-color: var(--accent-deep); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Mobile nav toggle */
.nav-toggle { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

/* Reference uses a flat 80px section rhythm at desktop, not a fluid ramp. */
.hero {
  padding-block: 80px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  align-items: center;
  column-gap: 48px;
  row-gap: 64px;
}

/* Flipped ratio for a hero whose lede runs to several paragraphs: the text
   needs the wider column or it reads as a long ribbon beside the artwork. */
.hero__grid--wide { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }

.hero__eyebrow {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: normal;
  margin: 0 0 .25rem;
  color: var(--ink);
}

.hero__title {
  font-size: clamp(2.9rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: normal;
  margin: 0 0 1.6rem;
}

.hero__lede {
  font-size: 1.125rem;
  color: var(--ink-soft);
  max-width: 30em;
  margin: 0;
}
/* The lede runs to more than one paragraph on the research page. */
.hero__lede p { margin: 0; }
.hero__lede p + p { margin-top: 1.1rem; }

.hero__meta {
  margin-top: 1.75rem;
  font-size: .95rem;
  color: var(--ink-muted);
}
.hero__meta a { border-bottom: 1px solid var(--accent-deep); }
.hero__meta a:hover { color: var(--ink); }

/* Portrait variant: photo cropped into an accent circle. Unused while the hero
   carries illustration, but kept so a photo can be dropped back in. */
.hero__figure {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}
.hero__figure::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 50%;
}
.hero__portrait {
  position: relative;
  width: 74%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}

/* Illustration variant: the artwork supplies its own accent circle, so it needs
   no blob behind it. multiply drops the near-white plate into the page. */
.hero__art { display: grid; place-items: center; }
.hero__art img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

/* Portrait artwork would run away with the hero's height at full column width,
   so cap it and let it centre in the column instead. */
.hero__art--portrait img {
  width: auto;
  max-width: 100%;
  max-height: 560px;
}

/* ==========================================================================
   Bio block — geometry from the reference's team page: portrait left,
   intro at 16px/24, underlined text links. The name is not shown here; the
   header already carries it.
   ========================================================================== */

.bio {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  column-gap: 80px;
  align-items: center;
}

.bio__photo img {
  width: 256px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.bio__intro {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 1rem;
  max-width: 34em;
}

/* The research questions read as a continuation of the intro's colon, so they
   carry the same type and no bullet — whitespace does the separating. */
.bio__questions {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  max-width: 34em;
}
.bio__questions li + li { margin-top: .5rem; }

.bio__more { margin: 0; font-size: 1rem; line-height: 1.5; }
.bio__more a {
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bio__more a:hover { color: var(--accent-deep); }

.bio__links { margin: 1.75rem 0 .5rem; display: flex; flex-wrap: wrap; gap: 24px; }
.bio__links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bio__links a:hover { color: var(--accent-deep); }

.bio__contact { font-size: 1rem; color: var(--ink-muted); margin: 0; }

@media (max-width: 900px) {
  .bio { grid-template-columns: 1fr; row-gap: 32px; }
  .bio__photo img { width: 200px; }
}

/* ==========================================================================
   Generic section rhythm
   ========================================================================== */

.section { padding-block: 80px; }
/* No section dividers: the reference separates blocks with whitespace alone.
   .section--rule is kept as an inert hook so the markup need not change. */
.section--rule { border-top: 0; }

.section__title {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: normal;
  margin: 0 0 1.1rem;
}

.section__body { color: var(--ink-soft); max-width: 40em; }
.section__body p { margin: 0 0 1.1rem; }
.section__body p:last-child { margin-bottom: 0; }

/* Split block: figure one side, prose the other. Alternates via --flip. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
  align-items: center;
  column-gap: 48px;
  row-gap: 64px;
}
.split--flip .split__figure { order: 2; }
/* Reordering alone would leave the prose in the narrow column on flipped rows;
   swap the ratio too so the text keeps the wider side on both alternations. */
.split--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); }

/* Figures are white-background scientific panels, so they sit on a soft tinted
   card rather than the reference site's circle — a circle behind an opaque
   rectangle reads as stray crescents. */
.split__figure {
  position: relative;
  display: grid;
  place-items: center;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, rgba(215,237,251,.38), rgba(215,237,251,.14));
  border-radius: 4px;
}
.split__figure img {
  position: relative;
  max-height: 360px;
  width: auto;
  mix-blend-mode: multiply;
}

/* Illustration variant: artwork that already sits on the accent colour needs no
   tinted panel — it would read as a box around the drawing. */
.split__figure--art {
  background: none;
  padding: 0;
}
.split__figure--art img { max-height: 460px; }

/* ==========================================================================
   Chevron button — the reference's black square affordance
   ========================================================================== */

/* Card grid and chevron button: no page carries these while the homepage is
   bio-only, but they are kept so the three link cards can be dropped back in. */
.chev {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: #fff;
  margin-top: 1.4rem;
  transition: background .18s ease, transform .18s ease;
}
.chev:hover,
.chev:focus-visible { background: var(--accent-deep); transform: translateX(3px); }
.chev svg { width: 15px; height: 15px; }

/* ==========================================================================
   Three-card row
   ========================================================================== */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 3.75rem);
  align-items: stretch;
}

/* Column layout so the chevrons sit on a common baseline even when
   a card's heading wraps to two lines. */
.card { display: flex; flex-direction: column; }
.card p { flex: 1; }
.card .chev { align-self: flex-start; }

.card__title {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: normal;
  margin: 0 0 .75rem;
}
.card p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* Each question is its own line; without separation the wrapped lines run
   together and read as one paragraph. */
.card__questions span { display: block; }
.card__questions span + span { margin-top: .6rem; }

/* ==========================================================================
   Long-form prose (research page, publications)
   ========================================================================== */

.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 0; }
.page-head__title {
  font-size: clamp(2.5rem, 5.4vw, 4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: normal;
  margin: 0 0 .75rem;
}
.page-head__lede { color: var(--ink-soft); max-width: 40em; margin: 0; font-size: 1.125rem; }
.page-head__lede a { color: var(--ink); border-bottom: 1px solid var(--accent-deep); }
.page-head__lede a:hover { background: var(--accent); }

.prose { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.prose h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: normal;
  margin: 3.5rem 0 1.1rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 1.3rem;
  font-weight: 500;
  margin: 2.25rem 0 .6rem;
}
.prose p  { margin: 0 0 1.15rem; color: var(--ink-soft); }
.prose ul, .prose ol { color: var(--ink-soft); padding-left: 1.25rem; margin: 0 0 1.15rem; }
.prose li { margin-bottom: .35rem; }
.prose a  { border-bottom: 1px solid var(--accent-deep); transition: background .15s ease; }
.prose a:hover { background: var(--accent); }
.prose img { margin: 1.5rem 0; }
.prose strong { font-weight: 500; color: var(--ink); }

/* Research project blocks */

.project { padding-block: clamp(2.5rem, 6vw, 5rem); }
.project + .project { border-top: 1px solid var(--rule); }
.project__num {
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 .6rem;
}
.project__title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: normal;
  margin: 0 0 1.25rem;
}
.project__body { color: var(--ink-soft); }
.project__body p { margin: 0 0 1.1rem; }
.project__body p:last-child { margin-bottom: 0; }
.project__body a { border-bottom: 1px solid var(--accent-deep); }
.project__body a:hover { background: var(--accent); }
.project__body ol, .project__body ul { padding-left: 1.25rem; }

/* Project prose runs much taller than its figure, so centering leaves a dead gap.
   Top-align instead, and let the figure track the text as it scrolls. */
.project .split { align-items: start; }
.project__figure { margin: 0; position: sticky; top: 108px; }
.project__figure img { width: auto; max-width: 100%; max-height: 420px; }

/* ==========================================================================
   Publications — geometry taken from the reference's .portfolio16_item:
   a 7fr / 3fr split (660.8 / 283.2 inside the 1024 column) with an 80px gap,
   no rules between entries, title 24px/500, links 16px/500 in plain black.
   ========================================================================== */

.pubs { padding-block: 80px; }

.pubs__heading {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: normal;
  margin: 0 0 40px;
  color: var(--ink);
}
.pubs__list + .pubs__heading { margin-top: 80px; }

/* The reference separates entries with a .line-divider: a 1px pure-black rule
   spanning the full content column. */
.pubs__list { display: grid; row-gap: 0; }
.pub + .pub { border-top: 1px solid #000; }
.pub { padding-block: 40px; }
.pub:first-child { padding-top: 0; }
.pub:last-child  { padding-bottom: 0; }

.pub { display: grid; }

/* Two-column only when an entry actually carries a figure, so text-only
   entries do not leave an empty gutter. */
.pub--thumb {
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  column-gap: 80px;
  align-items: start;
}

.pub__title {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  margin: 0 0 .5rem;
  color: var(--ink);
}

.pub__meta {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
}
.pub__meta strong { font-weight: 700; }
.pub__meta em { font-style: italic; }

.pub__links { margin: .75rem 0 0; display: flex; gap: 24px; }
.pub__links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color .18s ease;
}
.pub__links a:hover,
.pub__links a:focus-visible { border-bottom-color: var(--ink); }

.pub__meta .corr, .pubs__note .corr {
  font-size: .72em;
  font-weight: 700;
  vertical-align: super;
  line-height: 0;
  padding-left: 1px;
}
.pubs__note { display: block; margin-top: .35rem; font-size: .95rem; color: var(--ink-muted); }

.pub__thumb { overflow: hidden; }
.pub__thumb img { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .pubs { padding-block: 48px; }
  .pub--thumb { grid-template-columns: 1fr; row-gap: 24px; }
  .pub__thumb { max-width: 320px; }
  .pub { padding-block: 28px; }
  .pubs__list + .pubs__heading { margin-top: 56px; }
}

/* ==========================================================================
   CV — classic two-column CV: year rail on the left, entry on the right.
   Reuses .pubs__heading for section titles so the page matches Publications.
   ========================================================================== */

.cv { padding-block: 80px; }
/* Tighter than the publications page: a CV is a dense list, not an article. */
.cv .pubs__heading { margin-bottom: 12px; }
.cv__list { display: grid; row-gap: 0; margin-bottom: 56px; }
.cv__list:last-child { margin-bottom: 0; }

.cv__row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  column-gap: 32px;
  padding-block: 18px;
  align-items: start;
}
.cv__row + .cv__row { border-top: 1px solid var(--rule); }

.cv__year {
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 1px;
}

.cv__item { font-size: 1rem; line-height: 1.5; color: var(--ink); }
.cv__item strong { font-weight: 500; }
.cv__item em { font-style: italic; }
.cv__item a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cv__item a:hover { color: var(--accent-deep); }
.cv__title { color: var(--ink); }
.cv__note { color: var(--ink-muted); font-size: .95rem; }
.cv__item .corr { font-size: .72em; font-weight: 700; vertical-align: super; line-height: 0; }

@media (max-width: 700px) {
  .cv { padding-block: 48px; }
  .cv__row { grid-template-columns: 1fr; row-gap: 4px; padding-block: 14px; }
  .cv__year { font-size: .9rem; }
}

/* ==========================================================================
   Footer — full-bleed black band
   ========================================================================== */

.site-footer {
  background: var(--footer-bg);
  color: #e7eaec;
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
  margin-top: clamp(3rem, 7vw, 6rem);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.footer__name { font-size: 1.15rem; font-weight: 700; margin: 0 0 .4rem; color: #fff; }
.site-footer p { margin: 0 0 .3rem; font-size: 14px; color: #fff; line-height: 21px; }

.footer__h {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #78838b;
  margin: 0 0 .7rem;
}

.footer__links { list-style: none; padding: 0; margin: 0; }
.footer__links li { margin-bottom: .4rem; }
.footer__links a {
  font-size: 14px;
  color: #fff;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.footer__links a:hover { color: #fff; border-bottom-color: var(--accent-deep); }

.footer__base {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid #23282c;
  font-size: .85rem;
  color: #6d767d;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .hero, .section { padding-block: 48px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { max-width: 320px; margin-inline: auto; order: -1; }
  .split { grid-template-columns: 1fr; }
  .split--flip .split__figure { order: -1; }
  .split__figure { max-width: 420px; margin-inline: auto; }
  .cards { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header .wrap { min-height: 68px; flex-wrap: wrap; gap: .75rem; padding-block: .85rem; }
  .brand { font-size: 1.35rem; }
  .nav { gap: 1.1rem; width: 100%; }
  .nav a { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
