/* Junchuan Zhao, homepage. One stylesheet for the studio's interface and the page below it.
   Palette: green-black ink, ivory and aged brass, taken from the room itself. */

:root {
  --bg: #0d1412;
  --bg-2: #101916;
  --surface: #141e1b;
  --surface-2: #1a2622;
  --ink: #efe9dd;
  --muted: #a9b3a9;
  --faint: #77847c;
  --line: #212e29;
  --line-2: #34453d;
  --glass: rgba(12, 20, 17, 0.72);
  --glass-line: rgba(255, 255, 255, 0.1);
  --brass: #dcb978;
  --brass-ink: #1a1408;
  --voice: #e2c285;
  --music: #93cfbd;
  --human: #bcaae8;
  --affective: #eaa5b3;
  --figure-bg: #f6f5f0;
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
  --scroll-shade: rgba(0, 0, 0, 0.5);
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1240px;
  --pad: 48px;
  --edge: clamp(20px, 3.4vw, 52px);
  --radius: 18px;
  color-scheme: dark;
}

:root[data-mode="light"] {
  --bg: #eef0ea;
  --bg-2: #e5e9e1;
  --surface: #ffffff;
  --surface-2: #f6f7f2;
  --ink: #15231d;
  --muted: #52615a;
  --faint: #84918a;
  --line: #d9dfd5;
  --line-2: #c2ccc0;
  --glass: rgba(255, 255, 255, 0.8);
  --glass-line: rgba(20, 40, 34, 0.12);
  --brass: #8d6620;
  --brass-ink: #fffaf0;
  --voice: #94671d;
  --music: #2c7261;
  --human: #6750a6;
  --affective: #a8445f;
  --figure-bg: #ffffff;
  --shadow: 0 30px 70px rgba(30, 50, 44, 0.16);
  --scroll-shade: rgba(30, 50, 44, 0.16);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.6 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brass); text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 600 15px var(--sans); }
.skip-link:focus { top: 16px; }

/* ================================================================ the studio: a room, a name, one link */

.studio {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(58% 52% at 50% 46%, #1d332c 0%, rgba(29, 51, 44, 0) 72%),
    radial-gradient(46% 34% at 50% 104%, #241d10 0%, rgba(36, 29, 16, 0) 72%),
    linear-gradient(180deg, #090f0d 0%, var(--bg) 100%);
  transition: background 0.8s;
}
:root[data-mode="light"] .studio {
  background:
    radial-gradient(58% 52% at 50% 46%, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, #dfe6de 0%, var(--bg) 100%);
}

.studio-stage { position: absolute; inset: 0; }
.studio-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline: none; }
.studio-stage canvas:active { cursor: grabbing; }

/* Without WebGL, or without scripts, the room steps aside and the page below is the homepage. */
.studio.is-fallback,
html:not(.js) .studio { height: 0; min-height: 0; }

/* --- the name */
.studio-id {
  position: absolute;
  left: var(--edge);
  top: clamp(18px, 3vw, 44px);
  z-index: 3;
  max-width: calc(100% - 2 * var(--edge) - 60px);
  pointer-events: none;
  transition: opacity 0.4s;
}
.studio-id h1 {
  margin: 0;
  font: 400 clamp(38px, 4.5vw, 70px)/0.98 var(--serif);
  letter-spacing: -0.028em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45);
}
:root[data-mode="light"] .studio-id h1 { text-shadow: none; }
.studio-quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; pointer-events: auto; }
.studio-quick-links a { display: inline-flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 44px; padding: 0 16px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font: 500 13px var(--sans); text-decoration: none; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.studio-quick-links a span { color: var(--brass); }
.studio-quick-links a:hover { color: var(--brass); border-color: var(--brass); background: var(--surface); }
.studio[data-view]:not([data-view="home"]) .studio-id,
.studio[data-view]:not([data-view="home"]) .studio-hint { opacity: 0; pointer-events: none; }
.studio[data-view]:not([data-view="home"]) .studio-quick-links { visibility: hidden; pointer-events: none; }

/* --- day and night */
.studio-tools { position: absolute; right: var(--edge); top: clamp(18px, 3vw, 44px); z-index: 3; }
.mode-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.mode-toggle:hover { border-color: color-mix(in srgb, var(--brass) 60%, transparent); }
.mode-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mode-toggle .icon-moon { display: none; }
:root[data-mode="light"] .mode-toggle .icon-sun { display: none; }
:root[data-mode="light"] .mode-toggle .icon-moon { display: block; }
.mode-toggle[hidden] { display: none; }

/* --- hotspots: a brass dot on each thing that opens; its name appears on hover or focus */
.studio-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.studio-label {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  will-change: transform;
}
.studio-label.is-shown { opacity: 1; pointer-events: auto; }
.label-dot {
  width: 13px;
  height: 13px;
  border: 2.5px solid #e9c887;
  border-radius: 50%;
  background: #fffaf0;
  box-shadow: 0 0 0 1px rgba(20, 14, 4, 0.55), 0 0 0 6px rgba(233, 200, 135, 0.26), 0 3px 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s, box-shadow 0.25s;
}
.studio-label::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 1.5px solid #e9c887;
  border-radius: 50%;
  animation: ping 3.2s ease-out infinite;
}
.studio-label:nth-child(2)::before { animation-delay: 0.5s; }
.studio-label:nth-child(3)::before { animation-delay: 1s; }
.studio-label:nth-child(4)::before { animation-delay: 1.5s; }
.studio-label:nth-child(5)::before { animation-delay: 2s; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.85; } 60%, 100% { transform: scale(3.2); opacity: 0; } }
.label-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 15px 9px;
  border: 1px solid var(--glass-line);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  translate: -50% 6px;
  pointer-events: none;
  transition: opacity 0.22s, translate 0.22s;
}
.label-tip b { font: 600 16px/1.15 var(--serif); }
.label-tip span { color: var(--muted); font: 500 11.5px/1.2 var(--sans); }
.studio-label:hover .label-tip,
.studio-label:focus-visible .label-tip,
.studio-label.is-hover .label-tip { opacity: 1; translate: -50% 0; }
.studio-label:hover .label-dot,
.studio-label.is-hover .label-dot { transform: scale(1.25); box-shadow: 0 0 0 1px rgba(20, 14, 4, 0.55), 0 0 0 8px rgba(233, 200, 135, 0.34), 0 3px 14px rgba(0, 0, 0, 0.6); }
.studio-label:hover::before,
.studio-label.is-hover::before { animation: none; opacity: 0; }
/* a finger cannot hover, so the names stay up on touch screens */
@media (hover: none) { .label-tip { opacity: 1; translate: -50% 0; } }

/* --- the foot of the room: what is playing, and the way to the page */
.studio-dock {
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  bottom: clamp(18px, 3.2vh, 34px);
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 12px;
  pointer-events: none;
}
.studio-dock > * { pointer-events: auto; }
.studio-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; width: 100%; pointer-events: none; }
.studio-actions > * { pointer-events: auto; }
.studio-hint { grid-column: 1; margin: 0; max-width: 30em; color: var(--muted); font: 400 14px/1.45 var(--sans); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); transition: opacity 0.4s; }
:root[data-mode="light"] .studio-hint { text-shadow: none; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-touch { display: inline; } .hint-mouse { display: none; } }
.studio:not(.is-live) .studio-hint { visibility: hidden; }

.studio-enter {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 22px 0 28px;
  border-radius: 999px;
  background: var(--brass);
  color: var(--brass-ink);
  font: 600 16px var(--sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  box-shadow: 0 16px 44px color-mix(in srgb, var(--brass) 26%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.studio-enter:hover { color: var(--brass-ink); transform: translateY(-2px); box-shadow: 0 20px 52px color-mix(in srgb, var(--brass) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.studio-enter svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: nudge 2.8s ease-in-out infinite; }
@keyframes nudge { 0%, 55%, 100% { transform: translateY(0); } 28% { transform: translateY(4px); } }
/* with a panel open the link moves out from under it */
@media (min-width: 900px) {
  .studio[data-view]:not([data-view="home"]) .studio-dock { justify-items: start; }
  .studio[data-view]:not([data-view="home"]) .studio-enter { grid-column: 1; justify-self: start; }
  .studio[data-view]:not([data-view="home"]) .studio-hint { display: none; }
}

.studio-caption {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  max-width: min(680px, 100%);
  padding: 10px 18px;
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font: 500 14px var(--sans);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.studio-caption.is-on { opacity: 1; transform: none; }
.studio-caption:empty { display: none; }
.studio-caption b { font: 600 18px var(--serif); }
.studio-caption span { color: var(--muted); }
.studio-caption em { color: var(--faint); font-style: normal; }
.cap-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); align-self: center; }

/* --- side panel */
.studio-panel {
  position: absolute;
  top: 96px;
  right: 24px;
  bottom: 24px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: min(440px, 36vw);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.studio-panel[hidden] { display: none; }
.studio-panel.is-open { opacity: 1; transform: none; }
.panel-head { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 14px; }
.panel-title { margin: 0; font: 500 32px/1.1 var(--serif); letter-spacing: -0.015em; }
.panel-sub { margin: 6px 0 0; color: var(--muted); font: 400 14px var(--sans); }
.panel-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.panel-close:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.panel-close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.panel-body { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; padding: 4px 24px 28px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.panel-body > * + * { margin-top: 22px; }
.panel-body p { margin: 0; }
.panel-body p + p { margin-top: 12px; }
.panel-body h3, .panel-body h4 { margin: 0 0 10px; }
.panel-body h4 { font: 600 19px var(--serif); }
.panel-body .about { display: block; }
.panel-body .about-text p { font-size: 17px; line-height: 1.6; text-align: left; hyphens: manual; }
.panel-body .facts { margin-top: 20px; }
.panel-body .record { display: block; }
.panel-body .record > div + div { margin-top: 22px; }
.panel-body .record h3 { font-size: 20px; }
.panel-body .academic-record ul { list-style: none; margin: 0; padding: 0; }
.panel-body .academic-record li { padding: 18px 0; border-top: 1px solid var(--glass-line); color: var(--muted); font: 400 16px/1.6 var(--sans); }
.panel-body > .academic-record li:first-child { border-top: 0; padding-top: 4px; }
.panel-body .stage { display: block; margin: 0; padding: 0; border: 0; }
.panel-body .stage-text p { font-size: 17px; }
.panel-body .program { margin-top: 18px; }
.panel-body .piece { font-size: 17px; }
.panel-body .news li { grid-template-columns: 76px 1fr; gap: 14px; font-size: 17px; }
.panel-body .news li:first-child { padding-top: 0; }
.panel-body .contact-mail { font-size: 22px; margin: 0; }
.panel-note { color: var(--muted); font: 400 14px var(--sans); }
.panel-block { padding: 18px; border: 1px solid var(--glass-line); border-radius: 16px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.panel-block p { color: var(--muted); font: 400 15px/1.55 var(--sans); }
.panel-block .transport { margin-top: 16px; }

/* A single scroll area keeps long abstracts, transport controls and every record reachable. */
.studio-panel[data-panel="papers"] .panel-body > * + * { margin-top: 16px; }
.studio-places { display: none; }
.crate-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.crate-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: transparent;
  font: 500 13px var(--sans);
  cursor: pointer;
}
.crate-chip i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.crate-chip span { color: var(--faint); }
.crate-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.crate-chip[aria-pressed="true"] span { color: inherit; opacity: 0.6; }
.record-card { padding: 18px; min-width: 0; border: 1px solid var(--glass-line); border-radius: 18px; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.record-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font: 500 13px var(--sans); color: var(--muted); }
.record-meta b { color: var(--ink); font-weight: 600; }
.record-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.record-card h3 { margin: 12px 0 8px; font: 600 21px/1.28 var(--serif); }
.record-authors { color: var(--muted); font: 400 14px/1.5 var(--sans); }
.record-authors b { color: var(--ink); font-weight: 600; }
.record-blurb { margin-top: 12px !important; font-size: 16px; line-height: 1.55; }
.record-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.record-empty { color: var(--muted); font: 400 15px/1.5 var(--sans); }
.record-transport { display: flex; gap: 8px; margin-top: 18px; }
.transport {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: transparent;
  font: 600 14px var(--sans);
  cursor: pointer;
}
.transport:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.transport svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.transport.play { flex: 1; background: var(--brass); border-color: transparent; color: var(--brass-ink); }
.transport.play:hover { background: color-mix(in srgb, var(--brass) 88%, white); }
.transport.wide { width: 100%; }
.record-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.record-list li { min-width: 0; }
.record-list button {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.record-list button:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.record-list button[aria-current="true"] { background: color-mix(in srgb, var(--c) 22%, transparent); }
.rl-name { font: 600 16px/1.3 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-venue { color: var(--muted); font: 500 12.5px var(--sans); white-space: nowrap; }

/* the role mark: the same little note shape used on the page */
.rl-mark,
.note-mark {
  width: 12px;
  height: 9px;
  border-radius: 3px;
  background: var(--c, var(--ink));
  border: 1.5px solid var(--c, var(--ink));
}
.rl-mark[data-role="corresponding"],
.note-mark[data-role="corresponding"] { background: color-mix(in srgb, var(--c, var(--ink)) 35%, transparent); }
.rl-mark[data-role="coauthor"],
.note-mark[data-role="coauthor"] { background: transparent; }

/* piano key legend */
.keys-legend { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); height: 118px; }
.keys-legend .kw {
  display: grid;
  align-content: end;
  justify-items: center;
  padding-bottom: 8px;
  border: 1px solid var(--line-2);
  border-left-width: 0;
  background: #f4efe4;
  color: #1b1b1b;
  font: 600 13px var(--sans);
  transition: background 0.12s;
}
.keys-legend .kw:first-child { border-left-width: 1px; border-radius: 0 0 0 8px; }
.keys-legend .kw:nth-child(10) { border-radius: 0 0 8px 0; }
.keys-legend .kw small { color: #777; font-weight: 500; font-size: 11px; }
.keys-legend .kb {
  position: absolute;
  top: 0;
  left: calc((var(--i) + 1) * 10% - 3.2%);
  width: 6.4%;
  height: 62%;
  display: grid;
  align-content: end;
  justify-items: center;
  padding-bottom: 6px;
  border-radius: 0 0 5px 5px;
  background: #18181a;
  color: #ddd;
  font: 600 11px var(--sans);
  transition: background 0.12s;
}
.keys-legend .is-down.kw { background: var(--brass); }
.keys-legend .is-down.kb { background: #8a6a2c; }

/* the studio on small screens */
@media (max-width: 899px) {
  .studio { min-height: 560px; }
  .studio-id h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .studio-quick-links { margin-top: 12px; gap: 6px; }
  .studio-quick-links a { padding: 0 12px; gap: 12px; }
  .studio-dock { gap: 10px; justify-items: stretch; }
  .studio-actions { grid-template-columns: 1fr; gap: 10px; justify-items: center; }
  .studio-enter { grid-column: 1; grid-row: 1; height: 50px; }
  .studio-hint { grid-row: 2; max-width: none; text-align: center; font-size: 13px; }
  .studio-caption { justify-self: center; }
  .studio.is-live .studio-places { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; width: min(100%, 440px); justify-self: center; }
  .studio-places button {
    grid-column: span 3;
    min-width: 0;
    min-height: 44px;
    padding: 0 5px;
    border: 1px solid var(--glass-line);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font: 500 13px var(--sans);
  }
  .studio-places button:nth-last-child(-n + 3) { grid-column: span 4; }
  .studio-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: min(62%, calc(100svh - 80px));
    transform: translateY(24px);
  }
  .studio[data-view]:not([data-view="home"]) .studio-dock { opacity: 0; pointer-events: none; }
  .studio[data-view]:not([data-view="home"]) .studio-dock * { pointer-events: none; }
}

@media (max-width: 899px) and (max-height: 650px) {
  .studio-hint { display: none; }
  .studio-enter { height: 44px; font-size: 14px; }
}

/* ================================================================ the page */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: var(--wrap); height: 64px; margin: 0 auto; padding: 0 var(--pad); }
.brand { font: 500 20px var(--serif); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links a { padding: 7px 13px; border-radius: 999px; color: var(--muted); font: 500 14px var(--sans); text-decoration: none; white-space: nowrap; transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav-links .nav-studio { margin-left: 8px; border: 1px solid var(--line-2); color: var(--ink); }
.nav-links .nav-studio:hover { border-color: var(--brass); background: transparent; color: var(--brass); }
.nav-links .mode-toggle { flex: none; width: 36px; height: 36px; margin-left: 8px; border-color: var(--line-2); background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

/* --- masthead */
.masthead {
  padding: clamp(48px, 7.5vw, 112px) 0 0;
  scroll-margin-top: 64px;
  background: radial-gradient(70% 90% at 50% -30%, color-mix(in srgb, var(--brass) 9%, transparent) 0%, transparent 70%);
}
.mast-name {
  margin: 0 0 0 -0.045em;
  font: 350 clamp(42px, 11.8vw, 164px)/0.98 var(--serif);
  letter-spacing: -0.038em;
  white-space: nowrap;
}
.mast-row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) minmax(200px, auto);
  gap: clamp(28px, 4.4vw, 72px);
  align-items: start;
  margin-top: clamp(26px, 3.6vw, 52px);
  padding-top: clamp(26px, 3.2vw, 44px);
  border-top: 1px solid var(--line-2);
}
.mast-portrait { width: 172px; height: 172px; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); }
.mast-lead { margin: -0.12em 0 0; max-width: 23em; font: 400 clamp(22px, 2.55vw, 35px)/1.28 var(--serif); letter-spacing: -0.014em; text-wrap: balance; }
.mast-links { list-style: none; margin: 0; padding: 0; font: 500 16px var(--sans); }
.mast-links a { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: color 0.2s, padding 0.25s, border-color 0.2s; }
.mast-links li:first-child a { padding-top: 0; }
.mast-links a:hover { padding-left: 8px; border-color: var(--brass); }

/* --- sections */
.section { padding: clamp(84px, 10.5vw, 156px) 0 0; scroll-margin-top: 20px; }
.section:last-of-type { padding-bottom: clamp(96px, 11vw, 160px); }
.section-title,
.section-head { padding-top: 24px; border-top: 1px solid var(--line-2); }
.section-title { display: flex; align-items: baseline; gap: 0.32em; margin: 0 0 clamp(30px, 4vw, 56px); font: 400 clamp(34px, 4.7vw, 64px)/1.04 var(--serif); letter-spacing: -0.024em; }
.sec-num { color: var(--brass); font-style: italic; font-weight: 400; font-size: 0.44em; letter-spacing: 0.03em; translate: 0 -0.72em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head .section-title { margin: 0; padding-top: 0; border-top: 0; }
.section-note { margin: 0; color: var(--muted); font: 400 14px var(--sans); }

/* --- selected publications: one card per row, in the order set by "selected"; figure on
   the left, text on the right, every card the same */
.feature-grid { display: grid; grid-auto-rows: 1fr; gap: clamp(18px, 2vw, 26px); }   /* 1fr rows: every card as tall as the tallest */
.feature {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.35s;
}
@media (hover: hover) {
  .feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
}
/* the figure is fitted inside a fixed frame, so a tall figure cannot make its card taller than the others */
.feature-figure { --inset: 26px; position: relative; flex: 0 0 43%; display: block; min-height: 310px; overflow: hidden; background: var(--figure-bg); border-right: 1px solid var(--line); }
.feature-figure img { position: absolute; left: var(--inset); top: var(--inset); width: calc(100% - 2 * var(--inset)); height: calc(100% - 2 * var(--inset)); object-fit: contain; }
.feature-body { display: flex; flex-direction: column; justify-content: center; gap: 12px; flex: 1; min-width: 0; padding: clamp(26px, 3.2vw, 46px); }
.feature-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0; font: 500 13.5px var(--sans); color: var(--muted); }
.feature-venue { color: var(--ink); font-weight: 600; }
.feature-name { margin: 2px 0 0; font: 500 clamp(32px, 3.4vw, 46px)/1.06 var(--serif); letter-spacing: -0.024em; }
.feature-name.is-title { font-size: clamp(24px, 2.3vw, 31px); line-height: 1.18; letter-spacing: -0.014em; text-wrap: balance; }
.feature-name a { text-decoration: none; }
.feature-blurb { margin: 0; max-width: 34em; color: var(--muted); font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.55; }
.feature-links { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font: 500 13.5px var(--sans);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.pill:hover { border-color: var(--brass); color: var(--brass); background: color-mix(in srgb, var(--brass) 8%, transparent); }
.studio-panel .pill { border-color: var(--glass-line); }

.note-mark[data-cat="speech"] { --c: var(--voice); }
.note-mark[data-cat="music"] { --c: var(--music); }
.note-mark[data-cat="human"] { --c: var(--human); }
.note-mark[data-cat="affective"] { --c: var(--affective); }

/* --- all publications */
.paper-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 14px var(--sans);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.search input {
  width: min(340px, 100%);
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 400 15px var(--sans);
}
.search input::placeholder { color: var(--faint); }
.paper-status { min-height: 22px; margin: 0 0 10px; color: var(--faint); font: 400 13.5px var(--sans); }

.year-group { display: grid; grid-template-columns: clamp(110px, 12vw, 176px) 1fr; gap: 0 8px; border-top: 1px solid var(--line-2); }
.year-label { position: sticky; top: 88px; align-self: start; margin: 0; padding: 24px 0; color: var(--faint); font: 350 clamp(34px, 3.8vw, 52px)/1 var(--serif); letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
.year-papers { min-width: 0; }
.pub { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 22px; padding: 28px 0; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.pub-body { min-width: 0; }
.pub:first-child { border-top: 0; }
.pub[hidden] { display: none; }
.pub.is-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--brass) 22%, transparent); } 100% { background: transparent; } }
.pub-venue { display: flex; align-items: center; align-self: start; gap: 9px; margin: 6px 0 0; font: 600 14px var(--sans); }
.pub-title { margin: 0; max-width: 34em; font: 500 22px/1.3 var(--serif); letter-spacing: -0.008em; }
.pub-title a { text-decoration: none; }
.pub-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.pub-new { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--brass) 20%, transparent); color: var(--brass); font: 600 11.5px var(--sans); vertical-align: 3px; }
.pub-authors { margin: 7px 0 0; color: var(--muted); font: 400 15px/1.55 var(--sans); }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 16px; margin-top: 11px; font: 500 14px var(--sans); }
.pub-link { color: var(--ink); }
.pub-more summary { list-style: none; color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; cursor: pointer; }
.pub-more summary::-webkit-details-marker { display: none; }
.pub-more summary:hover { color: var(--ink); }
.pub-more[open] { flex-basis: 100%; }
.pub-more { min-width: 0; max-width: 100%; }
.pub-more[open] summary { color: var(--ink); }
.pub-more p { margin: 10px 0 4px; max-width: 64ch; color: var(--muted); font: 400 16.5px/1.6 var(--serif); }
.cite-panel { position: relative; min-width: 0; max-width: 100%; margin-top: 10px; }
.cite-panel pre { max-width: 100%; margin: 0; padding: 50px 18px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: 400 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.copy-citation { position: absolute; top: 8px; right: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); font: 500 12.5px var(--sans); cursor: pointer; }
.copy-citation[hidden] { display: none; }
.pub-empty { padding: 40px 0; color: var(--muted); font: 400 16px var(--sans); }
.pub-empty button { margin-top: 10px; height: 38px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; cursor: pointer; }

/* --- news: every item in one panel that scrolls. The shading at its top and bottom edge
   shows only while there is more to scroll to in that direction. */
.news-panel {
  max-height: min(508px, 70vh);   /* stops part-way through a row, so it reads as scrollable */
  overflow-y: auto;
  padding: 12px clamp(20px, 2.8vw, 40px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(var(--surface) 40%, transparent) top / 100% 64px no-repeat local,
    linear-gradient(transparent, var(--surface) 60%) bottom / 100% 64px no-repeat local,
    linear-gradient(var(--scroll-shade), transparent) top / 100% 32px no-repeat scroll,
    linear-gradient(transparent, var(--scroll-shade)) bottom / 100% 32px no-repeat scroll,
    var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.news-panel:focus-visible { outline-offset: 4px; border-radius: 22px; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: clamp(110px, 12vw, 176px) 1fr; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); font-size: 19.5px; line-height: 1.5; }
.news li:first-child { border-top: 0; }
.news time { padding-top: 5px; color: var(--faint); font: 500 14px var(--sans); font-variant-numeric: tabular-nums; }
.news p { margin: 0; max-width: 46em; }

/* --- about */
.about { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 80px); align-items: start; }
.about-text p { margin: 0; font-size: clamp(19px, 1.6vw, 21.5px); line-height: 1.65; text-align: justify; hyphens: auto; }
.facts { display: grid; gap: 18px; margin: 0; padding: 26px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s; }
@media (hover: hover) { .about > .facts:hover { transform: translateY(-4px); box-shadow: var(--shadow); } }
.facts div { display: grid; gap: 3px; }
.facts dt { color: var(--faint); font: 500 13px var(--sans); }
.facts dd { margin: 0; font: 400 15.5px/1.5 var(--sans); }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(36px, 5vw, 80px); margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(40px, 4.4vw, 60px); border-top: 1px solid var(--line); }
.stage h3 { margin: 0 0 16px; font: 400 clamp(28px, 3vw, 40px)/1.1 var(--serif); letter-spacing: -0.02em; }
.stage-text p { margin: 0 0 12px; max-width: 30em; color: var(--muted); font-size: 19px; }
.program { list-style: none; margin: 0; padding: 0; counter-reset: piece; }
.program li { counter-increment: piece; border-top: 1px solid var(--line); }
.program li:first-child { border-top: 0; }
.program a { display: flex; align-items: baseline; gap: 12px; padding: 14px 0; text-decoration: none; }
.program li:first-child a { padding-top: 4px; }
.program a::before { content: counter(piece); min-width: 1.4em; color: var(--faint); font: 500 13px var(--sans); }
.program a:hover .piece { color: var(--brass); }
.piece { font: 500 21px var(--serif); letter-spacing: -0.008em; transition: color 0.2s; }
.leader { flex: 1; min-width: 24px; }
.where { color: var(--muted); font: 400 14px var(--sans); white-space: nowrap; }
/* where the column is narrow (the studio panel, tablets, phones) the venue sits under the song */
.panel-body .program a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.panel-body .program .leader { display: none; }
.panel-body .program .where { grid-column: 2; white-space: normal; }
@media (max-width: 1180px) {
  .program a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
  .program .leader { display: none; }
  .program .where { grid-column: 2; white-space: normal; }
}

/* --- academic record */
.record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.6vw, 56px); }
.academic-record { scroll-margin-top: 100px; }
.record h3 { margin: 0 0 16px; font: 400 26px var(--serif); letter-spacing: -0.015em; }
.record ul { list-style: none; margin: 0; padding: 0; }
.record li { padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font: 400 15.5px/1.5 var(--sans); }

/* --- footer */
.site-footer { padding: clamp(72px, 9vw, 128px) 0 56px; border-top: 1px solid var(--line); background: var(--bg-2); }
.contact-lead { margin: 0; color: var(--muted); font: 400 17px var(--sans); }
.contact-mail { margin: 10px 0 30px -0.03em; font: 350 clamp(28px, 6.3vw, 92px)/1.05 var(--serif); letter-spacing: -0.035em; }
.contact-mail a { text-decoration: none; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding-top: 22px; border-top: 1px solid var(--line-2); font: 500 15px var(--sans); }
.copy-text { padding: 0; border: 0; background: none; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.18em; cursor: pointer; }
.copy-text:hover { color: var(--brass); }
.wechat-id { color: var(--faint); }
.colophon { margin: 52px 0 0; color: var(--faint); font: 400 13px var(--sans); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 500 14px var(--sans);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- narrower screens */
@media (max-width: 1080px) {
  .feature-figure { --inset: 20px; flex-basis: 46%; min-height: 270px; }
  .mast-row { grid-template-columns: 140px minmax(0, 1fr); }
  .mast-portrait { width: 140px; height: 140px; border-radius: 20px; }
  .mast-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 28px; padding-top: 6px; border-top: 1px solid var(--line); }
  .mast-links a,
  .mast-links li:first-child a { padding: 12px 0; border-bottom: 0; }
  .mast-links a:hover { padding-left: 0; }
}

@media (max-width: 899px) {
  :root { --pad: 20px; }
  body { font-size: 17px; }
  .nav-inner { height: 56px; }
  .brand { display: none; }
  .nav-links .nav-studio { margin-left: 4px; }
  .masthead { scroll-margin-top: 56px; }
  .feature-grid { grid-auto-rows: auto; gap: 18px; }
  .feature { flex-direction: column; }
  .feature-figure { --inset: 18px; flex: none; aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-body { justify-content: flex-start; padding: 22px 22px 24px; }
  .feature-name { font-size: 30px; }
  .feature-name.is-title { font-size: 23px; }
  .feature-blurb { font-size: 16.5px; }
  .year-group { grid-template-columns: 1fr; }
  .year-label { position: static; padding: 22px 0 2px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px 0; }
  .pub-title { font-size: 20px; }
  .about, .stage, .record { grid-template-columns: 1fr; }
  .about-text p { text-align: left; hyphens: manual; }
  .news li { grid-template-columns: 84px 1fr; font-size: 18px; }
  .news-panel { max-height: 66vh; padding: 6px 18px; border-radius: 18px; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
}

@media (max-width: 560px) {
  .mast-row { grid-template-columns: 1fr; }
  .mast-portrait { width: 112px; height: 112px; border-radius: 18px; }
  .contact-mail { font-size: clamp(22px, 6.8vw, 36px); overflow-wrap: anywhere; }
}

@media (max-width: 360px) {
  .studio-places button { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .studio-label::before { animation: none; opacity: 0; }
}
