/* ── Wang Jun 王俊 — paper, ink, rosewood ───────────────────────── */

/* Typography: all self-hosted, all SIL OFL (licence texts: assets/fonts/OFL-*.txt), subset to the site's own text
   (rebuild with tools/subset-fonts.mjs whenever the copy changes).
   EB Garamond    Latin text face (variable 400-600)
   Cormorant      Latin display face: headings and the large italic openings only
   WJ Song        Noto Serif SC Medium: Chinese text. Han + CJK punctuation only
   WJ Latin       EB Garamond limited to letters/digits, placed in front of WJ Song
                  so figures and Latin words inside Chinese text are not Song-style
   WJ Brush       Ma Shan Zheng: the brush hand (name, marks, ink transition) */
@font-face { font-family: "EB Garamond"; src: url(assets/fonts/eb-garamond.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(assets/fonts/eb-garamond-italic.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(assets/fonts/cormorant.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(assets/fonts/cormorant-italic.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "WJ Latin"; src: url(assets/fonts/eb-garamond.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; unicode-range: U+0020-00B6, U+00B8-024F, U+1E00-1EFF; }
@font-face { font-family: "WJ Song"; src: url(assets/fonts/noto-serif-sc.woff2) format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "WJ Brush"; src: url(assets/fonts/brush.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #f6f3ec;
  --paper-2: #efebe2;
  --ink: #1b1a17;
  --ink-2: #57534b;
  --ink-3: #8b867c;
  --hair: rgba(27, 26, 23, .14);
  --seal: #a8322b;
  --serif: "EB Garamond", "WJ Song", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "SimSun", serif;
  --display: "Cormorant", "EB Garamond", "WJ Song", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "SimSun", serif;
  --zh: "WJ Latin", "WJ Song", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --brush: "WJ Brush", "STKaiti", "KaiTi", "Kaiti SC", serif;
  --kai: "WJ Brush", "STKaiti", "KaiTi", "Kaiti SC", "BiauKai", "WJ Song", serif;
  --w: 1240px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1vw + 9.5px, 20px);
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: lining-nums proportional-nums; /* Garamond's old-style 1 reads as a capital I */
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }
::selection { background: var(--ink); color: var(--paper); }

/* language switching: .en / .fr / .zh siblings, one shown; .lat = shown in both Latin-script languages */
html:not([data-lang="en"]) .en, html:not([data-lang="fr"]) .fr, html:not([data-lang="zh"]) .zh { display: none !important; }
html[data-lang="zh"] .lat { display: none !important; }
sup { font-size: .68em; line-height: 0; vertical-align: .42em; letter-spacing: 0; } /* French ordinals: 2e, XIIe */
html[data-lang="zh"] body { font-family: var(--zh); font-size: clamp(16px, .85vw + 9.5px, 18.5px); letter-spacing: .05em; font-variant-numeric: lining-nums; }
.zh { font-family: var(--zh); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }

:focus-visible { outline: 1px solid var(--seal); outline-offset: 4px; }

/* ── Chinese framing: one sober rosewood moulding, silk mount (绫), bronze hanger ──────────────
   Nothing is injected. The moulding is a single border-image (assets/img/frame-rosewood.jpg:
   768px square, 128px slice, mitres + rounded profile + light from the upper left baked in).
   .frame            framed painting: moulding + silk mount + hanger     <div class="frame"><img></div>
   .frame-slim       text panel or photograph: thin moulding only, no mount, no hanger
   .work .pic        grid tile: thinnest moulding, no mount, no hanger (see gallery) */
:root {
  --rosewood: #5c2e1f;                     /* fallback + flat wood accents */
  --rosewood-hi: #7a4530;
  --rosewood-lo: #3a1a11;
  --silk: #ebe3cf;
  /* tone-on-tone damask floret, half-drop repeat (72px tile) */
  --silk-damask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cdefs%3E%3Cg id='f' fill='none' stroke='%23c3b287' stroke-opacity='.3' stroke-width='1.1' stroke-linecap='round'%3E%3Ccircle r='1.7'/%3E%3Cg id='p'%3E%3Cpath d='M0-3.4c-3.6-2.6-3.6-7.4 0-10.2 3.6 2.8 3.6 7.6 0 10.2z'/%3E%3Cpath d='M4.6-4.6c2.6-2.9 6.3-2.3 7 .5.5 2.2-1.3 3.7-3 3-1.2-.5-1.3-1.9-.3-2.4'/%3E%3C/g%3E%3Cuse href='%23p' transform='rotate(90)'/%3E%3Cuse href='%23p' transform='rotate(180)'/%3E%3Cuse href='%23p' transform='rotate(270)'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23f' x='18' y='18'/%3E%3Cuse href='%23f' x='54' y='54'/%3E%3Cg fill='%23c3b287' fill-opacity='.3'%3E%3Ccircle cx='54' cy='18' r='1.1'/%3E%3Ccircle cx='18' cy='54' r='1.1'/%3E%3Ccircle cx='36' cy='0' r='.8'/%3E%3Ccircle cx='0' cy='36' r='.8'/%3E%3Ccircle cx='36' cy='72' r='.8'/%3E%3Ccircle cx='72' cy='36' r='.8'/%3E%3C/g%3E%3C/svg%3E");
  /* antique bronze hanger: stepped openwork loop, softened at the corners, on a fret-engraved plate (48 x 40) */
  --hanger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 40'%3E%3Cdefs%3E%3ClinearGradient id='b' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%237f6b40'/%3E%3Cstop offset='.4' stop-color='%234b3d22'/%3E%3Cstop offset='1' stop-color='%23241b0e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath id='l' fill='none' stroke='%231a1208' stroke-width='5.6' stroke-linejoin='round' d='M9.5 24v-8h9v-8h11v8h9v8'/%3E%3Cpath fill='none' stroke='url(%23b)' stroke-width='4.2' stroke-linejoin='round' d='M9.5 24v-8h9v-8h11v8h9v8'/%3E%3Cpath fill='none' stroke='%23c2a66a' stroke-opacity='.5' stroke-width='.6' stroke-linecap='round' d='M8.3 15.2q.2-1 1.2-1.1h7.2v-6.2q.1-1 1.1-1.2h11'/%3E%3Crect x='2.5' y='22' width='43' height='17.5' rx='1.6' fill='url(%23b)' stroke='%231a1208' stroke-width='.7'/%3E%3Cpath fill='none' stroke='%23c2a66a' stroke-opacity='.45' stroke-width='.6' d='M3.6 22.8h40.8'/%3E%3Cg fill='none' stroke='%23b99c5e' stroke-opacity='.6' stroke-width='.9'%3E%3Cpath d='M14 35v-9h8.5v6.5h-4.7v-3.2h2.2'/%3E%3Cpath d='M34 35v-9h-8.5v6.5h4.7v-3.2h-2.2'/%3E%3Cpath d='M6 35v-9h4.5v5.6h-2'/%3E%3Cpath d='M42 35v-9h-4.5v5.6h2'/%3E%3Cpath d='M5.5 36.6h37'/%3E%3C/g%3E%3C/svg%3E");
}

.frame {
  --fw: clamp(18px, 2.1vw, 30px);                 /* moulding */
  --mat: clamp(14px, 2.2vw, 34px);                /* silk mount at the sides and foot */
  --mat-top: calc(var(--mat) * 1.45);             /* a little more silk above, as mounters leave it */
  --hw: clamp(26px, calc(var(--fw) * 1.42), 42px);/* hanger width */
  --hrise: calc(var(--hw) * .8);                  /* how far the hanger stands above the top rail */
  position: relative;
  margin-top: var(--hrise);                       /* reserved, so nothing clips or jumps */
  border: var(--fw) solid var(--rosewood);
  border-image: url(assets/img/frame-rosewood.jpg) 128 / var(--fw) stretch;
  padding: var(--mat-top) var(--mat) var(--mat);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 1px, rgba(120,100,60,.03) 1px 2px),
    var(--silk-damask) 0 0 / 46px 46px,
    var(--silk);
  box-shadow:
    inset 0 0 0 1px rgba(38, 18, 10, .55),          /* dark line where wood meets silk */
    inset 3px 4px 7px -1px rgba(38, 18, 10, .30),   /* the moulding's shadow on the mount */
    0 1px 2px rgba(38, 20, 10, .35),
    0 5px 10px -2px rgba(38, 20, 10, .22),
    0 30px 46px -26px rgba(38, 20, 10, .55);        /* wall shadow */
}
.frame > img {
  position: relative;
  box-shadow: 0 0 0 1px rgba(84, 66, 38, .38), 0 0 0 2px rgba(255, 255, 255, .28), 1px 2px 3px 1px rgba(84, 66, 38, .14);
}
/* the hanger: screwed behind the top rail, rising above it */
.frame::before {
  content: ""; position: absolute; pointer-events: none;
  left: 50%; bottom: calc(100% + var(--fw) - 1px);
  width: var(--hw); aspect-ratio: 48 / 40;
  transform: translateX(-50%);
  background: var(--hanger) center bottom / 100% 100% no-repeat;
  filter: drop-shadow(1px 2px 1.5px rgba(30, 18, 8, .38));
}

/* text panels and the photograph: the same wood, thinner; plain paper inside, nothing to hang */
.frame-slim {
  --fw: clamp(7px, .8vw, 10px);
  margin-top: 0; padding: 0; background: #faf8f3;
  box-shadow:
    inset 0 0 0 1px rgba(38, 18, 10, .4),
    inset 2px 3px 5px -2px rgba(38, 18, 10, .22),
    0 1px 2px rgba(38, 20, 10, .25),
    0 22px 36px -26px rgba(38, 20, 10, .45);
}
.frame-slim::before { content: none; }

/* ── seal: the artist's own, traced from the one on his paintings (assets/img/seal.svg) ──
   <span class="seal"><img></span>. It rests a little off square, as a hand leaves it.
   Stamping (main.js adds .wait, then .stamp; the ink transition never touches it): the stone's
   shadow comes down, the seal lands and squashes, the cinnabar takes from two pressure points
   outwards, the paper gives a little, the stone lifts. */
.seal { --tilt: -1.6deg; position: relative; display: inline-block; flex: none; width: 36px; aspect-ratio: 1000 / 994; rotate: var(--tilt); }
.seal > img { display: block; width: 100%; height: 100%; }
.seal-sm { --tilt: 1.2deg; width: 34px; margin-left: 14px; vertical-align: middle; }
.seal-lg { --tilt: -1.1deg; width: 60px; margin-bottom: 28px; }
.seal::before, .seal::after { content: ""; position: absolute; inset: 0; border-radius: 12%; pointer-events: none; opacity: 0; }
.seal::before { background: rgba(52, 24, 16, .62); filter: blur(4px); }                             /* the stone, coming down */
.seal::after { box-shadow: 0 0 0 1px rgba(27, 26, 23, .1), 0 1px 7px 2px rgba(27, 26, 23, .16); }  /* the paper giving under it */
.seal.wait > img { opacity: 0; }
.seal.stamp { animation: seal-press 1.05s both; }
.seal.stamp > img {
  animation: seal-ink 1.05s both;
  -webkit-mask: radial-gradient(circle closest-side, #000 62%, transparent) 30% 66% / 40% 40% no-repeat, radial-gradient(circle closest-side, #000 55%, transparent) 74% 26% / 20% 20% no-repeat;
  mask: radial-gradient(circle closest-side, #000 62%, transparent) 30% 66% / 40% 40% no-repeat, radial-gradient(circle closest-side, #000 55%, transparent) 74% 26% / 20% 20% no-repeat;
}
.seal.stamp::before { animation: seal-stone 1.05s both; }
.seal.stamp::after { animation: seal-give 1.05s both; }
@keyframes seal-press {
  0%   { transform: translate(4px, -18px) scale(1.36) rotate(8deg); animation-timing-function: cubic-bezier(.6, 0, .9, .45); }
  36%  { transform: scale(.94) rotate(-.9deg); animation-timing-function: ease-out; }
  48%  { transform: scale(.955) rotate(-.6deg); animation-timing-function: cubic-bezier(.3, 0, .3, 1); }
  66%  { transform: scale(1.022) rotate(.3deg); }
  100% { transform: none; }
}
@keyframes seal-ink {
  0%, 34% { opacity: 0; -webkit-mask-size: 40% 40%, 20% 20%; mask-size: 40% 40%, 20% 20%; filter: blur(.8px) saturate(1.35) brightness(1.12); }
  38%  { opacity: .72; -webkit-mask-size: 130% 130%, 70% 70%; mask-size: 130% 130%, 70% 70%; }
  52%  { opacity: .9; -webkit-mask-size: 260% 260%, 190% 190%; mask-size: 260% 260%, 190% 190%; filter: blur(.3px) saturate(1.35) brightness(1.12); }
  70%  { opacity: 1; -webkit-mask-size: 640% 640%, 640% 640%; mask-size: 640% 640%, 640% 640%; filter: blur(0) saturate(1.25) brightness(1.08); }
  100% { opacity: 1; -webkit-mask-size: 640% 640%, 640% 640%; mask-size: 640% 640%, 640% 640%; filter: blur(0) saturate(1) brightness(1); }   /* the wet cinnabar dries */
}
@keyframes seal-stone {
  0%   { opacity: 0; transform: translate(7px, 12px) scale(1.1); }
  30%  { opacity: .6; }
  36%  { opacity: .85; transform: none; }
  46%  { opacity: .7; transform: none; }
  62%, 100% { opacity: 0; transform: translate(4px, 7px) scale(1.16); }
}
@keyframes seal-give {
  0%, 33% { opacity: 0; transform: scale(1.12); }
  38%  { opacity: 1; transform: scale(1.02); }
  50%  { opacity: .8; transform: none; }
  100% { opacity: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .seal.wait > img { opacity: 1; }
  .seal.stamp, .seal.stamp > img, .seal.stamp::before, .seal.stamp::after { animation: none; -webkit-mask: none; mask: none; }
}

/* ── top bar ──────────────────────────────── */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: rgba(246, 243, 236, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s;
}
.bar.scrolled { border-bottom-color: var(--hair); }
.bar::before { /* a plain strip of rosewood across the very top */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(180deg, var(--rosewood-hi), var(--rosewood) 45%, var(--rosewood-lo));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { white-space: nowrap; font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: .16em; text-transform: uppercase; }
html[data-lang="zh"] .brand-name { font-size: 18px; letter-spacing: .2em; }
.nav { margin-left: auto; display: flex; gap: clamp(14px, 2.6vw, 36px); }
.nav a { white-space: nowrap; text-decoration: none; font-size: 13.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); position: relative; padding: 4px 0; }
html[data-lang="zh"] .nav a { letter-spacing: .3em; font-size: 14.5px; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
/* EN / FR / 中: one outlined pill, three buttons; the current language is inked, the others are pale */
.lang { flex: none; display: inline-flex; align-items: center; font-size: 13px; font-variant-numeric: lining-nums; border: 1px solid var(--hair); border-radius: 999px; padding: 0 5px; color: var(--ink-3); letter-spacing: .08em; transition: border-color .2s; }
.lang button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; border-radius: 999px; margin: 0; padding: 4px 7px; cursor: pointer; transition: color .2s; }
.lang button[aria-pressed="true"] { color: var(--ink); cursor: default; }
.lang button:hover { color: var(--ink); }
.lang button:focus-visible { outline-offset: -1px; }
.lang i { font-style: normal; opacity: .5; }
.lang:hover { border-color: var(--ink-2); }

/* ── hero ─────────────────────────────────── */
.hero {
  max-width: var(--w); margin: 0 auto;
  min-height: 100svh;
  padding: 120px var(--pad) 80px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero-text { display: flex; gap: clamp(24px, 3.5vw, 48px); align-items: flex-start; }
.name-vert {
  writing-mode: vertical-rl; margin: 0;
  font-family: var(--kai); font-weight: 400;
  font-size: clamp(92px, 10vw, 164px); line-height: 1; letter-spacing: .04em;
  color: var(--ink);
}
.hero-meta { padding-top: 10px; }
.kicker { margin: 0 0 18px; font-size: 12.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); }
html[data-lang="zh"] .kicker { letter-spacing: .4em; font-size: 13.5px; }
.hero-name { font-family: var(--display); font-size: clamp(44px, 4.4vw, 66px); line-height: 1; margin: 0 0 20px; font-weight: 500; letter-spacing: .01em; }
.hero-sub { color: var(--ink-2); margin: 0 0 40px; font-size: 18px; line-height: 1.6; }
html[data-lang="zh"] .hero-sub { font-size: 17px; line-height: 1.95; letter-spacing: .1em; }
.motto { margin: 0; padding-left: 20px; border-left: 1px solid var(--seal); }
.motto-zh { font-family: var(--kai); font-size: clamp(22px, 1.75vw, 26px); line-height: 1.3; letter-spacing: .02em; margin: 0 0 8px; white-space: nowrap; }
.motto-en { font-style: italic; color: var(--ink-2); margin: 0; font-size: 17px; line-height: 1.5; }

.hero-art { margin: 0; }
.hero-art figcaption { margin-top: 16px; font-size: 15px; color: var(--ink-3); letter-spacing: .02em; font-style: italic; }
html[data-lang="zh"] .hero-art figcaption { font-style: normal; font-size: 14px; letter-spacing: .12em; }

/* ── sections ─────────────────────────────── */
.section { max-width: var(--w); margin: 0 auto; padding: clamp(80px, 12vw, 160px) var(--pad) 0; }
.sec-head { display: flex; align-items: center; gap: 22px; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-num { font-family: var(--kai); font-size: 30px; line-height: 1; color: var(--seal); }
.sec-head h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(36px, 4.2vw, 56px); line-height: 1.1; letter-spacing: 0; }
html[data-lang="zh"] .sec-head h2 { font-size: clamp(28px, 3.1vw, 42px); letter-spacing: .22em; }
.sec-rule { flex: 1; height: 1px; background: var(--hair); position: relative; }
.sec-rule::before { content: ""; position: absolute; left: 0; top: -2px; width: min(56px, 100%); /* a long title leaves the rule shorter than that */ height: 5px;
  background: linear-gradient(180deg, var(--rosewood-hi), var(--rosewood) 50%, var(--rosewood-lo));
  box-shadow: 0 1px 2px rgba(38,20,10,.3); }
.cn { font-style: normal; font-family: var(--zh); }

/* biography */
.bio { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(36px, 6vw, 90px); align-items: start; }
.bio-text p { margin: 0 0 1.2em; max-width: 62ch; color: #2c2a26; }
.bio-text .lead { font-size: 1.24em; line-height: 1.48; color: var(--ink); }
html[data-lang="zh"] .bio-text p { line-height: 2.05; text-align: justify; }
html[data-lang="zh"] .bio-text .lead { font-size: 1.16em; line-height: 1.95; }
.pull { margin: 56px 0 0; padding: 30px 0 0; border-top: 1px solid var(--hair); }
.pull blockquote { margin: 0; }
.pull p { font-style: italic; font-size: 1.12em; line-height: 1.55; color: var(--ink-2) !important; }
.pull p.zh { font-style: normal; }
.pull figcaption { font-size: 14.5px; letter-spacing: .08em; color: var(--ink-3); }

.bio-side { align-self: stretch; }   /* the full height of the row, so the card below can stay in view */
.portrait { margin: 0 0 clamp(28px, 3vw, 40px); display: flex; align-items: flex-end; gap: 20px; }
.portrait .frame { flex: none; width: min(220px, 56%); }   /* a 480px photograph: never shown larger than it is */
.portrait picture { display: block; }
.portrait img { width: 100%; filter: grayscale(.55) sepia(.22) contrast(1.04) brightness(1.02); }
.portrait figcaption { padding-bottom: 6px; font-size: 14.5px; line-height: 1.5; letter-spacing: .04em; color: var(--ink-3); }
.portrait figcaption b { display: block; white-space: nowrap; margin-bottom: 4px; font-family: var(--display); font-weight: 500; font-size: 23px; line-height: 1.15; letter-spacing: .02em; color: var(--ink); }
html[data-lang="zh"] .portrait figcaption { font-size: 14px; letter-spacing: .12em; }
html[data-lang="zh"] .portrait figcaption b { font-family: var(--kai); font-size: 30px; letter-spacing: .1em; }
.bio-card { position: sticky; top: 100px; }
.card-inner { padding: clamp(24px, 3vw, 38px); }
.card-inner h3 { margin: 0 0 14px; font-weight: 500; font-size: 12.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--seal); }
.card-inner h3:not(:first-child) { margin-top: 32px; }
html[data-lang="zh"] .card-inner h3 { font-size: 14px; letter-spacing: .4em; }
.plain, .timeline { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 16.5px; line-height: 1.42; }
.plain.small li { font-size: 15px; color: var(--ink-2); }
html[data-lang="zh"] :is(.plain, .timeline) li { font-size: 15.5px; line-height: 1.7; }
html[data-lang="zh"] .plain.small li { font-size: 14.5px; }
.timeline li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 16.5px; line-height: 1.42; }
.timeline b { font-family: var(--serif); font-weight: 500; font-variant-numeric: lining-nums; letter-spacing: .02em; }

/* ── manifesto ────────────────────────────── */
.manifesto-inner { padding: clamp(32px, 7vw, 100px) clamp(24px, 7vw, 110px); }
.m-open { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.4vw, 33px); line-height: 1.38; max-width: 29em; margin: 0 0 clamp(40px, 6vw, 72px); font-style: italic; color: var(--ink); }
.m-open.zh { font-family: var(--zh); font-style: normal; line-height: 1.9; font-size: clamp(19px, 1.7vw, 24px); letter-spacing: .08em; }
.tenets { list-style: none; margin: 0; padding: 0; }
.tenets li { display: grid; grid-template-columns: clamp(56px, 7vw, 96px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--hair); }
.t-mark { font-family: var(--kai); font-size: clamp(56px, 6.6vw, 92px); line-height: .9; color: var(--ink); opacity: .9; }
.tenets h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: clamp(25px, 2.3vw, 32px); line-height: 1.2; }
html[data-lang="zh"] .tenets h3 { font-size: clamp(21px, 1.9vw, 26px); letter-spacing: .14em; margin-bottom: 14px; }
.tenets p { margin: 0 0 1em; max-width: 64ch; color: #2f2d29; }
html[data-lang="zh"] .tenets p { line-height: 2.05; text-align: justify; }
.tenets li:last-child .t-mark { color: var(--seal); }
.m-sign { margin: 40px 0 0; text-align: right; font-style: italic; color: var(--ink-2); font-size: 19px; }
html[data-lang="zh"] .m-sign { font-style: normal; font-size: 28px; letter-spacing: .06em; color: var(--ink); }
html[data-lang="zh"] .m-sign .zh { font-family: var(--kai); }

/* ── gallery ──────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: -24px 0 40px; }
.filters button { font: inherit; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; background: none; border: 0; padding: 6px 0; cursor: pointer; color: var(--ink-3); border-bottom: 1px solid transparent; }
.filters button small { font-size: 12px; letter-spacing: 0; color: var(--ink-3); margin-left: 2px; }
.filters button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.filters button:hover { color: var(--ink); }

.gallery { columns: 3 300px; column-gap: clamp(20px, 3vw, 40px); }
.work { break-inside: avoid; margin: 0 0 clamp(28px, 4vw, 52px); cursor: zoom-in; display: block; width: 100%; background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; }
.work .pic { --fw: clamp(6px, .7vw, 8px); background: var(--silk); overflow: hidden; border: var(--fw) solid var(--rosewood); border-image: url(assets/img/frame-rosewood.jpg) 128 / var(--fw) stretch; box-shadow: 0 1px 2px rgba(38,20,10,.28), 0 16px 28px -22px rgba(38,20,10,.5); }
.work img { width: 100%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), opacity .6s; opacity: 0; }
.work img.loaded { opacity: 1; }
.work:hover img { transform: scale(1.025); }
.work .cap { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 16.5px; }
.work .cap .t-zh { font-family: var(--zh); color: var(--ink-3); font-size: 14px; letter-spacing: .12em; white-space: nowrap; }
.work.hide { display: none; }

/* works toolbar */
.works-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin: -24px 0 40px; }
.works-bar .filters { margin: 0; }
.view-toggle { display: inline-flex; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; gap: 2px; }
.view-toggle button { font: inherit; font-size: 13.5px; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink-3); padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .3s, color .3s; }
.view-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.view-toggle button:not([aria-pressed="true"]):hover { color: var(--ink); }

/* one painting at a time */
.slide {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(28px, 4vw, 64px); align-items: center; padding: 72px 0 24px;
  scroll-snap-align: center;
}
.slide.hide { display: none; }
.slide-art { display: flex; justify-content: center; align-items: center; min-width: 0; }
.slide .frame { --fw: clamp(16px, 1.9vw, 28px); --mat: clamp(20px, 3.2vw, 48px); --mat-top: calc(var(--mat) * 1.25); cursor: zoom-in; display: inline-block; max-width: 100%;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), opacity 1.1s ease; opacity: .18; transform: scale(.95); }
.slide .frame img { max-height: calc(100svh - 136px - var(--hrise) - 2 * var(--fw) - var(--mat-top) - var(--mat)); width: auto; max-width: 100%; }
.slide-text { transition: opacity .9s ease .15s, transform .9s cubic-bezier(.2,.7,.2,1) .15s; opacity: 0; transform: translateY(14px); }
.slide.active .frame { opacity: 1; transform: none; }
.slide.active .slide-text { opacity: 1; transform: none; }
.slide-no { font-size: 13.5px; letter-spacing: .2em; color: var(--seal); margin: 0 0 18px; font-variant-numeric: lining-nums; }
.slide-no span { color: var(--ink-3); }
.slide-text h3 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 2.8vw, 42px); line-height: 1.1; margin: 0 0 8px; }
html[data-lang="zh"] .slide-text h3 { font-size: clamp(26px, 2.3vw, 34px); letter-spacing: .16em; margin-bottom: 18px; }
.slide-zh { font-family: var(--kai); font-size: 30px; line-height: 1.2; letter-spacing: .1em; margin: 0 0 18px; color: var(--ink-2); }
.slide-cat { font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--hair); }
.slide-text p.desc { margin: 0 0 1em; font-size: 17.5px; line-height: 1.58; color: #2f2d29; }
html[data-lang="zh"] .slide-cat { font-size: 13.5px; letter-spacing: .22em; }
html[data-lang="zh"] .slide-text p.desc { line-height: 2; font-size: 16px; text-align: justify; }
.slide-zoom { font: inherit; font-size: 14px; letter-spacing: .12em; background: none; border: 0; border-bottom: 1px solid var(--ink-3); padding: 2px 0; color: var(--ink-2); cursor: pointer; margin-top: 8px; }
.slide-zoom:hover { color: var(--ink); border-color: var(--ink); }

html.snap { scroll-snap-type: y proximity; }

.ex-counter { position: fixed; right: clamp(14px, 2.4vw, 32px); top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .1em; color: var(--ink-3);
  opacity: 0; pointer-events: none; transition: opacity .5s; font-variant-numeric: lining-nums; }
.ex-counter.on { opacity: 1; }
.ex-counter b { font-weight: 500; color: var(--ink); }
.ex-counter i { display: block; width: 1px; height: 60px; background: var(--hair); position: relative; }
.ex-counter i::after { content: ""; position: absolute; left: -1px; top: 0; width: 3px; height: var(--p, 0%); background: var(--seal); transition: height .5s; }

/* ── contact ──────────────────────────────── */
.contact { padding-bottom: clamp(80px, 10vw, 140px); }
.plinth-inner { text-align: center; padding: clamp(48px, 8vw, 100px) var(--pad); }
.plinth-inner h2 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 48px); margin: 0 0 16px; line-height: 1.12; }
html[data-lang="zh"] .plinth-inner h2 { font-size: clamp(24px, 2.8vw, 36px); letter-spacing: .18em; line-height: 1.4; }
.plinth-inner p { color: var(--ink-2); margin: 0 0 32px; }
.btn { display: inline-block; text-decoration: none; border: 1px solid var(--ink); padding: 12px 30px; letter-spacing: .1em; font-size: 16px; font-variant-numeric: lining-nums; transition: background .3s, color .3s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn[hidden], .cform[hidden] { display: none; }
/* contact form: hairline fields on the paper, labels above */
.cform { max-width: 520px; margin: 0 auto; text-align: left; display: grid; gap: 22px; }
.cform label { display: grid; gap: 6px; font-size: 13.5px; letter-spacing: .1em; color: var(--ink-3); }
.cform :is(input[type="text"], input[type="email"], textarea) { font: inherit; font-size: 16px; letter-spacing: normal; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; padding: 6px 0 8px; width: 100%; transition: border-color .2s; }
.cform textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.cform :is(input, textarea):focus { outline: none; border-bottom-color: var(--ink); }
.cform-hp { position: absolute; left: -9999px; opacity: 0; }
.cform button.btn { font: inherit; font-size: 16px; letter-spacing: .1em; color: var(--ink); background: none; border-radius: 0; cursor: pointer; justify-self: center; margin-top: 6px; }
.cform button.btn:hover { background: var(--ink); color: var(--paper); }
.cform button.btn:disabled { opacity: .45; cursor: default; }
.cform-status { min-height: 1.6em; text-align: center; font-size: 15px; color: var(--ink-2); }
.cform-status > span { display: none; }
.cform[data-state="sending"] [data-s="sending"], .cform[data-state="sent"] [data-s="sent"], .cform[data-state="error"] [data-s="error"] { display: inline; }
.cform[data-state="error"] .cform-status { color: var(--seal); }

.foot { max-width: var(--w); margin: 0 auto; padding: 28px var(--pad) 40px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); border-top: 1px solid var(--hair); }
.foot p { margin: 0; }
.totop { text-decoration: none; }

/* ── lightbox ─────────────────────────────── */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(246, 243, 236, .98); color: var(--ink); display: none; }
.lightbox[open] { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; }
.lightbox::backdrop { background: rgba(246, 243, 236, .9); }
.lightbox figure { grid-column: 2; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; padding: 56px 0 24px; min-width: 0; }
.lightbox img { max-height: calc(100vh - 150px); max-width: 100%; width: auto; object-fit: contain; box-shadow: 0 30px 60px -30px rgba(40,34,24,.45); transition: opacity .35s; }
.lightbox img.fading { opacity: 0; }
.lightbox figcaption { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; align-items: baseline; font-size: 19px; text-align: center; padding: 0 16px; }
.nw { white-space: nowrap; }
#lb-meta { color: var(--ink-3); font-size: 13.5px; letter-spacing: .12em; font-variant-numeric: lining-nums; }
.lb-close, .lb-nav { background: none; border: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.lb-close { position: absolute; top: 14px; right: 22px; font-size: 40px; line-height: 1; z-index: 2; }
.lb-nav { font-size: 54px; height: 100%; }
.lb-close:hover, .lb-nav:hover { color: var(--ink); }

/* ── ink transition (ink.js) ────────────── */
.inkfx { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; } /* sized by ink.js to the measured viewport */
html.ink-run :is(.bar, main, .foot) * { -webkit-text-fill-color: transparent !important; text-shadow: none !important; }
html.ink-run :is(.lang, .btn, .view-toggle button, .filters button, .slide-zoom) { border-color: transparent !important; }
html.ink-run .view-toggle button[aria-pressed="true"] { background: transparent !important; }
html.ink-run .nav a::after { opacity: 0; }
/* nothing may animate under the canvas, or as the real page is handed back (ink-end) */
html.ink-run :is(.lang, .lang button, .btn, .view-toggle button, .filters button, .slide-zoom, .reveal),
html.ink-end :is(.bar, main, .foot) * { transition: none !important; }

/* ── reveal ───────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .work img { transition: none; }
}

/* ── responsive ───────────────────────────── */
@media (min-width: 901px) and (max-width: 1100px) { /* narrow right column: the caption goes under the photograph */
  .portrait { flex-direction: column; align-items: flex-start; gap: 14px; }
  .portrait figcaption { padding-bottom: 0; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; padding-top: 110px; }
  .motto-zh { white-space: normal; }
  .hero-text { order: 1; }
  .hero-art { order: 2; }
  .bio { grid-template-columns: 1fr; }
  .bio-card { position: static; }
  .bio-side { display: contents; }
  .portrait { order: -1; margin-bottom: 0; }
  .slide { grid-template-columns: minmax(0, 1fr); min-height: auto; padding: 56px 0; gap: 24px; }
  .slide .frame img { max-height: 64svh; }
  .ex-counter { display: none; }
  html.snap { scroll-snap-type: none; }   /* stacked slides are taller than the screen: snapping would pull a nav jump past the section title */
  /* the French nav is the longest, and the language pill now holds three: keep the bar on one line */
  .bar { gap: 16px; }
  .nav { gap: 16px; }
  .nav a { font-size: 12.5px; letter-spacing: .12em; }
}
@media (max-width: 820px) {
  .brand-name { display: none; }
}
@media (max-width: 640px) {
  .bar { gap: 12px; padding-block: 10px; }
  .nav { gap: 14px; }
  .nav a { font-size: 11.5px; letter-spacing: .08em; }
  html[data-lang="zh"] .nav a { letter-spacing: .1em; font-size: 14px; }
  .lang { padding: 0 3px; font-size: 12px; }
  .lang button { padding: 5px 6px; }
  .name-vert { font-size: 84px; }
  .motto-zh { font-size: 19.5px; letter-spacing: 0; white-space: nowrap; }
  .tenets li { grid-template-columns: 1fr; gap: 8px; }
  .portrait { gap: 16px; }
  .portrait .frame { width: 46%; }
  .portrait figcaption b { font-size: 21px; }
  html[data-lang="zh"] :is(.bio-text p, .tenets p, .slide-text p.desc) { text-align: start; } /* too few characters per line to justify evenly */
  .lightbox[open] { grid-template-columns: 0 1fr 0; }
  .lb-nav { display: none; }
}
@media (max-width: 560px) { /* seal + nav + three-way language pill no longer fit on one line */
  .bar { flex-wrap: wrap; row-gap: 8px; }
  .lang { margin-left: auto; }
  .lang button { position: relative; padding: 5px 10px; }
  .lang button::after { content: ""; position: absolute; inset: -8px -1px; }   /* a finger-sized target without a taller pill */
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; gap: 6px; }
  .nav a { font-size: 11px; letter-spacing: .1em; }
  .hero { padding-top: 130px; }
}
