@font-face {
  font-family: "Exhibition Source Han Serif";
  src: url("fonts/SourceHanSerifCN-VF.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --wall: #151514;
  --ink: #e7dfd2;
  --muted: #bdb4a7;
  --gold: #bba17b;
  --rule: #39352f;
  --painting-ground: #201e1a;
  --font-serif: "Exhibition Source Han Serif", "Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-classical: "Times New Roman", "Times", var(--font-serif);
  font-family: var(--font-serif);
  font-weight: 400;
  font-synthesis: none;
  background: var(--wall);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
a { color: var(--gold); text-underline-offset: 4px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }

.exhibition-header {
  min-height: 100px;
  margin: 0 4.2vw;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: .12em;
}
.about-button { position: relative; background: none; border: 0; padding: 12px 0; font-size: 22px; font-weight: 500; letter-spacing: .06em; line-height: 1.6; }
.about-button span { display: inline-block; color: var(--gold); margin-left: 18px; font-family: var(--font-classical); font-size: 24px; }
.about-button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 7px; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 180ms ease; }
.about-button:hover::after, .about-button:focus-visible::after { transform: scaleX(1); }
.about-button:hover { color: var(--gold); }
.music-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 50%; }
.music-button svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.music-button:hover, .music-button[data-state="playing"] { color: var(--gold); border-color: var(--gold); }
.music-button .music-playing, .music-button[data-state="playing"] .music-muted { display: none; }
.music-button[data-state="playing"] .music-playing { display: inline; }
.music-button:disabled { opacity: .5; cursor: default; }
main { padding: 0 clamp(20px, 4vw, 64px); }
.title-block { text-align: left; padding: 48px 0; }
.eyebrow { font-family: var(--font-sans); font-size: 13px; font-weight: 400; letter-spacing: .16em; color: var(--muted); margin: 0 0 18px; }
.title-block .eyebrow { font-family: var(--font-classical); font-size: 14px; color: var(--gold); line-height: 1.5; }
h1, h2, .reading-section h3, .reading-quote { font-family: var(--font-serif); font-weight: 600; }
h1 { font-size: clamp(72px, 5.5vw, 84px); letter-spacing: .08em; margin: 0; line-height: 1.3; white-space: nowrap; }
.exhibition-lead { font-size: 28px; color: var(--muted); margin: 20px 0 0; letter-spacing: .03em; line-height: 1.7; }

.artwork, .title-block {
  width: min(100%, 1020px);
  margin: 0 auto;
}
.comparison {
  aspect-ratio: 1402 / 1126;
  position: relative;
  isolation: isolate;
  background: var(--painting-ground);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
  cursor: ew-resize;
  box-shadow: 0 0 0 1px #ffffff12;
}
.painting-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.recreation {
  /* Registered to unchanged architectural details in the original. */
  transform-origin: top;
  transform: translateY(-0.04855%) scaleY(1.00417);
}
.original { z-index: 1; clip-path: inset(0 calc(100% - var(--position)) 0 0); }
.divider {
  position: absolute;
  z-index: 2;
  left: var(--position);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--gold);
  transform: translateX(-50%);
  pointer-events: none;
}
.divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: #25221dee;
  box-shadow: 0 2px 12px #0005;
}
.divider-handle svg { width: 28px; height: 18px; stroke: var(--ink); stroke-width: 1.3; }
.comparison:not(.pointer-focus):has(:focus-visible) { outline: 2px solid var(--gold); outline-offset: 5px; }
.comparison:not(.pointer-focus):has(:focus-visible) .divider-handle { box-shadow: 0 0 0 4px var(--wall), 0 0 0 6px var(--gold); }
.image-status { position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; padding: 32px; margin: 0; text-align: center; font-family: var(--font-sans); line-height: 1.8; font-size: 14px; background: var(--painting-ground); }
.image-status[hidden] { display: none; }
.comparison[aria-busy="true"] { cursor: wait; }
.painting-captions { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; font-size: 18px; line-height: 1.6; letter-spacing: .06em; }
.caption-date { color: var(--gold); font-family: var(--font-classical); font-size: 22px; letter-spacing: .03em; font-variant-numeric: lining-nums; }
.caption-dot { margin: 0 9px; color: var(--muted); }
.exhibition-footer { margin: 48px 4.2vw 0; padding: 22px 0 28px; border-top: 1px solid var(--rule); display: flex; justify-content: center; color: var(--muted); line-height: 1.8; letter-spacing: .04em; }
.text-button { border: 0; background: none; padding: 10px 0; min-height: 44px; color: var(--muted); font-size: 16px; font-weight: 400; line-height: 1.7; letter-spacing: .04em; }
.text-button:hover { color: var(--gold); }
.text-button span { margin-left: 10px; color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.noscript-note { text-align: center; font-size: 13px; line-height: 1.8; }

dialog { width: min(896px, calc(100% - 48px)); max-height: calc(100svh - 64px); padding: 36px 48px 44px; color: var(--ink); background: #1d1c19; border: 1px solid #494136; overscroll-behavior: contain; }
dialog::backdrop { background: #0a0908d9; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading .eyebrow { margin: 0; }
.close-button { background: none; border: 0; font-family: var(--font-classical); font-size: 34px; width: 44px; height: 44px; line-height: 1; color: var(--muted); margin-right: -10px; }
.close-button:hover { color: var(--ink); }
h2 { font-size: 40px; line-height: 1.55; letter-spacing: .05em; margin: 20px 0 36px; }
.about-section { margin: 0 0 36px; }
.about-section h3 { color: var(--gold); font-size: 28px; font-weight: 600; line-height: 1.6; margin: 0 0 20px; letter-spacing: .03em; }
.about-section p { color: #d5ccbf; font-size: 20px; line-height: 1.8; letter-spacing: .02em; margin: 0 0 24px; }
.about-section strong { font-weight: 500; color: var(--ink); }
.reconstruction-note { padding-left: 24px; border-left: 1px solid var(--gold); }
.source-links { display: grid; gap: 14px; border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 28px; font-size: 16px; line-height: 1.8; }
.source-links span { color: var(--muted); }
.source-links a { width: fit-content; }
#info-title { font-size: 36px; text-wrap: balance; }

.reading-view { max-width: 800px; margin: 112px auto 0; padding: 40px 0 24px; border-top: 1px solid var(--rule); }
.reading-navigation { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.reading-navigation .eyebrow { margin: 0; }
.reading-view h2 { margin: 32px 0 36px; font-size: clamp(32px, 3vw, 42px); letter-spacing: .05em; text-wrap: balance; }
.reading-view p { font-size: 20px; font-weight: 400; line-height: 1.8; letter-spacing: .02em; color: #d5ccbf; margin: 0 0 26px; }
.reading-navigation p { font-size: 13px; margin: 0; color: var(--muted); }
.reading-introduction { padding-bottom: 14px; }
.reading-introduction p:first-child { color: var(--gold); }
.reading-section { padding-top: 46px; margin-top: 30px; border-top: 1px solid var(--rule); }
.reading-section h3 { font-size: 28px; line-height: 1.6; letter-spacing: .03em; margin: 0 0 20px; text-wrap: balance; }
.reading-section .chapter-date { font-family: var(--font-classical); color: var(--gold); font-size: 18px; line-height: 1.65; letter-spacing: .06em; margin: -4px 0 28px; font-variant-numeric: lining-nums; }
.reading-section strong { color: var(--ink); font-weight: 500; }
.reading-quote { color: var(--ink); font-size: clamp(30px, 3vw, 40px); line-height: 1.75; letter-spacing: .04em; margin: 40px 0 24px; padding: 16px 0 16px 28px; border-left: 1px solid var(--gold); }
.reading-end { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 28px; }
.reading-end p { color: var(--muted); font-size: 17px; }

@media (min-width: 760px) and (min-height: 650px) {
  .artwork, .title-block { width: min(100%, 1020px, calc((100svh - 320px) * 1402 / 1126)); }
}
@media (max-width: 600px) {
  .exhibition-header { min-height: 84px; margin: 0 24px; }
  .about-button { font-size: 20px; }
  .about-button span { font-size: 22px; margin-left: 14px; }
  main { padding: 0 20px; }
  .title-block { padding: 38px 0 36px; }
  .title-block .eyebrow { font-size: 12px; margin-bottom: 16px; letter-spacing: .13em; }
  h1 { font-size: clamp(46px, 13.5vw, 58px); }
  .exhibition-lead { font-size: clamp(21px, 5.8vw, 23px); margin-top: 14px; line-height: 1.65; }
  .eyebrow { font-size: 12px; }
  .painting-captions { padding-top: 18px; font-size: 16px; gap: 12px; }
  .caption-date { font-size: 20px; }
  .caption-dot { margin: 0 6px; }
  .divider-handle { width: 40px; height: 40px; }
  .exhibition-footer { margin: 36px 24px 0; }
  .reading-view { margin-top: 72px; padding-top: 28px; }
  .reading-view h2 { font-size: 30px; }
  .reading-view p { font-size: 18px; margin-bottom: 24px; }
  .reading-navigation p { font-size: 12px; margin: 0; }
  .reading-section { padding-top: 34px; margin-top: 26px; }
  .reading-section h3, .about-section h3 { font-size: 26px; }
  .reading-section .chapter-date { font-size: 16px; }
  .reading-quote { font-size: clamp(24px, 6.5vw, 28px); padding-left: 20px; }
  .reading-end p { font-size: 16px; }
  dialog { width: calc(100% - 24px); max-height: calc(100svh - 32px); padding: 24px 20px 30px; }
  #info-title { font-size: 30px; }
  .about-section p { font-size: 18px; }
  .reconstruction-note { padding-left: 18px; }
  h2 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .about-button::after { transition: none; }
}
