/* Deanna Gao, maquette
   The page is the paper: --paper is the exact tone every painting was normalised to
   (tools/tone.py TARGET), so works sit on the page without frames. */
:root {
  --paper: #f3f0e9;
  --paper-deep: #e9e4d9;
  --ink: #1f1d1a;
  --ink-soft: #5b5750;
  --ink-faint: #a29c90;
  --seal: #b0281f;

  --serif: "Alegreya", "Iowan Old Style", Georgia, serif;
  --sans: "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  --zh: "Noto Serif SC", "Songti SC", serif;

  /* type scale (Bringhurst steps) */
  --t-sm: 0.875rem;
  --t-base: 1.1875rem;
  --t-md: 1.5rem;
  --t-lg: clamp(2.25rem, 4.2vw, 3.5rem);
  --t-xl: clamp(4rem, 13vw, 11.5rem);

  --gutter: clamp(16px, 4vw, 64px);
  --hair: color-mix(in srgb, var(--ink) 12%, transparent);
  --caption: 400 var(--t-sm)/1.4 var(--sans);
  --ease: cubic-bezier(.22, .61, .21, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-base)/1.62 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--seal); }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
h1, h2, h3 { font-weight: 400; margin: 0; }
h2 { font-size: var(--t-lg); line-height: 1.05; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
em { font-style: italic; }
sup { line-height: 0; font-size: .7em; }
.muted { color: var(--ink-soft); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 50; background: var(--paper); padding: 8px 12px; }

/* Chinese genre name, set vertically in the margin like an inscription */
.zh {
  font-family: var(--zh);
  font-weight: 600;
  writing-mode: vertical-rl;
  letter-spacing: .3em;
  color: var(--seal);
  font-size: 1.05rem;
  margin: 0;
}

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  font: 500 var(--t-sm)/1 var(--sans);
  letter-spacing: .02em;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  transition: transform .5s var(--ease), background-color .4s ease, backdrop-filter .4s ease;
}
.bar.is-tucked { transform: translateY(-100%); }
.bar.is-top { background: transparent; backdrop-filter: none; }
.bar__home { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1.125rem/1 var(--serif); }
.bar__home img { width: 22px; height: auto; }
.bar__nav { display: flex; gap: clamp(14px, 2.2vw, 32px); }
.bar__nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 0; transition: color .2s; }
.bar__nav a[aria-current="page"] { color: var(--ink); }
.bar__nav a:hover, .menu nav a:hover { color: var(--seal); }
.bar__nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--seal); }
.bar__menu { display: none; }
/* phone menu: the pages as a column of large names, each with its Chinese name in seal red */
.menu {
  position: fixed; inset: 0; z-index: 30; background: var(--paper);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 92px var(--gutter) calc(28px + env(safe-area-inset-bottom, 0px));
}
.menu[hidden] { display: none; }
.menu nav { display: grid; border-top: 1px solid var(--hair); }
.menu nav a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--hair); text-decoration: none;
  font: 400 clamp(2rem, 9vw, 2.6rem)/1.1 var(--serif); letter-spacing: -.01em;
  animation: menu-in .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 40ms);
}
.menu nav a span { font: 400 1rem/1 var(--zh); letter-spacing: .25em; color: var(--seal); }
.menu nav a[aria-current="page"] { color: var(--seal); }
.menu__foot {
  margin: auto 0 0; padding-top: 40px; display: flex; justify-content: space-between; align-items: baseline;
  font: var(--caption); color: var(--ink-soft);
}
.menu__foot a { text-decoration: none; color: var(--ink); }
.menu__foot span { font: 400 1rem/1 var(--zh); letter-spacing: .15em; color: var(--seal); }
@keyframes menu-in { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 860px) {
  .bar__nav { display: none; }
  .bar__menu {
    display: block; position: relative; z-index: 31;
    font: inherit; background: none; border: 0; color: var(--ink); padding: 10px 0 10px 16px; cursor: pointer;
  }
  .bar.is-open { transform: none; background: var(--paper); backdrop-filter: none; z-index: 40; }
}

/* ---------- hero ----------
   Desktop: name + lede, portrait and calligraphy form one centred group on a common axis.
   Phones: the name, then the portrait with the calligraphy and its caption beside it, then the lede. */
.hero { position: relative; display: grid; }
.hero__name { letter-spacing: -.025em; padding-bottom: .06em; }  /* glyphs never touch the lede */
.hero__lede { font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.4; color: var(--ink-soft); }
/* the seal is stamped right after the signature, about the height of the capitals */
.hero__seal { display: inline-block; width: .62em; height: auto; margin-left: .14em; vertical-align: baseline; }
.hero__portrait { margin: 0; }
.hero__portrait .pic { box-shadow: 0 30px 60px -40px rgba(31, 29, 26, .55); }
.hero__calli { margin: 0; }
.hero__ink img { width: 100%; }
.hero__calli figcaption { font: var(--caption); color: var(--ink-soft); text-align: center; max-width: 16ch; }

@media (min-width: 701px) {
  .hero {
    min-height: min(100svh, 860px); align-items: center; justify-content: center; row-gap: var(--gutter);
    grid-template-columns: auto auto auto; column-gap: clamp(48px, 6vw, 110px);
    padding: clamp(96px, 14vh, 140px) var(--gutter) clamp(56px, 9vh, 96px);
  }
  .hero__name { margin: 0; font-size: clamp(5rem, 10.5vw, 10.5rem); line-height: .88; }
  .hero__lede { margin: clamp(22px, 3.5vh, 36px) 0 0; max-width: 32ch; }
  .hero__portrait { width: clamp(220px, 23vw, 360px); }
  .hero__calli { display: grid; justify-items: center; gap: 16px; }
  .hero__ink { width: clamp(120px, 14vw, 230px); }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .hero { grid-template-columns: auto auto; column-gap: clamp(40px, 6vw, 72px); }
  .hero__calli { display: none; }
}
@media (max-width: 700px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 32px 20px;
    padding: 96px var(--gutter) 48px;
  }
  .hero__text { display: contents; }
  .hero__name { grid-column: 1 / -1; grid-row: 1; margin-left: -.04em; font-size: clamp(3.4rem, 17vw, 4.6rem); line-height: .95; }
  .hero__portrait { grid-column: 1; grid-row: 2; width: 100%; }
  .hero__calli { grid-column: 2; grid-row: 2; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 12px; }
  .hero__ink { width: 88px; }
  .hero__calli figcaption { max-width: 11ch; font-size: .72rem; line-height: 1.35; }
  .hero__lede { grid-column: 1 / -1; grid-row: 3; margin: 0; max-width: 30ch; font-size: 1.15rem; }
}

/* Page-load sequence: the calligraphy is "written" top to bottom, then the seal is stamped */
.js .hero__ink { clip-path: inset(0 0 100% 0); }
.js .hero__name, .js .hero__lede { opacity: 0; translate: 0 14px; }
.js .hero__seal { opacity: 0; scale: 1.35; }
.js .hero__portrait { opacity: 0; translate: 0 18px; }
.is-loaded .hero__portrait { opacity: 1; translate: 0 0; transition: opacity 1.6s var(--ease) .3s, translate 1.6s var(--ease) .3s; }
.is-loaded .hero__ink { clip-path: inset(0 0 0 0); transition: clip-path 2.2s cubic-bezier(.55, .1, .35, 1) .15s; }
.is-loaded .hero__name { opacity: 1; translate: 0 0; transition: opacity 1.2s var(--ease) .5s, translate 1.2s var(--ease) .5s; }
.is-loaded .hero__lede { opacity: 1; translate: 0 0; transition: opacity 1.2s var(--ease) .8s, translate 1.2s var(--ease) .8s; }
.is-loaded .hero__seal { opacity: 1; scale: 1; transition: opacity .25s ease-out 2.2s, scale .45s cubic-bezier(.3, 1.6, .5, 1) 2.2s; }

/* ---------- handscroll ---------- */
.scroll { position: relative; }
.scroll__stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto auto; grid-template-columns: 100%;
  padding: 88px 0 28px;
}
.scroll__head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 40rem); column-gap: clamp(18px, 4vw, 72px); align-items: start;
  padding: 0 var(--gutter); margin-bottom: 20px;
}
.scroll__head .zh { margin-right: -12px; }
.scroll__quote { margin: 0; align-self: end; font-style: italic; font-size: clamp(1.0625rem, 1.45vw, 1.375rem); line-height: 1.5; }
.scroll__quote p { margin: 0; }
.scroll__quote p::before { content: "« "; }
.scroll__quote p::after { content: " »"; }
.scroll__quote footer { margin-top: 10px; font: var(--caption); font-style: normal; color: var(--ink-soft); }
/* the quote is read along with the scroll: words darken as the handscroll unrolls */
.scroll__quote .w { opacity: .22; transition: opacity .5s ease; }
.scroll__quote .w.is-on { opacity: 1; }
@media (max-width: 900px) {
  .scroll__head { grid-template-columns: auto minmax(0, 1fr); }
  .scroll__quote { grid-column: 2; margin-top: 14px; font-size: 1rem; }
}
.scroll__hint { font: var(--caption); color: var(--ink-soft); margin: 10px 0 0; }
.scroll__track {
  display: flex; flex-direction: row; align-items: center;
  gap: clamp(48px, 7vw, 120px);
  padding: 0 var(--gutter);
  width: max-content;
  will-change: transform;
}
.scroll__item { margin: 0; display: grid; gap: 14px; }
.scroll__item .pic { height: min(46svh, 440px); width: auto; aspect-ratio: var(--ar); cursor: zoom-in; }  /* one height for all three; the longest runs further */
.scroll__item .pic img { height: 100%; width: 100%; object-fit: contain; }
.scroll__item figcaption { font: var(--caption); color: var(--ink-soft); max-width: 36ch; }
.scroll__item figcaption b { display: block; font: 400 1.0625rem/1.3 var(--serif); color: var(--ink); }
.scroll__rod { margin: 18px var(--gutter) 0; height: 1px; background: var(--paper-deep); position: relative; }
.scroll__rod span { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* No-JS and reduced motion: a plain horizontal strip the reader scrolls */
.scroll.is-static .scroll__stage { position: relative; height: auto; }
.scroll.is-static .scroll__track { overflow-x: auto; width: auto; margin: 0; scroll-snap-type: x proximity; padding-bottom: 12px; }
.scroll.is-static .scroll__rod { display: none; }

.chapter blockquote footer {
  margin-top: 18px; font: var(--caption); font-style: normal; color: var(--ink-soft);
}

/* ---------- gallery ---------- */
.works { padding: 0 var(--gutter) clamp(80px, 12vh, 140px); }
.works__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 24px;
  margin-bottom: 40px;
}
.works__count { margin: 0; font: var(--caption); color: var(--ink-soft); }
.filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 20px; }
.filters button {
  font: 500 var(--t-sm)/1 var(--sans); color: var(--ink-soft); letter-spacing: .02em;
  background: none; border: 0; padding: 10px 0; cursor: pointer;
  box-shadow: inset 0 -1px 0 transparent; transition: color .2s, box-shadow .3s var(--ease);
}
.filters button span { font-family: var(--zh); font-weight: 400; margin-left: 4px; color: var(--seal); }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -1px 0 var(--seal); }

/* Hang in full rows: every row spans the whole width (no holes); row heights change
   from one row to the next so the wall has a rhythm (see hang() in main.js). */
.grid { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: var(--cg); row-gap: clamp(40px, 4.5vw, 64px); --cg: clamp(18px, 2.2vw, 36px); }
.tile {
  flex: 0 0 auto; min-width: 0; margin: 0; cursor: zoom-in; display: grid; gap: 12px; align-content: start;
  background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; width: 260px;
}
.tile .pic { width: 100%; aspect-ratio: var(--lar, var(--ar)); }  /* a narrow hanging scroll keeps the row height */
.tile .pic picture { display: block; width: 100%; height: 100%; }
.tile .pic img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom;
  transition: transform .9s var(--ease), filter .6s ease; transform-origin: center bottom; }
.tile:hover .pic img, .tile:focus-visible .pic img { transform: translateY(-4px); filter: drop-shadow(0 16px 20px rgba(31, 29, 26, .16)); }
.tile__cap { display: grid; gap: 3px; font: var(--caption); color: var(--ink-soft); }
.tile__cap b { font: 400 1.0625rem/1.3 var(--serif); color: var(--ink); text-wrap: balance; }
.tile[hidden] { display: none; }
@media (max-width: 640px) { .grid { --cg: 14px; row-gap: 32px; } .tile__cap b { font-size: .95rem; } }
.grid--small { margin-top: 56px; grid-column: 1 / -1; }

/* while loading, the slot shows the painting's average colour; the image fades in quickly over it */
.pic { position: relative; background: var(--ph, transparent); }
.pic img { opacity: 0; transition: opacity .3s ease; }
.pic img.is-ready { opacity: 1; }

/* ---------- life ---------- */
.chapter__year { margin: 0; }
.chapter__body p:last-child { margin-bottom: 0; }
.chapter__fig { margin: 0; }
.chapter__fig figcaption { font: var(--caption); color: var(--ink-soft); margin-top: 10px; }
.chapter--quote blockquote { margin: 0; font-size: clamp(1.25rem, 2vw, 1.625rem); line-height: 1.45; font-style: italic; }
.chapter--quote blockquote p::before { content: "« "; }
.chapter--quote blockquote p::after { content: " »"; }
.pull { font-style: italic; font-size: 1.25rem; line-height: 1.45; border-left: 1px solid var(--seal); padding-left: 18px; }

/* ---------- exhibitions ---------- */
.expo { position: relative; padding: clamp(80px, 12vh, 140px) var(--gutter); display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 48px clamp(32px, 6vw, 120px); }
.expo__head { position: sticky; top: 100px; align-self: start; display: grid; grid-template-columns: auto 1fr; column-gap: 18px; }
.expo__head .zh { grid-row: span 3; }
.expo__head p:not(.zh) { margin-top: 18px; color: var(--ink-soft); max-width: 40ch; }
.expo__list { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.expo__list li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 20px; padding: 14px 0; position: relative; }
.expo__list li::before {
  content: ""; position: absolute; left: -32px; top: 1.15em; width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--ink-faint); transition: background .4s, border-color .4s;
}
.expo__list li.is-past::before { background: var(--seal); border-color: var(--seal); }
.expo__list time { font-size: var(--t-md); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.expo__list p { margin: .25em 0 0; }
.expo__list::before { content: ""; position: absolute; left: 0; top: 1.4em; bottom: 1.4em; width: 1px; background: var(--paper-deep); }
.expo__list::after {
  content: ""; position: absolute; left: 0; top: 1.4em; bottom: 1.4em; width: 1px; background: var(--ink);
  transform-origin: top; transform: scaleY(var(--p, 0));
}
@media (max-width: 860px) {
  .expo { grid-template-columns: 1fr; }
  .expo__head { position: static; }
  .expo__list li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- masters ---------- */
.masters { padding: clamp(60px, 10vh, 120px) var(--gutter); }
.masters header { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; max-width: 68ch; margin-bottom: 56px; }
.masters header .zh { grid-row: 1 / span 9; }
.masters header > :not(.zh) { grid-column: 2; }
.masters header p:not(.zh) { margin: 14px 0 0; color: var(--ink-soft); }
.masters__row { display: flex; align-items: flex-start; gap: clamp(24px, 4vw, 64px); overflow-x: auto; padding-bottom: 16px; scrollbar-width: thin; }
.master { margin: 0; flex: 0 0 auto; display: grid; gap: 14px; cursor: zoom-in; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; }
.master .pic { height: clamp(260px, 46vh, 460px); aspect-ratio: var(--ar); }
.master .pic img { height: 100%; width: auto; }
.master span { font: var(--caption); color: var(--ink-soft); }
.masters__sub { font-size: var(--t-md); margin: 64px 0 24px; }
.masters__row--photos .master .pic { height: clamp(180px, 28vh, 280px); box-shadow: 0 14px 30px -20px rgba(31, 29, 26, .45); }
.masters__row--photos .master span { max-width: 30ch; }
/* a series inside the gallery (e.g. the peony ballet) gets its own heading line */
.series { flex: 0 0 100%; display: grid; gap: 8px; padding: 22px 0 0; border-top: 1px solid var(--hair); }
.series h3 { font-size: var(--t-md); line-height: 1.2; }
.series p { margin: 0; font-style: italic; color: var(--ink-soft); max-width: 62ch; }
.series[hidden], .series p:empty { display: none; }
.master b { display: block; font: 400 1.0625rem/1.3 var(--serif); color: var(--ink); }

/* ---------- studio ---------- */
.studio {
  padding: clamp(60px, 10vh, 120px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 38rem) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 120px);
  border-top: 1px solid var(--hair);
}
.studio__text { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-content: start; }
.studio__text .zh { grid-row: 1 / span 9; }
.studio__text > :not(.zh) { grid-column: 2; }
.studio__text h2 { margin-bottom: 24px; }
.studio__fig { margin: 0; justify-self: end; max-width: 520px; }
.studio__fig figcaption { font: var(--caption); color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } .studio__fig { justify-self: start; } }

/* ---------- press ---------- */
.press { padding: clamp(60px, 10vh, 120px) var(--gutter); }
.press__head { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; margin-bottom: 40px; }
.press__head .zh { grid-row: span 2; }
.press__head p:not(.zh) { margin: 10px 0 0; font: var(--caption); color: var(--ink-soft); }

/* ---------- catalogues ---------- */
.cats { padding: clamp(60px, 10vh, 120px) var(--gutter); }
.cats h2 { margin-bottom: 40px; }
.cats__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 48px; }
.cats__list a { display: grid; gap: 10px; text-decoration: none; width: 260px; }
.cats__list .pic { height: 280px; width: auto; max-width: 100%; aspect-ratio: var(--ar); box-shadow: 0 14px 30px -18px rgba(31, 29, 26, .45); transition: translate .5s var(--ease); }
.cats__list .pic img { width: 100%; height: 100%; }
.cats__list a:hover .pic { translate: 0 -4px; }
.cats__title { font-size: 1.0625rem; line-height: 1.3; }
.cats__meta { font: 400 var(--t-sm)/1 var(--sans); color: var(--ink-soft); }

/* ---------- footer ---------- */

/* ---------- lightbox ---------- */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
  display: grid; grid-template-columns: minmax(0, 1fr) 22rem; grid-template-rows: minmax(0, 1fr) auto;
}
.lb:not([open]) { display: none; }
.lb::backdrop { background: var(--paper); }
.lb__stage { position: relative; min-height: 0; grid-row: 1; grid-column: 1; }
.lb__media { position: absolute; inset: 0; display: grid; grid-template: 100% / 100%; place-items: center; padding: clamp(48px, 6vh, 72px) clamp(56px, 6vw, 96px) 16px; }
.lb__media picture { display: contents; }
.lb__media img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; grid-area: 1 / 1; min-height: 0; }
.lb__zone {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; background: none; border: 0; padding: 0 clamp(10px, 2vw, 28px);
  display: flex; align-items: center; color: var(--ink-soft); font: 400 1.6rem/1 var(--serif);
}
.lb__zone--prev { left: 0; justify-content: flex-start; cursor: w-resize; }
.lb__zone--next { right: 0; justify-content: flex-end; cursor: e-resize; }
.lb__zone span { opacity: .35; transition: opacity .25s, transform .35s var(--ease); }
.lb__zone:hover span, .lb__zone:focus-visible span { opacity: 1; }
.lb__zone--prev:hover span { transform: translateX(-4px); }
.lb__zone--next:hover span { transform: translateX(4px); }
.lb__zone:focus-visible { outline-offset: -6px; }
.lb__info { grid-row: 1; grid-column: 2; align-self: end; padding: 0 40px 28px 8px; }
.lb__zh { font: 400 1.25rem/1.3 var(--zh); color: var(--seal); margin: 0 0 10px; }
.lb__zh:empty { display: none; }
.lb__title { font-size: var(--t-md); line-height: 1.25; text-wrap: balance; }
.lb__date { margin: 10px 0 0; font: 400 1rem/1.4 var(--sans); color: var(--ink-soft); }
.lb__pos { margin: 20px 0 0; font: 400 var(--t-sm)/1 var(--sans); color: var(--ink-faint); font-variant-numeric: lining-nums tabular-nums; }
.lb__strip {
  grid-row: 2; grid-column: 1 / -1; display: flex; gap: 10px; overflow-x: auto; padding: 12px clamp(16px, 4vw, 40px) 18px;
  scrollbar-width: none; scroll-behavior: smooth; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.lb__strip::-webkit-scrollbar { display: none; }
.lb__thumb { flex: 0 0 auto; height: 56px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .45; transition: opacity .25s; position: relative; }
.lb__thumb img { height: 100%; width: auto; display: block; }
.lb__thumb:hover { opacity: .8; }
.lb__thumb[aria-selected="true"] { opacity: 1; }
.lb__thumb[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--seal); }
.lb__close {
  position: absolute; top: 10px; right: 14px; z-index: 3; font: 500 var(--t-sm)/1 var(--sans); color: var(--ink-soft);
  background: none; border: 0; padding: 14px; cursor: pointer;
}
.lb__close:hover { color: var(--ink); }
.lb.is-entering .lb__info, .lb.is-entering .lb__strip, .lb.is-entering .lb__zone { opacity: 0; }
.lb .lb__info, .lb .lb__strip, .lb .lb__zone { transition: opacity .45s ease .2s; }
@media (max-width: 860px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; }
  .lb__media { padding: 52px 16px 8px; }
  .lb__info { grid-row: 2; grid-column: 1; padding: 8px 16px 6px; align-self: start; }
  .lb__strip { grid-row: 3; }
  .lb__zone span { opacity: .6; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .js .hero__ink { clip-path: none; }
  .js .hero__name, .js .hero__lede, .js .hero__seal { opacity: 1; translate: none; scale: none; }
}

/* ---------- multi-page ---------- */
.page-sub main > section:first-child { padding-top: clamp(96px, 14vh, 140px); }
.page-sub main > section:first-child h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -.015em; }
.more {
  font: 500 var(--t-sm)/1 var(--sans); color: var(--ink); text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--seal); padding-bottom: 4px;
}
.more:hover { color: var(--seal); }
.works--home { padding-top: clamp(80px, 12vh, 140px); }
.works--home .works__head { grid-template-columns: minmax(0, 1fr) auto; }
.expo--home .expo__list li:last-child { padding-bottom: 0; }
.expo--home .expo__head .more { display: inline-block; margin-top: 14px; }
.masters--home header a { color: inherit; }

/* ---------- motion ---------- */
/* page to page: a short ink-fade (cross-document view transitions; browsers without support just navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .6s cubic-bezier(.22, .61, .21, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* section titles rise into place; the vertical Chinese label is "stamped" just after */
.js .rise { opacity: 0; transform: translateY(.45em); transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.js .rise.is-in { opacity: 1; transform: none; }
.js .zh.rise { transform: none; clip-path: inset(0 0 100% 0); transition: clip-path 1.1s cubic-bezier(.6, .05, .25, 1) .15s, opacity .4s; }
.js .zh.rise.is-in { clip-path: inset(0 0 0 0); }

/* biography: the year stays in view while its chapter is read */
@media (min-width: 901px) { .chapter__year { position: sticky; top: 96px; } }

/* exhibitions: rows settle in as the ink line reaches them */
.expo__list li { transition: opacity .6s ease, transform .8s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .js .rise, .js .zh.rise { opacity: 1; transform: none; clip-path: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* home selection: absolutely placed salon wall (see salon() in main.js) */
.grid--salon { display: block; position: relative; }
.grid--salon .tile { position: absolute; transition: left .6s var(--ease), top .6s var(--ease), width .6s var(--ease); }

/* ---------- rails (auto-drifting rows) ---------- */
.rail { scrollbar-width: none; cursor: grab; }
.rail::-webkit-scrollbar { display: none; }
.rail.is-drag { cursor: grabbing; }
.rail.is-drag * { pointer-events: none; }
.rail.is-drifting, .rail.is-drag { scroll-snap-type: none; }
.rail__ctl { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.rail__ctl button {
  width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); background: none;
  color: var(--ink); font: 400 1.05rem/1 var(--serif); cursor: pointer; transition: border-color .25s, color .25s, opacity .25s;
}
.rail__ctl button:hover:not(:disabled) { border-color: var(--seal); color: var(--seal); }
.rail__ctl button:disabled { opacity: .3; cursor: default; }
/* soft fade at the edges hints that the row continues */
.rail { --fl: 0px; --fr: 0px; mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); }
.rail.is-more-left { --fl: 28px; }
.rail.is-more-right { --fr: 28px; }

/* ---------- biography: full-width sheets of paper laid one over the other ----------
   No card chrome: each chapter is a sheet the width of the page with a large year;
   the next sheet slides up over it while the previous one recedes and dims. */
.life { padding: clamp(60px, 10vh, 120px) 0 0; background: var(--paper); }
.life__head { display: flex; gap: 18px; align-items: flex-start; padding-inline: var(--gutter); margin-bottom: clamp(24px, 4vh, 48px); }
.life .chapter {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 34rem) minmax(0, 1fr);
  gap: 16px clamp(28px, 4vw, 72px); align-items: center;
  padding: clamp(56px, 9vh, 96px) var(--gutter);
  background: var(--paper);
}
.life .chapter:nth-of-type(even) { background: var(--paper-deep); }
.life .chapter__year {
  font: 400 clamp(4.5rem, 9vw, 8.5rem)/.82 var(--serif); letter-spacing: -.03em; color: var(--ink);
  font-variant-numeric: oldstyle-nums; align-self: start;
}
.life .chapter__fig { max-width: 440px; justify-self: center; }
.life .chapter__fig .pic { box-shadow: 0 24px 50px -34px rgba(31, 29, 26, .5); }
@media (min-width: 901px) {
  .life .chapter {
    position: sticky; top: 0; min-height: 100svh; padding-top: calc(64px + clamp(40px, 7vh, 80px));
    box-shadow: 0 -1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 -24px 48px -36px rgba(31, 29, 26, .35);
    transform-origin: 50% 0; transform: scale(calc(1 - var(--p, 0) * .04)); will-change: transform;
  }
  .life .chapter::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: #1f1d1a; opacity: calc(var(--p, 0) * .18);
  }
  .life .chapter.is-flat { position: relative; min-height: 0; transform: none; }
  .life .chapter.is-flat::after { display: none; }
}
@media (max-width: 900px) {
  .life .chapter { grid-template-columns: 1fr; row-gap: 20px; padding-block: 56px; }
  .life .chapter__year { font-size: 4rem; }
}
@media (prefers-reduced-motion: reduce) { .life .chapter { transform: none !important; } .life .chapter::after { display: none; } }
.series--theme { padding-top: 40px; border-top: 0; }
.series--theme:first-child { padding-top: 0; }
.series--theme h3 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
.zh-inline { font-family: var(--zh); font-size: .6em; color: var(--seal); margin-left: .4em; vertical-align: .15em; }
.tile--band { grid-template-columns: 1fr; }
.tile--band .pic { aspect-ratio: auto; height: auto; }
.tile--band .pic img { height: auto; }
@media (max-width: 640px) { .tile--band .pic { width: 100%; } }
.chapter__figs { display: grid; gap: 22px; justify-items: center; align-content: center; }
.life .chapter__figs .chapter__fig { max-width: 520px; }
/* personnages: Ruji tall on the left, two rows on the right */
.mosaic { flex: 0 0 100%; display: grid; align-items: start; }
.mosaic__right { display: flex; flex-direction: column; }
.mosaic__row { display: flex; gap: var(--cg); align-items: flex-start; }
.mosaic.is-flow, .mosaic.is-flow .mosaic__right, .mosaic.is-flow .mosaic__row { display: contents; }
.mosaic:not(.is-flow) > .tile { grid-column: 1; grid-row: 1; }
.mosaic:not(.is-flow) > .mosaic__right { grid-column: 2; grid-row: 1; }
.life .chapter:first-of-type { box-shadow: none; }

/* ---------- final pass ---------- */
/* atelier: students as a readable two-column list */
.students { list-style: none; margin: 4px 0 22px; padding: 0; columns: 2 15rem; column-gap: 32px; }
.students li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); line-height: 1.3; }
.students span { display: block; font: var(--caption); color: var(--ink-soft); }
.students a { text-decoration: none; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--seal) 55%, transparent); }
.students a:hover { color: var(--seal); }
.tile.is-flash .pic { outline: 2px solid var(--seal); outline-offset: 6px; transition: outline-color 1.2s ease; }

/* press: a wall of clippings by decade */
.grid--press .tile .pic { box-shadow: 0 1px 0 rgba(31, 29, 26, .06), 0 14px 30px -18px rgba(31, 29, 26, .35); }

/* footer: a quiet colophon on the deeper paper, the seal as signature */
.foot {
  display: block; padding: clamp(64px, 10vh, 112px) var(--gutter) 28px; margin-top: clamp(40px, 8vh, 96px);
  background: var(--paper-deep); border-top: 0;
}
.foot__mast { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 20px; align-items: end; }
.foot__seal { grid-row: 1 / span 2; width: clamp(52px, 5vw, 72px); height: auto; align-self: center; margin: 0; }
.foot__name { grid-column: 2; margin: 0; font: 400 clamp(2.25rem, 4.5vw, 3.75rem)/.95 var(--serif); letter-spacing: -.015em; color: var(--ink); }
.foot__zh { grid-column: 3; grid-row: 1; margin: 0 0 .35em; font: 400 1.125rem/1 var(--zh); color: var(--seal); letter-spacing: .15em; }
.foot__role { grid-column: 2 / -1; margin: 10px 0 0; font: var(--caption); color: var(--ink-soft); }
.foot__cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(24px, 5vw, 80px);
  margin-top: clamp(40px, 7vh, 72px); padding-top: 32px; border-top: 1px solid var(--hair);
}
.foot__col { display: grid; gap: 10px; align-content: start; font: 400 .95rem/1.45 var(--sans); }
.foot__col p { margin: 0; color: var(--ink-soft); }
.foot__col a { color: var(--ink); text-decoration: none; width: fit-content; box-shadow: inset 0 -1px 0 transparent; transition: color .2s, box-shadow .25s; }
.foot__col a:hover { color: var(--seal); box-shadow: inset 0 -1px 0 var(--seal); }
.foot__col .foot__h { font: 500 var(--t-sm)/1 var(--sans); color: var(--ink-faint); margin-bottom: 6px; }
.foot__col .email { color: var(--ink); font-size: 1.05rem; }
.foot__base {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(48px, 8vh, 80px); font: 400 .8rem/1.4 var(--sans); color: var(--ink-faint);
}
.foot__base p { margin: 0; }
.foot__top { color: var(--ink-soft); text-decoration: none; }
.foot__top:hover { color: var(--seal); }
@media (max-width: 760px) {
  .foot__cols { grid-template-columns: 1fr; }
  .foot__mast { grid-template-columns: auto 1fr; }
  .foot__zh { grid-column: 2; grid-row: auto; margin: 6px 0 0; }
  .foot__role { grid-column: 2; }
}

/* 404 */
.notfound { min-height: 60svh; padding: 140px var(--gutter) 80px; display: grid; align-content: start; gap: 14px; }
.notfound .zh { margin-bottom: 6px; }
.notfound p { color: var(--ink-soft); }
.series--artist { display: flex; align-items: baseline; gap: 14px; padding-top: 34px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); scroll-margin-top: 90px; }
.series--artist:first-child { padding-top: 0; border-top: 0; }
.series--artist h3 { font-size: 1.375rem; }
.series--artist p { font: 400 var(--t-sm)/1 var(--sans); color: var(--ink-soft); font-style: normal; }

/* home: one call to action at the end of each section, always in the same place and style */
.cta-row { margin: clamp(28px, 4vh, 44px) 0 0; grid-column: 1 / -1; }
.cta {
  display: inline-block; padding: 14px 26px;
  font: 500 .95rem/1 var(--sans); letter-spacing: .02em; color: var(--paper); text-decoration: none;
  background: var(--ink); border-radius: 2px;
  transition: background-color .3s ease, transform .3s var(--ease);
}
.cta:hover, .cta:focus-visible { color: var(--paper); background: var(--seal); transform: translateY(-1px); }
.scroll__cta { margin: 14px var(--gutter) 0; }
.expo--home .cta-row { grid-column: 2; }
@media (max-width: 860px) { .expo--home .cta-row { grid-column: 1; } }
.life .chapter__fig--wide { max-width: 520px; }
/* two photos stacked in the right column, each kept short enough for the chapter to fit the screen */
.life .chapter__figs--stack { justify-items: stretch; gap: 18px; }
.life .chapter__figs--stack .chapter__fig { max-width: 400px; justify-self: center; }
@media (min-width: 901px) { .life .chapter__figs--stack .pic { width: min(100%, calc(31svh * var(--ar))); } }
/* two photos side by side, next to the text, at one common height */
.chapter__side { display: flex; gap: 16px; align-items: flex-start; justify-self: end; }
.chapter__side figure { margin: 0; flex: var(--ar) 1 0; min-width: 0; }
.chapter__side .pic { box-shadow: 0 24px 50px -34px rgba(31, 29, 26, .5); }
.chapter__side figcaption { font: var(--caption); color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 900px) { .chapter__side { justify-self: stretch; } }
@media (min-width: 901px) {
  .life .chapter:has(.chapter__side) { grid-template-columns: minmax(0, 15rem) minmax(0, 28rem) minmax(0, 1fr); }
  .chapter__side { width: 100%; max-width: 640px; }
}
/* medium screens: the photo pair moves under the text instead of shrinking beside it */
@media (min-width: 901px) and (max-width: 1240px) {
  .life .chapter:has(.chapter__side) { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); }
  .chapter__side { grid-column: 2; justify-self: start; max-width: 620px; margin-top: 8px; }
}
/* atelier: a column of teaching photos beside the text */
.studio__figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; align-content: start; justify-self: end; max-width: 620px; width: 100%; }
.studio__figs .studio__fig { margin: 0; max-width: none; justify-self: stretch; }
@media (max-width: 900px) { .studio__figs { justify-self: stretch; } }
.studio__figs .studio__fig .pic { aspect-ratio: 4 / 3; } .studio__figs .studio__fig .pic img { width: 100%; height: 100%; object-fit: cover; }  /* four photos, two by two */
@media (max-width: 600px) { .studio__figs { grid-template-columns: 1fr; } }

/* cut-outs (round fans, calligraphy, seals) and transparent PNGs: no coloured slot behind them */
.master .pic, .hero__ink, .pic:has(img.is-ready) { background: transparent; }
/* phones: the three handscrolls stacked, full width, under the title and quote */
.scroll.is-stacked .scroll__stage { padding: 56px 0 24px; }
.scroll.is-stacked .scroll__track { flex-direction: column; align-items: stretch; overflow: visible; gap: 28px; padding: 0 var(--gutter); scroll-snap-type: none; }
.scroll.is-stacked .scroll__item .pic { width: 100%; height: auto; aspect-ratio: var(--ar); }
.scroll.is-stacked .scroll__item .pic img { height: 100%; }
.scroll.is-stacked .scroll__head { margin-bottom: 28px; }

/* phones: a chapter photo is never taller than about half the screen */
@media (max-width: 900px) { .life .chapter__fig .pic { width: min(100%, calc(52svh * var(--ar))); } }
/* the guestbook under the text; two photos of one size stacked in the right column (1978) */
.chapter__note { margin: 22px 0 0; }
.chapter__note .pic, .chapter__pair2 .pic { box-shadow: 0 24px 50px -34px rgba(31, 29, 26, .5); }
.chapter__note figcaption, .chapter__pair2 figcaption { font: var(--caption); color: var(--ink-soft); margin-top: 8px; }
.chapter__pair2 { display: grid; gap: 18px; justify-self: center; width: min(100%, calc(32svh * 1.52)); }
.chapter__pair2 figure { margin: 0; }
.chapter__pair2 .pic { aspect-ratio: 3 / 2; }
.chapter__pair2 .pic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .chapter__pair2 { width: 100%; justify-self: stretch; } }
/* "all" view: each genre heading carries its quote */
.series--theme p { margin-top: 6px; max-width: 70ch; text-wrap: pretty; }
.series__by { font: var(--caption); font-style: normal; color: var(--ink-faint); white-space: nowrap; }
/* a single quotation set in a page (atelier, press) */
.studio__quote, .press__quote { margin: 8px 0 24px; padding-left: 18px; border-left: 1px solid var(--seal); max-width: 60ch; }
.studio__quote p, .press__quote p { margin: 0; font-style: italic; font-size: 1.2rem; line-height: 1.45; }
.studio__quote p::before, .press__quote p::before { content: "« "; }
.studio__quote p::after, .press__quote p::after { content: " »"; }
.studio__quote footer, .press__quote footer { margin-top: 10px; font: var(--caption); color: var(--ink-soft); }
.press__quote { margin: 0 0 48px; }
/* a round fan or cut-out in a chapter: no rectangular shadow */
.life .chapter__fig--cut .pic { box-shadow: none; }
