/* Exhibition styling informed by Unslop, Damir Sokolovsky, CC BY 4.0. */
:root {
  color-scheme: light;
  --paper: #f4f0e5;
  --surface: #ece7d7;
  --ink: #202a21;
  --secondary: #50594b;
  --muted: #5c6356;
  --line: #d5cdb9;
  --red: #a13e2e;
  --grove: #17231c;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: "Bonsai Serif", "Songti SC", "SimSun", serif;
  --ease: cubic-bezier(.2,.7,.3,1);
  --gutter: clamp(20px, 5.4vw, 92px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.8 var(--sans); line-break: strict; }
body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
button { border: 0; border-radius: 0; cursor: pointer; }
button:disabled { cursor: default; }
a, button { -webkit-tap-highlight-color: transparent; transition: color 180ms var(--ease), background-color 180ms var(--ease), border-color 180ms var(--ease); }
img { display: block; max-width: 100%; }
figure, p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: clamp(36px, 4.05vw, 62px); line-height: 1.23; letter-spacing: .045em; }
h3 { font-size: clamp(25px, 2.8vw, 35px); line-height: 1.35; }
.wrap { width: min(1320px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.45; fill: none; flex: none; }
:where(a, button, select, input, summary):focus-visible { outline: 2px solid var(--red); outline-offset: 5px; }
.skip-link { position: fixed; z-index: 20; left: 16px; top: -100px; padding: 8px 16px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }

.site-header { position: relative; height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; z-index: 5; }
.brand { width: max-content; display: inline-flex; align-items: center; gap: 12px; font: 23px/1.2 var(--serif); letter-spacing: .1em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 11px/1.4 var(--sans); letter-spacing: .14em; }
.brand-seal { display: grid; place-content: center; width: 30px; height: 39px; color: var(--paper); background: var(--red); outline: 1px solid #f4f0e575; outline-offset: -4px; font: 14px/1.02 var(--serif); letter-spacing: 0; text-align: center; }
.main-nav { display: flex; gap: clamp(21px, 3vw, 50px); align-items: center; }
.main-nav a, .partner-link { min-height: 44px; font-size: 14px; white-space: nowrap; }
.main-nav a { display: inline-flex; align-items: center; color: var(--secondary); }
.main-nav a:hover, .footer-links a:hover { color: var(--red); }
.header-actions { display: flex; justify-content: flex-end; gap: 12px; }
.partner-link { display: inline-flex; align-items: center; background: transparent; border: 1px solid #bcb59f; padding: 6px 17px; }
.partner-link:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.menu-button { display: none; width: 44px; height: 44px; justify-content: center; align-items: center; background: transparent; border: 1px solid var(--line); }

.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--secondary); font: 14px/1.6 var(--serif); letter-spacing: .13em; }
.red-rule { width: 22px; height: 1px; flex: none; background: var(--red); }
.small-seal { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--red); border: 1px solid currentColor; font: 20px/1 var(--serif); }
.section-index, .work-number { color: var(--red); font: 12px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.quiet-link, .text-link { display: inline-flex; align-items: center; gap: 12px; width: fit-content; min-height: 44px; background: transparent; color: inherit; padding: 0; border-bottom: 1px solid currentColor; font-size: 14px; }
.quiet-link:hover, .text-link:hover { color: var(--red); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 44px; margin-bottom: clamp(24px, 4vw, 46px); }
.section-head h2 { margin-top: 12px; }
.section-aside { color: var(--secondary); font-size: 15px; line-height: 1.9; }

.hero { position: relative; overflow: clip; background: #18241a; color: #f5efdd; isolation: isolate; }
.hero-scene { position: relative; isolation: isolate; }
.hero-landscape { position: absolute; z-index: -1; inset: 0; overflow: hidden; mask-image: linear-gradient(#000 88%, transparent 100%); }
.hero-landscape img { width: 100%; height: 100%; object-fit: cover; object-position: 66% center; }
.hero-inner { min-height: clamp(444px, 39vw, 626px); display: grid; position: relative; grid-template-columns: minmax(0, .89fr) minmax(0, 1.25fr); align-items: center; }
.hero-copy { position: relative; z-index: 1; padding-block: 44px 48px; }
.hero .eyebrow { color: #e2dac3; }
.hero .red-rule { background: #d0775e; }
.hero h1 { font-size: clamp(55px, 6.1vw, 100px); line-height: 1.11; letter-spacing: .075em; margin: 22px 0 25px; white-space: nowrap; }
.hero h1 span { display: block; }
.hero-description { color: #e4deca; font-size: clamp(15px, 1.15vw, 17px); line-height: 1.95; }
.primary-link { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; margin-top: 30px; padding: 10px 25px; background: #efe8d4; color: #1e291f; font: 16px/1.2 var(--serif); letter-spacing: .13em; }
.primary-link:hover { background: #fff9e8; color: #812f24; }
.hero-art { align-self: stretch; position: relative; min-width: 0; display: grid; place-items: center; }
.hero-image-button { width: min(116%, 840px); display: grid; place-items: center; transform: translate(2%, 1.5%); }
.hero-image-button img { width: 100%; height: auto; filter: drop-shadow(0 12px 12px #0c140e42); }
.hero-art figcaption { position: absolute; z-index: 2; width: min(100%, 540px); inset: auto 0 19px; margin-inline: auto; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ece7d458; padding-top: 10px; color: #f7efda; }
.hero-work-name { font: 24px/1.4 var(--serif); letter-spacing: .14em; display: inline-block; }
.hero-work-kind { margin-left: 12px; font-size: 13px; color: #e4deca; }
.hero-art .quiet-link { border-color: #f7efda88; }
.hero-art .quiet-link:hover { color: #fff7df; border-color: currentColor; }
.hero :focus-visible { outline-color: #f8e2b3; }

.selected { padding-block: clamp(62px, 7vw, 104px) clamp(68px, 8vw, 112px); }
.fish-pond {
  position: relative;
  pointer-events: none;
  background: center / 100% 100% no-repeat;
}
.fish-pond canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.fish-pond-ink {
  height: clamp(106px, 9.8vw, 154px);
  color: #d1c7a7;
  background-image: url("assets/fish-stream-ink.webp");
}
.fish-pond-paper {
  color: #626b5b;
  background-image: url("assets/fish-stream-paper.webp");
}
.fish-pond-garden { height: clamp(108px, 9.3vw, 148px); }
.fish-pond-guide { grid-area: stream; height: clamp(88px, 7.2vw, 116px); }
.fish-motion {
  position: absolute;
  bottom: 0;
  right: 2px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  color: inherit;
  opacity: .7;
  pointer-events: auto;
}
.fish-motion::before, .fish-motion::after { content: ""; grid-area: 1 / 1; }
.fish-motion::before { width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; opacity: .5; }
.fish-motion::after { width: 6px; height: 8px; border-inline: 1.5px solid currentColor; box-sizing: border-box; }
.fish-motion[data-paused="true"]::after {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: solid transparent;
  border-width: 4px 0 4px 6px;
  border-left-color: currentColor;
}
.fish-motion:is(:hover, :focus-visible) { opacity: 1; }
.fish-pond-ink .fish-motion, .fish-pond-garden .fish-motion { right: var(--gutter); }
.curated-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: stretch; }
.curated-main { min-width: 0; display: grid; grid-template-rows: 1fr auto; }
.curated-image { position: relative; min-height: 325px; display: grid; place-items: center; background: #eae0cc; }
.curated-image img { width: 89%; height: 100%; max-height: 555px; object-fit: contain; padding: 22px 12px; transition: transform 350ms var(--ease); }
.curated-image .small-seal { position: absolute; top: 18px; right: 18px; }
.curated-caption { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 14px 4px; }
.curated-caption > span { display: flex; gap: 18px; align-items: baseline; }
.curated-caption strong { font: 32px/1.3 var(--serif); letter-spacing: .09em; }
.curated-caption small, .specimen-kind { color: var(--muted); font-size: 13px; }
.curated-pair { min-width: 0; display: grid; grid-template-rows: repeat(2, minmax(0,1fr)); gap: 16px; }
.curated-pair .specimen { display: grid; grid-template-columns: minmax(0,1.38fr) minmax(0,1fr); align-items: center; border-top: 1px solid var(--line); }
.curated-pair .specimen-image { aspect-ratio: 4/3; background: transparent; }
.curated-pair .specimen-caption { padding-inline: clamp(10px, 1.6vw, 26px) 0; border: 0; }
.curated-pair .specimen-caption .icon { display: none; }
.curated-main:hover, .specimen:hover { color: var(--red); }
.curated-main:hover img, .specimen:hover img { transform: scale(1.035); }

.zen-section { position: relative; overflow: hidden; isolation: isolate; background: #e7e5d7; }
.zen-section::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .22; background: url("assets/huizhou-ink.webp") center 56% / cover; mix-blend-mode: multiply; }
.zen-layout { display: grid; grid-template-columns: 1fr .86fr; align-items: center; padding-block: clamp(42px, 5.6vw, 78px) 12px; gap: 32px; }
.zen-inscription img { width: min(65%, 290px); height: auto; margin-inline: auto; object-fit: contain; }
.zen-copy h2 { margin-block: 14px 16px; }
.zen-copy > p:last-child { color: #41493e; font-size: 15px; }

.catalog { padding-block: clamp(72px, 9vw, 132px) 44px; }
.catalog-filters { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 28px; padding-block: 14px; border-block: 1px solid var(--line); }
.filter-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-categories button { padding: 8px 14px; min-height: 44px; background: transparent; color: var(--secondary); font-size: 14px; border: 1px solid transparent; }
.filter-categories button[aria-pressed="true"] { background: var(--grove); border-color: var(--grove); color: var(--paper); }
.filter-categories button:hover:not([aria-pressed="true"]) { border-color: #bcb59f; color: var(--ink); }
.season-filter { display: inline-flex; align-items: center; gap: 10px; color: var(--secondary); font-size: 14px; }
.season-filter select { min-height: 44px; padding: 6px 12px; background: transparent; border: 1px solid #bcb59f; color: var(--ink); }
.catalog-status { margin-top: 12px; color: var(--muted); font-size: 13px; }
.chapter { margin-top: clamp(42px, 5vw, 68px); }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.chapter-head > div { display: flex; align-items: baseline; gap: 15px; }
.chapter-number { color: var(--red); font: 16px/1.4 var(--serif); }
.chapter-head p { color: var(--muted); font-size: 13px; }
.specimen-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(12px, 2.1vw, 32px); }
.specimen { min-width: 0; display: block; }
.specimen-image { position: relative; display: block; overflow: hidden; aspect-ratio: 1.15; background: #eee8da; }
.specimen-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform 350ms var(--ease); }
.specimen-caption { display: grid; gap: 3px; padding: 12px 3px 14px; border-bottom: 1px solid var(--line); }
.specimen-name-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.specimen-name { font: clamp(22px, 2.3vw, 30px)/1.25 var(--serif); letter-spacing: .07em; }
.specimen-description { color: var(--secondary); font-size: 13px; line-height: 1.6; }
.empty-state { padding: 50px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.empty-state p { color: var(--secondary); margin-block: 8px 12px; }

.guide { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "title description" "stream description"; align-items: center; gap: 6px 56px; border-top: 1px solid var(--line); padding-block: 50px 42px; }
.guide-intro { grid-area: title; }
.guide-description { grid-area: description; }
.guide h2 { margin-top: 14px; font-size: clamp(32px, 3.75vw, 48px); }
.guide p:not(.eyebrow) { color: var(--secondary); font-size: 15px; }
.guide .quiet-link { margin-top: 12px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-block: 28px 36px; border-top: 1px solid var(--line); }
.footer-links { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--secondary); }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); max-width: calc(100% - 28px); }
dialog::backdrop { background: #14201799; }
.wallet-dialog { position: fixed; width: min(460px, 100%); padding: 36px 32px; }
.wallet-dialog h2 { margin: 12px 0; font-size: 34px; }
.wallet-dialog > p:not(.eyebrow) { color: var(--secondary); }
.wallet-dialog .dismiss { margin-top: 12px; }
.close { position: absolute; inset: 8px 8px auto auto; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; color: inherit; z-index: 3; }
.close:hover { color: var(--red); }

@media (max-width: 980px) {
  .wrap { --gutter: clamp(20px, 4vw, 48px); }
  .site-header { gap: 20px; }
  .hero-inner { min-height: 435px; }
  .hero-image-button { width: 116%; transform: translate(0, 7%); }
  .curated-layout { gap: 22px; }
  .curated-pair .specimen { grid-template-columns: 1.05fr 1fr; }
  .specimen-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
}

@media (max-width: 720px) {
  .site-header { height: 68px; display: flex; justify-content: space-between; gap: 10px; }
  .brand { font-size: 20px; gap: 9px; }
  .brand small { font-size: 10px; }
  .brand-seal { width: 27px; height: 36px; }
  .header-actions { gap: 8px; }
  .partner-link { padding-inline: 10px; }
  .menu-button { display: flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--paper); border: 1px solid var(--line); padding: 8px 16px; }
  .main-nav[data-open="true"] { display: flex; }
  .main-nav a + a { border-top: 1px solid var(--line); }
  .hero-inner { display: grid; min-height: 0; grid-template-columns: 1fr; }
  .fish-pond-ink { height: clamp(96px, 22vw, 126px); }
  .fish-pond-garden { height: clamp(94px, 20vw, 119px); }
  .hero-landscape { top: auto; height: min(355px, 91vw); mask-image: linear-gradient(transparent, #000 6%, #000 88%, transparent); }
  .hero-landscape img { object-position: 51% 50%; }
  .hero-copy { padding: 32px 0 14px; }
  .hero h1 { font-size: clamp(40px, 10.2vw, 62px); margin-block: 14px; letter-spacing: .08em; }
  .hero-description { line-height: 1.75; }
  .primary-link { margin-top: 17px; min-height: 44px; padding-inline: 18px; }
  .hero-art { height: min(355px, 91vw); place-items: center; }
  .hero-image-button { width: min(110%, 565px); transform: translateY(-1%); }
  .hero-art figcaption { padding-top: 2px; bottom: 5px; width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-head h2 { margin-top: 9px; }
  .section-aside br { display: none; }
  .curated-layout { grid-template-columns: 1fr; gap: 18px; }
  .curated-image { min-height: 0; aspect-ratio: 1.32; }
  .curated-image img { width: 95%; padding: 8px; }
  .curated-caption { padding-block: 10px; }
  .curated-caption strong { font-size: 27px; }
  .curated-pair { grid-template-rows: none; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .curated-pair .specimen { display: block; }
  .curated-pair .specimen-caption { padding-inline: 3px; border-bottom: 1px solid var(--line); }
  .zen-layout { grid-template-columns: .74fr 1fr; gap: 16px; }
  .zen-copy h2 { font-size: clamp(23px, 5.4vw, 36px); margin-block: 9px 10px; }
  .zen-copy > p:last-child { font-size: 14px; }
  .zen-copy br { display: none; }
  .zen-inscription img { width: 98%; }
  .chapter-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .specimen-grid { gap: 16px 12px; }
  .specimen-description { display: none; }
  .filter-categories button { padding-inline: 8px; }
  .guide { grid-template-columns: 1fr; grid-template-areas: "title" "description" "stream"; padding-block: 38px 20px; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::after, *::before { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 720px) and (max-height: 740px) {
  .hero-copy { padding-block: 18px 6px; }
  .hero h1 { font-size: clamp(34px, 9vw, 46px); margin-block: 9px; line-height: 1.06; }
  .hero-description { font-size: 14px; line-height: 1.6; }
  .hero .primary-link { margin-top: 10px; }
  .hero-art, .hero-landscape { height: clamp(174px, 35svh, 246px); }
  .hero-art { align-items: start; }
  .hero-image-button { width: min(95%, 41svh); transform: none; }
}


/* The viewing room and the reading table share the gallery's paper and ink. */
.work-page {
  --room-ink: #17231c;
  --room-light: #eeebdf;
  --room-line: #c6c1ae;
  line-break: strict;
}

.work-breadcrumb, .work-breadcrumb nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.work-breadcrumb {
  justify-content: space-between;
  min-height: 72px;
  padding-block: 8px;
  font-size: .875rem;
  color: var(--secondary);
}
.work-breadcrumb nav [aria-current] { color: var(--ink); }
.work-breadcrumb a:hover, .share-button:hover { color: var(--red); }
.work-breadcrumb .share-button {
  min-height: 44px;
  font-size: .875rem;
  border-bottom: 1px solid transparent;
}
.work-breadcrumb .share-button:hover { border-bottom-color: currentColor; }

.work-experience {
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(318px, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "viewer heading" "viewer listening";
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: 28px;
  align-items: start;
}
.work-heading { grid-area: heading; padding-top: clamp(16px, 4vw, 64px); }
.work-heading .eyebrow { color: var(--red); font-size: .875rem; }
.work-heading h1 {
  margin: 10px 0 12px;
  font: 400 clamp(3.5rem, 6vw, 5.875rem)/1.2 var(--serif);
  letter-spacing: .11em;
}
.work-kind { color: var(--secondary); font-size: .875rem; line-height: 1.75; }
.work-intro {
  margin: 24px 0 0;
  max-width: 24em;
  color: var(--ink);
  font: 400 1.0625rem/1.85 var(--serif);
}
.work-viewer { grid-area: viewer; min-width: 0; }
.guided-view, .asset-facts .trial-link {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  min-height: 44px;
  margin-top: 12px;
  color: var(--red);
  font-size: .9375rem;
  border-bottom: 1px solid currentColor;
}
.guided-view::after { content: "↗"; }
.guided-view[hidden], .score-only [hidden] { display: none; }
.score-only .sound-modes { grid-template-columns: minmax(92px, 1fr) auto; }

.viewing-stage {
  position: relative;
  isolation: isolate;
  min-height: 432px;
  height: clamp(450px, 43vw, 650px);
  overflow: hidden;
  border: 1px solid #d1cdbc;
  background: var(--room-light);
  color: var(--ink);
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
.viewing-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(77%, 440px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid #cecbb944;
  border-radius: 50%;
  background: #f5f2e850;
  pointer-events: none;
}
.stage-image {
  position: absolute;
  inset: 52px 8px 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.stage-image > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transform-origin: center;
}
.viewing-stage[data-view="trunk"] .stage-image > img { transform: scale(1.9) translateY(-6%); }
.viewing-stage[data-view="pot"] .stage-image > img { transform: scale(2.1) translateY(-24%); }
.stage-note, .surface-toggle, .stage-expand, .viewing-stage .model-rotate {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font-size: .875rem;
  line-height: 1.35;
}
.stage-note {
  top: 8px;
  left: 20px;
  color: var(--secondary);
  pointer-events: none;
}
.surface-toggle {
  top: 8px;
  right: 20px;
  background: transparent;
  text-decoration: underline;
  text-decoration-color: #77766880;
  text-underline-offset: .32em;
}
.stage-expand { right: 20px; bottom: 10px; gap: 6px; }
.viewing-stage .model-rotate { left: 20px; bottom: 10px; }
.viewing-stage button:enabled:hover { color: var(--red); }
.viewing-stage[data-surface="ink"] {
  border-color: #3d493e;
  background: #202e26;
  color: #e6e9db;
}
.viewing-stage[data-surface="ink"]::before {
  border-color: #a5a88938;
  background: #3b4d3540;
}
.viewing-stage[data-surface="ink"] :is(.stage-note, .model-rotate, .stage-expand) { color: #e6e9db; }
.viewing-stage[data-surface="ink"] button:enabled:hover { color: #fff3cc; }
.viewing-stage[data-surface="ink"] .stage-image > img { mix-blend-mode: normal; }

.view-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(14px, 2vw, 28px);
  padding: 6px 0 0;
  border-bottom: 1px solid var(--line);
}
.view-controls button {
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--secondary);
  white-space: nowrap;
  font-size: .875rem;
}
.view-controls button:hover:enabled, .view-controls button[aria-pressed="true"] { color: var(--red); }
.view-controls button[aria-pressed="true"] { border-bottom-color: var(--red); }
.view-controls > span {
  margin-left: auto;
  color: var(--secondary);
  font-size: .8125rem;
  line-height: 1.65;
}

.sound-player {
  grid-area: listening;
  min-width: 0;
  padding: 24px;
  background: var(--room-ink);
  color: #f0efe4;
}
.sound-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.sound-title h2 { margin: 0; color: inherit; font: 400 1.5rem/1.5 var(--serif); white-space: nowrap; }
.sound-poem-credit { color: #d0d4c4; font-size: .8125rem; overflow-wrap: anywhere; }
.sound-poem-credit:hover { color: #fff3cc; text-decoration: underline; text-underline-offset: .25em; }
.score-credit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 10px 0 0; font-size: .9375rem; line-height: 1.65; }
.score-credit span { color: #d0d4c4; font-size: .8125rem; }
.sound-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; margin-top: 20px; }
.sound-modes > button, .voice-choice select {
  min-height: 44px;
  border: 1px solid #738174;
  background: transparent;
  color: inherit;
  padding: 8px;
  font-size: .875rem;
  line-height: 1.3;
  white-space: nowrap;
}
.sound-modes > button:hover:enabled, .sound-modes > button[aria-pressed="true"] { border-color: #dce1ce; }
.sound-modes > button[aria-pressed="true"] { color: #17231c; background: #e4e6d8; }
.sound-modes > button:disabled { opacity: .55; cursor: default; }
.sound-modes .sound-stop { border-color: transparent; color: #d0d4c4; }
.sound-player :focus-visible { outline-color: #dccc94; }
.voice-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: .875rem;
}
.voice-choice select {
  min-width: 0;
  width: 100%;
  color-scheme: dark;
  border-radius: 0;
}
.voice-choice select option { background: var(--room-ink); color: #f0efe4; }
.sound-settings { margin-top: 8px; color: #d0d4c4; font-size: .875rem; }
.sound-settings summary { display: list-item; min-height: 44px; width: fit-content; padding-block: 10px; cursor: pointer; }
.sound-settings label { display: flex; align-items: center; gap: 16px; }
.sound-settings input { flex: 1; min-height: 40px; max-width: 210px; accent-color: #e4e6d8; }
.sound-status { min-height: 1.7em; margin: 0; color: #d0d4c4; font-size: .8125rem; line-height: 1.7; }

.work-reading {
  display: grid;
  grid-template-columns: minmax(0, 1.82fr) minmax(318px, 1fr);
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(56px, 7vw, 100px);
  padding-block: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
}
.poem-block {
  --poem-inset: clamp(24px, 4vw, 56px);
  --stream-height: clamp(102px, 10vw, 140px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas: "verses heading" "stream stream";
  position: relative;
  isolation: isolate;
  align-items: start;
  gap: 24px;
  min-height: 380px;
  padding: var(--poem-inset) var(--poem-inset) calc(var(--poem-inset) / 2);
  border: 1px solid #d1cdbc;
  background: #eeece0;
}
.poem-block::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 0 calc(var(--stream-height) / 2);
  height: 60%;
  background: url("assets/huizhou-ink.webp") left bottom / auto 92% no-repeat;
  opacity: .2;
  mask-image: linear-gradient(transparent, #000 45%, #000 72%, transparent);
  mix-blend-mode: multiply;
  pointer-events: none;
}
.poem-heading { grid-area: heading; padding: 0 0 8px 20px; border-left: 1px solid #cac5b4; }
.poem-heading .eyebrow { color: var(--red); font-size: .875rem; }
.poem-heading h2 {
  max-width: 7em;
  margin: 12px 0 8px;
  color: var(--ink);
  font: 400 clamp(1.5rem, 3vw, 2rem)/1.45 var(--serif);
  scroll-margin-top: 20px;
}
.poem-author { margin: 0; color: var(--secondary); font-size: .875rem; line-height: 1.75; }
.poem-lines {
  grid-area: verses;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  justify-content: center;
  align-items: start;
  gap: clamp(10px, 1.7vw, 24px);
}
.poem-lines p {
  margin: 0;
  border-top: 2px solid transparent;
  padding-top: 8px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  color: var(--ink);
  font: 400 clamp(1.375rem, 2.45vw, 2.125rem)/1.25 var(--serif);
  letter-spacing: .16em;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}
.poem-lines p.reading { color: var(--red); border-top-color: var(--red); }
.poem-lines p > span { letter-spacing: 0; }
.poem-block .poem-stream {
  grid-area: stream;
  align-self: end;
  justify-self: center;
  width: calc(100% + var(--poem-inset));
  min-width: 0;
  max-width: none;
  height: var(--stream-height);
}

.asset-facts { padding-top: 8px; min-width: 0; }
.asset-facts h2, .related-works h2 {
  margin: 0;
  font: 400 clamp(1.625rem, 2.6vw, 2.25rem)/1.4 var(--serif);
}
.asset-facts dl { margin: 16px 0 20px; border-top: 1px solid var(--line); font-size: .875rem; }
.asset-facts dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  line-height: 1.65;
}
.asset-facts dt { color: var(--secondary); white-space: nowrap; }
.asset-facts dd { margin: 0; color: var(--ink); text-align: right; }
.asset-facts .notice { margin: 0 0 16px; font-size: .875rem; line-height: 1.75; }
.asset-facts .disabled-button {
  min-height: 44px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--secondary);
  font-size: .875rem;
}
.related-works { padding-block: clamp(32px, 4.5vw, 64px); border-top: 1px solid var(--line); }
.related-works > .section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.related-works .quiet-link { font-size: .875rem; }
.related-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; width: min(100%,768px); }
.related-grid .specimen-image { aspect-ratio: 16/10; }
.share-status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 12px 24px;
  background: var(--room-ink);
  color: #f0efe4;
  font-size: .875rem;
}
.share-status:empty { display: none; }
.image-dialog { width: min(1200px,calc(100% - 32px)); padding: 48px 20px 24px; background: var(--paper); }
.image-dialog > img { width: 100%; max-height: calc(100svh - 180px); object-fit: contain; mix-blend-mode: multiply; }
.image-dialog > p { margin-top: 16px; text-align: center; font: 400 1rem/1.5 var(--serif); }
.image-dialog .close { min-width: 44px; min-height: 44px; }

@media (max-width: 1120px) {
  .view-controls > span { flex-basis: 100%; margin: 0; padding-block: 2px 10px; }
  .poem-block { grid-template-columns: minmax(0, 1fr); grid-template-areas: "heading" "verses" "stream"; }
  .poem-heading { padding-left: 0; border-left: 0; }
}
@media (max-width: 820px) {
  .work-breadcrumb { min-height: 60px; }
  .work-experience { grid-template-columns: minmax(0,1fr); grid-template-rows: auto; grid-template-areas: "heading" "viewer" "listening"; gap: 20px; }
  .work-heading { padding-top: 8px; }
  .work-heading h1 { font-size: clamp(2.875rem, 9vw, 4.5rem); margin: 6px 0 8px; }
  .work-intro { margin-top: 12px; max-width: 34em; font-size: 1rem; }
  .viewing-stage { min-height: 360px; height: min(75vw, 528px); }
  .view-controls > span { flex-basis: auto; margin-left: auto; padding: 0; }
  .sound-player { padding: 20px; }
  .work-reading { grid-template-columns: 1fr; }
  .poem-block { grid-template-columns: minmax(0,1fr) max-content; grid-template-areas: "verses heading" "stream stream"; min-height: 320px; }
  .poem-heading { padding-left: 16px; border-left: 1px solid #cac5b4; }
}
@media (max-width: 640px) {
  .work-breadcrumb, .work-breadcrumb nav { gap: 8px; }
  .work-breadcrumb, .work-breadcrumb .share-button { font-size: .8125rem; }
  .viewing-stage { min-height: 350px; height: auto; }
  .stage-note, .surface-toggle, .stage-expand, .viewing-stage .model-rotate { font-size: .8125rem; }
  .stage-note, .viewing-stage .model-rotate { left: 12px; }
  .surface-toggle, .stage-expand { right: 12px; }
  .view-controls > span { flex-basis: 100%; margin: 0; padding-block: 2px 10px; }
  .sound-player { padding: 16px; }
  .sound-modes { gap: 6px; }
  .poem-block { --stream-height: clamp(88px, 20vw, 112px); grid-template-columns: minmax(0,1fr); grid-template-areas: "heading" "verses" "stream"; gap: 12px; min-height: 0; }
  .poem-heading { padding-left: 0; border-left: 0; }
  .poem-heading h2 { max-width: none; }
  .poem-lines { gap: 20px; }
  .poem-lines p { font-size: 1.5rem; }
  .related-grid { gap: 16px; }
  .related-grid .specimen-image { aspect-ratio: 4/3; }
}
@media (prefers-reduced-motion: reduce) {
  .viewing-stage, .poem-lines p { transition: none; }
}

/* Keep four-verse groups together when an eight-line verse cannot fit across. */
.poem-block-long {
  container-type: inline-size;
  grid-template-columns: minmax(0,1fr);
  grid-template-areas: "heading" "verses" "stream";
}
.poem-block-long .poem-heading { padding-left: 0; border-left: 0; }
.poem-block-long .poem-heading h2 { max-width: none; }
.poem-block-long .poem-lines {
  display: grid;
  direction: rtl;
  grid-template-columns: repeat(4, max-content);
  gap: 1.25rem clamp(8px, 1.25vw, 18px);
}
.poem-block-long .poem-lines p {
  direction: ltr;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}
@container (min-width: 28rem) {
  .poem-block-long .poem-lines { grid-template-columns: repeat(8, max-content); }
  .poem-block-long .poem-lines:has(> p:nth-child(10):last-child) {
    grid-template-columns: repeat(5, max-content);
  }
}

/* Viewer and fullscreen share the same model shell so camera state follows the viewer. */
.model-shell { position: absolute; inset: 48px 8px 52px; }
.model-mount, .bonsai-model { display: block; width: 100%; height: 100%; }
.bonsai-model { --poster-color: transparent; background: transparent; touch-action: pan-y; }
.model-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.model-loading {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 10px 20px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}
.model-status { margin: 0; color: var(--secondary); font-size: .875rem; line-height: 1.65; }
.model-shell[data-model-state="poster"] .model-loading {
  bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.model-shell[data-model-state="poster"] .model-status { display: none; }
.model-shell[data-model-state="poster"] .model-retry {
  min-height: 44px;
  margin: 0;
  padding: 8px 20px;
  background: var(--room-ink);
  border: 1px solid var(--room-line);
  color: var(--room-light);
}
.model-shell[data-model-state="poster"] .model-retry:hover { color: #fff; }
.model-progress {
  display: block;
  width: 180px;
  max-width: 100%;
  height: 2px;
  margin: 10px auto 0;
  border: 0;
  accent-color: var(--red);
}
.model-progress::-webkit-progress-bar { background: var(--line); }
.model-progress::-webkit-progress-value { background: var(--red); }
.model-retry {
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--red);
  font-size: .875rem;
}
.model-progress[hidden], .model-retry[hidden],
.model-shell[data-model-state="ready"] :is(.model-poster, .model-loading) { display: none; }
.model-shell:not([data-model-state="ready"]) .model-mount { visibility: hidden; }
.photo-exhibit :is(.model-loading, .model-rotate, .stage-expand, .guided-view, .view-controls) { display: none; }
.viewing-stage-3d button:disabled, .view-controls button:disabled { opacity: .55; cursor: wait; }
.viewing-stage-3d[data-surface="ink"] .model-poster { mix-blend-mode: normal; }

.model-dialog {
  width: min(1280px, calc(100% - 32px));
  max-width: none;
  height: calc(100svh - 40px);
  max-height: calc(100svh - 40px);
  margin: auto;
  padding: 48px 24px 24px;
  border: 1px solid #d1cdbc;
  background: #eeebdf;
}
.model-dialog .close { min-width: 44px; min-height: 44px; z-index: 5; }
.model-expanded-mount { position: relative; height: calc(100% - 44px); }
.model-expanded-mount .model-shell { inset: 0; }
.model-dialog > p {
  margin: 16px 0 0;
  color: var(--secondary);
  font: 400 .9375rem/1.6 var(--serif);
  text-align: center;
}
.model-dialog[data-surface="ink"] { border-color: #3d493e; background: #202e26; color: #e6e9db; }
.model-dialog[data-surface="ink"] > p { color: #e6e9db; }

@media (max-width: 640px) {
  .viewing-stage-3d { aspect-ratio: 4/5; }
  .model-shell { inset: 48px 0 48px; }
  .model-dialog {
    width: calc(100% - 16px);
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
    padding: 48px 8px 16px;
  }
  .model-dialog > p { font-size: .8125rem; }
}

@font-face{font-family:"Bonsai Serif";font-weight:400;font-style:normal;font-display:swap;src:url("assets/fonts/noto-serif-sc.ttf?v=417db50d29a5") format("truetype")} :root{--serif:"Bonsai Serif","Songti SC","STSong","SimSun",serif}
