/* ============================================================
   sz330.github.io — 墨水画 stylesheet
   宣纸 · 松烟墨 · 五墨（焦浓重淡清）· 留白
   No colour: hierarchy is carried by ink density alone.
   EB Garamond · 思源宋体 · 马善政楷书 · IBM Plex Mono
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* 宣纸 rice paper */
  --xuan: #f3ebd8;
  --xuan-2: #e9dfc7;
  /* 五墨 — the five densities of pine-soot ink */
  --jiao: #100f0d;   /* 焦墨 burnt — accents, the darkest mark on the page */
  --mo: #262320;     /* 浓墨 thick — body text */
  --zhong: #4b463d;  /* 重墨 heavy */
  --mo-soft: #766d5e; /* 淡墨 light — secondary text */
  --qing: #a89e8a;   /* 清墨 clear — the faintest wash */
  /* 朱砂 cinnabar — the ONE colour on the page, and only ever in the seal.
     A 墨水画 is monochrome except here: the seal is stamped, not painted. */
  --zhu: #a5322b;
  /* 界行 rule lines */
  --jie: #cfc3a6;
  --jie-strong: #b0a181;

  --serif: "EB Garamond", "Noto Serif SC", Georgia, "Songti SC", serif;
  --cjk: "Noto Serif SC", "Songti SC", serif;
  --brush: "Ma Shan Zheng", "Kaiti SC", cursive;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --measure: 64ch;
  --pad: clamp(20px, 4vw, 48px);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.7;
  color: var(--mo);
  background-color: var(--xuan);
  /* paper fiber + 帘纹 laid lines */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.085'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, rgba(35, 32, 27, 0.018) 0 1px, transparent 1px 7px);
  background-blend-mode: multiply, normal;
  overflow-x: hidden;
}

:lang(zh-Hans), .cjk { font-family: var(--cjk); }

::selection { background: var(--jiao); color: var(--xuan); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--jie-strong);
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

a:hover { color: var(--jiao); text-decoration-color: var(--jiao); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--jiao);
  outline-offset: 3px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- scroll progress ---------- */

.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--jiao);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--xuan);
  border-bottom: 3px double var(--mo);
}

.nav .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 15px;
  padding-bottom: 15px;
}

.nav-name {
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-name em { font-style: italic; color: var(--jiao); }


.nav ul {
  display: flex;
  list-style: none;
  gap: clamp(14px, 2.6vw, 30px);
  flex-wrap: wrap;
}

.nav ul a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  text-decoration: none;
  color: var(--mo-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}

.nav ul a:hover { color: var(--jiao); }

.nav ul a[aria-current="page"] {
  color: var(--jiao);
  border-bottom-color: var(--jiao);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(56px, 9vh, 108px);
  padding-bottom: clamp(96px, 24vh, 260px);
  min-height: calc(100svh - 72px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hero-inner { will-change: opacity, transform; }

/* ============================================================
   墨水画 — the hero IS the painting
   Composed after the Ma-Xia school (马远 "One-Corner Ma" / 夏圭):
   the weight is pushed into the corners — 郑板桥 bamboo holding the
   lower left, a 王冕 plum branch entering the upper right, mountains
   and water laid low — and the middle is 留白, empty paper, which is
   where the words live. Scrolling peels the corners back off the page.

   The whole peel runs off ONE inherited custom property, --peel (0→1),
   which site.js writes on .hero-art once per frame. Each layer declares
   its own escape vector below, so the load-in animations (which own the
   children) and the scroll peel (which owns the layers) never contend
   for the same property on the same element.
   ============================================================ */

.hero-art {
  --peel: 0;
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

:is(.hero-art, .page-art) .lyr {
  --o: 1;      /* base ink weight, dialled down on small screens */
  --fade: 1;   /* how completely this layer leaves as the page opens */
  position: absolute;
  opacity: calc(var(--o) * (1 - var(--fade) * var(--peel)));
  will-change: transform, opacity;
}

/* the ink is laid down stroke by stroke, wet, and dries into the paper */
:is(.hero-art, .page-art) .lyr > * {
  display: block;
  width: 100%;
  animation: ink-in 2.2s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes ink-in {
  from { opacity: 0; transform: translateY(16px); filter: blur(7px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* --- 远山 the distant range: 淡墨, thinned almost to water --- */
.l-far {
  left: 0; right: 0; bottom: 0;
  height: 56%;
  filter: blur(1.7px);
  --fade: 0.9;
  transform: translateY(calc(-7vh * var(--peel))) scale(calc(1 + 0.04 * var(--peel)));
  transform-origin: 50% 100%;
}
.l-far > svg { animation-delay: 0.45s; }

/* --- 近山 the near peaks, cut with 斧劈皴 axe-stroke texture --- */
.l-mid {
  left: 0; right: 0; bottom: 0;
  height: 41%;
  --fade: 0.95;
  transform: translateY(calc(-12vh * var(--peel))) scale(calc(1 + 0.07 * var(--peel)));
  transform-origin: 50% 100%;
}
.l-mid > svg { animation-delay: 0.85s; }

/* --- 水 after 马远《水图》: a handful of strokes, and the rest left empty --- */
.l-water {
  left: 0; right: 0; bottom: 5%;
  height: 15%;
  transform: translateY(calc(7vh * var(--peel)));
}
.l-water > svg { animation-delay: 1.45s; }

/* --- 月 the moon is never painted — it is the blank the wash is laid around (烘云托月).
       It sits low and to the right, rising behind the far range. --- */
/* Out of the inscription's column entirely. At 5vw it sat behind the poem as soon
   as the wrap grew to meet the viewport and the two collided. */
.l-moon {
  right: 30vw;
  top: 58%;
  width: clamp(92px, 11vw, 148px);
  transform: translate(calc(4vw * var(--peel)), calc(-15vh * var(--peel)));
}

.moon {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--xuan);
  box-shadow:
    0 0 0 1px rgba(38, 35, 32, 0.06),
    0 0 28px 14px rgba(38, 35, 32, 0.05),
    0 0 68px 40px rgba(38, 35, 32, 0.022);
  animation-delay: 0.25s;
}

/* --- 墨梅 the plum branch, swept in from the top-right corner --- */
.l-plum {
  top: -3%;
  right: -2vw;
  width: min(46vw, 600px);
  transform-origin: 100% 0;
  transform: translate(calc(21vw * var(--peel)), calc(-9vh * var(--peel))) rotate(calc(7deg * var(--peel)));
}
.l-plum > svg { animation-delay: 1.15s; }

/* --- 墨竹 the bamboo, 浓墨, holding the lower-left corner down.
       Width is pinned to the gutter left of the text column — (100vw - 1080px)/2
       is the margin beside .wrap — so the culms rise in the empty margin and
       stop short of the headline instead of growing through it. --- */
.l-bamboo {
  bottom: 0;
  left: 0;
  width: clamp(130px, calc((100vw - 1080px) / 2 + 28px), 340px);
  transform-origin: 0 100%;
  transform: translate(calc(-25vw * var(--peel)), calc(2vh * var(--peel))) rotate(calc(-6deg * var(--peel)));
}
.l-bamboo > svg { animation-delay: 1.7s; }

/* --- 雁 wild geese, two strokes each --- */
.l-birds {
  inset: 0;
  transform: translate(calc(9vw * var(--peel)), calc(-7vh * var(--peel)));
}
.l-birds > .birds { animation-delay: 2.1s; height: 100%; position: relative; }

.bird { position: absolute; width: 32px; animation: bird-drift 80s linear infinite; }
.bird svg { width: 100%; display: block; }
.bird path { stroke: var(--mo); stroke-width: 2.2; fill: none; stroke-linecap: round; opacity: 0.32; }

/* The geese fly in the open band right of the text column and below the name
   plate — they drift +34vw, so the whole flight path has to stay off the words. */
.bird:nth-child(1) { top: 70%; left: 68%; }
.bird:nth-child(2) { top: 66%; left: 74%; width: 22px; animation-delay: -24s; }

@keyframes bird-drift {
  from { margin-left: 0; }
  to { margin-left: 34vw; }
}

/* --- 雾 mist, breathing; it thins last, so the page seems to surface through it --- */
.l-mist-1 { left: -12%; width: 124%; bottom: 22%; --fade: 0.5;
  transform: translateY(calc(-3vh * var(--peel))) scaleY(calc(1 + 0.7 * var(--peel))); }
.l-mist-2 { left: -12%; width: 124%; bottom: 8%; --fade: 0.4; --o: 0.8;
  transform: translateY(calc(2vh * var(--peel))) scaleY(calc(1 + 0.9 * var(--peel))); }

.mist {
  height: clamp(44px, 8vh, 92px);
  background: linear-gradient(to right, transparent 0%, rgba(243, 235, 216, 0.8) 26%, rgba(243, 235, 216, 0.95) 55%, transparent 100%);
  filter: blur(8px);
  /* ink-in fades it in; mist-drift (listed second) owns the transform */
  animation:
    ink-in 2.2s cubic-bezier(0.22, 1, 0.36, 1) 1.3s backwards,
    mist-drift 26s ease-in-out infinite alternate;
}

.l-mist-2 .mist { animation-duration: 2.2s, 34s; animation-delay: 1.5s, -13s; }

@keyframes mist-drift {
  from { transform: translateX(-3.5%); }
  to { transform: translateX(3.5%); }
}

/* ---- 五墨 — every mark in the painting, graded by ink density ---- */

/* these three fill their layer box and crop at the sides rather than squash */
.l-far > svg, .l-mid > svg, .l-water > svg { height: 100%; }

/* 清墨 / 淡墨 — the distance */
:is(.hero-art, .page-art) .far-1 { fill: var(--mo); opacity: 0.05; }
:is(.hero-art, .page-art) .far-2 { fill: var(--mo); opacity: 0.085; }

/* 重墨 — the near range and its texture */
:is(.hero-art, .page-art) .mid-1 { fill: var(--mo); opacity: 0.15; }
:is(.hero-art, .page-art) .cun { fill: none; stroke: var(--mo); stroke-width: 3; stroke-linecap: round; opacity: 0.13; }
:is(.hero-art, .page-art) .pine { fill: none; stroke: var(--mo); stroke-width: 1.8; stroke-linecap: round; opacity: 0.3; }

/* 水 — and the boat, which is the darkest thing in all that emptiness */
:is(.hero-art, .page-art) .wave { fill: none; stroke: var(--mo); stroke-width: 2.2; stroke-linecap: round; opacity: 0.16; }
:is(.hero-art, .page-art) .boat { fill: none; stroke: var(--mo); stroke-width: 2; stroke-linecap: round; opacity: 0.36; }

/* 墨梅 — branch in 焦墨, petals left as bare paper.
   The blossoms live in a <use> shadow tree that class selectors can't
   reach, so they inherit their ink from this group instead. */
:is(.hero-art, .page-art) .branch { fill: var(--jiao); opacity: 0.82; }
:is(.hero-art, .page-art) .twig { fill: none; stroke: var(--jiao); stroke-linecap: round; opacity: 0.72; }
/* 飞白 — bare paper laid back over the branch where the brush skipped. Broken into
   dashes, not a continuous line: a solid streak down the middle reads as a highlight
   on a tube, which is the one thing a brush stroke must never look like. */
:is(.hero-art, .page-art) .feibai {
  fill: none;
  stroke: var(--xuan);
  stroke-linecap: butt;
  stroke-dasharray: 21 13;
  opacity: 0.4;
}
:is(.hero-art, .page-art) .tai { fill: var(--jiao); opacity: 0.8; }
:is(.hero-art, .page-art) .mei-group {
  fill: var(--xuan);
  stroke: var(--jiao);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.8;
}

/* 墨竹 — 浓墨, pressed hardest into the paper */
:is(.hero-art, .page-art) .culm { fill: var(--jiao); opacity: 0.5; }
:is(.hero-art, .page-art) .node { fill: none; stroke: var(--jiao); stroke-width: 3.4; stroke-linecap: round; opacity: 0.58; }
:is(.hero-art, .page-art) .leaf { fill: var(--jiao); opacity: 0.55; }
:is(.hero-art, .page-art) .culm-far { fill: var(--mo); opacity: 0.14; }
:is(.hero-art, .page-art) .leaf-far { fill: var(--mo); opacity: 0.17; }

/* 坡石 — the rock the bamboo grows out of */
:is(.hero-art, .page-art) .rock { fill: var(--mo); opacity: 0.12; }
:is(.hero-art, .page-art) .cun-rock { fill: none; stroke: var(--mo); stroke-width: 2.2; stroke-linecap: round; opacity: 0.14; }

/* 兰 — the orchid. Every leaf is one stroke: thin where the brush lands, swelling
   through the belly of the arc, drawn out to a hair at the tip. The leaves cross
   each other — 交凤眼, "crossing phoenix eyes" — which is the whole trick of 兰. */
:is(.hero-art, .page-art) .lan-leaf { fill: var(--jiao); opacity: 0.5; }
:is(.hero-art, .page-art) .lan-stem { fill: none; stroke: var(--jiao); stroke-width: 1.8; stroke-linecap: round; opacity: 0.45; }
:is(.hero-art, .page-art) .lan-flower { fill: var(--mo); opacity: 0.42; }
:is(.hero-art, .page-art) .lan-heart { fill: var(--jiao); opacity: 0.72; }

/* 荷 — the lotus: leaves are wet wash, the flower is drawn 圈花法 like the plum */
:is(.hero-art, .page-art) .lotus-pad { filter: url(#bleed); }
:is(.hero-art, .page-art) .pad { fill: var(--mo); opacity: 0.19; }
:is(.hero-art, .page-art) .pad-vein { fill: none; stroke: var(--mo); stroke-width: 1.6; stroke-linecap: round; opacity: 0.22; }
:is(.hero-art, .page-art) .stem { fill: none; stroke: var(--jiao); stroke-width: 2.4; stroke-linecap: round; opacity: 0.5; }
:is(.hero-art, .page-art) .petal { fill: var(--xuan); stroke: var(--jiao); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.78; }
:is(.hero-art, .page-art) .seedpod { fill: none; stroke: var(--jiao); stroke-width: 1.8; opacity: 0.55; }
/* 鱼 — after 八大山人: one fish, a great deal of empty water, and a look on its face */
:is(.hero-art, .page-art) .fish { fill: var(--mo); opacity: 0.42; }
:is(.hero-art, .page-art) .fish-fin { fill: none; stroke: var(--mo); stroke-width: 1.8; stroke-linecap: round; opacity: 0.45; }
:is(.hero-art, .page-art) .fish-eye { fill: var(--jiao); opacity: 0.85; }
:is(.hero-art, .page-art) .fish-eye-white { fill: var(--xuan); }

/* ---------- 内页画 layers ----------
   The inner pages set their headline hard left, so the void is on the right.
   That is where the subject goes — 一角, weight in one corner, the rest of the
   band left as paper for the words to sit on. */

/* the far range, laid along the foot of the band on every inner page */
.l-pg-far {
  left: 0; right: 0; bottom: 0; height: 52%;
  --fade: 0.85;
  transform-origin: 50% 100%;
  transform: translateY(calc(-5vh * var(--peel))) scale(calc(1 + 0.035 * var(--peel)));
}
.l-pg-far > svg { height: 100%; }

.l-pg-mist {
  left: -10%; width: 120%; bottom: 12%;
  --fade: 0.5;
  transform: translateY(calc(-2vh * var(--peel))) scaleY(calc(1 + 0.6 * var(--peel)));
}

/* 兰 — research: the orchid clump sits in the right corner, leaves thrown left */
.l-orchid {
  right: 1vw; top: -3%;
  width: clamp(210px, 27vw, 430px);
  transform-origin: 100% 0;
  transform: translate(calc(18vw * var(--peel)), calc(-8vh * var(--peel))) rotate(calc(6deg * var(--peel)));
}
.l-orchid > svg { animation-delay: 1.05s; }

/* 竹 — projects: a grove standing in the right corner, 郑板桥 again but denser */
.l-grove {
  right: 0; bottom: 0;
  width: clamp(170px, 23vw, 370px);
  transform-origin: 100% 100%;
  transform: translate(calc(22vw * var(--peel)), calc(2vh * var(--peel))) rotate(calc(5deg * var(--peel)));
}
.l-grove > svg { animation-delay: 1.05s; }

/* 荷 — hobbies: lotus over open water, and one fish with an opinion */
.l-lotus {
  right: -1vw; top: 3%;
  width: clamp(220px, 30vw, 470px);
  transform-origin: 100% 0;
  transform: translate(calc(20vw * var(--peel)), calc(-9vh * var(--peel))) rotate(calc(7deg * var(--peel)));
}
.l-lotus > svg { animation-delay: 1.05s; }

/* 荷塘鱼藻 — the fish belongs under the lotus, not stranded mid-paper. Small and
   faint: big and dark in open space it read as clip art rather than 八大山人. */
.l-fish {
  --o: 0.6;
  right: 5vw; bottom: 9%;
  width: clamp(56px, 6.5vw, 96px);
  transform: translate(calc(9vw * var(--peel)), calc(7vh * var(--peel)));
}
.l-fish > svg { animation-delay: 1.6s; }

/* Below ~1180px the gutter beside .wrap closes up and the painting has nowhere
   left to stand but underneath the words. From here down it steps back into a
   watermark: the ink thins the narrower the screen gets. The words have to win. */
@media (max-width: 1180px) {
  .l-bamboo { --o: 0.42; }
  .l-plum { --o: 0.62; }
  .l-orchid, .l-grove, .l-lotus { --o: 0.5; }
}

@media (max-width: 900px) {
  .l-orchid, .l-grove, .l-lotus { --o: 0.3; }
  .l-fish { --o: 0.45; }
}

/* Below ~760px the text column runs the full width and the subject has nowhere
   to stand that isn't on top of a word — the orchid was crossing the headline,
   the bamboo the lede. The plants step off; the range and the mist stay, so the
   page is still ink, just quieter. Same rule as the home page: words win. */
@media (max-width: 760px) {
  .l-orchid, .l-grove, .l-lotus, .l-fish { display: none; }
}

@media (max-width: 1100px) {
  .l-moon { display: none; }
}

/* The branch has to keep its tail out of the SZ-330 line, so as the screen
   narrows it retreats further into the corner rather than reaching across. */
@media (max-width: 900px) {
  .l-bamboo { --o: 0.3; }
  .l-plum { top: -10%; right: -5vw; width: min(52vw, 300px); --o: 0.5; }
  /* No open sky left for them to cross without hitting a word. */
  .l-birds { display: none; }
}

@media (max-width: 620px) {
  .l-bamboo { left: -7vw; --o: 0.18; }
  .l-plum { top: -4%; right: -8vw; width: min(60vw, 240px); --o: 0.4; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mo-soft);
  margin-bottom: 30px;
}

.hero-meta .sep { color: var(--jiao); padding: 0 8px; }

.hero-name {
  font-size: clamp(54px, 9.4vw, 112px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.005em;
  margin-bottom: 28px;
}

.hero-name em { font-style: italic; color: var(--jiao); }

.hero-tag {
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.75;
  max-width: var(--measure);
  margin-bottom: 36px;
}

/* 着重号 — Chinese emphasis dots, not italics */
.hl {
  color: var(--jiao);
  text-emphasis: filled dot var(--jiao);
  -webkit-text-emphasis: filled dot var(--jiao);
  text-emphasis-position: under right;
  -webkit-text-emphasis-position: under right;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hero-links a { text-decoration: none; color: var(--mo); }
.hero-links a::before { content: "· "; color: var(--jiao); }
.hero-links a:hover { color: var(--jiao); }

/* ---------- 米字格 name column ---------- */

/* A painter writes in the blank, not across his own branch. Pushed down so the
   inscription sits under the plum's lowest limb and left of the moon. */
/* Drops the inscription clear of the plum's lowest hanging limb. The tree is sized
   off vw, so this has to be as well — a vh-based drop lets the branch land on the
   poem the moment the window is wide and short. */
.hero-side { padding-top: clamp(200px, 19vw, 290px); }

/* 题款 — the inscription. Each column is set vertical; the columns themselves run
   right to left (row-reverse), which is the order they are read in. No box and no
   pinyin any more: a painter writing on his own paper does not rule himself a grid. */
.inscription {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(10px, 1.3vw, 20px);
  padding-top: 4px;
}

.inscription > * {
  writing-mode: vertical-rl;
  line-height: 1.05;
}

.poem-line {
  font-family: var(--brush);
  font-size: clamp(21px, 2.1vw, 29px);
  letter-spacing: 0.12em;
  color: var(--mo);
}

.poem-src {
  font-family: var(--cjk);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.22em;
  color: var(--mo-soft);
  margin-top: clamp(18px, 3vh, 34px);
}

/* 张斯柏 — the same name, written the other way, sitting over its English self */
.name-cjk {
  font-family: var(--brush);
  font-size: clamp(22px, 2.3vw, 32px);
  letter-spacing: 0.3em;
  line-height: 1;
  color: var(--jiao);
  margin-bottom: clamp(6px, 1.1vh, 14px);
}

.scroll-cue {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mo-soft);
  margin-top: clamp(40px, 6vh, 76px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.scroll-cue::after {
  content: "↓";
  color: var(--jiao);
  animation: cue-bob 1.9s ease-in-out infinite;
}

@keyframes cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* hero load-in */

.hero .rise {
  opacity: 0;
  transform: translateY(20px);
  animation: rise 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero .rise-1 { animation-delay: 0.05s; }
.hero .rise-2 { animation-delay: 0.18s; }
.hero .rise-3 { animation-delay: 0.32s; }
.hero .rise-4 { animation-delay: 0.46s; }
.hero .rise-5 { animation-delay: 0.6s; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* the inscription is written column by column, right to left, as it would be */
.hero .inscription > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero .inscription > *:nth-child(1) { animation-delay: 0.62s; }
.hero .inscription > *:nth-child(2) { animation-delay: 0.78s; }
.hero .inscription > *:nth-child(3) { animation-delay: 0.94s; }

/* ---------- ticker ---------- */

.ticker {
  border-top: 1px solid var(--mo);
  border-bottom: 3px double var(--mo);
  overflow: hidden;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 38s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.ticker-track > div {
  display: flex;
  white-space: nowrap;
  font-size: 15px;
  padding: 12px 0;
}

.ticker-track span { padding: 0 16px; }
.ticker-track b { color: var(--jiao); font-weight: 400; padding-left: 14px; }

@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */

section.block {
  padding-top: clamp(64px, 9vh, 116px);
  position: relative;
}

section.block:last-of-type { padding-bottom: clamp(64px, 9vh, 116px); }

.kicker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 15px;
  color: var(--mo-soft);
  margin-bottom: 14px;
}

/* brush-written numeral */
.kicker b {
  font-family: var(--brush);
  font-size: 24px;
  font-weight: 400;
  color: var(--jiao);
}

.kicker .en {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* a single tapered brush stroke, drawn left to right */
.rule {
  height: 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 8' preserveAspectRatio='none'%3E%3Cpath d='M0,4.4 C240,1.6 480,6.4 720,4 C960,1.6 1200,6.2 1440,3 L1440,4.4 C1200,7.6 960,3.2 720,5.8 C480,8 240,3.6 0,6 Z' fill='%2323201b'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: clamp(28px, 4vh, 48px);
}

.rule.in { transform: scaleX(1); }

/* brush watermark character behind a section title */
.block-title {
  position: relative;
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: clamp(24px, 3vh, 40px);
}

.block-title em { font-style: italic; color: var(--jiao); }

/* 淡墨 — a breath of wash bleeding into the paper behind a section title */
.block-title::before {
  content: "";
  position: absolute;
  left: -0.5em;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(110px, 13vw, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 35, 32, 0.075) 0%, rgba(38, 35, 32, 0.04) 55%, transparent 72%);
  filter: url(#bleed);
  pointer-events: none;
  z-index: -1;
}

/* ---------- prose + facts ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 5vw, 76px);
  align-items: start;
}

.prose p { max-width: var(--measure); margin-bottom: 1.15em; }
.prose p:last-child { margin-bottom: 0; }

.facts {
  border-top: 3px double var(--mo);
  font-size: 16px;
}

.facts div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--jie);
}

.facts dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mo-soft);
  padding-top: 5px;
}

.facts dd { margin: 0; }

.note {
  font-style: italic;
  font-size: 19px;
  color: var(--jiao);
}

/* ---------- toolbox ---------- */

.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 52px);
}

.tool-group { border-top: 3px double var(--mo); padding-top: 14px; }

.tool-group h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
}

.tool-group h3 span { font-family: var(--brush); font-size: 21px; color: var(--jiao); font-weight: 400; }

.tool-group ul { list-style: none; }

.tool-group li {
  padding: 8px 0;
  border-bottom: 1px solid var(--jie);
  font-size: 17px;
}

/* ---------- coursework rows ---------- */

.rows { border-top: 3px double var(--mo); }

.row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 6px 24px;
  padding: 18px 10px 18px 0;
  border-bottom: 1px solid var(--jie);
  transition: background-color 0.3s ease, padding-left 0.3s ease;
}

.row:hover { background: var(--xuan-2); padding-left: 10px; }

.row .code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--jiao);
  padding-top: 6px;
}

.row h3 { font-size: 20px; font-weight: 600; line-height: 1.35; }

.row p {
  grid-column: 2;
  font-size: 17px;
  color: var(--mo-soft);
  max-width: var(--measure);
}

/* ---------- page head ---------- */

.page-head {
  padding: clamp(44px, 7vh, 88px) 0 clamp(24px, 4vh, 40px);
  position: relative;
}

/* The 烘云托月 ring that used to sit here was directly behind the headline, and
   once it bled it read as a stain on the paper rather than a moon. The painting
   carries the ink now; the headline gets 留白. */

/* ---------- 内页画 — every page gets its own painting ----------
   Same layer machinery as the hero: one inherited --peel per painting, each
   layer declaring its own way out. The band sits behind the page head and
   runs off into the gutters, so the words keep the middle. */
.page-art {
  --peel: 0;
  position: absolute;
  left: 50%;
  top: calc(-1 * clamp(44px, 7vh, 88px));
  transform: translateX(-50%);
  width: 100vw;
  height: clamp(420px, 62vh, 720px);
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  /* A painting has no bottom edge — the ink just runs out and the paper takes
     over. Without this the band ends in a ruled horizontal cut, which is the
     one thing that instantly reads as a <div>. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgba(0, 0, 0, 0.45) 76%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 52%, rgba(0, 0, 0, 0.45) 76%, transparent 97%);
}

.page-head h1 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 24px;
  font-size: clamp(44px, 7.4vw, 86px);
  font-weight: 400;
  line-height: 1.05;
  margin: 14px 0 22px;
}

.page-head h1 em { font-style: italic; color: var(--jiao); }

.page-head .lede {
  font-size: clamp(19px, 1.9vw, 22px);
  max-width: var(--measure);
  color: var(--mo-soft);
}

/* ---------- entries (研究 / 作品) ---------- */

/* No box. A painting does not put its subject in a rectangle — it sets it in
   开合 (open space) and lets a stroke hold the edge. What was a double-ruled
   card is now a single wet brush stroke down the left margin, the ink pooling
   where the brush first touched down beside the number. */
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: clamp(16px, 3vw, 44px);
  padding: clamp(32px, 5vh, 56px) 0 clamp(32px, 5vh, 56px) clamp(22px, 3vw, 40px);
  margin-bottom: clamp(28px, 4vh, 48px);
}

/* the stroke: full ink at the top where the brush lands, dragging out to dry below */
.entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: clamp(24px, 3.5vh, 40px);
  bottom: clamp(24px, 3.5vh, 40px);
  width: 3px;
  background: linear-gradient(
    to bottom,
    rgba(16, 15, 13, 0.62) 0%,
    rgba(16, 15, 13, 0.45) 28%,
    rgba(16, 15, 13, 0.22) 62%,
    rgba(16, 15, 13, 0.05) 92%,
    transparent 100%
  );
  border-radius: 2px 2px 0 0;
  pointer-events: none;
}

/* 淡墨 — where the brush first touched, the paper drank it in */
.entry::after {
  content: "";
  position: absolute;
  left: -30px;
  top: 4px;
  width: clamp(120px, 12vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 35, 32, 0.06) 0%, rgba(38, 35, 32, 0.03) 52%, transparent 72%);
  filter: url(#bleed);
  pointer-events: none;
  z-index: -1;
}

.entry-num {
  font-family: var(--brush);
  font-size: clamp(46px, 5.4vw, 68px);
  line-height: 1;
  color: var(--jiao);
  opacity: 0.85;
}

.entry h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 6px;
}

.entry .org {
  font-size: 16px;
  font-style: italic;
  color: var(--mo-soft);
  margin-bottom: 18px;
}

.entry .tagline {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--jiao);
  margin-bottom: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 44px;
  border-top: 1px solid var(--jie);
  border-bottom: 1px solid var(--jie);
  padding: 12px 0;
  margin-bottom: 20px;
}

.meta div { display: flex; flex-direction: column; gap: 2px; }

.meta dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mo-soft);
}

.meta dd { margin: 0; font-size: 16px; }

.entry .desc { max-width: var(--measure); margin-bottom: 16px; }

.entry ul.points {
  list-style: none;
  max-width: var(--measure);
  margin-bottom: 22px;
}

.entry ul.points li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 17px;
  color: var(--mo-soft);
  border-bottom: 1px dotted var(--jie);
}

/* 顿号-style marker */
.entry ul.points li::before {
  content: "、";
  position: absolute;
  left: 0;
  font-family: var(--cjk);
  color: var(--jiao);
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-family: var(--mono);
  font-size: 13px;
}

.entry-links a { text-decoration: none; }
.entry-links a::before { content: "◈ "; color: var(--jiao); font-size: 11px; }

/* sits beside the repo link to qualify what the repo actually holds */
.entry-links .repo-note { color: var(--mo-soft); }

/* publication block */

.pub {
  border-left: 3px double var(--jiao);
  padding: 4px 0 4px 20px;
  margin-bottom: 22px;
  max-width: var(--measure);
}

.pub-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jiao);
}

.pub-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 4px 0 2px;
}

.pub-venue {
  font-size: 15px;
  font-style: italic;
  color: var(--mo-soft);
  margin-bottom: 10px;
}

/* ---------- hobbies ---------- */

.artist-list {
  list-style: none;
  columns: 2;
  column-gap: clamp(28px, 5vw, 60px);
  border-top: 3px double var(--mo);
  margin-top: 8px;
}

.artist-list li { break-inside: avoid; border-bottom: 1px solid var(--jie); }

.artist-list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 4px;
  text-decoration: none;
}

.artist-list a:hover { background: var(--xuan-2); }

.artist-list .idx { font-family: var(--mono); font-size: 11px; color: var(--jiao); }
.artist-list .who { font-size: 19px; }

.artist-list .genre {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mo-soft);
  text-align: right;
}

.stat-line { font-size: clamp(21px, 2.4vw, 27px); margin: 20px 0 6px; }

.stat-line b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9em;
  color: var(--jiao);
  font-variant-numeric: tabular-nums;
}

/* ---------- outro ---------- */

.outro h2 {
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 400;
  line-height: 1.05;
  margin-bottom: 22px;
}

.outro h2 em { font-style: italic; color: var(--jiao); }

.outro p { max-width: var(--measure); margin-bottom: 26px; }

.big-mail {
  font-family: var(--mono);
  font-size: clamp(16px, 2.4vw, 23px);
  text-decoration-color: var(--jiao);
}

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

footer {
  margin-top: clamp(56px, 9vh, 104px);
  border-top: 3px double var(--mo);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  padding-top: 24px;
  padding-bottom: 34px;
  font-size: 14px;
  color: var(--mo-soft);
}

footer .seal-mark {
  font-family: var(--cjk);
  color: var(--jiao);
  letter-spacing: 0.1em;
}

/* 印章 — 张斯柏印, a 白文 seal: characters knocked out of the cinnabar block.
   Read down the right column then down the left — 张 斯 / 柏 印. Stone never
   prints clean, so the #stamp filter chips the edge and roughens the strokes,
   and it sits a couple of degrees off square because a hand pressed it. */
footer .seal {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  width: 58px;
  height: 58px;
  padding: 5px;
  flex: 0 0 auto;
  background: var(--zhu);
  color: var(--xuan);
  font-family: var(--cjk);
  font-size: 19px;
  line-height: 1;
  place-items: center;
  opacity: 0.9;
  transform: rotate(-2.2deg);
  filter: url(#stamp);
}

footer .seal span:nth-child(1) { grid-area: 1 / 2; }  /* 张 */
footer .seal span:nth-child(2) { grid-area: 2 / 2; }  /* 斯 */
footer .seal span:nth-child(3) { grid-area: 1 / 1; }  /* 柏 */
footer .seal span:nth-child(4) { grid-area: 2 / 1; }  /* 印 */

footer .wrap { align-items: center; }

footer a { text-decoration: none; color: inherit; }
footer a:hover { color: var(--jiao); }

/* ---------- scroll reveal (ink settling into paper) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(3px);
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s ease;
}

.reveal.in { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
  .artist-list { columns: 1; }
  .entry { grid-template-columns: 1fr; gap: 10px; }
  .entry-num { font-size: 40px; }
}

@media (max-width: 680px) {
  body { font-size: 18px; }
  .hero-grid { grid-template-columns: 1fr; }
  /* the inscription moves above the words here, so it does not need the drop
     that keeps it clear of the plum on wide screens */
  .hero-side { order: -1; padding-top: 0; padding-bottom: 10px; }
  /* no room for a vertical inscription beside the words — lay it flat instead */
  .inscription { flex-direction: column; align-items: flex-start; gap: 4px; }
  .inscription > * { writing-mode: horizontal-tb; margin-top: 0; }
  .poem-src { margin-top: 2px; }
  .row { grid-template-columns: 1fr; padding-right: 0; }
  .row p { grid-column: 1; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero .rise, .hero .inscription > *, :is(.hero-art, .page-art) .lyr > *, .bird, .mist { animation: none; opacity: 1; }
  /* the painting stays hung on the wall: no load-in, no peel */
  :is(.hero-art, .page-art) .lyr { transform: none; }
  :is(.hero-art, .page-art) .lyr > * { transform: none; filter: none; }
  .reveal, .rule { transition: none; opacity: 1; transform: none; filter: none; }
  .rule { transform: scaleX(1); }
  .ticker-track { animation: none; }
  .scroll-cue::after { animation: none; }
}
