/* Jiazhou (Joe) Liang - academic homepage
   Layout: sticky top bar, then a two-column page (left rail + main content). */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-tint: #f1f4f9;
  --text: #1f2328;
  --muted: #5d6570;
  --faint: #8a919b;
  --rule: #e2e5ea;
  --rule-strong: #cfd5de;
  --link: #1e3a6e;
  --link-hover: #0b5394;
  --accent: #c2611a;
  --accent-soft: #fdeed8;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: Menlo, Consolas, "Liberation Mono", monospace;
  --nav-h: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--text); }
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 26px; line-height: 1.25; margin: 0; letter-spacing: -0.005em; }
h3 { font-size: 18px; line-height: 1.35; margin: 0 0 4px; }
p { margin: 0 0 14px; }

/* ---------- Top bar ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1160px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-name { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--text); white-space: nowrap; }
.site-name:hover { color: var(--text); text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.site-nav ul a {
  display: block;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  transition: background-color .2s ease, color .2s ease;
}
.site-nav ul a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.site-nav ul a[aria-current="page"] { background: var(--bg-tint); color: var(--link); font-weight: 600; }

/* ---------- Page grid ---------- */
.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 24px 64px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.rail {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 15px;
}
.rail::-webkit-scrollbar { display: none; }
.content { min-width: 0; }

/* ---------- Profile rail (home) ---------- */
.profile-photo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 457 / 480;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
}
.profile-name { font-size: 25px; margin: 0 0 4px; }
.profile-role { color: var(--muted); margin: 0 0 12px; line-height: 1.45; }
.facts { list-style: none; margin: 0 0 14px; padding: 0; color: var(--muted); }
.facts li { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; line-height: 1.4; }
.facts svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.social a:not(.cv-btn) {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--muted);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.social a:not(.cv-btn):hover { color: var(--link); border-color: var(--link); transform: translateY(-2px); text-decoration: none; }
.social svg { width: 16px; height: 16px; }
.cv-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--link);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color .2s ease, transform .2s ease;
}
.cv-btn:hover { background: var(--link-hover); color: #fff; text-decoration: none; transform: translateY(-1px); }
.cv-btn.wide { display: block; text-align: center; }
.rail-note { display: block; margin-top: 6px; font-size: 13px; color: var(--faint); text-align: center; }

.toc { display: flex; flex-direction: column; border-left: 1px solid var(--rule); }
.toc-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.toc .toc-label { padding-left: 14px; }
.toc a {
  padding: 3px 0 3px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  transition: color .2s ease, border-color .2s ease;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--link); border-left-color: var(--link); font-weight: 600; }

/* ---------- Content blocks ---------- */
.block { margin-bottom: 64px; }
.block:last-child { margin-bottom: 0; }
.block-head { margin-bottom: 20px; }
.block-head.with-link { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.more-link { font-size: 15px; font-weight: 600; white-space: nowrap; }
.more-link span { display: inline-block; transition: transform .2s ease; }
.more-link:hover span { transform: translateX(3px); }
.page-head { margin-bottom: 30px; }
.page-intro { color: var(--muted); max-width: 680px; }
.note { font-size: 14.5px; color: var(--muted); margin-top: -8px; }
.content > .block > h2 { margin-bottom: 18px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }

/* About */
.latest {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 4px 14px 4px 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.latest:hover { border-color: var(--rule-strong); box-shadow: 0 4px 14px rgba(30, 58, 110, .08); text-decoration: none; color: var(--text); }
.latest-tag {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.latest span[aria-hidden] { color: var(--link); transition: transform .2s ease; }
.latest:hover span[aria-hidden] { transform: translateX(3px); }
.lead {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.005em;
}
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 18px 34px;
  align-items: center;
  margin: 6px 0 30px;
}
.hero .stage { grid-column: 2; grid-row: 1; }
.hero .asks { grid-column: 1; grid-row: 1; }
.asks { margin: 0; }
.asks-intro {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--muted);
}
.asks-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.ask {
  --hl: var(--link);
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 30px 14px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--hl) 5%, #fff), #fff 60%);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.ask:hover {
  border-color: color-mix(in srgb, var(--hl) 35%, var(--rule));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--hl) 14%, transparent);
  transform: translateY(-2px);
}
.ask-see   { --hl: #0f766e; }
.ask-mem   { --hl: #1e3a6e; }
.ask-align { --hl: #8a3a8f; }
.ask-show  { --hl: #c2611a; }
.ask-num {
  position: absolute; top: 8px; right: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  color: color-mix(in srgb, var(--hl) 55%, #fff);
}
.ask-fig {
  flex: none;
  width: 84px; height: 59px;
  border: 1px solid color-mix(in srgb, var(--hl) 22%, var(--rule));
  border-radius: 8px;
  background: color-mix(in srgb, var(--hl) 5%, #fff);
  overflow: hidden;
  transition: border-color .3s ease;
}
.mini { display: block; width: 100%; height: 100%; }
.mini [class] { transform-box: view-box; }
.mini text { font: 700 5.6px var(--sans); letter-spacing: .06em; fill: var(--faint); text-anchor: middle; }
.mini .bub rect { fill: #fff; stroke: var(--hl); stroke-width: 1.1; }
.mini .bub path { fill: none; stroke: color-mix(in srgb, var(--hl) 55%, #fff); stroke-width: 1.4; stroke-linecap: round; }
.mini .bub circle { fill: var(--hl); }
.mini .check { fill: none; stroke: var(--hl); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Scenes rest on their final frame; they play while the card is active or hovered. */

/* 01 see: the glasses scan the scene, then box and label each object. */
.mini-see .lens { fill: #fff; stroke: #3b4252; stroke-width: 1.6; }
.mini-see .table { stroke: #c9cfd9; stroke-width: 1.2; }
.mini-see .obj { fill: #fff; stroke: #9aa3b2; stroke-width: 1.1; }
.mini-see .obj-l { fill: none; stroke: #9aa3b2; stroke-width: 1.1; stroke-linecap: round; }
.mini-see .scan { stroke: var(--hl); stroke-width: 1.2; opacity: 0; }
.mini-see .bb rect { fill: none; stroke: var(--hl); stroke-width: 1; stroke-dasharray: 2.5 1.5; }
.mini-see .bb .tag { fill: var(--hl); stroke: none; }
.ask.active .mini-see .scan, .ask:hover .mini-see .scan { animation: see-scan 5s ease-in-out infinite; }
.ask.active .mini-see .b1, .ask:hover .mini-see .b1 { animation: see-b1 5s ease infinite; }
.ask.active .mini-see .b2, .ask:hover .mini-see .b2 { animation: see-b2 5s ease infinite; }
.ask.active .mini-see .b3, .ask:hover .mini-see .b3 { animation: see-b3 5s ease infinite; }
@keyframes see-scan { 0% { opacity: 0; transform: none; } 5% { opacity: .9; } 38% { opacity: .9; transform: translateY(36px); } 42%, 100% { opacity: 0; transform: translateY(36px); } }
@keyframes see-b1 { 0%, 18% { opacity: 0; } 22%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes see-b2 { 0%, 26% { opacity: 0; } 30%, 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes see-b3 { 0%, 34% { opacity: 0; } 38%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* 02 remember: conversations pile up over days; a day-3 question recalls day 1. */
.mini-mem .col { fill: none; stroke: #dfe3e9; stroke-width: 1; stroke-dasharray: 2 2; }
.mini-mem .q { fill: var(--hl); font-size: 8px; }
.mini-mem .recall { fill: none; stroke: var(--hl); stroke-width: 1.3; stroke-dasharray: 3 2.5; }
.mini-mem .m1 rect { fill: color-mix(in srgb, var(--hl) 14%, #fff); }
.ask.active .mini-mem .m1, .ask:hover .mini-mem .m1 { animation: mem-m1 5s ease infinite; }
.ask.active .mini-mem .m2, .ask:hover .mini-mem .m2 { animation: mem-m2 5s ease infinite; }
.ask.active .mini-mem .m3, .ask:hover .mini-mem .m3 { animation: mem-m3 5s ease infinite; }
.ask.active .mini-mem .recall, .ask:hover .mini-mem .recall { animation: mem-recall 5s ease infinite; }
.ask.active .mini-mem .m1 rect, .ask:hover .mini-mem .m1 rect { animation: mem-glow 5s ease infinite; }
@keyframes mem-m1 { 0%, 4% { opacity: 0; transform: translateY(5px); } 12%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes mem-m2 { 0%, 22% { opacity: 0; transform: translateY(5px); } 30%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes mem-m3 { 0%, 40% { opacity: 0; transform: translateY(5px); } 48%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes mem-recall { 0%, 54% { opacity: 0; stroke-dashoffset: 40; } 58% { opacity: 1; } 74%, 94% { opacity: 1; stroke-dashoffset: 0; } 100% { opacity: 0; } }
@keyframes mem-glow { 0%, 72% { fill: #fff; } 78%, 100% { fill: color-mix(in srgb, var(--hl) 24%, #fff); } }

/* 03 aligned: a first guess misses; the user's feedback steers the next one to the centre. */
.mini-align .ring { fill: #fff; stroke: color-mix(in srgb, var(--hl) 45%, #fff); stroke-width: 1.1; }
.mini-align .r3 { fill: var(--hl); stroke: none; }
.mini-align .dart path { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mini-align .d1 path { stroke: #a3a9b4; }
.mini-align .d2 path { stroke: var(--hl); }
.mini-align .r3 { transform-origin: 54px 30px; }
.ask.active .mini-align .d1, .ask:hover .mini-align .d1 { animation: al-d1 5s ease-out infinite; }
.ask.active .mini-align .fb, .ask:hover .mini-align .fb { animation: al-fb 5s ease infinite; }
.ask.active .mini-align .d2, .ask:hover .mini-align .d2 { animation: al-d2 5s ease-out infinite; }
.ask.active .mini-align .r3, .ask:hover .mini-align .r3 { animation: al-hit 5s ease infinite; }
.ask.active .mini-align .check, .ask:hover .mini-align .check { animation: al-check 5s ease infinite; }
@keyframes al-d1 { 0% { opacity: 0; transform: translate(-40px, 6px); } 4% { opacity: 1; } 16%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes al-fb { 0%, 22% { opacity: 0; transform: translateY(4px); } 30%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes al-d2 { 0%, 42% { opacity: 0; transform: translateX(-30px); } 46% { opacity: 1; } 56%, 94% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes al-hit { 0%, 55% { transform: none; } 62% { transform: scale(1.6); } 70%, 100% { transform: none; } }
@keyframes al-check { 0%, 62% { opacity: 0; } 70%, 94% { opacity: 1; } 100% { opacity: 0; } }

/* 04 present: the playhead runs along the day; the card appears exactly at the marked moment. */
.mini-show .tl { stroke: #c9cfd9; stroke-width: 1.4; stroke-linecap: round; }
.mini-show .tick { fill: none; stroke: #c9cfd9; stroke-width: 1.2; stroke-linecap: round; }
.mini-show .moment { fill: var(--hl); }
.mini-show .head line { stroke: #3b4252; stroke-width: 1.3; }
.mini-show .head circle { fill: #3b4252; }
.mini-show .head { transform: translateX(42px); }
.mini-show .hud rect { fill: #fff; stroke: var(--hl); stroke-width: 1.3; }
.mini-show .hud .ln { fill: none; stroke: color-mix(in srgb, var(--hl) 55%, #fff); stroke-width: 1.6; stroke-linecap: round; }
.mini-show .hud .tail { fill: #fff; stroke: var(--hl); stroke-width: 1.2; stroke-linejoin: round; }
.mini-show .hud .spark { fill: var(--hl); }
.mini-show .hud { transform-origin: 50px 34px; }
.ask.active .mini-show .head, .ask:hover .mini-show .head { animation: sh-head 5s linear infinite; }
.ask.active .mini-show .hud, .ask:hover .mini-show .hud { animation: sh-hud 5s cubic-bezier(.3,1.5,.5,1) infinite; }
@keyframes sh-head { 0% { transform: none; } 50%, 100% { transform: translateX(42px); } }
@keyframes sh-hud { 0%, 49% { opacity: 0; transform: scale(.2); } 58%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; transform: scale(.9); } }
.ask-text {
  position: relative;
  font-family: var(--serif);
  font-size: 18.5px; line-height: 1.3; font-weight: 600;
  color: var(--hl);
}
/* Without JS: a plain coloured underline. */
html:not(.js) .ask-text { text-decoration: underline; text-decoration-color: var(--hl); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.js .ask { opacity: 0; transform: translateY(10px); }
.js .ask.on { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease, border-color .25s ease, box-shadow .25s ease; }
.js .ask.on:hover { transform: translateY(-2px); }
.js .asks.playing .ask.on:not(.active) { opacity: .5; filter: saturate(.5); }
.js .ask.on.active {
  border-color: color-mix(in srgb, var(--hl) 55%, var(--rule));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--hl) 16%, transparent), inset 3px 0 0 var(--hl);
  transform: translateX(4px);
}
.ask.active .ask-fig { border-color: color-mix(in srgb, var(--hl) 60%, var(--rule)); }
.js .asks .ask { transition: opacity .45s ease, filter .45s ease, transform .45s ease, border-color .3s ease, box-shadow .3s ease; }
.hl-marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.hl-marks path, .hl-marks line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hl-marks .dot { stroke: none; transform-box: fill-box; transform-origin: center; transform: scale(0); }
.hl-marks .dot.on { transform: scale(1); transition: transform .35s cubic-bezier(.3,1.8,.5,1); }
.hl-marks .scan { stroke-width: 1.5; opacity: 0; }
.lead a.q {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.lead a.q:hover, .lead a.q:focus-visible { color: var(--link); text-decoration-style: solid; text-decoration-color: var(--link); }
.rail-back { font-size: 15px; color: var(--muted); }
.rail-back:hover { color: var(--link); }
.ask { cursor: pointer; }
.ask:focus-visible { outline: 2px solid var(--hl); outline-offset: 3px; }
.ask { scroll-margin-top: calc(var(--nav-h) + 24px); }
.ask:target { outline: 2px solid color-mix(in srgb, var(--hl) 60%, transparent); outline-offset: 3px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; }
.chips li {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--link);
  font-size: 14px;
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.card:hover {
  border-color: var(--rule-strong);
  box-shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 12px 28px rgba(16, 24, 40, .08);
  transform: translateY(-2px);
}
.badge {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--link);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
}

/* Research themes */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.theme { display: flex; gap: 16px; align-items: flex-start; padding: 18px; }
.theme h3 { font-size: 17.5px; margin-bottom: 4px; }
.theme p { margin: 0 0 6px; font-size: 15.5px; line-height: 1.5; color: var(--muted); }
.theme .theme-papers { font-size: 14px; margin: 0; }
.theme:has(.theme-link) { position: relative; cursor: pointer; }
.theme-link { color: inherit; }
.theme-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.theme-link span { display: inline-block; color: var(--link); transition: transform .2s ease; }
.theme:hover .theme-link { color: var(--link); text-decoration: none; }
.theme:hover .theme-link span { transform: translateX(3px); }
.theme .theme-papers a { position: relative; z-index: 1; }

/* Selected publication cards */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pub-card { display: flex; flex-direction: column; overflow: hidden; }
.pub-card .card-fig {
  height: 170px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: #fff;
  padding: 12px;
}
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card-body .badge { align-self: flex-start; }
.pub-card .pub-title { font-size: 16.5px; line-height: 1.35; margin: 2px 0 0; }
.pub-card .pub-authors { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 0; }
.card-links { margin: auto 0 0; padding-top: 6px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.card-links a { font-weight: 600; }

/* ---------- Publication list ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pub-section { margin-bottom: 44px; }
.pub-section > h2 { margin-bottom: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.pubs .pub {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 0;
}
.pubs .pub + .pub { border-top: 1px solid #eef0f3; }
.pub-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pub-thumb {
  display: block;
  width: 100%;
  height: 124px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s ease; }
.pub-thumb:hover, .pub-thumb:focus-visible { border-color: var(--rule-strong); box-shadow: 0 6px 18px rgba(30, 58, 110, .10); }
.pub-thumb:hover img, .card:hover .card-fig img { transform: scale(1.04); }
.pub-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--link);
  font-size: 12.5px;
  font-weight: 600;
}
.pubs .pub-title { font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.38; margin-bottom: 4px; }
.pub-authors { font-size: 15.5px; line-height: 1.5; }
.pub-venue { font-size: 15.5px; color: var(--muted); line-height: 1.5; }
.pub .me { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pub sup { font-size: 0.7em; }
.pub-links { margin-top: 8px; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pub-links a, .pub-links .toggle { font-weight: 600; }
.toggle {
  font: inherit;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.toggle:hover { color: var(--link-hover); text-decoration: underline; }
.toggle[aria-expanded="true"] { color: var(--accent); }
.pub-panel {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: 8px;
}
.pub-panel:not([hidden]) { animation: panel-in .28s ease; }
.pub-panel p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.pub-panel pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bibtex { position: relative; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font: 12.5px var(--sans);
  color: var(--link);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1px 9px;
  cursor: pointer;
}
.copy:hover { border-color: var(--link); }
.year { font-family: var(--sans); color: var(--faint); font-size: 14px; font-weight: 600; letter-spacing: .1em; margin: 20px 0 0; }
.pub.filtered-out { display: none; }
.year-group.empty, .pub-section.empty { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Filters (publications rail) */
.rail-group { display: flex; flex-direction: column; }
.filters { display: flex; flex-direction: column; gap: 4px; }
.filters button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: 15px var(--sans);
  text-align: left;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.filters button:hover { background: var(--bg-soft); color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--bg-tint); color: var(--link); font-weight: 600; }
.filters .n { font-size: 12.5px; color: var(--faint); font-weight: 400; }
.filter-count { display: inline-block; margin-left: 6px; padding: 0 9px; border-radius: 999px; background: var(--bg-soft); font-size: 13.5px; color: var(--muted); }

/* Lightbox */
.lightbox {
  border: 0;
  padding: 20px 20px 14px;
  max-width: min(1000px, 94vw);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
}
.lightbox::backdrop { background: rgba(20, 24, 33, .55); }
.lightbox[open] { animation: panel-in .25s ease; }
.lightbox figure { margin: 0; }
.lightbox img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.lightbox figcaption { margin-top: 10px; font-family: var(--serif); font-size: 15.5px; color: var(--muted); text-align: center; }
.lightbox-close { position: absolute; top: 4px; right: 10px; font-size: 26px; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; }

/* ---------- News timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 92px; top: 8px; bottom: 8px; width: 1px; background: var(--rule); }
.timeline li { display: grid; grid-template-columns: 80px 1fr; gap: 26px; padding: 6px 0; position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 86px;
  top: 15px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--link);
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); }
.timeline time { font-size: 14.5px; color: var(--faint); padding-top: 1px; white-space: nowrap; }
.timeline p { margin: 0; }
.js .timeline li.more { display: none; }
.js .timeline.expanded li.more { display: grid; animation: panel-in .3s ease; }
.more-toggle {
  display: none;
  margin: 10px 0 0 106px;
  font: 600 14.5px var(--sans);
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.js .more-toggle { display: inline-block; }
.more-toggle:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s ease; }
.js [data-reveal].in { opacity: 1; transform: none; }

/* Shared keyframes */
@keyframes ping { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
@keyframes march { to { stroke-dashoffset: -14; } }

/* Theme icons */
.icon { flex: 0 0 48px; width: 48px; height: 48px; overflow: visible; }
.icon * { fill: none; stroke: var(--link); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon .tag, .icon .blink, .icon .dot { fill: #fff; }
.icon .dot.alt { stroke: var(--accent); }
.icon .divider { stroke: #b9c3d6; stroke-dasharray: 3 4; }
.js [data-reveal] .draw * { stroke-dasharray: var(--len, 0); stroke-dashoffset: var(--len, 0); }
.js [data-reveal] .draw .divider { stroke-dasharray: 3 4; stroke-dashoffset: 0; }
.js [data-reveal].in .draw * { animation: draw 1.4s ease forwards; }
.js [data-reveal].in .draw .divider { animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.icon .bob { transform-box: fill-box; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.js [data-reveal].in .icon .bob { animation: bob 3s ease-in-out 1.6s infinite; }
.js [data-reveal].in .icon .blink { animation: draw 1.4s ease forwards, blink 3.6s ease-in-out 1.6s infinite; }
.js [data-reveal].in .icon .b2 { animation-delay: 0s, 2.2s; }
.js [data-reveal].in .icon .b3 { animation-delay: 0s, 2.8s; }
@keyframes blink { 0%, 30%, 100% { fill: #fff; } 12% { fill: #fde7c8; } }
.js [data-reveal].in .icon .tag { animation: draw 1.4s ease forwards, tag 4s ease-in-out 1.6s infinite; }
@keyframes tag { 0%, 100% { fill: #fff; } 50% { fill: #e6ecf5; } }
.js [data-reveal].in .icon .dot { animation: draw 1.4s ease forwards, pulse 3s ease-in-out 1.6s infinite; transform-box: fill-box; transform-origin: center; }
.js [data-reveal].in .icon .d2 { animation-delay: 0s, 2.4s; }
@keyframes pulse { 50% { transform: scale(1.25); } }

/* ---------- CV page ---------- */
.cv-timeline { list-style: none; margin: 0; padding: 0; }
.cv-timeline > li { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 14px 0; }
.cv-timeline > li + li { border-top: 1px solid #eef0f3; }
.cv-timeline time { font-size: 14.5px; color: var(--faint); padding-top: 3px; white-space: nowrap; }
.cv-timeline h3 { font-size: 18px; margin-bottom: 0; }
.cv-org { margin: 0 0 6px; color: var(--muted); font-size: 15.5px; }
.cv-timeline ul, .plain-list { margin: 4px 0 0; padding-left: 20px; }
.cv-timeline li li, .plain-list li { margin: 3px 0; font-size: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--bg-soft); }
.stat strong { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.1; color: var(--link); }
.stat span { font-size: 14px; color: var(--muted); }
.awards { list-style: none; margin: 0; padding: 0; }
.awards li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 6px 0; border-bottom: 1px solid #eef0f3; }
.awards .when { color: var(--faint); font-size: 14.5px; white-space: nowrap; }
.content .chips li { background: var(--bg-soft); color: var(--text); }
#about .chips li { background: var(--bg-tint); color: var(--link); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--bg-soft); }
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 24px 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .page { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .hero .stage, .hero .asks { grid-column: 1; grid-row: auto; }
    .js .ask.on.active { transform: none; }
}
@media (max-width: 820px) {
  .page { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .rail { position: static; max-height: none; overflow: visible; }
  .rail .toc { display: none; }
  .profile { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; }
  .profile-photo { max-width: 112px; border-radius: 12px; }
  .profile-name { font-size: 22px; }
  .filters { flex-direction: row; flex-wrap: wrap; }
  .filters button { width: auto; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 12px; }
  .card-grid, .themes { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 28px; }
  .site-name { font-size: 17px; }
  .nav-inner, .footer-inner { padding-left: 16px; padding-right: 16px; }
  .page { padding-left: 16px; padding-right: 16px; }
  .site-nav ul a { padding: 4px 8px; font-size: 15px; }
  .profile { grid-template-columns: 1fr; }
    .lead { font-size: 21px; }
  .ask-text { font-size: 17.5px; }
  .pubs .pub { grid-template-columns: 1fr; gap: 10px; }
  .pub-side { flex-direction: row; align-items: flex-end; gap: 12px; }
  .pub-thumb { width: 170px; height: 104px; flex: 0 0 auto; }
  .timeline::before { left: 6px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; padding-left: 26px; }
  .timeline li::before { left: 0; }
  .more-toggle { margin-left: 26px; }
  .cv-timeline > li { grid-template-columns: 1fr; gap: 2px; }
  .stat-row { grid-template-columns: 1fr 1fr 1fr; }
  .stat strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js [data-reveal] .draw * { stroke-dashoffset: 0; }
  .js .ask { opacity: 1; transform: none; }
}

@media print {
  .site-nav, .rail, .pub-links, .site-footer, .hero .stage { display: none; }
  .page { display: block; }
}

/* Current focus text under the stage */
.focus-text { margin: 16px 0 0; font-size: 16px; }

/* ---------- Questions page: one continuous story beside the cards ---------- */
.stage { margin: 0; }
.stage-view {
  position: relative;
  aspect-ratio: 460 / 300;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #f4f6f9;
  overflow: hidden;
}
.stage-view .layer { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.stage-cap { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; min-height: 4.4em; font-size: 15.5px; line-height: 1.45; color: var(--muted); }
.stage-num { flex: none; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--accent); }
#stage-text { transition: opacity .25s ease; }
#stage-text.swap { opacity: 0; }
.stage .flash { background: #fff; pointer-events: none; }
#hud { pointer-events: none; }
.stage-btn {
  position: absolute; right: 8px; bottom: 8px; z-index: 3;
  padding: 1px 10px;
  font: 12px var(--sans); color: var(--link);
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer;
}
.stage-btn:hover { border-color: var(--rule-strong); }

/* Map layer: a floor plan the camera tilts (hybrid view), zooms and pans. */
#map-wrap { overflow: hidden; background: linear-gradient(180deg, #e9eef5, #f6f7f9 45%); }
#map { display: block; width: 100%; height: 100%; transform-origin: 50% 62%; }
#map * { vector-effect: non-scaling-stroke; }
#map .grid-line { fill: none; stroke: #e3e7ee; stroke-width: .6; }
#map .apt-bg { fill: #fff; }
#map .w { fill: none; stroke: #3b4252; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#map .ob { fill: #fff; stroke: #9aa3b2; stroke-width: 1.2; }
#map .ol { fill: none; stroke: #9aa3b2; stroke-width: 1.2; }
#map .rm { font: 600 8px var(--sans); letter-spacing: .14em; fill: #a3a9b4; }
#map .cb { fill: #f3e9dc; stroke: #b08968; stroke-width: 1.2; }
#map .rb { fill: #f7d9d6; stroke: #c0392b; stroke-width: 1.2; }
#map .rib { fill: none; stroke: #c0392b; stroke-width: 1.2; }
#map .trail { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .75; }
#map .tr1 { stroke: #0f766e; }
#map .tr2 { stroke: #1e3a6e; }
#map .tr3 { stroke: #8a3a8f; }
#map .pin { fill: #0f766e; stroke: #fff; stroke-width: 1.2; }
#map .pin2 { fill: #1e3a6e; stroke: #fff; stroke-width: 1.2; }
#map .tg rect { fill: #0f766e; }
#map .tg2 rect { fill: #1e3a6e; }
#map .tg text, #map .tg2 text { font: 700 8.5px var(--sans); fill: #fff; }
#map .halo { fill: none; stroke: #c2611a; stroke-width: 2.4; }
#map .cone { fill: rgba(15, 118, 110, .12); stroke: rgba(15, 118, 110, .3); stroke-width: 1; }
#map .hb, #hud .hb { fill: #3b4252; }
#map .hh { fill: #f2d3b6; stroke: #3b4252; stroke-width: 1.4; }
#map .hg { fill: var(--link); }
#map .tl-line { fill: none; stroke: #c9cfd9; stroke-width: 3; stroke-linecap: round; }
#map .tl-dot { fill: #1e3a6e; stroke: #fff; stroke-width: 2; }
#map .tl-day { font: 700 40px var(--sans); letter-spacing: .12em; fill: #1e3a6e; }
#map .tl-sub { font: 400 32px var(--sans); fill: #5d6570; }
#map .recall { fill: none; stroke: #1e3a6e; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; }
#map .recall-cap text { font: 400 34px var(--sans); fill: #5d6570; }
#map .recall-cap .rc2 { font: 700 42px var(--serif); fill: #1e3a6e; }
#map .prop { fill: none; stroke: #8a3a8f; stroke-width: 1.6; stroke-dasharray: 4 3; animation: march 1s linear infinite; }
#map .nope { fill: none; stroke: #c0392b; stroke-width: 2.4; stroke-linecap: round; }
#map .gift rect { fill: #fff; stroke: #c0392b; stroke-width: 1; }
#map .gift text { font: 700 7.5px var(--sans); fill: #c0392b; }
#map .chk circle { fill: #8a3a8f; }
#map .chk path { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
#map .talk { fill: none; stroke-width: 1.6; }
#map .tu { stroke: #3b4252; }
#map .tb { stroke: #8a3a8f; }
#map .glow { fill: rgba(138, 58, 143, .14); }
#map .bot-b { fill: #fff; stroke: #8a3a8f; stroke-width: 1.6; }
#map .eye { fill: #8a3a8f; }
#map .ant { fill: none; stroke: #8a3a8f; stroke-width: 1.6; }
#map .bot { animation: bot-bob 2.4s ease-in-out infinite; }
@keyframes bot-bob { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }

/* First-person layer: the room through the glasses. */
#pov .wall { fill: #f4f5f7; }
#pov .floor { fill: #e8ebf0; }
#pov .persp { fill: none; stroke: #d3d8e0; stroke-width: 1.2; }
#pov .win { fill: #fff; stroke: #cfd5de; stroke-width: 2; }
#pov .win-l { fill: none; stroke: #cfd5de; stroke-width: 2; }
#pov .sofa { fill: #e3e8f0; stroke: #9aa3b2; stroke-width: 1.4; }
#pov .door { fill: #fff; stroke: #9aa3b2; stroke-width: 1.6; }
#pov .knob { fill: #9aa3b2; }
#pov .shelf { fill: #fff; stroke: #9aa3b2; stroke-width: 1.6; }
#pov .shelf-l { fill: none; stroke: #9aa3b2; stroke-width: 1.6; }
#pov .cbox { fill: #f3e9dc; stroke: #b08968; stroke-width: 1.3; }
#pov .rbox { fill: #f7d9d6; stroke: #c0392b; stroke-width: 1.4; }
#pov .rib { fill: none; stroke: #c0392b; stroke-width: 1.4; }
#pov .tbl { fill: #fff; stroke: #9aa3b2; stroke-width: 1.4; stroke-linejoin: round; }
#pov .tbl-l { fill: none; stroke: #9aa3b2; stroke-width: 1.6; }
#pov .mug { fill: #fff; stroke: #1e3a6e; stroke-width: 1.6; }
#pov .mug-h { fill: none; stroke: #1e3a6e; stroke-width: 1.6; }
#pov .vf { fill: none; stroke: #0f766e; stroke-width: 2.4; stroke-linecap: round; }
#pov .scanA { stroke: #0f766e; stroke-width: 1.6; }
#pov .bb { fill: rgba(15, 118, 110, .06); stroke: #0f766e; stroke-width: 1.4; stroke-dasharray: 5 3; }
#pov .dt { fill: #0f766e; }
#pov .det text { font: 700 10.5px var(--sans); fill: #fff; }
#pov .roomchip rect { fill: rgba(255, 255, 255, .92); stroke: #0f766e; stroke-width: 1.2; }
#pov .roomchip text { font: 700 11px var(--sans); fill: #0f766e; }
#pov .lead { fill: none; stroke: #c2611a; stroke-width: 1.4; stroke-dasharray: 4 3; animation: march 1s linear infinite; }
#pov .lab rect { fill: rgba(255, 247, 239, .95); stroke: #c2611a; stroke-width: 1.2; }
#pov .lab text { font: 600 12px var(--sans); fill: #8a3f0e; }
#pov .bell { fill: none; stroke: #c2611a; stroke-width: 2; stroke-linecap: round; }
#pov .note rect { fill: #fff; stroke: #c2611a; stroke-width: 1.6; }
#pov .note-i { fill: #c2611a; }
#pov .note text { font: 400 12px var(--sans); fill: #3b4252; }
#pov .note .nb { font-weight: 700; fill: #8a3f0e; }
#pov .gaze circle { fill: none; stroke: #c2611a; stroke-width: 1.6; }
#pov .gaze .gd { fill: #c2611a; stroke: none; }
#pov .gaze path { fill: none; stroke: #c2611a; stroke-width: 1.6; stroke-linecap: round; }
#pov .frameD { transform-box: view-box; transform-origin: 230px 150px; }
#pov .frame { fill: #1f2630; }
#pov .rim { fill: none; stroke: #3b4252; stroke-width: 5; }

/* Screen overlay: chat panel and day badge. */
#hud .panel { fill: rgba(255, 255, 255, .94); stroke: #e2e5ea; stroke-width: 1; }
#hud .say rect { fill: #fff; stroke: #c4cad4; stroke-width: 1; }
#hud .bot-say rect { fill: #f6eef6; stroke: #8a3a8f; }
#hud .say text, #hud .pref text { font: 400 10.6px var(--sans); fill: #1f2328; }
#hud .say .b { font-weight: 700; fill: #3b4252; }
#hud .bot-say .b { fill: #8a3a8f; }
#hud .pref rect { fill: #fff; stroke: #8a3a8f; stroke-width: 1; stroke-dasharray: 3 2; }
#hud .pref .b { font-weight: 700; fill: #8a3a8f; }
#hud .badge rect { fill: rgba(255, 255, 255, .92); stroke: #cfd5de; stroke-width: 1; }
#hud .badge text { font: 700 10.5px var(--sans); letter-spacing: .12em; fill: #1e3a6e; }
