/* MUSE Lab (lab/index.html). Paper-white page with drifting watercolour washes; the hero
   holds the music-and-painting canvas, the sections below sit on frosted cards. */

@font-face { font-family: "Inter"; src: url("../assets/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../assets/fonts/fraunces-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../assets/fonts/fraunces-semibold-italic.woff2") format("woff2"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Ma Shan Zheng Subset"; src: url("../assets/fonts/mashanzheng-subset.woff2") format("woff2"); font-display: swap; }

:root {
  --navy: #14294a;
  --slate: #3b4c72;
  --accent: #506695;
  --accent-strong: #3d507b;
  --accent-soft: #f3f5fa;
  --accent-border: #d1d7e6;
  --heading: #20242c;
  --text: #3f4654;
  --text-soft: #545b69;
  --muted: #6f7787;
  --orange: #f7923f;
  --orange-deep: #ad4f15;
  --orange-soft: #fff2e6;
  --paper: #fbf8f2;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.95);
  --line: rgba(20, 41, 74, 0.09);
  --shadow: 0 6px 18px rgba(36, 52, 88, 0.06);
  --shadow-hover: 0 16px 34px rgba(36, 52, 88, 0.12);
  --glow: rgba(80, 102, 149, 0.1);
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: "Fraunces", "Ma Shan Zheng Subset", "Kaiti SC", "STKaiti", "KaiTi", Georgia, serif;
  --font-brush: "Ma Shan Zheng Subset", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --ease-out: cubic-bezier(0.2, 0.65, 0.3, 1);
  --bar-h: 64px;
  --gutter: 24px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 12px);
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .12 0 0 0 0 .2 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.lang-en .zh, .lang-zh .en { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.icon {
  flex: none;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 12px; }

/* watercolour washes drifting behind everything */
.washes {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.wash {
  position: absolute;
  width: 56vmax;
  height: 56vmax;
  border-radius: 50%;
  opacity: 0.8;
  will-change: transform;
  animation: drift 22s ease-in-out infinite alternate;
}

.w1 { left: -20vmax; top: -24vmax; background: radial-gradient(circle, rgba(174, 232, 248, 0.75), rgba(174, 232, 248, 0) 66%); }
.w2 { right: -22vmax; top: -6vmax; background: radial-gradient(circle, rgba(255, 210, 173, 0.7), rgba(255, 210, 173, 0) 64%); animation-delay: -7s; }
.w3 { left: 6vw; bottom: -34vmax; background: radial-gradient(circle, rgba(212, 202, 247, 0.7), rgba(212, 202, 247, 0) 64%); animation-delay: -12s; }
.w4 { right: -8vw; bottom: -30vmax; background: radial-gradient(circle, rgba(196, 236, 216, 0.6), rgba(196, 236, 216, 0) 64%); animation-delay: -16s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vmax, 3vmax) scale(1.12); }
}

/* ---------- top bar: clear over the hero, frosted once the page scrolls ---------- */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--bar-h);
  padding: 0 24px;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.bar.is-scrolled {
  background: rgba(251, 248, 242, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line), 0 10px 28px rgba(20, 41, 74, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--slate);
  transition: opacity 0.35s ease, transform 0.35s var(--ease-out);
}

.brand:hover { text-decoration: none; }
.brand img { display: none; }   /* the logo itself sits in the top-right corner */

.bar:not(.is-scrolled) .brand {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* the section links sit at the right, next to the sound button */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(36, 52, 88, 0.05);
}

.nav a {
  position: relative;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.nav a:hover { background: rgba(80, 102, 149, 0.1); color: var(--accent-strong); text-decoration: none; }
.nav a.is-active { background: var(--accent); color: #fff; }

.nav .nav__pi { margin-left: 9px; color: var(--muted); }

.nav .nav__pi::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -6px;
  width: 1px;
  height: 16px;
  margin-top: -8px;
  background: rgba(20, 41, 74, 0.15);
}

.tools { display: inline-flex; align-items: center; gap: 8px; }

/* the lab's logo in the top-right corner */
.corner-logo { display: inline-flex; margin-left: 6px; }
.corner-logo:hover { text-decoration: none; }

.corner-logo img {
  width: 64px;
  height: auto;
  filter: drop-shadow(0 6px 12px rgba(20, 41, 74, 0.16));
  transition: transform 0.5s var(--ease-out);
}

.corner-logo:hover img { transform: rotate(-8deg) scale(1.08); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lang-switch button {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.lang-en [data-set-lang="en"], .lang-zh [data-set-lang="zh"] { background: var(--accent); color: #fff; }

/* round glass buttons: sound on / off, phone menu */
.sound, .menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--accent);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.sound svg { width: 18px; height: 18px; }
.sound:hover, .menu-btn:hover { background: var(--accent); color: #fff; }
.sound[aria-pressed="false"] { color: var(--muted); }
.sound[aria-pressed="false"]:hover { color: #fff; }
.sound[aria-pressed="true"] .off, .sound[aria-pressed="false"] .on { display: none; }
.sound[hidden] { display: none; }

.menu-btn { display: none; }

.menu-btn__bars { display: grid; gap: 3px; }

.menu-btn__bars span {
  display: block;
  width: 14px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}

.bar.is-open .menu-btn__bars span:nth-child(1) { transform: translateY(4.6px) rotate(45deg); }
.bar.is-open .menu-btn__bars span:nth-child(2) { opacity: 0; }
.bar.is-open .menu-btn__bars span:nth-child(3) { transform: translateY(-4.6px) rotate(-45deg); }

/* ---------- hero: the music-and-painting canvas behind the lab's name ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

/* multiplied onto the paper like watercolour */
#art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#art.is-ready { opacity: 1; }

.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--bar-h) + clamp(24px, 8vh, 90px)) 16px 28px;   /* the title sits a little below the bar */
  text-align: center;
}

.title {
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(58px, min(11vw, 16vh), 128px);   /* smaller on short screens, so the hero fits */
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--slate);
}

/* blue-gray title with a slow light sweeping across; a little extra air before "Lab" */
.title .muse {
  margin-right: 0.16em;
  background: linear-gradient(110deg, #3b4c72 0%, #6278a7 35%, #9ea8be 50%, #6278a7 65%, #3b4c72 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

/* the full name in Fraunces italic, the title's own calligraphic cut */
.subtitle {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 27px);
  font-style: italic;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: #5d6f99;
}

.tagline {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  font-style: italic;
  color: var(--text);
}

.tagline .zh { font-style: normal; letter-spacing: 0.04em; }

.hl {
  padding: 0 4px;
  background: linear-gradient(transparent 56%, rgba(247, 146, 63, 0.32) 56%) no-repeat 0 0 / 100% 100%;
  color: var(--navy);
  animation: hl-draw 1s var(--ease-out) 1.1s both;
}

@keyframes hl-draw {
  from { background-size: 0% 100%; }
  to { background-size: 100% 100%; }
}

.topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 900px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.topics li {
  padding: 8px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(36, 52, 88, 0.06);
  font-size: 16px;
  color: var(--navy);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.topics li:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(36, 52, 88, 0.12);
}

/* all the lab's news, two lines at a time; lab.js moves them up one by one and pauses on hover */
.ticker {
  --row: calc(15px * 1.6 + 8px);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(820px, 100%);
  margin: 24px 0 0;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(36, 52, 88, 0.06);
  text-align: left;
  transition: box-shadow 0.25s ease;
}

.ticker:hover { box-shadow: 0 10px 22px rgba(36, 52, 88, 0.1); }

/* a quiet, greyed lavender */
.ticker__tag {
  flex: none;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #e4dff0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b5482;
}

.ticker__view {
  flex: 1;
  min-width: 0;
  height: calc(var(--row) * 2);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 5px, #000 calc(100% - 5px), transparent);
  mask-image: linear-gradient(transparent, #000 5px, #000 calc(100% - 5px), transparent);
}

.ticker__list { margin: 0; padding: 0; list-style: none; }

.ticker__item {
  display: flex;
  gap: 14px;
  padding: 4px 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.ticker__date {
  flex: none;
  width: 60px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  color: var(--accent);
}

.ticker__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker__text a { color: var(--accent-strong); }
.ticker__icon { margin-right: 6px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 30px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid rgba(20, 41, 74, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 15.5px;
  color: var(--navy);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.btn:hover { transform: translateY(-2px); text-decoration: none; }

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(80, 102, 149, 0.28);
}

.btn.primary:hover { background: #e4dff0; border-color: #e4dff0; color: #5b5482; }   /* the "最新" lavender */

.btn .arrow { transition: transform 0.25s ease; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover .arrow--down { transform: translateY(3px); }

.hint {
  position: relative;
  z-index: 2;
  align-self: center;
  margin: 0 16px 22px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  color: var(--muted);
  transition: opacity 0.8s ease;
}

.hint.is-hidden { opacity: 0; }
.hint-touch { display: none; }

@media (hover: none), (pointer: coarse) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

/* entrance: hero lines float up one after another */
.hero__inner > * { animation: rise 0.9s var(--ease-out) both; }
.hero__inner > :nth-child(2) { animation-delay: 0.08s; }
.hero__inner > :nth-child(3) { animation-delay: 0.18s; }
.hero__inner > :nth-child(4) { animation-delay: 0.28s; }
.hero__inner > :nth-child(5) { animation-delay: 0.38s; }
.hero__inner > :nth-child(6) { animation-delay: 0.48s; }
.hero__inner > :nth-child(7) { animation-delay: 0.58s; }
.hero__inner > :nth-child(8) { animation-delay: 0.68s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- sections ---------- */
main {
  position: relative;
  z-index: 2;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 92px 24px 8px;
}

.section:last-child { padding-bottom: 88px; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 34px;
}

.sec-num {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 600;
  color: var(--orange-deep);
}

.sec-num::after {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.45;
}

.sec-title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--slate);
}

.lang-zh .sec-title { font-weight: 400; letter-spacing: 0.04em; }

.sec-title > span { position: relative; z-index: 1; }

/* a watercolour stroke under each heading, brushed in when it scrolls into view */
.stroke {
  position: absolute;
  left: -8px;
  bottom: -7px;
  z-index: 0;
  width: calc(100% + 18px);
  height: 22px;
  overflow: visible;
}

.stroke path {
  fill: none;
  stroke: var(--stroke, rgba(174, 232, 248, 0.95));
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.js-reveal .stroke path { stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease-out) 0.3s; }
.js-reveal .is-in .stroke path { stroke-dashoffset: 0; }

#work { --stroke: rgba(196, 236, 216, 0.95); }
#news { --stroke: rgba(255, 210, 173, 0.85); }
#about { --stroke: rgba(174, 232, 248, 0.95); }
#research { --stroke: rgba(212, 202, 247, 0.9); }
#publications { --stroke: rgba(255, 196, 150, 0.85); }
#projects { --stroke: rgba(212, 202, 247, 0.9); }
#contact { --stroke: rgba(174, 232, 248, 0.95); }

/* scroll reveal, timed like the homepage: each block floats up as it comes into view
   (only when scripts run and motion is allowed; hover transitions are listed too, as this rule wins) */
.js-reveal .reveal {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.75s var(--ease-out) var(--d, 0s), translate 0.75s var(--ease-out) var(--d, 0s),
    transform 0.3s ease, box-shadow 0.3s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.js-reveal .reveal.is-in { opacity: 1; translate: none; }

/* soft light that follows the pointer (coordinates set in lab.js) */
.spotlight {
  background-image: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), var(--glow), transparent 62%);
}

/* ---------- about ---------- */
/* two columns of equal height: the PI card sits at the bottom of the left one, level with the MUSE card */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 44px;
  align-items: stretch;
}

.about__col { display: flex; flex-direction: column; gap: 26px; }

.about__text p {
  margin: 0;
  font-size: 19px;
  line-height: 1.75;
  color: var(--heading);
}

.about__text strong { color: var(--navy); }

.acronym {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 10px;
  list-style: none;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.acro {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  transition: background-color 0.25s ease;
}

.acro + .acro { border-top: 1px dashed rgba(20, 41, 74, 0.09); }
.acro:hover { background: rgba(255, 255, 255, 0.75); }

.acro__letter {
  flex: none;
  width: 52px;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  color: var(--c);
  transition: transform 0.4s var(--ease-out);
}

.acro:hover .acro__letter { transform: rotate(-8deg) scale(1.1); }
/* the four letters in quiet, greyed tones */
.acro:nth-child(1) { --c: #536078; }
.acro:nth-child(2) { --c: #6f9cad; }
.acro:nth-child(3) { --c: #c49a74; }
.acro:nth-child(4) { --c: #988fba; }

.acro__word { display: block; font-size: 16px; color: var(--heading); }
.acro__word .zh { font-weight: 400; color: var(--muted); }

.acro__body p { margin: 2px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* colours of the research cards, panes and news pictures ("tone" in data/lab.json): a light tint
   deepening a little across the surface; blue, green and pink are the homepage's research tints */
.tone-blue { --tc-bg: #eef5f8; --tc-deep: #d7e8ef; --tc-border: #d5e6ed; --tc-accent: #44707f; --tc-seal: #6d97a8; --glow: rgba(68, 112, 127, 0.13); }
.tone-green { --tc-bg: #eff4ee; --tc-deep: #d9e7d6; --tc-border: #d8e5d6; --tc-accent: #4a6f4f; --tc-seal: #7b9d7c; --glow: rgba(74, 111, 79, 0.13); }
.tone-lavender { --tc-bg: #f4f2fb; --tc-deep: #e3dcf5; --tc-border: #e0dbf3; --tc-accent: #5d548f; --tc-seal: #8a7fc4; --glow: rgba(93, 84, 143, 0.12); }
.tone-pink { --tc-bg: #faf1f3; --tc-deep: #f3dce2; --tc-border: #eed9de; --tc-accent: #94525f; --tc-seal: #bd8492; --glow: rgba(148, 82, 95, 0.12); }
.tone-steel { --tc-bg: #eff1f6; --tc-deep: #dde1ec; --tc-border: #dce0ea; --tc-accent: #4c5875; --tc-seal: #8790ac; --glow: rgba(76, 88, 117, 0.12); }
.tone-sand { --tc-bg: #fbf3e9; --tc-deep: #f3e1ca; --tc-border: #f1dcc4; --tc-accent: #9a5a22; --tc-seal: #d29a5c; --glow: rgba(154, 90, 34, 0.12); }
.tone-mint { --tc-bg: #edf6f3; --tc-deep: #d5ebe2; --tc-border: #d3e9e1; --tc-accent: #3f7466; --tc-seal: #6fa898; --glow: rgba(63, 116, 102, 0.12); }
.tone-peach { --tc-bg: #fcf1ec; --tc-deep: #f4ddd2; --tc-border: #f2dbd1; --tc-accent: #9a5547; --tc-seal: #d49a88; --glow: rgba(154, 85, 71, 0.12); }

/* the arrows beside a section title, for its row of cards */
.sec-tools {
  display: flex;
  gap: 10px;
  margin-left: auto;
  align-self: center;
}

.arrow-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  font-size: 21px;
  color: var(--slate);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.arrow-btn .icon { stroke-width: 2; }
.arrow-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent); color: #fff; }
.arrow-btn:disabled { opacity: 0.35; cursor: default; }

/* a section whose content runs to the window's edges: only its head keeps the page width */
.section--wide { max-width: none; padding-right: 0; padding-left: 0; }

.section__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- rows of cards that scroll sideways (research directions, featured work): the first card
   in line with the page, the row running out to the window's edges (lab.js: arrows and dragging) ---------- */
.rail {
  --edge: max(var(--gutter), calc((100% - 1120px) / 2 + var(--gutter)));
  display: flex;
  gap: 24px;
  padding: 8px var(--edge) 34px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--edge);
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; }
.rail.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.rail img { -webkit-user-drag: none; }

/* ---------- research directions: picture cards, tinted like the homepage cards, one tint per direction ---------- */
.dir {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: min(352px, 82vw);
  border: 1px solid var(--tc-border);
  border-radius: 20px;
  background-color: var(--tc-bg);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dir:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* the direction's illustration as the card's background, fading out towards the bottom behind the text */
.dir__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 0.34;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.55) 55%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, 0.55) 55%, transparent 95%);
  transition: transform 0.8s var(--ease-out), opacity 0.4s ease;
}

.dir:hover .dir__bg { opacity: 0.46; transform: scale(1.04); }

.dir__body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.dir__head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 10px;
}

.dir__seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--tc-seal);
  box-shadow: 0 0 0 3px var(--tc-bg), inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 8px 18px rgba(36, 52, 88, 0.16);
  font-family: var(--font-brush);
  font-size: 34px;
  line-height: 1;
  color: #fff;
  transform: rotate(-6deg);
  transition: transform 0.4s var(--ease-out);
}

.dir:hover .dir__seal { transform: rotate(0deg) scale(1.06); }

/* stamped on when the card comes into view */
.js-reveal .dir .dir__seal { opacity: 0; }
.js-reveal .dir.is-in .dir__seal { opacity: 1; animation: stamp 0.55s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--d, 0s) + 0.35s) backwards; }

@keyframes stamp {
  from { opacity: 0; transform: rotate(-16deg) scale(1.7); }
  to { opacity: 1; transform: rotate(-6deg) scale(1); }
}

.dir__title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
  text-wrap: balance;
}

.lang-zh .dir__title { font-size: 21px; font-weight: 400; letter-spacing: 0.02em; }

.dir__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-soft);
}

/* the direction's topics as small tags */
.dir__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.dir__topics li {
  padding: 3px 11px;
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.6;
  color: var(--heading);
}

.dir__label {
  margin: auto 0 8px;
  padding-top: 18px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tc-accent);
}

.lang-zh .dir__label { letter-spacing: 0.2em; }

.dir__papers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dir__papers a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid var(--tc-border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  color: var(--heading);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dir__papers a:hover {
  border-color: var(--tc-accent);
  background: #fff;
  transform: translateX(3px);
  text-decoration: none;
}

.dir__venue {
  flex: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
  color: var(--tc-accent);
}

.dir__name { font-weight: 600; }

/* ---------- featured work: tall panes, each opening its project page ---------- */
.pane {
  display: flex;
  flex-direction: column;
  width: min(372px, 82vw);
  padding: 30px 30px 26px;
  border: 1px solid var(--tc-border);
  border-radius: 26px;
  background: var(--tc-bg) linear-gradient(165deg, var(--tc-bg) 10%, var(--tc-deep));
  box-shadow: var(--shadow);
  color: var(--text-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pane:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.pane__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--heading);
}

.pane__blurb {
  min-height: calc(1.55em * 3);
  margin: 12px 0 14px;
  font-size: 15.5px;
  line-height: 1.55;
}

.lang-zh .pane__blurb { font-size: 15px; letter-spacing: 0.02em; }

/* the animated picture of what the work does (images/work/*.svg, 400 × 420) */
.pane__visual {
  display: block;
  width: 100%;
  aspect-ratio: 400 / 420;
  height: auto;
  margin: auto 0 18px;   /* pictures and buttons line up across the row whatever the length of the text */
  object-fit: contain;   /* an uploaded picture of another shape */
}

.pane__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.pane__btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.pane__btn:hover { border-color: var(--accent); background: var(--accent); color: #fff; text-decoration: none; transform: translateY(-1px); }
.pane__btn--ghost { border-color: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.62); color: var(--heading); }
.pane__btn--ghost:hover { border-color: #fff; background: #fff; color: var(--accent-strong); }


/* ---------- latest news: headlines in two columns, each with its date, kind and a square picture;
   the whole entry opens the story ---------- */
.stories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-bottom: 1px solid var(--line);
}

.story {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 24px;
  align-items: center;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.story__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--heading);
  text-wrap: balance;
}

.lang-zh .story__title { font-family: var(--font); font-size: 19px; line-height: 1.5; letter-spacing: 0.01em; }

.story__link { color: inherit; }
.story__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.story__link:hover { text-decoration: none; }
.story:hover .story__link { color: var(--accent-strong); }

.story__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.story__meta > * + *::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 12px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  vertical-align: middle;
}

.story__date { font-variant-numeric: tabular-nums; }
.story__more { display: inline-flex; align-items: center; font-weight: 600; color: var(--accent-strong); }
.story__chev { margin-left: 4px; font-size: 1.2em; line-height: 1; transition: transform 0.25s ease; }
.story:hover .story__chev { transform: translateX(3px); }

.story__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--tc-border);
  border-radius: 18px;
  background: var(--tc-bg) linear-gradient(165deg, var(--tc-bg) 10%, var(--tc-deep));
}

.story__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.story:hover .story__thumb img { transform: scale(1.05); }

/* ---------- publications: every paper, by year, filtered by research direction ---------- */
@keyframes feature-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* venue names stand out in the logo's orange, set in Fraunces italic */
.pub-venue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 11px 2px 9px;
  border: 1px solid #f6cba3;
  border-radius: 7px;
  background: linear-gradient(120deg, #fff6ee 0%, var(--orange-soft) 100%);
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--orange-deep);
}

.pub-venue::before {
  content: "\2726";
  font-size: 12px;
  font-style: normal;
  color: var(--orange);
}

.pub-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 2px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: #3b4c72;
  white-space: nowrap;
}

.pub-badge::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.75;
}

.me { font-weight: 700; color: var(--accent); }

.pi__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.pbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.pbtn .icon { font-size: 15px; }

.pbtn:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  text-decoration: none;
}

/* filters by research direction */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.chip[data-filter="all"] { padding-left: 14px; }
.chip:hover { background: #fff; box-shadow: var(--shadow); }
.chip.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }

.chip__seal, .pitem__seal {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--tc-seal, var(--accent));
  font-family: var(--font-brush);
  line-height: 1;
  color: #fff;
}

.chip__seal { width: 24px; height: 24px; font-size: 15px; }

.chip__n {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(80, 102, 149, 0.1);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  color: var(--accent-strong);
}

.chip.is-active .chip__n { background: rgba(255, 255, 255, 0.22); color: #fff; }

.chip--visual, .pitem__seal--visual { --tc-seal: #6d97a8; }
.chip--trust, .pitem__seal--trust { --tc-seal: #7b9d7c; }
.chip--affect, .pitem__seal--affect { --tc-seal: #bd8492; }

/* the full list, one block per year */
.year {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 0 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.year[hidden] { display: none; }

.year__label {
  position: sticky;
  top: calc(var(--bar-h) + 18px);
  align-self: start;
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 34px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  color: rgba(80, 102, 149, 0.5);
}

.plist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pitem {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr) auto;
  grid-template-areas: "venue body seal";
  gap: 14px;
  align-items: start;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pitem:hover { border-color: var(--glass-edge); background: var(--glass-strong); box-shadow: var(--shadow); }
.pitem[hidden] { display: none; }
.pitem.pop { animation: feature-in 0.45s var(--ease-out) both; }

.pitem__venue {
  grid-area: venue;
  justify-self: start;
  padding: 2px 9px;
  border: 1px solid #f6cba3;
  border-radius: 8px;
  background: var(--orange-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.5;
  color: var(--orange-deep);
}

.pitem__venue--muted { border-color: #e3e6ea; background: #f4f5f7; color: var(--muted); }

.pitem__body { grid-area: body; min-width: 0; }
.pitem__title { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.45; color: var(--heading); }
.pitem__authors { display: block; margin-top: 3px; font-size: 13.5px; font-style: italic; color: var(--muted); }

.pitem__extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 5px;
}

.pitem__note { font-size: 12.5px; font-weight: 700; color: var(--accent-strong); }
.pitem__links a { margin-right: 8px; font-size: 13px; font-weight: 700; }

.pitem__seal {
  grid-area: seal;
  width: 28px;
  height: 28px;
  font-size: 18px;
  opacity: 0.85;
  transform: rotate(-6deg);
}

.flash { animation: flash 1.8s ease; }

@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(80, 102, 149, 0); }
  25% { box-shadow: 0 0 0 4px rgba(80, 102, 149, 0.4); }
}

/* ---------- projects: research and industry projects in two columns, a sentence on what each is about ---------- */
.grants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-bottom: 1px solid var(--line);
}

.grant {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.grant__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

/* the role, coloured like the homepage's project badges: dark when leading, grey when taking part */
.grant__role {
  padding: 2px 10px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
}

.grant__role--solid { border-color: var(--accent); background: var(--accent); color: #fff; }
.grant__role--muted { border-color: #e3e6ea; background: #f4f5f7; color: var(--muted); }

.grant__period { font-variant-numeric: tabular-nums; }

.grant__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--heading);
  text-wrap: balance;
}

.grant__brief {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
}

.grant__funder { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- the PI, under the introduction ---------- */
.pi {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background-color: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.pi:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.pi__photo {
  flex: none;
  width: 104px;
  height: 130px;
  object-fit: cover;
  border-radius: 16px;
  background: #9ea8be;
  box-shadow: 0 10px 22px rgba(36, 52, 88, 0.15);
}

.pi__body { min-width: 0; }

.pi__role {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-deep);
}

.pi__name {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--slate);
}

.lang-zh .pi__name { font-weight: 400; letter-spacing: 0.04em; }
.pi__alt { margin-left: 4px; font-size: 0.6em; color: var(--muted); }
.pi__title { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- contact ---------- */
.contact__intro {
  margin: -16px 0 22px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-soft);
}

.contact__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 18px;
  list-style: none;
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.crow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  transition: background-color 0.25s ease;
}

.crow:hover { background: rgba(255, 255, 255, 0.85); }

.crow > .icon {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}

.crow__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.crow__value { font-size: 15.5px; color: var(--heading); overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 34px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.foot p { margin: 0; }
.to-top { display: inline-flex; align-items: center; gap: 6px; }

/* the owner's "✎ 编辑页面" button, only on a device signed in at admin/ (admin/editor.js does the editing) */
.edit-entry {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 40;
  padding: 10px 16px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font: 600 13.5px/1 var(--font);
  color: var(--slate);
  box-shadow: 0 8px 20px rgba(36, 52, 88, 0.14);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.edit-entry:hover { border-color: var(--accent); background: var(--accent); color: #fff; }

/* who took the photos on the research cards (none at the moment) */
.foot .foot__credits { flex-basis: 100%; font-size: 11.5px; line-height: 1.7; opacity: 0.85; }
.foot .foot__credits:empty { display: none; }
.foot__credits a { color: var(--muted); text-decoration: underline; text-decoration-color: rgba(20, 41, 74, 0.18); text-underline-offset: 2px; }
.foot__credits a:hover { color: var(--accent); }

/* ---------- project pages (lab/projects/<slug>/, one template generated by admin/render.js) ---------- */
.bar__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px 7px 9px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 14px;
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.bar__back .icon { font-size: 17px; stroke-width: 2; }
.bar__back:hover { background: var(--accent); color: #fff; text-decoration: none; }

.project {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--bar-h) + 52px) var(--gutter) 64px;
}

.project__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 52px;
  align-items: center;
}

.project__venue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

.project__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--slate);
}

.project__paper {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted);
}

.project__blurb {
  margin: 22px 0 0;
  font-size: 20px;
  line-height: 1.55;
  color: var(--heading);
  text-wrap: pretty;
}

.lang-zh .project__blurb { font-size: 19px; letter-spacing: 0.02em; }

.project__authors { margin: 16px 0 0; font-size: 14px; font-style: italic; color: var(--muted); }

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
}

.project__visual {
  overflow: hidden;
  border: 1px solid var(--tc-border);
  border-radius: 28px;
  background: var(--tc-bg) linear-gradient(165deg, var(--tc-bg) 10%, var(--tc-deep));
  box-shadow: var(--shadow-hover);
}

.project__visual img { display: block; width: 100%; height: auto; }

/* below the hero: a reading column; the figure and the other works take the full width */
.project__section { max-width: 800px; margin: 76px auto 0; }
.project__section--wide { max-width: none; }

.project__h {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--slate);
}

.lang-zh .project__h { font-weight: 400; letter-spacing: 0.04em; }
.project__section--wide .project__h { max-width: 800px; margin-right: auto; margin-left: auto; }

.project__text { margin: 0; font-size: 16.5px; line-height: 1.8; color: var(--text); }

.project__points {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: point;
}

.project__points li {
  position: relative;
  padding: 18px 22px 18px 66px;
  border: 1px solid var(--tc-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.65;
  color: var(--heading);
  counter-increment: point;
}

.project__points li::before {
  content: counter(point, decimal-leading-zero);
  position: absolute;
  top: 15px;
  left: 22px;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 600;
  color: var(--tc-accent);
}

.project__figure {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.project__figure a { display: block; cursor: zoom-in; }
.project__figure img { display: block; width: 100%; height: auto; border-radius: 12px; }
.project__figure figcaption { margin: 12px 8px 2px; font-size: 14px; text-align: center; color: var(--muted); }

.project__bib {
  position: relative;
  border-radius: 18px;
  background: #1d2433;
  color: #e3e9f5;
}

.project__bib pre {
  margin: 0;
  padding: 22px 24px;
  overflow-x: auto;
  font: 13.5px/1.7 ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, Menlo, monospace;
  white-space: pre;
}

.project__copy { position: absolute; top: 12px; right: 12px; }
.project__copy.is-done { border-color: #7bb88a; background: #7bb88a; color: #fff; }
.project__copy.is-done::after { content: "✓"; }

/* the other featured works */
.project__more {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.pcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tc-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text-soft);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); text-decoration: none; }

.pcard__visual {
  display: block;
  aspect-ratio: 1;
  background: var(--tc-bg) linear-gradient(165deg, var(--tc-bg) 10%, var(--tc-deep));
}

.pcard__visual img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pcard__name {
  margin: 14px 16px 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--heading);
}

.pcard__blurb {
  display: -webkit-box;
  margin: 6px 16px 16px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ---------- smaller screens ---------- */
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .bar:not(.is-scrolled) .brand { opacity: 1; transform: none; pointer-events: auto; }

  .nav {
    position: absolute;
    top: calc(var(--bar-h) - 4px);
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 200px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out), visibility 0s 0.25s;
  }

  .bar.is-open .nav {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
  }

  .nav a { padding: 10px 16px; font-size: 15px; }
  .nav .nav__pi { margin: 6px 0 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
  .nav .nav__pi::before { display: none; }

  .about__grid { grid-template-columns: 1fr; }
  .stories { grid-template-columns: 1fr; }
  .grants { grid-template-columns: 1fr; }
  .project__hero { grid-template-columns: 1fr; gap: 32px; }
  .project__visual { max-width: 460px; }
  .project__more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root { --bar-h: 58px; --gutter: 16px; }
  .bar { padding: 0 12px; gap: 8px; }
  .brand { font-size: 18px; gap: 8px; }
  .corner-logo { margin-left: 0; }
  .corner-logo img { width: 44px; }
  .actions { gap: 12px 16px; margin-top: 24px; }
  .btn { padding: 11px 20px; font-size: 15px; }
  .topics { gap: 8px; margin-top: 26px; }
  .topics li { padding: 6px 13px; font-size: 14px; }
  /* phones: the tag on its own line, each item may take two lines */
  .ticker { --row: calc(14px * 1.55 * 2 + 8px); flex-direction: column; gap: 8px; margin-top: 22px; padding: 12px 14px; }
  .ticker__tag { margin-top: 0; }
  .ticker__view { flex: none; width: 100%; height: calc(var(--row) * 2); }
  .ticker__item { gap: 10px; font-size: 14px; line-height: 1.55; }
  .ticker__date { width: 52px; }
  .ticker__text { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .section { padding: 68px 16px 4px; }
  .sec-head { margin-bottom: 24px; }
  .about__text p { font-size: 17px; }
  .section--wide { padding-right: 0; padding-left: 0; }
  .sec-tools { display: none; }   /* phones swipe the rows */
  .rail { gap: 14px; padding-bottom: 26px; }
  .dir { width: min(320px, 84vw); }
  .dir__body { padding: 18px; }
  .pane { width: min(330px, 84vw); padding: 24px 22px 22px; border-radius: 22px; }
  .pane__title { font-size: 26px; }
  .story { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px; padding: 20px 0; }
  .story__more { display: none; }   /* the whole entry is the link */
  .story__title { font-size: 19px; }
  .lang-zh .story__title { font-size: 17px; }
  .story__thumb { border-radius: 14px; }
  .grant { padding: 18px 0; }
  .grant__title { font-size: 16px; }
  .grant__brief { font-size: 14.5px; }
  .year { grid-template-columns: 1fr; padding: 12px 0; }
  .year__label { position: static; margin: 6px 0 6px 4px; font-size: 28px; }
  .pitem { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "venue seal" "body body"; gap: 8px 12px; padding: 12px; }
  .pi { align-items: flex-start; gap: 16px; }
  .pi__photo { width: 84px; height: 105px; }
  .contact__intro { margin: -8px 0 18px; font-size: 15.5px; }
  .contact__list { grid-template-columns: 1fr; padding: 10px; }
  .foot { padding: 20px 16px 30px; }
  .bar__back { padding: 7px; }
  .bar__back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* just the arrow */
  .project { padding-top: calc(var(--bar-h) + 32px); }
  .project__blurb { font-size: 18px; }
  .project__section { margin-top: 56px; }
  .project__h { font-size: 24px; }
  .project__points li { padding: 14px 16px 14px 54px; font-size: 15px; }
  .project__points li::before { left: 16px; top: 12px; font-size: 19px; }
  .project__bib pre { padding: 18px 16px; font-size: 12.5px; }
  .project__copy { top: 8px; right: 8px; }
  .project__more { gap: 12px; }
  .pcard__name { margin: 10px 12px 0; font-size: 17px; }
  .pcard__blurb { margin: 4px 12px 12px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hint, .sound { display: none; }
  .ticker__view { overflow-y: auto; }   /* no auto-scrolling: read on by hand */
  * { transition: none !important; }
}
