/* Chengzhi Liu, academic homepage */
:root {
  --bg: #ffffff;
  --outer-bg: #f3f6fa;
  --frame-line: #e0e7f0;
  --surface: #ffffff;
  --sunk: #f6f8fb;
  --ink: #0f1e33;
  --ink-2: #3a4a61;
  --muted: #66758b;
  --line: #e4e9f0;
  --accent: #1d5bd6;
  --accent-ink: #1849ad;
  --accent-soft: #edf3fe;
  --tide: #8bb6f3;
  --field: 29, 91, 214;
  --shadow: 0 1px 2px rgba(15, 30, 51, .05), 0 8px 24px -12px rgba(15, 30, 51, .16);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(20px, 3.2vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #08111f;
  --outer-bg: #070d17;
  --frame-line: #1d2b40;
  --surface: #0d1829;
  --sunk: #0b1525;
  --ink: #e6edf8;
  --ink-2: #b6c3d6;
  --muted: #8494ab;
  --line: #1b2940;
  --accent: #6ea8ff;
  --accent-ink: #9cc3ff;
  --accent-soft: #11223b;
  --tide: #3d6db3;
  --field: 110, 168, 255;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  isolation: isolate;
  margin: 0; background: var(--outer-bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.page-frame { width: min(var(--wrap), calc(100% - 48px)); margin: 0 auto 28px; background: var(--bg); border: 1px solid var(--frame-line); border-top: 3px solid var(--accent); border-radius: 3px; box-shadow: 0 8px 36px -18px rgba(15, 40, 80, .16); }
.hero { border-radius: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent-ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease), color .2s; }
a:hover { background-size: 100% 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0 0 1em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
.anchor-alias { position: absolute; display: block; width: 0; height: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--accent); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* progress + header */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--tide), var(--accent)); }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--outer-bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s, background-color .35s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { width: min(var(--wrap), calc(100% - 48px)); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 24px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 500 17px/1 var(--serif); background: none; }
.mark svg { width: 30px; height: 30px; color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 14px; padding: 7px 9px; border-bottom: 2px solid transparent; background: none; transition: color .2s, border-color .2s; }
.nav a:hover { color: var(--accent-ink); border-bottom-color: var(--tide); }
.nav a.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.header-actions { display: flex; gap: 6px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color .2s, border-color .2s, transform .5s var(--ease); }
.icon-btn:hover { color: var(--accent); border-color: var(--tide); }
.icon-btn svg { width: 18px; height: 18px; grid-area: 1 / 1; transition: opacity .3s, transform .5s var(--ease); }
#theme-toggle .i-sun, :root[data-theme="dark"] #theme-toggle .i-moon { opacity: 0; transform: rotate(-90deg) scale(.6); }
:root[data-theme="dark"] #theme-toggle .i-sun { opacity: 1; transform: none; }

/* hero */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 32px 0 0; }
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%); }
.hero::before { content: ""; position: absolute; z-index: -2; width: 720px; height: 720px; right: -220px; top: -320px; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--field), .10), transparent); }
.hero-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 42px; align-items: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(var(--field), .5); animation: pulse 2.4s var(--ease) infinite; }
h1 { font: 500 clamp(34px, 4vw, 46px)/1.1 var(--serif); letter-spacing: -.02em; margin-bottom: 12px; }
.lede { font: 500 19px/1.45 var(--serif); color: var(--accent-ink); margin-bottom: 16px; }
.hero-copy > p:not(.lede) { color: var(--ink-2); margin-bottom: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 500; background: var(--surface); transition: border-color .2s, color .2s, transform .25s var(--ease), box-shadow .25s; }
.link-btn svg { width: 17px; height: 17px; color: var(--accent); }
.link-btn:hover { border-color: var(--tide); color: var(--accent-ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.link-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-btn.primary svg { color: #fff; }
:root[data-theme="dark"] .link-btn.primary { color: #06101e; }
:root[data-theme="dark"] .link-btn.primary svg { color: #06101e; }
.link-btn.primary:hover { color: #fff; background: var(--accent-ink); }
:root[data-theme="dark"] .link-btn.primary:hover { color: #06101e; }

.portrait { position: relative; margin: 0; justify-self: center; width: 100%; max-width: 230px; }
.portrait img { position: relative; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; border: 5px solid var(--surface); border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 8px 10px 0 var(--accent-soft); }
.orbit { position: absolute; inset: -22px; opacity: .65; color: var(--accent); pointer-events: none; }
.orbit svg { width: 100%; height: 100%; animation: spin 40s linear infinite; }
.orbit-track { stroke: var(--tide); stroke-width: .6; stroke-dasharray: 2 5; opacity: .9; }
.orbit-sat { fill: var(--accent); stroke: none; }
.orbit-sat.dim { fill: var(--tide); }
.portrait figcaption { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.pin { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.affiliations { list-style: none; margin: 24px var(--gutter) 0; padding: 12px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.affiliations li + li { border-left: 1px solid var(--line); }
.affiliations li { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.affiliations a { display: grid; place-items: center; height: 28px; background: none; }
.affiliations img { height: 22px; width: auto; max-width: 140px; filter: none; opacity: 1; transition: filter .3s, opacity .3s, transform .3s var(--ease); }
.affiliations .logo-ucsb { height: 10px; }
.affiliations a:hover img { filter: none; opacity: 1; transform: translateY(-1px); }
.affiliations span { color: var(--muted); font-size: 13.5px; }
:root[data-theme="dark"] .logo-ucsb, :root[data-theme="dark"] .logo-liv { filter: brightness(0) saturate(100%) invert(80%) sepia(28%) saturate(680%) hue-rotate(179deg); }
:root[data-theme="dark"] .affiliations a:hover .logo-ucsb, :root[data-theme="dark"] .affiliations a:hover .logo-liv { filter: brightness(0) saturate(100%) invert(80%) sepia(28%) saturate(680%) hue-rotate(179deg); }

/* sections */
.section { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 30px var(--gutter) 0; display: block; }
.section > h2 { display: flex; align-items: center; gap: 18px; font: 600 25px/1.2 var(--serif); letter-spacing: -.01em; margin-bottom: 18px; color: var(--ink); }
.section > h2::after { content: ""; display: block; flex: 1; height: 1px; background: linear-gradient(90deg, var(--tide), var(--line)); }
.section-body { min-width: 0; }

/* research */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; }
.theme { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: center; padding: 4px 22px; text-align: center; }
.theme + .theme::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.theme:hover .theme-art { transform: translateY(-3px); }
.theme-art { display: block; grid-row: auto; width: 180px; height: 108px; max-width: 100%; color: var(--accent); margin-bottom: 14px; padding: 0; background: transparent; border: 0; overflow: visible; transition: transform .3s; }
.theme h3 { display: flex; align-items: center; justify-content: center; min-height: 2.5em; font: 600 18px/1.25 var(--serif); margin-bottom: 10px; }
.theme p { max-width: 40ch; color: var(--ink-2); font-size: 14px; line-height: 1.5; margin: 0; }
.research-diagram { stroke-width: 1.35; }
.research-diagram text { fill: var(--accent-ink); stroke: none; text-anchor: middle; font: 500 11px var(--sans); }
.art-node { fill: var(--surface); stroke: var(--tide); }
.art-core { fill: var(--accent-soft); stroke: var(--accent); }
.art-halo { fill: var(--accent-soft); stroke: var(--tide); opacity: .5; animation: research-halo 5s ease-in-out infinite alternate; }
.art-guide { stroke: var(--tide); opacity: .55; }
.art-signal { stroke: var(--accent); stroke-dasharray: 3 9; animation: research-signal 3.5s linear infinite; }
.art-arrow { stroke: var(--accent); }
.art-check { stroke-width: 2.5; }
@keyframes research-signal { to { stroke-dashoffset: -48; } }
@keyframes research-halo { to { opacity: .9; } }

/* news */
#news .section-body { width: 100%; max-width: 920px; margin-inline: auto; }
.news-window { height: 290px; overflow-y: auto; overscroll-behavior-y: auto; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: var(--tide) var(--accent-soft); background: color-mix(in srgb,var(--accent-soft) 35%,var(--surface)); border: 0; border-left: 2px solid var(--tide); border-radius: 0 6px 6px 0; padding: 8px 18px; }
.news-window::-webkit-scrollbar { width: 10px; }
.news-window::-webkit-scrollbar-thumb { background: var(--tide); border-radius: 8px; }
.news-window::-webkit-scrollbar-track { background: var(--accent-soft); }
.timeline { position: relative; list-style: none; margin: 0; padding: 0; }
.timeline::after { content: ""; position: absolute; pointer-events: none; left: 105px; top: 21px; width: 2px; height: var(--news-progress, 0px); background: var(--accent); }
.timeline li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 34px; position: relative; padding: 9px 0; color: var(--ink-2); }
.timeline li::after { content: ""; position: absolute; left: 105px; top: 0; bottom: 0; width: 2px; background: var(--tide); opacity: .65; }
.timeline li:first-child::after { top: 20px; }
.timeline li:last-child::after { bottom: calc(100% - 20px); }
.timeline li::before { content: ""; position: absolute; z-index: 2; left: 101px; top: 16px; width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.timeline li::before { transition: background .22s ease, box-shadow .22s ease, transform .22s ease; }
.timeline li.is-read::before { background: var(--accent); }
.timeline li.is-current::before { background: var(--accent); transform: scale(1.25); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px color-mix(in srgb,var(--accent) 32%,transparent); }
.timeline li.is-current time { color: var(--accent); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .timeline li::before { transition: none; } }
.timeline time { color: var(--accent-ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; padding-top: 1px; }
.timeline p { margin: 0; color: var(--ink-2); }
.timeline strong { color: var(--ink); font-weight: 600; }
.news-hint { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin: 8px 2px 0; }

/* publications */
.pub-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font: 500 14px/1 var(--sans); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 8px 12px; cursor: pointer; transition: all .2s; }
.filters button span { color: var(--muted); margin-left: 3px; font-variant-numeric: tabular-nums; }
.filters button:hover { border-color: var(--tide); }
.filters button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--tide); color: var(--accent-ink); }
.filters button[aria-pressed="true"] span { color: var(--accent-ink); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); min-width: 230px; transition: border-color .2s; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { border: 0; outline: 0; background: none; color: var(--ink); font: 400 14.5px var(--sans); padding: 9px 0; width: 100%; }
.pub-note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.result-count { color: var(--muted); font-size: 14px; margin: 4px 0 0; min-height: 1em; }
.year { font: 500 15px/1 var(--sans); color: var(--muted); margin: 14px 0 2px; display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pub { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pub:last-of-type { border-bottom: 0; }
.pub[hidden], .year[hidden] { display: none; }
.pub-meta { float: right; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 5px 14px; }
.pub-body::after { content: ""; display: block; clear: both; }
.venue, .honor { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 6px; letter-spacing: .01em; }
.venue { --v: 29, 91, 214; color: rgb(var(--v)); background: rgba(var(--v), .09); }
.v-neurips { --v: 91, 76, 196; }
.v-cvpr { --v: 22, 112, 196; }
.v-iclr { --v: 13, 132, 120; }
.v-aaai { --v: 176, 74, 32; }
.v-aacl { --v: 160, 98, 16; }
.v-pre { --v: 92, 106, 128; }
:root[data-theme="dark"] .venue { color: rgb(var(--v)); filter: brightness(1.75) saturate(.9); background: rgba(var(--v), .18); }
.honor { color: #a14a00; background: #fff3e2; }
.honor::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; }
:root[data-theme="dark"] .honor { color: #ffc27a; background: rgba(255, 170, 70, .12); }
.pub h4 { font: 600 18px/1.35 var(--serif); margin-bottom: 5px; color: var(--accent-ink); }
.pub h4 a { color: inherit; }
.pub h4 a:hover { color: var(--accent); }
.authors { color: var(--ink-2); font-size: 14px; line-height: 1.45; margin-bottom: 3px; }
.authors b { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--tide); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.summary { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-links a { font-size: 13px; font-weight: 500; padding: 0 8px 0 0; color: var(--accent-ink); background: none; }
.pub-links a::before { content: "["; margin-right: 2px; color: var(--muted); }
.pub-links a::after { content: "]"; margin-left: 2px; color: var(--muted); }
.pub-links a:hover { color: var(--accent-ink); border-color: var(--tide); background: var(--accent-soft); }
.empty-state { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; margin-top: 16px; }
mark { background: rgba(var(--field), .18); color: inherit; border-radius: 3px; padding: 0 1px; }

/* experience */
.exp { list-style: none; margin: 0; padding: 0; }
.exp li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.exp li:first-child { padding-top: 0; }
.exp-logo { height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 12px; }
.exp-logo img { height: 24px; width: auto; max-width: 100%; }
.exp-logo .logo-ucsb { height: 10px; }
:root[data-theme="dark"] .exp-logo .logo-ucsb, :root[data-theme="dark"] .exp-logo .logo-liv { filter: none; }
.exp h3 { font: 500 18px/1.3 var(--serif); }
.exp p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.exp time { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* service */
#service { display: block; }

.service-list { margin: 0; padding-left: 22px; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.service-list li { padding-left: 5px; margin-bottom: 6px; }
.service-list li::marker { color: var(--accent); }
.service-list strong { font-weight: 600; color: var(--ink); }
.invited-talks { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.service h3 { font: 500 18px/1.3 var(--serif); margin-bottom: 10px; }
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.talks li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; color: var(--ink-2); font-size: 15px; }
.talks time { color: var(--muted); font-size: 14px; padding-top: 1px; }
.talks small { display: block; color: var(--muted); font-size: 13.5px; }

/* contact + footer */
.contact { margin: 28px var(--gutter) 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; }
.contact p { flex: 1 1 420px; margin: 0; font: 400 18px/1.45 var(--serif); color: var(--ink-2); }
.visitor-section { margin: 28px var(--gutter) 0; padding: 26px 0 4px; border-top: 1px solid var(--line); text-align: center; }
.visitor-section h2 { font: 500 24px/1.25 var(--serif); color: var(--ink); }
.visitor-caption { margin: 6px 0 18px; color: var(--muted); font-size: 14px; }
.visitor-map { width: 100%; max-width: 420px; min-height: 160px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #1d5bd6; }
.visitor-map img { width: 100%; }
.visitor-details { display: inline-block; font-size: 13px; font-weight: 500; }
.visitor-note { max-width: 420px; margin: 8px auto 0; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.site-footer { max-width: var(--wrap); margin: 22px auto 0; padding: 14px var(--gutter) 20px; border-top: 0; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12.5px; }
.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 20; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

/* entrance */
.hero-copy > *, .portrait { animation: rise .8s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
.hero-copy > :nth-child(5) { animation-delay: .24s; }
.hero-copy > :nth-child(6) { animation-delay: .3s; }
.portrait { animation-delay: .15s; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -18; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--field), .45); } 80%, 100% { box-shadow: 0 0 0 9px rgba(var(--field), 0); } }
@keyframes frame { 0%, 100% { fill: transparent; } 30% { fill: rgba(var(--field), .2); } }
@keyframes draw { 0% { stroke-dashoffset: 44; } 40%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -44; } }
@keyframes scan { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }
@keyframes hot { 0%, 100% { fill-opacity: .4; } 50% { fill-opacity: 1; } }
@keyframes travel { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(268px); } }
@keyframes lens { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-90px, -14px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes zoomin { from { opacity: 0; transform: scale(.96); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* responsive */
@media (max-width: 920px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero-inner { grid-template-columns: minmax(0, 1fr) 170px; gap: 26px; }
  .portrait { max-width: 170px; }
  .portrait figcaption { justify-content: flex-start; margin-left: -8px; }
  .section { grid-template-columns: 1fr; }
  .section > h2 { position: static; }
  .themes { grid-template-columns: 1fr; gap: 22px; }
  .theme { grid-template-columns: 144px minmax(0,1fr); column-gap: 20px; padding: 4px 0; text-align: left; justify-items: stretch; }
  .theme h3 { display: block; min-height: 0; margin-bottom: 7px; }
  .theme p { max-width: none; }
  .theme-art { grid-row: 1 / 3; width: 144px; height: 90px; margin-bottom: 0; align-self: center; }
  .theme + .theme::before { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .theme { grid-template-columns: 112px minmax(0,1fr); column-gap: 16px; }
  .theme-art { width: 112px; height: 76px; }
  .hero { padding-top: 20px; }
  .hero-inner { grid-template-columns: 1fr; gap: 18px; }
  .portrait { order: -1; width: 100px; justify-self: start; margin-left: 10px; }
  .portrait img { aspect-ratio: 1; }
  .portrait figcaption { display: none; }
  .affiliations { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .affiliations li { flex-direction: column; gap: 4px; }
  .affiliations img { max-width: 90px; max-height: 22px; }
  .affiliations .logo-ucsb { height: 7px; }
  .affiliations span { font-size: 11px; }
  .pub-meta { float: none; margin: 0 0 5px; }
  .section { padding-top: 24px; }
  .news-window { height: 310px; padding: 8px 15px; }
  .page-frame { width: calc(100% - 16px); margin: 0 auto 16px; border-radius: 3px; }
  .header-inner { width: 100%; padding: 10px 20px; }
  .affiliations { margin-top: 20px; }
  .affiliations li + li { border: 0; }
  .timeline li { grid-template-columns: 65px minmax(0, 1fr); gap: 24px; padding: 9px 0; }
  .timeline li::before { left: 73px; }
  .timeline li::after, .timeline::after { left: 77px; }
  .timeline time { font-size: 13px; }
  .exp li { grid-template-columns: 1fr; gap: 10px; }
  .exp-logo { width: 120px; }
  .search { min-width: 0; width: 100%; }
  .mark span { display: none; }
}
@media print {
  .news-window { height: auto; overflow: visible; }
  .news-hint { display: none; }
  .site-header, .field, .to-top, .progress, .pub-tools, .orbit { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Publication preview: all papers remain available without JavaScript. */
.papers-toggle { margin-top: 12px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font: 500 14px/1.4 var(--sans); cursor: pointer; transition: border-color .2s, background .2s; }
.papers-toggle:hover { border-color: var(--tide); background: var(--sunk); }
.papers-toggle span { margin-left: 8px; }
.papers-toggle[hidden] { display: none; }
@media print {
  .papers-toggle, .result-count, .empty-state { display: none !important; }
  .pub[hidden], .year[hidden] { display: block; }
}

@media print { .page-frame { width: 100%; margin: 0; border: 0; box-shadow: none; } }


/* A personal compass monogram, photo stack, and travelling scholar. */
.mark svg.personal-logo { width: 43px; height: 43px; flex-shrink: 0; }
.mark { gap: 9px; }
.portrait-trigger { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; color: white; isolation: isolate; }
.portrait-trigger img { display: block; transition: transform .55s var(--ease), box-shadow .55s var(--ease); }
.portrait-trigger .photo-back { position: absolute; inset: 0; height: 100%; transform: rotate(6deg) translate(9px,-3px); object-position: 50% 55%; box-shadow: 0 2px 12px #142a4820; }
.portrait-trigger .photo-front { transform: rotate(-2deg); box-shadow: 0 4px 16px #142a4820; }
.portrait-trigger:hover .photo-back, .portrait-trigger:focus-visible .photo-back { transform: rotate(11deg) translate(19px,-6px); }
.portrait-trigger:hover .photo-front, .portrait-trigger:focus-visible .photo-front { transform: rotate(-5deg) translate(-6px,2px); }
.photo-hint { position: absolute; bottom: 14px; left: 8px; right: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 4px; border-radius: 4px; background: #102743c9; font: 500 11px/1.2 var(--sans); backdrop-filter: blur(8px); }
.photo-hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.album-open { overflow: hidden; }
.photo-gallery { width: min(1040px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 24px 32px 30px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); overflow: auto; box-shadow: 0 30px 100px #06112755; }
.photo-gallery::backdrop { background: #061127b8; backdrop-filter: blur(9px); }
.gallery-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.gallery-eyebrow { font: 600 10px/1.5 var(--sans); color: var(--accent); letter-spacing: .18em; }
.gallery-header h2 { font: 500 28px/1.2 var(--serif); margin: 5px 0 0; }
.gallery-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font: 400 28px/1 var(--sans); cursor: pointer; flex-shrink: 0; }
.gallery-spread { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; padding: 12px 9px; }
.gallery-card { margin: 0; padding: 8px 8px 0; border: 1px solid var(--line); background: var(--bg); box-shadow: 0 8px 22px #0c254515; transform: rotate(-3deg); }
.gallery-card:nth-child(2) { transform: rotate(3deg); }
.gallery-card img { width: 100%; height: min(50vh,400px); object-fit: contain; background: var(--surface); display: block; }
.gallery-card figcaption { padding: 12px 0; color: var(--ink-2); text-align: center; font: 400 16px/1.3 var(--serif); }
.photo-gallery[open] .gallery-card { animation: album-unfold .65s var(--ease) both; }
.photo-gallery[open] .gallery-card:nth-child(2) { animation-name: album-unfold-right; }
@keyframes album-unfold { from { opacity: 0; transform: translate(28%,12%) rotate(9deg) scale(.86); } to { opacity: 1; transform: rotate(-3deg); } }
@keyframes album-unfold-right { from { opacity: 0; transform: translate(-28%,12%) rotate(-9deg) scale(.86); } to { opacity: 1; transform: rotate(3deg); } }
.scroll-explorer { position: fixed; z-index: 15; right: max(1px,calc((100vw - 1330px)/2)); top: 0; width: 57px; color: var(--accent); pointer-events: none; transform: translateY(var(--explorer-y,88px)); will-change: transform; }
.scroll-explorer svg { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 3px 3px #17345112); }
.explorer-person { animation: explorer-breathe 3s ease-in-out infinite; transform-origin: 44px 85px; }
.explorer-leg { transform-origin: 40px 82px; }
.walking .leg-front { animation: explorer-stride .38s ease-in-out infinite alternate; }
.walking .leg-back { animation: explorer-stride .38s ease-in-out infinite alternate-reverse; }
.walking .explorer-person { animation: explorer-breathe .38s ease-in-out infinite; }
.explorer-arm { transform-origin: 48px 63px; animation: explorer-map 4s ease-in-out infinite; }
.explorer-spark { animation: explorer-glint 3s ease-in-out infinite; }
@keyframes explorer-stride { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes explorer-breathe { 50% { transform: translateY(-2px); } }
@keyframes explorer-map { 50% { transform: rotate(-7deg); } }
@keyframes explorer-glint { 50% { opacity: .25; } }
@media (max-width: 640px) {
  .mark svg.personal-logo { width: 36px; height: 36px; }
  .photo-hint { left: auto; right: -4px; bottom: 0; font-size: 0; padding: 6px; gap: 0; }
  .photo-hint > span { display: none; }
  .photo-gallery { padding: 18px 16px; }
  .gallery-header h2 { font-size: 22px; }
  .gallery-spread { gap: 14px; padding: 5px 0; }
  .gallery-card { padding: 4px 4px 0; }
  .gallery-card img { height: auto; aspect-ratio: 3 / 4; }
  .gallery-card figcaption { font-size: 12px; padding: 9px 2px; }
  .scroll-explorer { width: 30px; right: 0; opacity: .88; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-gallery[open] .gallery-card, .explorer-person, .explorer-arm, .explorer-spark, .walking .explorer-leg { animation: none; }
  .portrait-trigger img { transition: none; }
}
@media print { .scroll-explorer, .photo-gallery, .photo-hint, .photo-back { display: none !important; } }


/* A taller, narrower archive with explicit scrolling controls. */
.news-hint { justify-content: space-between; font-size: 12px; }
.news-controls { display: flex; gap: 6px; }
.news-controls button { width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 5px; color: var(--accent); background: var(--surface); font: 500 18px/1 var(--sans); cursor: pointer; }
.news-controls button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--tide); }
.news-controls button:disabled { opacity: .3; cursor: default; }

/* Pointer decoration never intercepts links, selection, or scrolling. */
.pointer-effects { position: fixed; inset: 0; overflow: hidden; z-index: 80; pointer-events: none; }
.cursor-glow { position: absolute; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--tide); box-shadow: 0 0 0 5px color-mix(in srgb,var(--tide) 10%,transparent),0 0 17px 5px color-mix(in srgb,var(--tide) 24%,transparent); z-index: 80; pointer-events: none; opacity: 0; transition: opacity .2s; will-change: transform; }
.cursor-glow.visible { opacity: .8; }
.scholar-click { position: absolute; width: 52px; height: 52px; margin: -38px 0 0 -26px; z-index: 81; pointer-events: none; animation: cap-lift 1.15s ease-out both; }
.scholar-click svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 6px #1d63ce40); }
.scholar-click::after { content: ''; position: absolute; inset: 12px; border: 1px solid var(--tide); border-radius: 50%; animation: cap-ripple .75s ease-out both; }
@keyframes cap-lift { 0% { opacity: 0; transform: translateY(8px) rotate(-12deg) scale(.55); } 18% { opacity: 1; transform: translateY(-4px) rotate(5deg) scale(1); } 62% { opacity: .9; } 100% { opacity: 0; transform: translateY(-52px) rotate(-8deg) scale(.85); } }
@keyframes cap-ripple { from { opacity: .6; transform: translateY(14px) scale(.2); } to { opacity: 0; transform: translateY(14px) scale(2.5); } }
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) { .cursor-glow, .scholar-click { display: none; } }
@media print { .news-controls, .cursor-glow, .scholar-click { display: none !important; } }


/* The landscape continues along the margins; body copy stays on paper. */
.ambient-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.field { pointer-events: none; -webkit-mask-image: linear-gradient(180deg,#000 0%,#000 75%,transparent 100%); mask-image: linear-gradient(180deg,#000 0%,#000 75%,transparent 100%); }
.hero::before { background: radial-gradient(closest-side,rgba(var(--field),.06),transparent); }
.portrait-trigger .photo-third { position: absolute; inset: 0; height: 100%; object-fit: cover; object-position: 50% 55%; transform: rotate(-7deg) translate(-5px,-7px); box-shadow: 0 2px 12px #142a4820; }
.portrait-trigger:hover .photo-third, .portrait-trigger:focus-visible .photo-third { transform: rotate(-12deg) translate(-14px,-12px); }
.gallery-card:nth-child(2) { transform: rotate(1deg); }
.gallery-card:nth-child(3) { transform: rotate(3deg); }
.photo-gallery[open] .gallery-card:nth-child(2) { animation: album-unfold-center .65s var(--ease) both; }
.photo-gallery[open] .gallery-card:nth-child(3) { animation: album-unfold-right .7s var(--ease) both; }
.gallery-swipe { display: none; }
@keyframes album-unfold-center { from { opacity: 0; transform: translateY(12%) scale(.86); } to { opacity: 1; transform: rotate(1deg); } }
@media (max-width: 640px) {
  .gallery-spread { display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 12px 10px 20px; scrollbar-width: thin; scrollbar-color: var(--tide) transparent; }
  .gallery-card { flex: 0 0 84%; min-width: 0; scroll-snap-align: center; }
  .gallery-card img { height: min(48dvh,380px); aspect-ratio: auto; object-fit: contain; }
  .gallery-card figcaption { font-size: 14px; }
  .gallery-swipe { display: flex; justify-content: center; gap: 10px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
  .ambient-field { display: none; }
}
@media (prefers-reduced-motion: reduce) { .photo-gallery[open] .gallery-card { animation: none; } }
@media print { .ambient-field, .photo-third { display: none !important; } }


/* Give the animated margins room while keeping the academic page compact. */
@media screen and (min-width: 921px) {
  .page-frame, .header-inner { width: min(var(--wrap),calc(100% - 120px)); }
}
.photo-hint { left: auto; right: 10px; bottom: 12px; width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: #102743aa; }
.photo-hint svg { width: 16px; height: 16px; }
.gallery-header { justify-content: flex-end; margin-bottom: 4px; }
.gallery-card { padding-bottom: 8px; }
.photo-gallery { padding-top: 14px; padding-bottom: 24px; }
@media (max-width: 640px) {
  .photo-hint { right: -4px; bottom: 0; }
  .gallery-card { padding-bottom: 4px; }
  .photo-gallery { padding-top: 10px; padding-bottom: 12px; }
}

@media (max-width: 360px) { .theme { grid-template-columns: 96px minmax(0,1fr); gap: 10px; } .theme-art { width: 96px; height: 64px; } }
