/* Asympta / printed folio. One type system, one paper stock. */
@font-face {
  font-family: "Folio Old Standard";
  src: url("assets/fonts/old-standard-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Folio Fell";
  src: url("assets/fonts/fell-english-sc.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Folio Song";
  src: url("assets/fonts/noto-serif-tc-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #eae4d7;
  --ink: #4d473d;
  --muted: #6d6557;
  --line: #aaa18f;
  --serif: "Folio Old Standard", "Baskerville", "Times New Roman", serif;
  --small: "Folio Fell", "Folio Old Standard", "Baskerville", serif;
  --cjk: "Folio Song", "Songti TC", "Noto Serif CJK TC", "PMingLiU", serif;
  --measure: 820px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; scroll-padding-top: 30px; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("assets/folio/paper-patina.svg?v=20261101-4"), url("assets/folio/security-weave.svg?v=20261101-3"), linear-gradient(#eae4d775, #eae4d775), url("assets/folio/cotton-stock.webp");
  background-repeat: repeat;
  background-size: 1100px 1400px, 512px 512px, auto, 500px 500px;
  font: 17px/1.8 var(--serif);
  font-kerning: normal;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: auto;
}
html[lang="zh-Hant"] body { font-family: var(--cjk); }
a { color: inherit; text-decoration: none; text-underline-offset: .3em; text-decoration-thickness: 1px; }
a:hover, button:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-underline-offset: .3em; }
button:disabled { cursor: default; opacity: .4; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 5px; }
[hidden] { display: none !important; }
::selection { background: #d6d4c8; color: #181816; -webkit-text-fill-color: #181816; }
.skip { position: fixed; left: 16px; top: -100px; z-index: 20; padding: 12px 18px; background: var(--paper); }
.skip:focus { top: 12px; }
.print-definitions { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* The running head stays outside the title's quiet field. */
.running-head {
  width: min(100% - 88px, 1120px);
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  letter-spacing: .08em;
}
.running-head nav { display: flex; align-items: center; gap: 32px; }
.running-head a, .language { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; }
.running-author { font: 16px/1.4 var(--small); letter-spacing: .08em; }
.language { min-width: 35px; font: 12px/1.4 var(--serif); letter-spacing: .03em; }
.language[lang="zh-Hant"] { font-family: var(--cjk); }

/* Title leaf: scale and space provide the hierarchy, without an illustration. */
.title-page {
  width: min(100% - 48px, 860px);
  min-height: clamp(650px, calc(100svh - 88px), 850px);
  padding: clamp(63px, 9svh, 104px) 0 36px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.edition { font: 13px/1.5 var(--small); letter-spacing: .2em; margin-bottom: clamp(60px, 8svh, 90px); }
.title-page h1 {
  margin: 0;
  font: 400 clamp(60px, 7.3vw, 106px)/1.13 var(--serif);
  letter-spacing: .16em;
  text-indent: .16em;
  white-space: nowrap;
}
.cover-kind { margin: 27px 0 0; font: 18px/1.7 var(--small); letter-spacing: .19em; }
html[lang="zh-Hant"] .cover-kind { font-family: var(--cjk); font-size: 16px; letter-spacing: .34em; text-indent: .34em; }
.title-rule { width: 55px; height: 1px; margin: 36px 0 27px; background: var(--ink); opacity: .7; transform: rotate(-.3deg); }
.author { margin: 0; font: 20px/1.5 var(--small); letter-spacing: .15em; text-indent: .15em; }
.cover-index { display: inline-flex; align-items: center; justify-content: center; gap: 20px; min-height: 44px; margin-top: clamp(65px, 9svh, 103px); font-size: 13px; letter-spacing: .13em; }
.cover-index .down { font: 21px/1 var(--serif); letter-spacing: 0; }
.folio-number { display: block; margin-top: 50px; text-align: center; color: var(--muted); font: 13px/1.5 var(--serif); letter-spacing: .06em; }
.title-page > .folio-number { margin-top: auto; padding-top: 38px; }

/* Pigment is inside live, selectable type. Small controls stay solid and sharp. */
.print-type, .index-name { color: var(--ink); font-synthesis: none; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .print-type, .index-name {
    background: var(--ink) url("assets/folio/letterpress-ink.svg?v=20261101-4") repeat;
    background-size: 256px 256px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
/* Static paper-tooth displacement and capillary spread, limited to the large glyph surfaces. */
.title-page h1, .work-heading h2 { filter: url("#ink-impression"); }
.contents .section-title, .correspondence .section-title, .viewer-title h2 { filter: url("#ink-impression-small"); }

/* An index and two actual work plates, composed on the same page measure. */
.leaf { width: calc(100% - 80px); max-width: var(--measure); margin: 0 auto; position: relative; scroll-margin-top: 30px; }
.running-line { display: flex; align-items: center; justify-content: space-between; padding-top: 15px; border-top: 1px solid var(--line); font: 12px/1.5 var(--small); letter-spacing: .13em; }
.contents { display: grid; grid-template-columns: minmax(185px, max-content) minmax(0, 1fr); gap: 0 42px; padding-top: 50px; padding-bottom: 138px; }
.contents .running-line { grid-column: 1 / -1; }
.section-title { font: 400 43px/1.3 var(--serif); letter-spacing: .09em; }
/* The paint box must contain the full translated word and its ink edge. */
.contents .section-title { margin: 57px 0 0; padding-inline-end: .15em; }
html[lang="zh-Hant"] .section-title { font-family: var(--cjk); letter-spacing: .2em; font-size: 34px; }
.index-list { list-style: none; margin: 41px 0 0; padding: 0; }
.index-list a { display: flex; align-items: baseline; gap: 19px; min-height: 76px; padding: 19px 0 17px; }
.index-list a:hover { text-decoration: none; }
.index-list a:hover .index-name { text-decoration: underline; text-decoration-thickness: .7px; }
.index-roman { flex-shrink: 0; width: 28px; font: 14px/1.5 var(--small); }
.index-name { font: 400 28px/1.5 var(--serif); letter-spacing: .025em; }
html[lang="zh-Hant"] .index-name[data-i18n] { font: 400 23px/1.6 var(--cjk); letter-spacing: .12em; }
.leader { flex: 1; min-width: 8px; border-bottom: 1px dotted #aaa89c; margin-bottom: 5px; }
.index-list a > span:last-child { font: 13px/1.4 var(--serif); }
.work { padding-bottom: 119px; }
.work-heading { display: flex; align-items: baseline; gap: 27px; padding: 70px 0 43px; }
.chapter-number { font: 16px/1.5 var(--small); color: #5b5a52; letter-spacing: .08em; }
.work-heading h2 { margin: 0; font: 400 clamp(48px, 5.3vw, 74px)/1.18 var(--serif); letter-spacing: .085em; text-transform: uppercase; }
#paperie .work-heading { justify-content: flex-end; }
.plate { position: relative; margin: 0 0 29px; }
.writing-plate { max-width: 490px; margin-left: 49px; margin-right: auto; }
.paperie-plate { max-width: 740px; margin-left: auto; }
.plate-side { position: absolute; left: -38px; top: 5px; font: 12px/1.5 var(--small); color: var(--muted); }
#paperie .plate-side { left: auto; right: -34px; }
.plate-link { display: block; position: relative; isolation: isolate; overflow: hidden; cursor: zoom-in; background: #e9e8df; }
.plate-link > img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; filter: saturate(.79) contrast(.94) brightness(1.015) sepia(.025); }
.plate-link::before, .viewer-media.is-print-reproduction::after, .viewer-media.is-film-reproduction::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("assets/print-screen.svg"), url("assets/folio/cotton-stock.webp");
  background-size: 96px 96px, 700px 700px;
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: .18;
}
.plate-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border: 1px solid #302f2b30; pointer-events: none; }
.plate-open { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 27px; height: 27px; display: grid; place-items: center; background: var(--paper); color: var(--ink); font: 21px/1 var(--serif); opacity: 0; transition: opacity .2s; }
.plate-link:hover .plate-open, .plate-link:focus-visible .plate-open { opacity: 1; }
.plate figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-top: 8px; color: #5b5a53; font-size: 12px; line-height: 1.8; letter-spacing: .04em; }
.plate figcaption a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.work-links { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 35px; font-size: 14px; letter-spacing: .03em; }
.work-links a { display: inline-flex; align-items: center; min-height: 44px; }
#writing .work-links { margin-left: 49px; }
#paperie .work-links { justify-content: flex-end; }
.work > .folio-number { margin-top: 40px; }
.print-pass { pointer-events: none; position: absolute; inset: 0; z-index: 1; opacity: 0; background: repeating-linear-gradient(0deg, transparent 0 2px, #eeede75c 2px 3px); mix-blend-mode: screen; }

/* Correspondence closes the folio; no additional promotional copy. */
.correspondence { text-align: center; padding-bottom: 92px; }
.correspondence > .chapter-number { display: block; margin-top: 72px; }
.correspondence .section-title { margin: 22px 0 31px; font-size: 59px; text-transform: uppercase; letter-spacing: .14em; }
html[lang="zh-Hant"] .correspondence .section-title { font-size: 42px; text-indent: .2em; }
.availability { font-size: 17px; letter-spacing: .025em; margin: 0 0 30px; }
.email { display: inline-block; max-width: 100%; overflow-wrap: anywhere; font: 25px/1.65 var(--serif); padding-bottom: 1px; border-bottom: 1px solid #79776c; }
.email:hover { text-decoration: none; border-color: var(--ink); }
.contact-note { max-width: 400px; margin: 42px auto 17px; font-size: 13px; line-height: 2; letter-spacing: .025em; color: #5b5a53; text-wrap: pretty; }
.social { display: flex; justify-content: center; align-items: center; gap: 24px; font: 16px/1.6 var(--serif); }
.social a { display: inline-flex; align-items: center; min-height: 44px; }
.correspondence .folio-number { margin-top: 61px; }
.colophon { width: calc(100% - 80px); max-width: var(--measure); margin: 0 auto; padding: 48px 0 36px; border-top: 1px solid var(--line); text-align: center; }
.printer-mark { display: inline-block; font: 31px/1.3 var(--serif); }
.colophon p { margin: 22px 0 14px; font: 12px/1.5 var(--small); letter-spacing: .15em; }
.colophon nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; color: var(--muted); font-size: 12px; }
.colophon nav a, .back-top { display: inline-flex; align-items: center; min-height: 44px; }
.back-top { margin-top: 7px; font-size: 12px; letter-spacing: .1em; }

/* The image reader is a paper sheet, with native video and keyboard controls. */
#viewer {
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("assets/folio/paper-patina.svg?v=20261101-4"), url("assets/folio/security-weave.svg?v=20261101-3"), linear-gradient(#eae4d775, #eae4d775), url("assets/folio/cotton-stock.webp");
  background-repeat: repeat;
  background-size: 1100px 1400px, 512px 512px, auto, 500px 500px;
  width: min(1100px, calc(100vw - 48px));
  height: calc(100dvh - 48px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid #8d8b80;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#viewer::backdrop { background: #eae4d7ed; }
.viewer-sheet { min-height: 100%; padding: 0 45px 25px; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; border-bottom: 1px solid var(--line); font: 13px/1.5 var(--small); letter-spacing: .12em; }
.viewer-head > div { display: flex; align-items: center; gap: 21px; }
.close-viewer { min-height: 44px; min-width: 55px; font-size: 13px; letter-spacing: .03em; }
html[lang="zh-Hant"] .close-viewer { font-family: var(--cjk); }
.viewer-title { text-align: center; padding: 26px 0 23px; font: 13px/1.4 var(--small); }
.viewer-title h2 { margin: 9px 0 0; font: 400 37px/1.3 var(--serif); letter-spacing: .07em; }
.viewer-figure { margin: 0 auto; max-width: 790px; }
.viewer-media { position: relative; display: flex; align-items: center; justify-content: center; min-height: 160px; overflow: hidden; }
#viewer-image { display: block; max-width: 100%; width: auto; height: auto; max-height: 53dvh; object-fit: contain; }
#viewer-image.is-print { mix-blend-mode: multiply; filter: saturate(.79) contrast(.94) brightness(1.015) sepia(.025); }
.viewer-media.is-print-reproduction { background: #e9e8df; }
#viewer-video { display: block; width: 100%; max-height: 53dvh; aspect-ratio: 1554/1080; object-fit: contain; background: #e9e8df; filter: saturate(.81) contrast(.91) brightness(1.025) sepia(.025); }
.viewer-media.is-film-reproduction::after { opacity: .13; }
#viewer-caption { min-height: 28px; margin: 16px 0 0; text-align: center; font-size: 12px; line-height: 1.8; color: #5b5a53; }
#media-error { text-align: center; font-size: 14px; color: #743b30; margin: 10px 0; }
.viewer-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; padding-top: 11px; margin: 22px auto 0; max-width: 790px; border-top: 1px solid var(--line); font-size: 13px; }
.viewer-footer button { min-height: 44px; }
.viewer-footer [data-prev] { justify-self: start; }
.viewer-footer [data-next] { justify-self: end; }
#viewer-counter { font: 13px/1.5 var(--serif); letter-spacing: .12em; }
.viewer-links { display: flex; justify-content: center; align-items: center; gap: 30px; margin-top: 8px; font-size: 13px; }
.viewer-links a { display: inline-flex; align-items: center; min-height: 44px; }
body.has-viewer { overflow: hidden; }

@media (max-width: 900px) {
  .title-page h1 { font-size: clamp(53px, 9vw, 82px); }
  .contents { grid-template-columns: minmax(145px, max-content) minmax(0, 1fr); gap: 0 28px; }
  .work-heading { padding-top: 58px; }
  .writing-plate { width: min(76%, 490px); margin-left: 35px; }
  .paperie-plate { width: calc(100% - 20px); }
  #paperie .plate-side { right: -26px; }
  #writing .work-links { margin-left: 35px; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 20px; }
  .running-head { width: calc(100% - 40px); min-height: 70px; gap: 12px; font-size: 12px; }
  .running-head nav { gap: 19px; }
  .running-author { font-size: 14px; letter-spacing: .035em; }
  .language { font-size: 12px; min-width: 30px; }
  .title-page { width: calc(100% - 38px); min-height: clamp(570px, calc(100svh - 70px), 630px); padding: 53px 0 29px; }
  .edition { font-size: 12px; margin-bottom: 66px; }
  .title-page h1 { font-size: clamp(37px, 11.6vw, 60px); letter-spacing: .13em; text-indent: .13em; }
  .title-page h1, .work-heading h2 { filter: url("#ink-impression-small"); }
  .cover-kind { font-size: 17px; margin-top: 21px; }
  html[lang="zh-Hant"] .cover-kind { font-size: 15px; }
  .title-rule { width: 43px; margin: 31px 0 24px; }
  .author { font-size: 19px; }
  .cover-index { margin-top: 68px; font-size: 13px; }
  .title-page > .folio-number { padding-top: 30px; }
  .leaf { width: calc(100% - 48px); scroll-margin-top: 20px; }
  .running-line { font-size: 11px; padding-top: 13px; }
  .contents { display: block; padding-top: 35px; padding-bottom: 88px; }
  .contents .section-title { margin: 38px 0 18px; font-size: 34px; }
  html[lang="zh-Hant"] .contents .section-title { font-size: 28px; }
  .index-list { margin-top: 0; }
  .index-list a { min-height: 68px; gap: 16px; padding: 15px 0; }
  .index-name { font-size: 25px; }
  html[lang="zh-Hant"] .index-name[data-i18n] { font-size: 21px; }
  .index-roman { font-size: 13px; width: 25px; }
  .work { padding-bottom: 80px; }
  .work-heading { gap: 17px; padding: 46px 0 31px; }
  .work-heading h2 { font-size: clamp(33px, 9vw, 50px); letter-spacing: .06em; }
  .chapter-number { font-size: 14px; }
  .writing-plate { width: calc(100% - 24px); margin-left: 24px; }
  .paperie-plate { width: calc(100% - 16px); margin-left: 0; }
  .plate-side { left: -24px; font-size: 10px; }
  #paperie .plate-side { right: -23px; }
  .plate { margin-bottom: 16px; }
  .plate figcaption { font-size: 11px; gap: 10px; }
  .plate-open { opacity: 1; width: 24px; height: 24px; right: 7px; bottom: 7px; }
  .work-links { font-size: 13px; gap: 27px; }
  #writing .work-links { margin-left: 24px; }
  #paperie .work-links { padding-right: 16px; }
  .work > .folio-number { margin-top: 31px; }
  .correspondence { padding-bottom: 71px; }
  .correspondence > .chapter-number { margin-top: 49px; }
  .correspondence .section-title { font-size: 44px; margin: 18px 0 27px; }
  html[lang="zh-Hant"] .correspondence .section-title { font-size: 34px; }
  .availability { font-size: 15px; margin-bottom: 25px; }
  .email { font-size: clamp(19px, 5.4vw, 25px); }
  .contact-note { max-width: 315px; font-size: 13px; margin-top: 33px; }
  .social { font-size: 15px; }
  .correspondence .folio-number { margin-top: 43px; }
  .colophon { width: calc(100% - 48px); padding-top: 36px; }
  .colophon nav { gap: 22px; font-size: 11px; }
  #viewer { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; }
  .viewer-sheet { padding: 0 20px 22px; }
  .viewer-head { min-height: 62px; gap: 10px; font-size: 12px; }
  .viewer-head > div { gap: 16px; }
  .viewer-title { padding: 22px 0 20px; }
  .viewer-title h2 { font-size: 32px; }
  #viewer-image, #viewer-video { max-height: 48dvh; }
  .viewer-footer { gap: 8px; margin-top: 17px; font-size: 12px; }
  #viewer-counter { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .print-pass { display: none !important; }
}
@media (prefers-contrast: more), (forced-colors: active) {
  :root { --ink: #191917; --muted: #393932; --line: #69685e; }
  body, #viewer { background-image: none !important; }
  .print-type, .index-name { filter: none !important; background: none !important; -webkit-text-fill-color: currentColor !important; -webkit-text-stroke: 0 !important; }
  .plate-link::before, .viewer-media::after { display: none; }
  .plate-open { border: 1px solid currentColor; }
}
@media print {
  body, #viewer { background: #fff !important; color: #000; }
  .running-head, .cover-index, .work-links, .plate-open, .print-pass, .language, .back-top, .skip, #viewer { display: none !important; }
  .title-page { min-height: 85vh; break-after: page; }
  .leaf { width: 90%; break-inside: avoid; }
  .contents { padding-top: 35px; }
  .work, .correspondence { break-before: page; }
  .work-heading { break-after: avoid; }
  .plate { break-inside: avoid; }
  .print-type, .index-name { filter: none !important; background: none !important; color: #000 !important; -webkit-text-fill-color: currentColor !important; -webkit-text-stroke: 0 !important; }
  .plate-link { background: #fff; }
  .plate-link::before, .plate-link::after, .plate figcaption a { display: none; }
  a { color: #000; }
}

/* Search-accessible work captions, in the existing printed index. */
.work-summary {margin:0 0 13px;color:var(--muted);font:15px/1.8 var(--serif);max-width:700px}
#writing .work-summary {margin-left:49px}
#paperie .work-summary {text-align:right;margin-left:auto}
html[lang="zh-Hant"] .work-summary {font-family:var(--cjk)}
@media(max-width:600px){#writing .work-summary{margin-left:0}#paperie .work-summary{text-align:left;margin-left:0}}
