/* Keep the decorative artwork separate from the layout and playback controls. */
:is(.credit-item, .project-link) {
  position: relative;
  isolation: isolate;
  transition: background-color .25s ease, border-color .25s ease,
    box-shadow .25s ease, translate .25s cubic-bezier(.2, .7, .3, 1);
}
:is(.credit-item, .project-link)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(ellipse 180px 130px at var(--glint-x, 50%) var(--glint-y, 38%),
      #fff6ff55, #fce9ff14 55%, transparent 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.project-link:focus-visible {
  background-color: rgba(255,255,255,.19);
  outline: 2px solid #fff5fc;
  outline-offset: 4px;
}
.project-link:focus-visible::before {
  --glint-x: 50%;
  --glint-y: 38%;
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  :is(.credit-item, .project-link):hover {
    background-color: rgba(255,255,255,.19);
    border-color: #22172b;
    box-shadow: 9px 10px 0 rgba(0,0,0,.61), inset 0 0 0 1px #fff4ff23;
  }
  :is(.credit-item, .project-link):hover::before { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(.credit-item, .project-link):hover { translate: 0 -3px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.credit-item, .project-link),
  :is(.credit-item, .project-link)::before { transition: none; }
}

.section-inner {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}
#contact-section .section-inner { max-width: 1280px; margin-inline: auto; }
#contact-section .section-copy { max-width: 40rem; }

.track-grid {
  align-items: stretch;
  gap: clamp(18px, 2.7vw, 38px);
}
.track-card,
.track-card:hover {
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-height: 0;
  padding: clamp(18px, 2vw, 28px);
}
.track-card.is-hidden { transform: translateY(20px); }
.track-card.is-filtered-out { display: none; }
.track-card h3 {
  font-size: clamp(23px, 2.45vw, 36px);
  line-height: 1.15;
  min-height: 2.3em;
  overflow-wrap: anywhere;
  transform: none;
}
.track-card p { max-width: none; line-height: 1.65; }
.track-card .track-tag { transform: none; }
.track-card :is(h3, p, .track-tag, .track-meta) { margin: 0; }
.track-card .track-meta { margin-block-start: auto; }
.track-card audio:not([hidden]) { position: relative; z-index: 2; width: 100%; }
.track-card audio[hidden] { display: none; }
.project-link { grid-template-rows: auto 1fr auto; }
.project-link h3 {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.38;
}
.project-link p { color: inherit; opacity: .86; }
.project-link > span {
  justify-self: start;
  padding: 6px 11px;
  border-radius: 999px;
  background: #050509;
  color: white;
  font-size: 12px;
}

.track-player {
  align-self: stretch;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  gap: 0 9px;
  align-items: center;
  position: relative;
  z-index: 2;
  color: #110b1c;
  text-shadow: none;
  font: 14px/1.35 system-ui, sans-serif;
}
.purple-card .track-player { color: #fff; }
.track-player button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.playback-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #120d1d;
  color: #fff;
  font: 700 16px/1 system-ui, sans-serif;
}
.purple-card .playback-toggle { background: #fff; color: #110b1c; }
.playback-mute {
  color: inherit;
  width: 28px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #ffffff31;
}
.speaker {
  position: relative;
  display: block;
  width: 17px;
  height: 16px;
}
.speaker::before {
  content: "";
  position: absolute;
  inset: 1px 6px 1px 0;
  background: currentColor;
  clip-path: polygon(0 32%, 36% 32%, 100% 0, 100% 100%, 36% 68%, 0 68%);
}
.speaker::after {
  content: "";
  position: absolute;
  inset: 3px 0 3px 8px;
  border-right: 2px solid currentColor;
  border-radius: 50%;
}
.playback-mute[aria-pressed="true"] .speaker::after {
  inset: 1px auto 1px 11px;
  border-radius: 0;
  transform: rotate(32deg);
}
.playback-wave {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 62px;
}
.wave-bars {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  gap: 1px;
  pointer-events: none;
}
.wave-bars i {
  flex: 1;
  min-width: 0;
  height: var(--level);
  min-height: 2px;
  background: currentColor;
  opacity: .42;
}
.wave-bars .played { opacity: .95; }
.wave-playhead {
  position: absolute;
  inset: 5px auto 5px var(--progress, 0%);
  width: 2px;
  transform: translateX(-1px);
  background: currentColor;
  opacity: .9;
  pointer-events: none;
}
.wave-timestamp {
  position: absolute;
  top: -10px;
  left: clamp(18px, var(--progress, 0%), calc(100% - 18px));
  transform: translateX(-50%);
  padding: 1px 5px;
  border-radius: 5px;
  background: #120d1d;
  color: white;
  font: 11px/1.35 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
}
.track-player.playing .wave-timestamp,
.playback-wave:hover .wave-timestamp,
.playback-wave:focus-within .wave-timestamp { opacity: 1; }
.track-player input {
  position: absolute;
  inset: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 4px;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}
.track-player input::-webkit-slider-thumb {
  appearance: none;
  width: 2px;
  height: 44px;
  background: transparent;
}
.track-player input::-moz-range-thumb {
  width: 2px;
  height: 44px;
  border: 0;
  background: transparent;
}
.track-player input::-moz-range-track { background: transparent; }
.track-player :is(button, input):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.playback-toggle:focus-visible { outline-color: #110b1c; }
.purple-card .playback-toggle:focus-visible { outline-color: #fff; }
.playback-times {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -3px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.track-player .playback-status {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.5;
  color: inherit;
}
.playback-status:not(:empty) { padding-top: 6px; }

:lang(zh-CN) body {
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.65;
}
:lang(zh-CN) :is(.logo, .nav, .eyebrow, .subtitle, .scroll-cue, .section-kicker, .track-tag, .track-meta span, .filter-pill, .credit-year, .credit-tag, .bio-tags span, .contact-links a) {
  letter-spacing: .04em;
}
:lang(zh-CN) .hero-content h1 {
  font-size: clamp(52px, 8.4vw, 118px);
  line-height: 1.18;
  letter-spacing: .02em;
}
:lang(zh-CN) .subtitle { max-width: 38ch; margin: 22px auto 0; line-height: 1.75; }
:lang(zh-CN) :is(.music-header h2, .section-title) {
  font-size: clamp(36px, 5.3vw, 79px);
  line-height: 1.2;
  letter-spacing: 0;
}
:lang(zh-CN) :is(.content-section, .music-section) {
  min-height: 0;
  padding-block: clamp(64px, 10vw, 140px);
}
:lang(zh-CN) .music-header {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: clamp(22px, 3vw, 36px);
}
:lang(zh-CN) .section-copy,
:lang(zh-CN) .music-header p,
:lang(zh-CN) .track-card p,
:lang(zh-CN) .credit-main p,
:lang(zh-CN) .project-link p { line-height: 1.75; }
:lang(zh-CN) .section-kicker { margin-bottom: 10px; }
:lang(zh-CN) :is(#credits-section, #bio-section, #contact-section) .section-title {
  margin-bottom: clamp(16px, 2.6vw, 32px);
}
:lang(zh-CN) .credits-layout { grid-template-columns: minmax(200px, 1fr) minmax(0, 1.9fr); gap: clamp(24px, 5vw, 76px); }
:lang(zh-CN) .credit-item { grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: start; padding: 18px 22px; }
:lang(zh-CN) .credit-year { padding-top: 4px; }
:lang(zh-CN) .credit-main h3 { line-height: 1.4; font-size: clamp(18px, 2vw, 25px); letter-spacing: 0; }
:lang(zh-CN) .credit-tag { transform: none; }
:lang(zh-CN) .bio-card { gap: clamp(20px, 3vw, 42px); margin-bottom: 0; }

@media (max-width: 980px) {
  :lang(zh-CN) .credits-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .track-card h3 { min-height: 0; }
  :lang(zh-CN) .filter-row { gap: 8px; margin-bottom: 24px; }
  :lang(zh-CN) .filter-pill { padding: 8px 12px; }
  :lang(zh-CN) .credit-item { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 16px; }
  :lang(zh-CN) .credit-year { padding-top: 0; grid-column: 1; }
  :lang(zh-CN) .credit-tag { grid-column: 2; grid-row: 1; padding: 4px 8px; }
  :lang(zh-CN) .credit-main { grid-column: 1 / -1; grid-row: 2; }
  :lang(zh-CN) .bio-card { padding: 16px; }
}


html {
  --topbar-height: 62px;
  scroll-padding-top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -22px;
  pointer-events: none;
  opacity: var(--glass-opacity, 0);
  background: linear-gradient(180deg, #eee0ff40, #251a3852);
  -webkit-backdrop-filter: blur(22px) saturate(1.14);
  backdrop-filter: blur(22px) saturate(1.14);
  -webkit-mask-image: linear-gradient(#000 0 58%, transparent 100%);
  mask-image: linear-gradient(#000 0 58%, transparent 100%);
  transition: opacity .16s ease-out;
}
.topbar-inner {
  position: relative;
  width: min(1280px, 86%);
  min-height: var(--topbar-height);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: fadeDown .45s ease both;
}
.topbar a:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 680px) {
  html { --topbar-height: 52px; }
  .topbar-inner { width: calc(100% - 40px); }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-inner { animation: none; }
  .topbar::before { transition: none; }
}

.resume-groups { display: grid; gap: clamp(28px, 4vw, 52px); min-width: 0; }
.resume-group-title { margin-bottom: 14px; font-size: 17px; line-height: 1.45; }
.resume-group .credit-item { align-items: start; }
.resume-group .credit-year {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.resume-group .credit-main h3 { line-height: 1.32; overflow-wrap: anywhere; }
.credit-source {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.credit-source:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }


.bio-skills {
  margin-top: 32px;
  padding: clamp(18px, 3.2vw, 36px);
  scroll-margin-block-start: 20px;
  border: 3px solid #050509;
  border-radius: 24px 18px 28px 20px;
  background: rgba(36, 24, 56, .94);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .72);
}
.bio-skills h3 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
  line-height: 1.25;
}
.skills-list { margin: 0; font-size: 1rem; line-height: 1.6; }
.skills-list > div {
  display: grid;
  grid-template-columns: minmax(0, .34fr) minmax(0, 1fr);
  gap: 10px clamp(16px, 3vw, 36px);
  padding-block: 14px;
}
.skills-list > div + div { border-top: 1px solid #f9dffa40; }
.skills-list dt { color: #f7d4f5; font-weight: 750; }
.skills-list dd { margin: 0; }
.skills-instruments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 680px) {
  .skills-list > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}


#the-returning-heros, #race-to-death, #the-shangyi-town, #bibooop-night { scroll-margin-top: 104px; }
#the-returning-heros h3, #race-to-death h3, #the-shangyi-town h3, #bibooop-night h3 { text-transform: none; }


#last-witness-section { min-height: 0; }
.last-witness-summary { max-width: 720px; margin-top: 18px; }
.last-witness-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(24px, 5vw, 64px);
  margin-top: 42px;
}
.last-witness-track { scroll-margin-top: 104px; }
.last-witness-track h3 { text-transform: none; }
.last-witness-tags {
  display: flex;
  align-items: stretch;
  gap: 6px;
  max-width: 100%;
}
.last-witness-tags .track-tag {
  min-width: 0;
  padding-inline: 9px;
  font-size: clamp(11px, 1.3vw, 13px);
  line-height: 1.3;
  letter-spacing: .045em;
}
.last-witness-tags .last-witness-recording {
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
  color: #251734;
  background: #f1def6;
}
.last-witness-track .track-player { margin-block-start: auto; }
.last-witness-menu { --card-color: #4b326e; }
.last-witness-site-link {
  display: inline-block;
  margin-top: 34px;
  color: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .22em;
}
@media (max-width: 760px) {
  .last-witness-tracks { grid-template-columns: minmax(0, 1fr); }
}


.project-showcase {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: clamp(20px, 4vw, 52px);
  margin-top: 32px;
  padding: clamp(18px, 3.4vw, 40px);
  border: 3px solid #050509;
  border-radius: 26px 20px 30px 22px;
  background: linear-gradient(135deg, #231732, #403050);
  box-shadow: 7px 7px 0 rgba(0, 0, 0, .72);
}
.project-showcase + .filter-row { margin-top: clamp(28px, 5vw, 52px); }
.project-showcase h3 {
  font-size: clamp(1.5rem, 2.6vw, 2.55rem);
  line-height: 1.1;
}
.project-showcase p {
  margin-top: 13px;
  font-size: 1rem;
  line-height: 1.65;
  color: #eee1f2;
}
.project-showcase a {
  display: inline-block;
  margin-top: 14px;
  color: #f7d4f5;
  font-size: 1rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .22em;
}
.project-showcase-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #120d1b;
}
@media (max-width: 760px) {
  .project-showcase { grid-template-columns: minmax(0, 1fr); }
}


.project-showcase-player { position: relative; min-width: 0; }
.project-showcase-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff7fb;
  background: #20132a;
  border: 2px solid #edd2f6;
  border-radius: 999px;
  padding: 11px 18px;
  font: 750 1rem/1.25 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.project-showcase-play:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.project-showcase-play:disabled { cursor: progress; }
.project-showcase .project-showcase-status { font-size: .9rem; margin-top: 8px; }
.project-showcase-status:empty { display: none; }
