/* Mengze Hong · v5 — sky / peach / lilac.
   Tango reference: transparent centered navigation, condensed glass on scroll.
   One canonical stylesheet; no legacy palette overrides. */
@font-face {
  font-family: 'Rubik';
  src: url('../fonts/Rubik.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #141923;
  --ink-2: #3d4655;
  --muted: #667184;
  --faint: #929baa;
  --line: #e0e6ef;
  --line-strong: #cdd6e3;
  --blue: #4568b8;
  --blue-deep: #315394;
  --blue-soft: #e7f1ff;
  --orange: #a56930;
  --orange-soft: #fff0df;
  --purple: #7460a7;
  --purple-soft: #eee9fa;
  --sky: #91c1f8;
  --peach: #ffddb9;
  --lavender: #c6b6ee;
  --glass: rgba(255, 255, 255, .86);
  --sans: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --pad: clamp(20px, 4vw, 48px);
  --maxw: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #10151e;
  --surface: #19212d;
  --ink: #f1f5fa;
  --ink-2: #c5cfde;
  --muted: #a0aec2;
  --faint: #718096;
  --line: #2a3545;
  --line-strong: #3b4c63;
  --blue: #a4c9fa;
  --blue-deep: #bdd9ff;
  --blue-soft: #1b2d45;
  --orange: #f3c798;
  --orange-soft: #352b22;
  --purple: #c6b6ee;
  --purple-soft: #2b273d;
  --sky: #203652;
  --peach: #3b3026;
  --lavender: #322d49;
  --glass: rgba(25, 33, 45, .90);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 500; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: #c3d6f6; color: #141923; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.wrap { width: min(calc(100% - 2 * var(--pad)), var(--maxw)); margin-inline: auto; }
.hidden { display: none !important; }
.bg-grid { display: none; }
.skip { position: fixed; z-index: 200; top: 10px; left: 12px; padding: 10px 18px; border-radius: 8px; background: var(--ink); color: var(--bg); transform: translateY(-150%); }
.skip:focus { transform: none; }
.scroll-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 110; background: var(--blue); transform: scaleX(0); transform-origin: left; }
/* Navigation: brand left, links centered, contact right. */
.site-header {
  position: fixed;
  z-index: 100;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  width: min(calc(100% - 64px), 1320px);
  height: 56px;
  padding: 0 8px 0 18px;
  border: 1px solid transparent;
  border-radius: 99px;
  transition: transform .28s var(--ease), opacity .2s, width .5s var(--ease), background .35s, box-shadow .35s;
}
.site-header.header-hidden { transform: translate(-50%, calc(-100% - 32px)); opacity: 0; pointer-events: none; }
.site-header.scrolled {
  width: min(calc(100% - 24px), 1200px);
  background: var(--glass);
  border-color: var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 8px 28px -16px rgba(31, 58, 120, .25);
}
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; white-space: nowrap; }
.brand-name { font-size: 16px; font-weight: 550; letter-spacing: -.025em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  transform-origin: center;
  transition: transform .35s var(--spring);
  animation: brand-arrive .65s var(--spring) both;
}
.brand-mark img { display: block; width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.brand:hover .brand-mark, .brand:focus-visible .brand-mark { transform: translateY(-3px); }
@keyframes brand-arrive {
  0% { opacity: 0; transform: translateY(-5px); }
  70% { opacity: 1; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}
.nav { display: flex; gap: 2px; position: relative; justify-self: center; }
.nav a { position: relative; z-index: 1; padding: 8px 16px; color: var(--muted); font-size: 14px; font-weight: 450; white-space: nowrap; transition: color .2s; }
.nav a > span { display: none; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav-pill { position: absolute; top: 0; left: 0; height: 100%; border-radius: 99px; background: transparent; opacity: 0; transition: transform .35s var(--ease), width .35s var(--ease), background .3s; }
.scrolled .nav-pill { background: var(--blue-soft); }
.header-tools { display: flex; align-items: center; gap: 8px; justify-self: end; }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; transition: background .2s; }
.theme-toggle:hover { background: var(--blue-soft); }
.theme-toggle svg { width: 19px; height: 19px; }
.icon-moon { display: none; }
[data-theme='dark'] .icon-moon { display: block; }
[data-theme='dark'] .icon-sun { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { color: var(--surface); background: var(--ink); }
.btn-primary:hover { box-shadow: 0 8px 18px -10px rgba(20, 25, 35, .5); }
.btn-glass { background: var(--surface); border: 1px solid var(--line-strong); }
.btn-glass:hover { background: var(--blue-soft); }
.btn-ghost { background: var(--ink); color: var(--surface); min-height: 36px; padding: 9px 19px; font-size: 13px; }
.menu-btn { display: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; }
.mobile-menu { position: fixed; z-index: 90; inset: 0; padding: 110px var(--pad) 36px; background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .25s, visibility .25s; }
.mobile-menu.open { visibility: visible; opacity: 1; }
.mobile-menu > a { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: clamp(25px, 6vw, 40px); letter-spacing: -.035em; transform: translateY(14px); opacity: 0; transition: transform .4s var(--ease), opacity .4s; }
.mobile-menu.open > a { transform: none; opacity: 1; }
.mobile-menu > a span { color: var(--blue); font: 12px var(--mono); }
.mm-foot { display: flex; gap: 24px; margin-top: 28px; color: var(--muted); }
/* Hero: normal flow, no floating panels or empty staging area. */
.hero {
  position: relative;
  padding: 108px var(--pad) 28px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 8% 9%, rgba(145, 193, 248, .19), transparent 55%),
    radial-gradient(ellipse at 90% 40%, rgba(255, 221, 185, .23), transparent 48%);
}
[data-theme='dark'] .hero { background: radial-gradient(ellipse at 8% 9%, #1b2d453b, transparent 55%), radial-gradient(ellipse at 90% 40%, #352b2259, transparent 48%); }
.hero-inner { max-width: var(--maxw); margin-inline: auto; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .75fr); gap: clamp(32px, 5vw, 76px); align-items: center; }
.hero-copy { min-width: 0; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-deep); font-size: 11px; font-weight: 450; }
.pill-soft { background: var(--orange-soft); color: var(--orange); }
.dot { display: inline-block; width: 5px; height: 5px; background: currentColor; border-radius: 50%; flex-shrink: 0; }
.hero-name { margin-top: 18px; font-size: clamp(48px, 5.7vw, 82px); line-height: 1.08; font-weight: 450; letter-spacing: -.065em; }
.name-line { display: block; white-space: nowrap; }
.hero-statement { margin-top: 20px; max-width: 26ch; font-size: clamp(22px, 2vw, 27px); line-height: 1.35; letter-spacing: -.03em; font-weight: 400; }
em { font-style: normal; }
.hero-statement em { color: var(--blue-deep); }
.hero-sub { max-width: 570px; margin-top: 15px; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-strong); max-width: 570px; }
.hero-metrics { display: flex; align-items: baseline; gap: 28px; }
.hero-metrics > div { display: flex; flex-direction: column; gap: 0; }
.hero-metrics strong { font-size: 27px; font-weight: 450; line-height: 1.2; letter-spacing: -.05em; }
.hero-metrics span { color: var(--muted); font-size: 10.5px; }
.hero-socials { display: flex; gap: 8px; align-items: center; }
.social-link { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink-2); transition: color .2s, background .2s, transform .25s var(--ease); }
.social-link svg { width: 19px; height: 19px; }
.social-link:hover { color: var(--ink); background: var(--blue-soft); transform: translateY(-2px); }
.hero-visual { display: flex; align-items: center; justify-content: center; min-width: 0; }
.portrait-card {
  position: relative;
  width: min(100%, 330px);
  aspect-ratio: 1280 / 1641;
  border-radius: 24px;
  overflow: hidden;
  background: var(--blue-soft);
  transform: rotate(2deg);
  box-shadow: 0 20px 44px -25px rgba(31, 58, 120, .32);
  transition: transform .5s var(--ease), box-shadow .3s;
}
.portrait-card picture, .portrait-card img { display: block; width: 100%; height: 100%; }
.portrait-card img { object-fit: contain; }
/* Sections */
.section { padding-block: 42px; }
.section-head { display: grid; grid-template-columns: 1.22fr .78fr; align-items: end; gap: 48px; margin-bottom: 25px; }
.section-label, .page-eyebrow, .panel-label, .label { display: inline-flex; align-items: center; gap: 8px; font: 10px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-label i, .page-eyebrow i { display: inline-block; width: 5px; height: 5px; background: var(--blue); border-radius: 50%; }
.section-title { margin-top: 10px; font-size: clamp(30px, 3vw, 42px); line-height: 1.16; letter-spacing: -.045em; font-weight: 450; max-width: 26ch; }
.section-title em { color: var(--blue-deep); }
.section-lede { font-size: 13.5px; line-height: 1.7; color: var(--muted); max-width: 48ch; }
.section-link { display: inline-flex; align-items: center; gap: 14px; color: var(--blue-deep); font-size: 12px; font-weight: 500; margin-top: 10px; }
.section-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.threads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.thread { display: flex; flex-direction: column; padding: 25px; border-radius: 22px; background: var(--blue-soft); transition: transform .35s var(--ease), box-shadow .35s; }
.thread:nth-child(2) { background: var(--orange-soft); }
.thread:nth-child(3) { background: var(--purple-soft); }
.thread:hover { box-shadow: 0 14px 28px -22px rgba(31, 58, 120, .4); }
.thread-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.thread-num { font: 11px var(--mono); color: var(--blue); }
.thread-chip { font-size: 10px; padding: 3px 9px; border-radius: 99px; background: var(--surface); color: var(--blue-deep); }
.thread:nth-child(2) .thread-num, .thread:nth-child(2) .thread-chip { color: var(--orange); }
.thread:nth-child(3) .thread-num, .thread:nth-child(3) .thread-chip { color: var(--purple); }
.thread h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.035em; font-weight: 500; }
.thread > p { margin-top: 12px; color: var(--ink-2); font-size: 12.5px; line-height: 1.65; }
.thread-tags { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 15px 0 20px; }
.thread-tags span { font-size: 9px; color: var(--muted); }
.thread-papers { margin-top: auto; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.thread-papers .label { display: block; font-size: 8px; margin-bottom: 8px; }
.thread-papers a { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 11px; color: var(--ink-2); }
.thread-papers a span { font: 8.5px var(--mono); color: var(--muted); white-space: nowrap; }
.thread-papers a:hover { color: var(--blue-deep); }
.swipe-hint { display: none; }
/* Each paper is an individual card, with a real 16px gutter. */
.pub-panel { display: grid; gap: 16px; padding: 0; background: transparent; border: 0; }
.pub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  align-items: start;
  gap: 10px 24px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: border-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}
.pub:hover { border-color: var(--line-strong); box-shadow: 0 10px 26px -19px rgba(31, 58, 120, .28); transform: translateY(-2px); }
.pub-meta { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; gap: 12px; }
.pub-year { font: 11px var(--mono); color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.pub-meta .badges { flex-direction: row; align-items: center; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: 8.5px; line-height: 1.35; font-weight: 500; white-space: nowrap; color: var(--muted); background: var(--bg); }
.badge.ccf-a { color: var(--blue-deep); background: var(--blue-soft); }
.badge.ccf-b { color: var(--purple); background: var(--purple-soft); }
.badge.ccf-c, .badge.oral { color: var(--orange); background: var(--orange-soft); }
.badge.first, .badge.role { color: var(--ink-2); background: var(--bg); }
.badge.preprint, .badge.workshop { color: var(--muted); background: var(--bg); }
.badge.core { color: var(--blue-deep); background: var(--blue-soft); }
.badge.thcpl { color: var(--orange); background: var(--orange-soft); }
.pub-venue .badge { vertical-align: middle; margin-left: 4px; }
.pub-body { min-width: 0; }
.pub-title { font-size: 18px; line-height: 1.35; letter-spacing: -.025em; font-weight: 500; }
.pub-title a { transition: color .2s; }
.pub-title a:hover { color: var(--blue-deep); }
.pub-authors { margin-top: 8px; font-size: 10.5px; line-height: 1.6; color: var(--muted); }
.pub-authors b { font-weight: 500; color: var(--ink-2); }
.pub-venue { margin-top: 6px; color: var(--blue-deep); font-size: 10.5px; line-height: 1.5; }
.sep { margin-inline: 7px; color: var(--faint); }
.pub-side { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: end; gap: 14px; }
.pub-cites { font: 10px var(--mono); color: var(--muted); }
.pub-links { display: flex; flex-wrap: nowrap; justify-content: end; gap: 7px; }
.pub-links a, .cite-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-2); font-size: 10px; line-height: 1.3; white-space: nowrap; transition: border-color .2s, background .2s; }
.pub-links > * { flex: 0 0 auto; }
.pub-links a:hover, .cite-btn:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-deep); }
/* Experience */
.cv-head-btn { justify-self: end; align-self: end; }
.cv-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr); align-items: start; gap: 20px; }
.cv-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 25px; }
.cv-panel > .panel-label { margin-bottom: 7px; }
.cv-side { display: flex; flex-direction: column; gap: 20px; }
.cv-side > .cv-panel:last-child { flex: 1; }
.exp-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.exp-item:last-child { border: 0; padding-bottom: 0; }
.exp-stamp { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.exp-date { padding-top: 2px; font: 10px/1.6 var(--mono); color: var(--muted); }
.org-logo { display: flex; align-items: center; justify-content: flex-start; width: 124px; height: 56px; padding: 0; background: transparent; border: 0; border-radius: 0; }
.org-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.org-logo-today { padding: 0; }
.exp-item h3 { font-size: 19px; line-height: 1.35; font-weight: 500; letter-spacing: -.02em; }
.exp-role { display: block; font-size: 12px; line-height: 1.55; color: var(--blue-deep); margin-top: 6px; }
.exp-item p { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 9px; }
.edu-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 15px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.edu-item:last-child { border: 0; padding-bottom: 0; }
.edu-logo { display: flex; align-items: center; grid-row: 1 / span 3; align-self: start; width: 92px; height: 48px; margin: 0; padding: 0; background: transparent; border: 0; border-radius: 0; }
.edu-logo img { display: block; max-width: 92px; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.edu-item > h4, .edu-item > p { grid-column: 2; }
.edu-item h4 { font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: -.015em; }
.meta { font-size: 12px; line-height: 1.65; color: var(--muted); margin-top: 6px; }
.meta.accent { color: var(--purple); }
.cv-list { padding-top: 10px; }
.cv-list li { position: relative; font-size: 12px; line-height: 1.65; color: var(--ink-2); padding: 6px 0 6px 13px; }
.cv-list li::before { content: ''; position: absolute; left: 0; top: 14px; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
/* Editorial media: an actual newspaper spread, selected columns, one conversation. */
.media-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); align-items: stretch; gap: 20px; }
.media-card { min-width: 0; padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.media-feature { display: flex; flex-direction: column; }
.media-feature-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.media-kicker { display: block; color: var(--muted); font: 9px/1.5 var(--mono); letter-spacing: .055em; text-transform: uppercase; }
.media-feature h3 { margin-top: 8px; font-size: 28px; line-height: 1.2; font-weight: 500; letter-spacing: -.03em; }
.media-feature h3 span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-top: 7px; }
.media-role { flex: 0 0 auto; padding: 6px 10px; border-radius: 99px; color: var(--blue-deep); background: var(--blue-soft); font-size: 10px; }
.media-cover { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #ffffff; }
.media-cover img { display: block; width: 100%; height: auto; object-fit: contain; transition: opacity .25s; }
.media-cover:hover img { opacity: .86; }
.media-feature-caption { padding-top: 22px; }
.media-feature-caption h4 { margin-top: 8px; font-size: 18px; line-height: 1.6; font-weight: 500; letter-spacing: .015em; }
.media-feature-caption p { max-width: 58ch; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.media-feature-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 0; padding-top: 16px; }
.media-feature-foot time, .media-column time { font: 10px/1.5 var(--mono); color: var(--muted); }
.media-feature-foot a { color: var(--blue-deep); font-size: 12px; }
.media-side { display: flex; flex-direction: column; gap: 14px; }
.media-side .media-card { padding: 20px; }
.media-column { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.media-column:last-child { border: 0; padding-bottom: 0; }
.media-column h4 { margin-top: 6px; color: var(--ink-2); font-size: 14px; font-weight: 450; line-height: 1.65; }
.media-column > span { font-size: 21px; color: var(--blue-deep); transition: transform .2s; }
.media-column:hover h4 { color: var(--blue-deep); }
.media-column:hover > span { transform: translate(2px, -2px); }
.media-podcast { flex: 1; display: flex; flex-direction: column; background: var(--purple-soft); border-color: transparent; }
.media-podcast-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.media-podcast .media-kicker { color: var(--purple); }
.media-wave { display: flex; align-items: center; gap: 3px; height: 34px; flex: 0 0 auto; }
.media-wave i { display: block; height: var(--h); width: 3px; border-radius: 3px; background: var(--purple); opacity: .7; }
.media-podcast h3 { margin-top: 10px; font-size: 27px; font-weight: 450; line-height: 1.2; letter-spacing: -.03em; }
.media-podcast p { color: var(--ink-2); font-size: 12px; line-height: 1.6; margin-top: 9px; max-width: 35ch; }
.podcast-episode { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--purple) 20%, transparent); }
.podcast-meta { font: 9px/1.5 var(--mono); color: var(--purple); }
.podcast-episode h4 { margin-top: 6px; font-size: 13px; font-weight: 450; line-height: 1.65; }
.podcast-episode a { flex: 0 0 auto; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--purple) 25%, transparent); border-radius: 99px; font-size: 10px; color: var(--purple); white-space: nowrap; transition: background .2s; }
.podcast-episode a:hover { background: var(--surface); }
/* Compact, quiet footer. */
.footer { padding: 24px var(--pad) 28px; }
.footer-card { max-width: var(--maxw); margin-inline: auto; position: relative; border-radius: 24px; padding: 34px 38px 24px; background: #182332; color: #f4f7fc; }
.footer-eyebrow { color: #b3c3d9; font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.footer-title { max-width: 30ch; margin-top: 15px; font-size: clamp(27px, 3.5vw, 48px); line-height: 1.16; font-weight: 400; letter-spacing: -.045em; }
.footer-title em, .footer-title-sm em { color: #ffddb9; }
.footer-mail { display: inline-flex; align-items: center; gap: 20px; margin-top: 20px; color: #b6d6ff; font-size: 15px; overflow-wrap: anywhere; transition: color .2s; }
.footer-mails { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; margin-top: 20px; }
.footer-mails .footer-mail { margin-top: 0; gap: 12px; }
.footer-mail:hover { color: #ffffff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 32px; margin-top: 30px; padding-top: 22px; border-top: 1px solid #344253; }
.footer-grid .label { display: block; color: #8296b0; font-size: 8px; margin-bottom: 8px; }
.footer-grid a { display: block; color: #becadd; font-size: 10px; line-height: 1.9; }
.footer-grid a:hover { color: #ffffff; }
.footer-grid p { color: #becadd; font-size: 10px; line-height: 1.8; max-width: 30ch; }
.footer-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #344253; font: 8px var(--mono); color: #8296b0; }
.back-to-top { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 42px; padding: 6px 7px 6px 14px; border: 1px solid #46586f; border-radius: 99px; color: #d5e4fa; font: 11px/1 var(--sans); transition: background .2s, border-color .2s; }
.back-to-top:hover { background: #25374d; border-color: #91c1f8; }
.top-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #b6d6ff; color: #182332; }
.top-arrow svg { width: 17px; height: 17px; transition: transform .2s var(--ease); }
.back-to-top:hover .top-arrow svg { transform: translateY(-2px); }
.footer-quick-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer-card-sm .footer-quick-links .footer-mail { margin-top: 0; }
.footer-card-sm { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding-block: 28px; }
.footer-title-sm { font-size: 32px; line-height: 1.2; letter-spacing: -.04em; margin-top: 10px; font-weight: 400; }
.footer-card-sm .footer-mail { margin-top: 0; }
/* Full publication record */
.page-hero { padding: 124px 0 36px; }
.page-hero > .wrap:first-child { display: grid; grid-template-columns: 1.25fr .75fr; gap: 60px; align-items: end; }
.page-title { margin-top: 16px; font-size: clamp(48px, 5.3vw, 76px); letter-spacing: -.06em; line-height: 1.08; font-weight: 450; }
.page-title em { color: var(--blue-deep); }
.page-intro { color: var(--muted); font-size: 13px; line-height: 1.75; max-width: 58ch; margin-top: 20px; }
.stats { display: flex; gap: 60px; padding-top: 26px; margin-top: 30px; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 30px; font-weight: 450; line-height: 1.2; letter-spacing: -.04em; }
.stat span { color: var(--muted); font: 9px var(--mono); margin-top: 5px; }
.filter-bar { position: sticky; top: 82px; z-index: 20; width: min(calc(100% - 2 * var(--pad)), var(--maxw)); margin: 0 auto 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-radius: 18px; padding: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filter { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 99px; color: var(--muted); font-size: 11px; }
.filter.active { color: var(--surface); background: var(--ink); }
.filter:not(.active):hover { background: var(--blue-soft); color: var(--blue-deep); }
.filter-count { font: 9px var(--mono); white-space: nowrap; color: var(--muted); }
.filter.active .filter-count { color: inherit; opacity: .6; }
.pub-year-group { margin-block: 30px 40px; }
.year-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.year-head h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.04em; font-weight: 450; }
.year-head span { font: 10px var(--mono); color: var(--muted); }
.empty-state { display: none; text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state.show { display: block; }
.page-note { padding-block: 18px; }
.page-note .wrap { display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font: 8px/1.7 var(--mono); }
/* Not found */
.notfound { padding: 150px 0 60px; }
.nf-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.nf-title { font-size: clamp(48px, 6vw, 80px); line-height: 1.1; letter-spacing: -.055em; margin-top: 18px; font-weight: 450; }
.nf-title em { color: var(--blue-deep); }
.nf-lede { max-width: 42ch; margin-top: 20px; color: var(--muted); font-size: 14px; }
.nf-art { position: relative; padding: 30px; display: grid; place-items: center; }
.nf-num { color: var(--blue); font-size: clamp(100px, 15vw, 200px); font-weight: 450; letter-spacing: -.07em; line-height: 1; position: relative; }
.portrait-blob { position: absolute; inset: 0; border-radius: 45% 55% 58% 42%; background: var(--blue-soft); transform: rotate(-8deg); }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translate(-50%, 15px); opacity: 0; visibility: hidden; padding: 11px 22px; border: 1px solid var(--line); background: var(--ink); color: var(--surface); border-radius: 99px; font-size: 12px; transition: opacity .25s, transform .25s, visibility .25s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.pub.reveal { opacity: 1; transform: none; }
.pub.reveal:hover { transform: translateY(-2px); }
@media (max-width: 1100px) {
  .site-header { width: calc(100% - 24px); padding-left: 14px; gap: 10px; }
  .nav a { padding-inline: 12px; font-size: 12px; }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 40px; }
  .hero-name { font-size: clamp(48px, 5.8vw, 68px); }
  .hero-statement { font-size: 23px; }
  .portrait-card { width: min(100%, 294px); }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px; }
  .pub-side { grid-column: 1; grid-row: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
  .thread { padding: 21px; }
  .thread h3 { font-size: 19px; }
  .thread-papers a { font-size: 10px; }
  .thread-papers a span { font-size: 7.5px; }
  .exp-item { grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
  .org-logo { width: 106px; height: 60px; }
  .exp-item h3 { font-size: 18px; }
}
@media (max-width: 860px) {
  .site-header { display: flex; justify-content: space-between; background: var(--glass); border-color: var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
  .nav { display: none; }
  .menu-btn { display: block; }
  .header-tools .btn-ghost { display: none; }
  .hero { padding-top: 102px; }
  .hero-grid { gap: 30px; }
  .hero-name { font-size: clamp(44px, 6vw, 56px); }
  .hero-statement { font-size: 21px; }
  .hero-pills { gap: 5px; }
  .pill { font-size: 9px; }
  .hero-sub { font-size: 12px; }
  .hero-bottom { gap: 14px; flex-wrap: wrap; }
  .hero-metrics { gap: 24px; }
  .hero-metrics strong { font-size: 25px; }
  .hero-socials { gap: 3px; }
  .social-link { width: 29px; height: 29px; }
  .section-head { gap: 28px; }
  .section-title { font-size: 32px; }
  .threads { gap: 12px; }
  .thread { padding: 18px; }
  .thread > p { font-size: 11px; }
  .thread-tags { gap: 5px 9px; }
  .thread-tags span { font-size: 8px; }
  .thread-papers a { display: block; font-size: 10px; }
  .thread-papers a span { display: block; font-size: 8px; margin-top: 1px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pub-side { grid-column: 1; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; }
  .pub-title { font-size: 17px; }
  .cv-grid { grid-template-columns: 1fr; }
  .cv-side { display: grid; grid-template-columns: 1fr 1fr; }
  .exp-item { grid-template-columns: 132px minmax(0, 1fr); }
  .org-logo { width: 124px; height: 64px; }
  .media-grid { grid-template-columns: 1fr; }
  .media-side { display: grid; grid-template-columns: 1.1fr .9fr; }
  .page-hero > .wrap:first-child { gap: 35px; }
  .filter-bar { gap: 10px; flex-wrap: wrap; }
  .filter { padding: 7px 10px; }
}
@media (max-width: 640px) {
  .site-header { top: 10px; height: 52px; }
  .brand { gap: 6px; }
  .brand-name { font-size: 14px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-mark img { width: 40px; height: 40px; }
  .header-tools { gap: 4px; }
  .theme-toggle { width: 31px; height: 31px; }
  .hero { padding: 90px var(--pad) 20px; }
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .hero-name { margin-top: 18px; font-size: clamp(39px, 11.5vw, 60px); }
  .hero-statement { margin-top: 16px; max-width: 27ch; font-size: 23px; line-height: 1.35; }
  .hero-sub { font-size: 12.5px; margin-top: 14px; }
  .hero-actions { gap: 8px; margin-top: 20px; }
  .btn { font-size: 12px; padding: 10px 17px; }
  .hero-bottom { flex-wrap: nowrap; gap: 12px; margin-top: 21px; padding-top: 16px; }
  .hero-metrics { gap: 23px; }
  .hero-metrics strong { font-size: 24px; }
  .hero-metrics span { font-size: 9px; }
  .hero-socials { gap: 3px; }
  .social-link { width: 28px; height: 28px; }
  .social-link svg { width: 17px; height: 17px; }
  .portrait-card { width: 100%; border-radius: 12px; transform: rotate(1.5deg); }
  .section { padding-block: 30px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 20px; }
  .section-title { font-size: 30px; max-width: 24ch; margin-top: 9px; }
  .section-lede { font-size: 12.5px; }
  .threads { grid-template-columns: 1fr; gap: 14px; }
  .thread { padding: 22px; }
  .thread-top { margin-bottom: 14px; }
  .thread h3 { font-size: 21px; }
  .thread > p { font-size: 12px; }
  .thread-tags { margin-bottom: 17px; }
  .thread-tags span { font-size: 9px; }
  .thread-papers a { display: flex; font-size: 11px; padding-block: 4px; }
  .thread-papers a span { display: inline; margin: 0; font-size: 8px; }
  .pub-panel { gap: 16px; }
  .pub { grid-template-columns: 1fr; gap: 10px; padding: 19px; border-radius: 16px; }
  .pub-meta { flex-direction: row; align-items: center; gap: 12px; }
  .pub-meta .badges { flex-direction: row; gap: 5px; }
  .pub-year { font-size: 10px; }
  .pub-title { font-size: 16px; }
  .pub-authors { font-size: 10px; margin-top: 7px; }
  .pub-venue { font-size: 10px; }
  .pub-side { grid-column: 1; align-items: center; gap: 12px; flex-wrap: wrap; }
  .pub-cites { font-size: 8px; }
  .pub-links { gap: 5px; }
  .pub-links a, .cite-btn { font-size: 9px; padding-inline: 8px; min-height: 27px; }
  .pub-links { justify-content: flex-start; }
  #cv .section-head { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  #cv .section-title { font-size: 26px; }
  .cv-head-btn { font-size: 10px; padding: 9px 12px; gap: 7px; min-height: 35px; }
  .cv-grid { gap: 14px; }
  .cv-side { grid-template-columns: 1fr; gap: 14px; }
  .cv-panel { padding: 22px; }
  .exp-item { grid-template-columns: 1fr; gap: 14px; padding-block: 21px; }
  .exp-stamp { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .exp-date { font-size: 10px; }
  .org-logo { width: 104px; height: 44px; padding: 0; flex: 0 0 auto; }
  .exp-item h3 { font-size: 18px; }
  .exp-item p { font-size: 13px; }
  .edu-item h4 { font-size: 17px; }
  .edu-item { grid-template-columns: 74px minmax(0, 1fr); column-gap: 13px; }
  .edu-logo { width: 74px; height: 40px; }
  .edu-logo img { max-width: 74px; max-height: 40px; }
  .media-grid { gap: 14px; }
  .media-card { padding: 22px; }
  .media-feature-head { gap: 10px; margin-bottom: 18px; }
  .media-feature h3 { font-size: 25px; }
  .media-role { font-size: 8px; padding: 5px 8px; }
  .media-feature-caption h4 { font-size: 16px; }
  .media-side { grid-template-columns: 1fr; gap: 14px; }
  .media-podcast h3 { font-size: 25px; }
  .footer { padding-top: 12px; }
  .footer-card { padding: 26px 24px 20px; border-radius: 20px; }
  .footer-title { font-size: 30px; max-width: 21ch; }
  .footer-mail { font-size: 13px; gap: 12px; }
  .footer-mails { gap: 13px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 25px; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
  .footer-base { font-size: 7px; line-height: 1.6; }
  .footer-base .back-to-top { margin-left: auto; }
  .footer-card-sm { display: block; }
  .footer-card-sm .footer-mail { margin-top: 20px; }
  .footer-quick-links { justify-content: space-between; gap: 12px; margin-top: 20px; }
  .footer-title-sm { font-size: 30px; }
  .page-hero { padding: 98px 0 27px; }
  .page-hero > .wrap:first-child { grid-template-columns: 1fr; gap: 0; }
  .page-hero > .wrap:first-child > .page-intro { display: none; }
  .page-title { font-size: 47px; }
  .page-intro { font-size: 12px; }
  .stats { gap: 0; justify-content: space-between; margin-top: 24px; padding-top: 20px; }
  .stat b { font-size: 25px; }
  .stat span { font-size: 8px; }
  .filter-bar { top: 73px; gap: 6px; padding: 9px; border-radius: 15px; }
  .filter { font-size: 10px; padding: 6px 8px; gap: 4px; }
  .filter-count { font-size: 8px; }
  .filters { gap: 3px; }
  #shownCount { padding-left: 8px; }
  .pub-year-group { margin-top: 25px; }
  .year-head h2 { font-size: 25px; }
  .year-head span { font-size: 9px; }
  .page-note .wrap { flex-direction: column; gap: 8px; }
  .notfound { padding: 105px 0 40px; }
  .nf-grid { grid-template-columns: 1fr; gap: 40px; }
  .nf-title { font-size: 50px; }
  .nf-art { width: 270px; margin-inline: auto; }
  .nf-num { font-size: 120px; }
  .nf-home { display: inline-flex !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .brand-mark { transform: none; }
}
@media print {
  .site-header, .scroll-progress, .mobile-menu, .filter-bar, .theme-toggle, .toast, .back-to-top { display: none !important; }
  body { color: #111; background: #fff; }
  .hero, .page-hero { padding-top: 20px; }
  .reveal { opacity: 1; transform: none; }
  .pub, .thread, .cv-panel { break-inside: avoid; }
}

/* Frameless marks retain legibility on dark surfaces. */
[data-theme='dark'] .org-logo-today img { filter: invert(1); }
[data-theme='dark'] .org-logo:not(.org-logo-today) img,
[data-theme='dark'] .edu-logo img[src*='nottingham'] { filter: invert(1) hue-rotate(180deg); }
[data-theme='dark'] .edu-logo img[src*='polyu-mark'] { filter: brightness(1.25); }
.edu-logo img[src*='polyu-mark'] { width: 48px; height: 48px; }

/* Hero Scholar overlap. Append after removing the obsolete
   "Hero photo notes" block; keep the original hero and mobile font rules. */
.hero .hero-socials {
  gap: 20px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.hero .hero-socials .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: auto;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 400;
}
.hero .hero-socials .social-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.hero .hero-socials .social-link:hover {
  color: var(--blue-deep);
  background: transparent;
}
.hero .hero-socials .social-link:hover span {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-visual.hero-overlap {
  position: relative;
  width: min(100%, 330px);
  justify-self: center;
  isolation: isolate;
}
.hero-overlap .portrait-card {
  width: 100%;
  flex: 0 0 auto;
}
.hero-overlap .portrait-card img { object-fit: contain; }
.scholar-overlap {
  position: absolute;
  z-index: 2;
  left: -38px;
  bottom: 12px;
  display: block;
  width: 248px;
  height: 108px;
  padding: 13px 16px 14px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: rgba(247, 251, 255, .72);
  color: var(--ink);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 22px -12px rgba(31, 58, 90, .24), 0 2px 5px rgba(31, 58, 90, .05);
  transform: rotate(-2deg);
  transform-origin: center;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .2s;
}
.scholar-overlap-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-2);
  font: 10px/1.4 var(--mono);
}
.scholar-overlap-arrow {
  font: 13px/1 var(--sans);
  transition: transform .25s var(--ease);
}
.scholar-overlap-metrics {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: end;
  gap: 10px;
  margin-top: 9px;
}
.scholar-overlap-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.scholar-overlap-stat strong {
  font-size: 24px;
  font-weight: 450;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.scholar-overlap-stat:first-child strong { font-size: 34px; }
.scholar-overlap-stat > span {
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}
[data-theme='dark'] .scholar-overlap {
  background: rgba(18, 27, 41, .72);
  border-color: rgba(165, 193, 231, .22);
  box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .42), 0 2px 5px rgba(0, 0, 0, .12);
}
@media (hover: hover) and (pointer: fine) {
  .hero-overlap .portrait-card:hover { transform: translateY(-3px) rotate(.75deg); }
  .scholar-overlap:hover {
    transform: translateY(-3px) rotate(-1deg);
    border-color: color-mix(in srgb, var(--blue) 28%, transparent);
    box-shadow: 0 12px 25px -14px rgba(31, 58, 90, .28), 0 2px 5px rgba(31, 58, 90, .06);
  }
  .scholar-overlap:hover .scholar-overlap-arrow { transform: translate(1px, -1px); }
}
@media (min-width: 641px) and (max-width: 900px) {
  /* Keep the gutter clear and stay below the face as the photo narrows. */
  .scholar-overlap { left: -20px; bottom: -24px; }
}
@media (max-width: 640px) {
  .hero .hero-socials { gap: 18px; margin-top: 14px; }
  .hero .hero-socials .social-link { height: 28px; font-size: 11px; gap: 6px; }
  .hero .hero-socials .social-link svg { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: hero-overlap-arrive .6s var(--ease) backwards; }
  .hero-copy .hero-name { animation-delay: 50ms; }
  .hero-copy .hero-statement { animation-delay: 100ms; }
  .hero-copy .hero-actions { animation-delay: 150ms; }
  .hero-copy .hero-socials { animation-delay: 200ms; }
  .hero-overlap .portrait-card { animation: hero-overlap-portrait .7s var(--ease) 100ms backwards; }
  .scholar-overlap { animation: hero-overlap-arrive .6s var(--ease) 250ms backwards; }
}
@keyframes hero-overlap-arrive {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes hero-overlap-portrait {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-overlap .portrait-card:hover { transform: rotate(2deg); }
  .scholar-overlap:hover { transform: rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 640px) {
  .hero-overlap .portrait-card:hover { transform: rotate(1.5deg); }
  .scholar-overlap:hover { transform: none; }
}
@media print {
  .hero-overlap .portrait-card, .scholar-overlap { box-shadow: none; }
  .scholar-overlap { -webkit-backdrop-filter: none; backdrop-filter: none; }
}


/* Deliberate desktop line breaks; narrow screens keep natural, readable flow. */
@media (min-width: 1024px) {
  .hero-statement { max-width: 100%; }
  .hero-statement-line { display: block; white-space: nowrap; }
}
#research .thread h3 { font-size: clamp(22px, 1.6vw, 23px); }
#research .thread > p { font-size: 14px; }
#research .thread-chip { font-size: 11px; }
#research .thread-tags { gap: 7px 14px; }
#research .thread-tags span { font-size: 10px; }
#research .thread-papers .label { font-size: 9px; }
#research .thread-papers a { font-size: 12px; line-height: 1.55; }
#research .thread-papers a span { font-size: 9.5px; }

/* Research: larger type without oversized internal whitespace. */
#research.section { padding-block: 32px; }
#research .section-head { gap: 28px; margin-bottom: 20px; }
#research .section-title { font-size: clamp(30px, 2.6vw, 37px); }
#research .section-lede { font-size: 14px; line-height: 1.6; }
#research .thread { padding: 21px; }
#research .thread-top { margin-bottom: 12px; }
#research .thread > p { margin-top: 9px; line-height: 1.55; }
#research .thread-tags { margin: 12px 0 14px; }
#research .thread-papers { padding-top: 11px; }
#research .thread-papers .label { margin-bottom: 6px; }
#research .thread-papers a { padding-block: 3px; transition: color .2s; }
#research .thread-papers a span { transition: color .2s; }
#research .thread-papers a:hover,
#research .thread-papers a:focus-visible { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
#research .thread-papers a:hover span,
#research .thread-papers a:focus-visible span { color: var(--blue-deep); }
#research .thread:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 30%, transparent); }
#research .thread-papers a span::after { content: '↗'; display: inline-block; margin-left: 5px; font: 11px/1 var(--sans); opacity: .7; transition: transform .2s var(--ease); }
#research .thread-papers a:hover span::after,
#research .thread-papers a:focus-visible span::after { transform: translate(1px, -1px); }

/* Append after the current stylesheet. Desktop/tablet styling is untouched. */
@media (max-width: 640px) {
  /* Full-width introduction, followed by a small photo + plain Scholar row. */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .hero .hero-copy { min-height: 0; }
  .hero .hero-pills {
    max-width: none;
    min-height: 0; /* Also clears the old <=360px absolute-photo workaround. */
  }
  .hero .hero-statement { max-width: none; }
  .hero-visual.hero-overlap {
    position: static;
    inset: auto;
    display: grid;
    grid-template-columns: clamp(88px, 24vw, 104px) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 0;
    justify-self: stretch;
    margin: 0;
  }
  .hero .hero-overlap .portrait-card,
  .hero .hero-overlap .portrait-card:hover {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    transform: none;
  }
  .hero .hero-overlap .portrait-card picture,
  .hero .hero-overlap .portrait-card img {
    width: 100%;
    height: auto;
  }
  .hero .hero-overlap .portrait-card img { object-fit: contain; }
  .hero .scholar-overlap,
  .hero .scholar-overlap:hover {
    position: static;
    inset: auto;
    display: block;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: none;
  }
  .hero .scholar-overlap-caption {
    font-size: 10px;
    line-height: 1.4;
  }
  .hero .scholar-overlap-metrics {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 8px;
    margin-top: 9px;
  }
  .hero .scholar-overlap-stat { gap: 4px; }
  .hero .scholar-overlap-stat strong { font-size: 24px; }
  .hero .scholar-overlap-stat:first-child strong { font-size: 30px; }
  .hero .scholar-overlap-stat > span {
    font-size: 10px;
    line-height: 1.4;
  }

  /* Compact spacing, retaining the larger Research typography. */
  #research.section { padding-block: 24px; }
  #research .section-head {
    gap: 10px;
    margin-bottom: 14px;
  }
  #research .section-title {
    margin-top: 6px;
    font-size: clamp(28px, 7.4vw, 30px);
    line-height: 1.15;
  }
  #research .section-lede {
    font-size: 14px;
    line-height: 1.55;
  }
  #research .threads { gap: 10px; }
  #research .thread { padding: 16px 18px; }
  #research .thread-top { margin-bottom: 8px; }
  #research .thread h3 {
    font-size: clamp(22px, 1.6vw, 23px);
    line-height: 1.25;
  }
  #research .thread > p {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.55;
  }
  #research .thread-tags {
    gap: 4px 12px;
    margin: 8px 0 9px;
  }
  #research .thread-tags span { font-size: 10px; }
  #research .thread-papers {
    margin-top: 0;
    padding-top: 8px;
  }
  #research .thread-papers .label {
    font-size: 9px;
    margin-bottom: 3px;
  }
  #research .thread-papers a {
    padding-block: 3px;
    font-size: 12px;
    line-height: 1.5;
  }
  #research .thread-papers a span { font-size: 9.5px; }

  /* Only the Experience panel: do not alter Education or Honors. */
  #cv .cv-grid > .cv-panel { padding: 18px; }
  #cv .cv-grid > .cv-panel > .panel-label { margin-bottom: 0; }
  #cv .exp-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-block: 14px;
  }
  #cv .panel-label + .exp-item { padding-top: 8px; }
  #cv .exp-item:last-child { padding-bottom: 0; }
  #cv .exp-stamp {
    gap: 10px;
    min-height: 0;
  }
  #cv .exp-date { padding-top: 0; }
  #cv .exp-stamp .org-logo {
    width: 104px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  #cv .exp-role { margin-top: 4px; }
  #cv .exp-item p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.7;
  }
}

/* CV logo alignment refinement — append after all existing main.css rules.
   Uses the authentic assets; WeBank's English-only PNG crop is supplied separately.
   Existing typography, content-driven item heights, and dark-mode filters stay intact. */

/* A shared shallow frame aligns every company mark on the same vertical center. */
#cv .exp-date { white-space: nowrap; }
#cv .exp-stamp .org-logo {
  width: min(116px, 100%);
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: flex-start;
}
#cv .exp-stamp .org-logo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#cv .exp-stamp .org-logo-today img { width: 84px; }
#cv .exp-stamp .org-logo-tencent img { width: 110px; }
#cv .exp-stamp .org-logo-webank img { width: 100px; }
/* Preserve the complete 360:100 wordmark at a slightly larger natural scale. */
#cv .exp-stamp .org-logo-luckin img { width: 114px; }

/* Center both schools inside the same existing logo column; text stays in column 2.
   PolyU moves 22px right on desktop, rather than moving the text or the column. */
#cv .edu-logo { justify-content: center; }
#cv .edu-logo img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#cv .edu-logo img[src*='polyu-mark'] { width: 48px; height: auto; }
#cv .edu-logo img[src*='nottingham-mark'] {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  filter: none;
}

@media (min-width: 641px) {
  /* Dates and headings share the item top; logo centers share a vertical track. */
  #cv .exp-item { align-items: start; }
  #cv .panel-label + .exp-item { padding-top: 16px; }
  #cv .exp-stamp { gap: 10px; }
  #cv .exp-date { padding-top: 0; }
}

@media (max-width: 640px) {
  /* Retain the compact date + logo row; override the final #cv mobile rule. */
  #cv .exp-stamp .org-logo {
    width: 112px;
    height: 32px;
    flex: 0 0 auto;
    justify-content: flex-end;
  }
  #cv .exp-stamp .org-logo-today img { width: 78px; }
  #cv .exp-stamp .org-logo-tencent img { width: 104px; }
  #cv .exp-stamp .org-logo-webank img { width: 96px; }
  #cv .exp-stamp .org-logo-luckin img { width: 112px; }
  /* A true square, centered in the inherited 74px column (+17px from its old edge). */
  #cv .edu-logo img[src*='polyu-mark'] { width: 40px; height: auto; }
  #cv .edu-logo img[src*='nottingham-mark'] { width: 40px; height: 40px; }
}

.pub-authors-mobile, .pub-venue-mobile { display: none; }

@media (max-width: 640px) {
  #publications .pub { padding: 17px 18px; gap: 9px; }
  #publications .pub-authors { margin-top: 6px; }
  #publications .pub-venue { margin-top: 4px; }
  #publications .pub-authors-full,
  #publications .pub-venue-full { display: none; }
  #publications .pub-authors-mobile,
  #publications .pub-venue-mobile { display: block; white-space: nowrap; }
  #media .media-podcast { display: none; }
  .footer-grid { display: none; }
}

/* Mobile: compact identity with portrait, profile links, and Research rail. */
@media (max-width: 640px) {
  /* Flatten only the mobile layout wrappers, not their semantic children.
     No row gaps: each existing child supplies its own deliberate spacing. */
  .hero .hero-grid {
    grid-template-columns: minmax(0, 1fr) clamp(88px, 24vw, 104px);
    align-items: center;
    gap: 0 16px;
  }
  .hero .hero-copy {
    display: contents;
  }
  .hero .hero-visual.hero-overlap {
    display: block;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    width: 100%;
    max-width: 104px;
  }
  .hero .scholar-overlap,
  .hero .scholar-overlap:hover { display: none; }
  .hero .hero-pills {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    max-width: none;
    margin: 0 0 12px;
  }
  .hero .hero-name {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    font-size: clamp(35px, 10vw, 44px);
    line-height: 1.08;
  }
  .hero .hero-name .name-line { white-space: normal; }
  .hero .hero-statement {
    grid-column: 1 / -1;
    grid-row: 3;
    max-width: none;
    margin-top: 18px;
    font-size: 18px;
    line-height: 1.5;
  }
  .hero .hero-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 18px;
  }
  .hero .hero-socials {
    grid-column: 1 / -1;
    grid-row: 5;
    margin-top: 12px;
  }

  #research .section-lede { display: none; }
  #research .threads {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-block: 2px 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  #research .threads:focus-visible { outline-offset: -2px; }
  #research .threads::-webkit-scrollbar { height: 5px; }
  #research .threads::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 99px;
  }
  #research .thread {
    flex: 0 0 clamp(250px, calc(100vw - 78px), 318px);
    min-width: 0;
    height: auto;
    padding: 16px 18px;
    scroll-snap-align: start;
    /* Offscreen cards must not depend on reveal or a mouse tilt transform. */
    opacity: 1;
    transform: none !important;
    animation: none;
    transition: none;
  }
  #research .thread:focus-within {
    box-shadow: none;
    outline: 2px solid color-mix(in srgb, var(--blue) 45%, transparent);
    outline-offset: -2px;
  }
  #research .thread h3 { font-size: 22px; line-height: 1.25; }
  #research .thread > p { font-size: 14px; line-height: 1.55; }
  #research .thread-papers a {
    display: flex;
    min-width: 0;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  #research .thread-papers a span {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  #research .swipe-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    color: var(--muted);
    font: 10px/1.5 var(--mono);
  }
  #research .swipe-hint span { color: var(--blue-deep); }
}

/* Mobile Selected Work: links beside authors, no separate citation row. */
@media (max-width: 640px) {
  #publications .pub {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto auto;
    align-items: start;
    gap: 6px 6px;
    padding: 17px clamp(12px, 3.6vw, 18px);
    min-width: 0;
  }

  #publications .pub-body,
  #publications .pub-side {
    display: contents;
  }

  #publications .pub-meta {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    gap: 10px;
  }
  #publications .pub-year { font-size: 10px; }
  #publications .pub-meta .badges { gap: 4px; }
  #publications .pub-meta .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 1;
    text-align: center;
  }
  #publications .pub-meta .badge-label {
    display: block;
    line-height: 1;
    transform: translateY(.5px);
  }

  #publications .pub-title {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    margin: 0;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    -webkit-line-clamp: unset;
    font-size: 16px;
    line-height: 1.35;
  }
  #publications .pub-title a {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #publications .pub-authors {
    grid-column: 1;
    grid-row: 3;
    align-self: center;
    min-width: 0;
    margin: 0;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
  }
  #publications .pub-authors-mobile { white-space: nowrap; }

  #publications .pub-links {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: end;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-width: 0;
    margin: 0;
  }
  #publications .pub-links a,
  #publications .pub-links .cite-btn {
    flex: 0 0 auto;
    min-height: 27px;
    padding: 5px 4px;
    font-size: 9px;
    line-height: 1.3;
    white-space: nowrap;
  }
  /* Mobile success text is a single checkmark with an explicit aria-label;
     fixed width prevents the author/link row moving when Cite is clicked. */
  #publications .pub-links .cite-btn {
    width: 28px;
    min-width: 28px;
    padding-inline: 0;
  }

  #publications .pub-venue {
    grid-column: 1 / -1;
    grid-row: 4;
    min-width: 0;
    margin: 0;
    font-size: 10px;
    line-height: 1.5;
    white-space: nowrap;
  }
  #publications .pub-venue-mobile { white-space: nowrap; }
  #publications .pub-cites { display: none; }
}
