/* Yuanmingyuan 1860. Same family as the Küstrin 1913 site (structure and component names from yaga.sh), on a light ground: xuan paper, ink, the seal's vermilion, and the azurite and mineral green of blue-green landscape painting, used sparingly. The 3D view (reconstruction/) keeps its own dark sheet. */

@font-face { font-family: 'Geist'; src: url('assets/fonts/geist-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; src: url('assets/fonts/geist-latin-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; src: url('assets/fonts/geist-mono-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; src: url('assets/fonts/geist-mono-latin-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; src: url('assets/fonts/newsreader-latin.woff2') format('woff2'); font-style: italic; font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; src: url('assets/fonts/newsreader-latin-ext.woff2') format('woff2'); font-style: italic; font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Subsets holding only the characters these pages use (see credits). Text outside them falls back to the system's Chinese fonts. */
@font-face { font-family: 'Noto Sans SC'; src: url('assets/fonts/noto-sans-sc-subset.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Serif SC'; src: url('assets/fonts/noto-serif-sc-subset.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  /* ground: xuan paper; ink and its grey; the seal's vermilion (accent-ink is its darker step, for small text on the paper bands: AA) */
  --bg: #FBF9F4;
  --paper-band: #F4EFE4;
  --card: #FFFFFF;
  --surface: #F1EBDD;
  --silk: #EFE8D8;
  --ink: #1E1812;
  --body: #3A3129;
  --muted: #5B5047;
  --line: #E6DDCB;
  --line-strong: #CDBE9E;
  --gold: #C8A45A;
  --accent: #C2452D;
  --accent-ink: #A93A24;
  --tile: #3F6E8C;
  --green: #5E8C7B;
  --sans: 'Geist', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --head: 'Geist', 'Noto Serif SC', 'Songti SC', 'SimSun', system-ui, serif;
  --mono: 'Geist Mono', 'Noto Sans SC', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Newsreader', 'Noto Serif SC', 'Songti SC', 'SimSun', Georgia, serif;
  --zh-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --fs-display: clamp(32px, 4.4vw, 56px);
  --fs-lead: clamp(17px, 1.4vw, 19px);
  --fs-label: 12px;
  --gutter: clamp(20px, 4vw, 48px);
  --max: 1200px;
  --header-h: 64px;
  --bar-h: 28px;
  --section-y: clamp(72px, 9vw, 128px);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* paper grain: SVG noise at about 3% */
  --grain: 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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .09 0 0 0 0 .06 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #FBF9F4; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); text-decoration: none; font-size: 14px; }
.skip:focus { top: 8px; }

/* Buttons: square, as on yaga.sh */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.btn-dark { background: var(--ink); color: var(--bg); }
.btn-seal { background: var(--accent); color: #FBF9F4; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.btn[aria-disabled="true"] { cursor: default; }

@media (hover: hover) {
  .btn-dark:hover { background: var(--accent-ink); }
  .btn-seal:hover { background: var(--accent-ink); }
  .btn-ghost:hover { border-color: var(--ink); }
}

/* Header */

/* yaga.sh family bar, as on elliott.yaga.sh, here on the paper: the Yaga mark (made for dark grounds) is shown in ink */
.yaga-bar { background: var(--paper-band); border-bottom: 1px solid var(--line); }
.yaga-bar-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  height: var(--bar-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.yaga-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--bar-h);
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  transition: color 200ms var(--ease-out);
}
.yaga-bar-link strong { color: var(--ink); font-weight: 500; }
.yaga-bar-arrow { display: block; width: 12px; height: 12px; flex: none; transition: transform 200ms var(--ease-out); }
.yaga-bar-mark, .ink-mark { display: block; width: 16px; height: 16px; flex: none; filter: brightness(0) opacity(0.82); }
@media (hover: hover) {
  .yaga-bar-link:hover { color: var(--ink); }
  .yaga-bar-link:hover .yaga-bar-arrow { transform: translateX(-3px); }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 244, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand-mark { display: block; width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand-name [lang^="zh"], :lang(zh) .brand-name { font-family: var(--zh-serif); font-weight: 500; letter-spacing: 0.04em; }
:lang(zh) .brand-name [lang="en"] { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }

.header-right { display: flex; align-items: center; gap: 16px; }

.site-nav { display: flex; align-items: center; gap: 2px; margin: 0 auto 0 12px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--body); text-decoration: none; font-size: 14px; white-space: nowrap; }
.site-nav a:hover { color: var(--accent-ink); }

.lang { display: flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.06em; color: var(--muted); }
.lang b { color: var(--ink); font-weight: 500; }
.lang a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
@media (hover: hover) { .lang a:hover { color: var(--ink); } }

/* Hero: base. The full-screen carousel is styled below, under Round 22b (.hero-full). */

.hero { position: relative; overflow: clip; isolation: isolate; }
.hero-copy { min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-bar { width: 24px; height: 2px; background: var(--accent); flex: none; }

/* section numbers as small seals */
.seal-num { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 2px; background: var(--accent); color: #FBF9F4; font-family: var(--zh-serif); font-size: 14px; font-weight: 500; line-height: 1; letter-spacing: 0; text-transform: none; transform: rotate(-3deg); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px rgba(251, 249, 244, 0.7); }

h1, h2 {
  font-family: var(--head);
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 12px 0 0 0;
  color: var(--ink);
  max-width: 18ch;
  text-wrap: balance;
}

.hero-copy h1 { margin-top: 20px; max-width: none; }
.title-zh { display: block; font-family: var(--zh-serif); font-size: 1.5em; line-height: 1.15; letter-spacing: 0.06em; }
.title-pinyin { display: block; margin-top: 10px; font-size: 0.72em; letter-spacing: -0.02em; }
.title-en { display: block; margin-top: 6px; font-size: 0.72em; letter-spacing: -0.02em; color: var(--accent); }
.hero .title-zh { font-size: clamp(64px, 9vw, 128px); line-height: 1; letter-spacing: 0.08em; color: var(--ink); }
.hero .title-pinyin { margin-top: 18px; font-size: clamp(26px, 2.8vw, 38px); }
.hero .title-en { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.01em; color: var(--accent-ink); }

.accent { color: var(--accent); }
h2 .accent, .h2-accent { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.01em; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--tile);
}
.tag::before { content: ''; width: 6px; height: 6px; background: var(--tile); flex: none; }

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--body);
  max-width: 44ch;
  margin: 20px 0 0 0;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* The album mount: silk round the picture, a gold hairline, brocade marks at the corners (as the 1744 leaves are mounted) */

.mount {
  display: block;
  padding: clamp(10px, 1.6vw, 20px);
  background:
    linear-gradient(var(--gold), var(--gold)) top 5px left 5px / 18px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top 5px left 5px / 1.5px 18px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top 5px right 5px / 18px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top 5px right 5px / 1.5px 18px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom 5px left 5px / 18px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom 5px left 5px / 1.5px 18px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom 5px right 5px / 18px 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom 5px right 5px / 1.5px 18px no-repeat,
    var(--silk);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(30, 24, 18, 0.05), 0 18px 40px -24px rgba(30, 24, 18, 0.28);
}
.mount > img, .mount > picture, .mount > a, .mount > .mount-in { display: block; outline: 1px solid rgba(200, 164, 90, 0.85); outline-offset: 3px; }
.mount img { width: 100%; height: auto; }

/* Picture frames: round window (月洞门) and fan */
.moon { position: relative; display: block; margin: 0 auto; width: min(100%, 520px); aspect-ratio: 1; border-radius: 50%; padding: clamp(10px, 1.4vw, 16px); background: var(--silk); box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 0 1px var(--gold), 0 0 0 7px var(--bg), 0 0 0 8px rgba(200, 164, 90, 0.55); }
.moon img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fan { -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 120' preserveAspectRatio='none'%3E%3Cpath d='M2 34 A140 140 0 0 1 198 34 L150 118 A84 84 0 0 0 50 118 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 120' preserveAspectRatio='none'%3E%3Cpath d='M2 34 A140 140 0 0 1 198 34 L150 118 A84 84 0 0 0 50 118 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* Sections */

.band { position: relative; border-top: 1px solid var(--line); }

.band-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}

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

.copy p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  max-width: 58ch;
  margin: 20px 0 0;
  text-wrap: pretty;
}
.copy p:first-child { margin-top: 0; }
.copy .list + p { margin-top: 28px; }
.copy h2 + p, .copy .head-row + p { margin-top: 24px; }

/* A heading with a vertical Chinese title in a column beside it */
.head-row { display: flex; align-items: flex-start; gap: clamp(14px, 2vw, 24px); }
.head-row > :not(.v-title) { min-width: 0; }
.v-title { flex: none; margin-top: 14px; writing-mode: vertical-rl; font-family: var(--zh-serif); font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; line-height: 1; letter-spacing: 0.32em; color: var(--accent-ink); padding: 10px 6px; border-left: 1px solid var(--gold); border-right: 1px solid var(--gold); }

/* Archival image with caption: square edge, 1px border, caption in the serif */

.plate-frame { display: block; background: var(--surface); border: 1px solid var(--line-strong); }
.plate-frame img { width: 100%; height: auto; }

.caption {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.45;
  color: var(--body);
  text-wrap: pretty;
}
.caption a { color: inherit; text-underline-offset: 2px; }
.caption [lang^="zh"] { font-style: normal; }

/* Dated list */

.list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line-strong); }
.list li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.list b { font-family: var(--mono); font-size: 13px; font-weight: 500; line-height: 1.9; letter-spacing: 0.02em; color: var(--ink); }

/* Paper band: the alternating, slightly deeper paper with its grain */

.paper {
  --bg: #F4EFE4;
  --surface: #EAE2D0;
  --line: #E0D5BF;
  --muted: #574C43;
  background: var(--grain), var(--bg);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

/* Cloud divider between sections (祥云), drawn once in the page's sprite */
.cloud-rule { display: flex; align-items: center; gap: 18px; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); color: var(--gold); }
.cloud-rule::before, .cloud-rule::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(200, 164, 90, 0), rgba(200, 164, 90, 0.8)); }
.cloud-rule::after { background: linear-gradient(90deg, rgba(200, 164, 90, 0.8), rgba(200, 164, 90, 0)); }
.cloud-rule svg { flex: none; width: 76px; height: 26px; }
.cloud-rule + .band { border-top: 0; }

/* Confidence legend */

.legend { display: grid; gap: 10px; margin: 28px 0 0; }
.legend div { display: flex; gap: 12px; align-items: baseline; font-size: 15px; line-height: 1.5; color: var(--body); }
.legend b {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--ink);
}

/* Footer */

.contact-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 40px var(--gutter) 0;
}

.credits-link { margin: 0; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: 0.06em; text-transform: uppercase; }
.credits-link a { color: var(--body); }

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 0 32px;
}

.footer-brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.footer-brand a { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.footer-brand .ink-mark { width: 20px; height: 20px; }

.copyright {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* Homepage components (Round 21), after Küstrin's: the intro, the views with their caption cards, the placeholders for the renders to come, the compare slider, the facts, the scene cards, the grades as seals, the closing call */

.intro .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
.intro figure { margin: 0; }
.intro figcaption { max-width: 440px; margin: 22px auto 0; text-align: center; }

/* Facts: big numbers, every one from a run on the repo (see the comment in the page) */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.55); }
.stat { padding: clamp(18px, 2vw, 26px); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.stat-num { font-size: clamp(34px, 3.6vw, 48px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-num small { margin-left: 4px; font-size: 0.45em; letter-spacing: 0; color: var(--muted); }
.stat-label { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--body); text-wrap: pretty; }

/* Timeline in the year band */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--gold); }
.timeline li { position: relative; padding: 0 0 18px; font-size: 16px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.timeline li::before { content: ''; position: absolute; left: -27px; top: 7px; width: 9px; height: 9px; background: var(--bg); border: 1.5px solid var(--accent); transform: rotate(45deg); }
.timeline b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink); }

/* The views */
.views { --gallery-max: 1440px; border-top: 1px solid var(--line); padding-bottom: clamp(56px, 7vw, 104px); }
.views-intro, .views-head { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.views-intro { padding-top: var(--section-y); }
.views-note { max-width: 62ch; margin: 24px 0 0; font-size: 17px; line-height: 1.6; color: var(--body); text-wrap: pretty; }
.views-group { margin-top: clamp(64px, 8vw, 112px); }
.views-head { margin-bottom: 32px; }
.views-group h2 { max-width: 26ch; font-size: clamp(28px, 3.2vw, 44px); }

.gv { margin: 0; min-width: 0; }
.gv > figure { margin: 0; }
.gv-full { max-width: var(--gallery-max); margin: 0 auto; padding: 0 var(--gutter); }
.gv-pic { position: relative; display: block; overflow: hidden; background: var(--surface); }
a.gv-pic { cursor: zoom-in; }
.gv-pic img, .gv-pic picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.gv-pic img { transition: transform 700ms var(--ease-out); }
@media (hover: hover) { a.gv-pic:hover img { transform: scale(1.012); } }
.gv-full .gv-pic { aspect-ratio: 16 / 9; max-height: 88svh; }
.gv-pic.contain img { object-fit: contain; background: var(--silk); }

.gv-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 40px); max-width: var(--gallery-max); margin: 0 auto; padding: 0 var(--gutter); align-items: start; }
.gv-row-narrow { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.gv-full + .gv-row, .gv-row + .gv-row, .gv-row + .gv-full, .gv-full + .gv-full { margin-top: clamp(48px, 6vw, 88px); }
.gv-wide .gv-pic { aspect-ratio: 16 / 9; }
.gv-narrow .gv-pic { aspect-ratio: 1; }

/* the caption card: white, a hairline, lifted over the foot of a full-width picture */
.gv-cap { position: relative; display: block; margin-top: 16px; padding: clamp(18px, 2vw, 26px); background: var(--card); border: 1px solid var(--line); color: var(--body); }
.gv-full .gv-cap { width: min(720px, calc(100% - 2 * clamp(16px, 3vw, 40px))); margin: -56px 0 0 clamp(16px, 3vw, 40px); box-shadow: 0 16px 36px -28px rgba(30, 24, 18, 0.45); }
.gv h3 { margin: 0; font-size: clamp(19px, 1.7vw, 22px); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.gv h3 [lang^="zh"] { font-family: var(--zh-serif); letter-spacing: 0.02em; }
.gv-cap p { margin: 10px 0 0; max-width: 62ch; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.gv-credit { margin-top: 12px !important; font-family: var(--serif); font-style: italic; font-size: 15px !important; color: var(--muted); }
.gv-credit a { color: inherit; text-underline-offset: 2px; }
.gv-label { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gv-label::before { content: ''; width: 16px; height: 1.5px; background: var(--accent); }
.gv-label.is-evidence::before { background: var(--tile); }

/* Tags on a picture: what it is */
.pic-tag { position: absolute; left: 12px; bottom: 12px; padding: 5px 8px; background: rgba(251, 249, 244, 0.92); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink); pointer-events: none; }
.pic-tag.is-ai { background: rgba(30, 24, 18, 0.82); border-color: transparent; color: #FBF9F4; }
.gv-full .pic-tag { bottom: 68px; }

/* Placeholder for a render to come (figure.ph). Replaced by its picture when assets/gallery/<slot>.webp is listed in assets/gallery/manifest.json (main.js) */
.ph { position: relative; margin: 0; min-width: 0; }
.ph-frame { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--grain), linear-gradient(180deg, #F7F2E7 0%, #F1EADB 100%); border: 1px solid var(--line-strong); outline: 1px solid rgba(200, 164, 90, 0.7); outline-offset: -8px; }
.ph[data-aspect="4:3"] .ph-frame { aspect-ratio: 4 / 3; }
.ph[data-aspect="3:4"] .ph-frame { aspect-ratio: 3 / 4; }
.ph[data-aspect="4:5"] .ph-frame { aspect-ratio: 4 / 5; }
.ph[data-aspect="1:1"] .ph-frame { aspect-ratio: 1; }
.ph[data-aspect="9:16"] .ph-frame { aspect-ratio: 9 / 16; }
.ph[data-aspect="3:2"] .ph-frame { aspect-ratio: 3 / 2; }
.ph-art { position: absolute; inset: auto 0 0 0; width: 100%; height: 58%; color: var(--ink); }
.ph-seal { position: absolute; top: clamp(16px, 2.4vw, 28px); right: clamp(16px, 2.4vw, 28px); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 3px; border: 1.5px solid var(--accent); color: var(--accent-ink); font-family: var(--zh-serif); font-size: 18px; line-height: 1; transform: rotate(4deg); background: rgba(251, 249, 244, 0.7); }
.ph-label { position: absolute; left: clamp(16px, 2.4vw, 28px); top: clamp(16px, 2.4vw, 28px); right: 72px; margin: 0; font-family: var(--mono); font-size: 11px; line-height: 1.55; letter-spacing: 0.03em; color: var(--muted); text-wrap: pretty; }
.ph-label b { display: block; margin-bottom: 2px; font-weight: 500; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.08em; }
.ph-label code { font: inherit; color: var(--ink); }
.ph-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.ph-filled .ph-frame > img { opacity: 1; }
.ph-link { display: block; }
.ph-filled .pic-tag, .gv-full .ph-filled .pic-tag { top: 12px; bottom: auto; }
.ph.ph-filled .ph-art, .ph.ph-filled .ph-seal, .ph.ph-filled .ph-label { display: none; }
.ph.ph-filled .ph-frame { outline: 0; background: var(--surface); }
.gv-full .ph .ph-frame { max-height: 88svh; }

/* From above: a strip of tall views, scrolled sideways like a handscroll */
.scroll-strip { max-width: var(--gallery-max); margin: 0 auto; padding: 0 var(--gutter); }
.scroll-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: clamp(16px, 2vw, 28px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 6px 2px 18px; scrollbar-color: var(--line-strong) transparent; }
.scroll-track > * { scroll-snap-align: start; }
.scroll-track .gv-cap { margin-top: 12px; padding: 14px 16px; }
.scroll-track .gv-cap p { font-size: 14px; }
.scroll-hint { margin: 10px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Compare: our model from the camera fitted to plate 15, against the plate */
.cmp { --pos: 50%; position: relative; overflow: hidden; margin-top: clamp(32px, 4vw, 48px); aspect-ratio: 1600 / 918; background: var(--surface); border: 1px solid var(--line-strong); touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.cmp picture, .cmp img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.cmp-top { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #FBF9F4; box-shadow: 0 0 0 1px rgba(30, 24, 18, 0.25); pointer-events: none; }
.cmp-grip { position: absolute; top: 50%; left: var(--pos); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px #FBF9F4, 0 4px 14px rgba(30, 24, 18, 0.3); pointer-events: none; }
.cmp-grip::before, .cmp-grip::after { content: ''; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px; border: 5px solid transparent; }
.cmp-grip::before { left: 8px; border-right-color: #FBF9F4; }
.cmp-grip::after { right: 8px; border-left-color: #FBF9F4; }
.cmp-tag { position: absolute; top: 12px; padding: 5px 8px; background: rgba(251, 249, 244, 0.92); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink); pointer-events: none; }
.cmp-tag-a { left: 12px; }
.cmp-tag-b { right: 12px; }
.cmp input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.cmp-dragging { cursor: ew-resize; }

/* October 1860: plain paper, a thin ink rule, no ornament */
.sober { background: var(--bg); border-top: 1px solid var(--ink); }
.sober .eyebrow-bar { background: var(--ink); }
.sober h2 .accent { font-family: var(--head); font-style: normal; color: var(--ink); }

/* Scene cards (Küstrin's six views) */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(32px, 4vw, 56px); }
.card { display: flex; flex-direction: column; padding: 14px 14px 18px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.card .card-shot { display: block; aspect-ratio: 5 / 4; overflow: hidden; background: var(--silk); outline: 1px solid rgba(200, 164, 90, 0.7); outline-offset: -6px; }
.card .card-shot img { width: 100%; height: 100%; object-fit: cover; }
.card-year { margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--accent-ink); }
.card h3 { margin: 6px 0 0; font-size: 19px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.card h3 [lang^="zh"] { font-family: var(--zh-serif); letter-spacing: 0.04em; }
.card p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--body); }
.card .card-go { margin-top: auto; padding-top: 14px; font-size: 14px; font-weight: 500; color: var(--accent-ink); }
@media (hover: hover) { .card:hover { border-color: var(--line-strong); box-shadow: 0 14px 30px -24px rgba(30, 24, 18, 0.45); } .card:hover .card-go { text-decoration: underline; text-underline-offset: 3px; } }

/* The grades as seals: A pressed solid, B in outline, C a dashed outline (a guess) */
.grades { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.grades li { display: flex; gap: 16px; align-items: flex-start; font-size: 16px; line-height: 1.55; color: var(--body); }
.grade { flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-top: -3px; border-radius: 3px; font-family: var(--serif); font-style: italic; font-size: 20px; font-weight: 600; line-height: 1; }
.grade-a { background: var(--accent); color: #FBF9F4; box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 3px rgba(251, 249, 244, 0.75); transform: rotate(-3deg); }
.grade-b { border: 2px solid var(--accent); color: var(--accent-ink); transform: rotate(2deg); }
.grade-c { border: 2px dashed var(--accent); color: var(--accent-ink); transform: rotate(-1deg); }

/* The closing call */
.contact-band { text-align: left; }
.contact-band h2 { max-width: 22ch; }
.contact-lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--body); max-width: 52ch; margin: 20px 0 0; text-wrap: pretty; }
.todo-note { margin: 12px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); }

/* Lightbox */
.lb { width: min(96vw, 1500px); max-height: 94svh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lb::backdrop { background: rgba(30, 24, 18, 0.86); }
.lb-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-stage img { max-width: 100%; max-height: 80svh; width: auto; height: auto; background: var(--silk); }
.lb-cap { max-width: 70ch; margin: 0; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.45; color: #F4EFE4; text-align: center; }
.lb-close { position: fixed; top: 12px; right: 12px; width: 44px; height: 44px; border: 1px solid rgba(244, 239, 228, 0.5); background: rgba(30, 24, 18, 0.6); color: #F4EFE4; font-size: 22px; line-height: 1; cursor: pointer; }

/* Reveal on scroll: only when the script runs, never with reduced motion */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out); }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

/* Sources and credits */

.credits .band-inner { padding-bottom: 48px; }
.h1-credits { margin: 16px 0 24px; max-width: 18ch; }
.credits .lead { max-width: 62ch; }
.credits-block { margin-top: clamp(48px, 6vw, 72px); }
.credits-block h2 { margin: 0 0 16px; max-width: none; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.source-list { list-style: none; margin: 0; padding: 0; max-width: 78ch; }
.source-list li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--body); overflow-wrap: anywhere; }
.source-list a { color: var(--body); }
.credit-note { max-width: 62ch; margin: 0 0 24px; font-size: 14px; line-height: 1.5; color: var(--body); }
.credit-scroll { overflow-x: auto; }
.credit-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; color: var(--body); }
.credit-table th { padding: 8px 12px 8px 0; text-align: left; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.credit-table td { padding: 12px 12px 12px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.credit-table a { color: var(--body); overflow-wrap: anywhere; }
.credit-thumb { width: 108px; }
.credit-thumb img { width: 96px; height: 96px; max-width: none; object-fit: cover; background: var(--surface); }
.credit-src { font-size: 13px; color: var(--muted); }
.credit-src a { color: var(--muted); }

/* Placeholder for the reconstruction page */

.placeholder { min-height: calc(100svh - var(--header-h) - var(--bar-h) - 1px); display: flex; align-items: center; }
.placeholder .band-inner { width: 100%; }
.placeholder h1 { max-width: 22ch; margin-top: 16px; }
.placeholder .lead { max-width: 52ch; }

/* The Chinese page: serif headings, no tight Latin tracking, no italics, no uppercase */

:lang(zh) h1, :lang(zh) h2 { font-family: var(--zh-serif); letter-spacing: 0.02em; line-height: 1.3; }
:lang(zh) h2 { max-width: 15em; word-break: keep-all; overflow-wrap: anywhere; }
:lang(zh) h2 .accent { display: inline-block; font-family: var(--zh-serif); font-style: normal; } /* wrap between phrases, never inside one */
:lang(zh) .hero .title-en { font-family: var(--zh-serif); font-style: normal; letter-spacing: 0.04em; }
:lang(zh) .title-en { font-family: var(--zh-serif); letter-spacing: 0.02em; }
:lang(zh) .hero .title-pinyin { font-family: var(--sans); }
:lang(zh) .lead, :lang(zh) .copy p, :lang(zh) .list li, :lang(zh) .legend div, :lang(zh) .grades li, :lang(zh) .gv-cap p, :lang(zh) .timeline li, :lang(zh) .contact-lead { line-height: 1.85; }
:lang(zh) .caption, :lang(zh) .gv-credit, :lang(zh) .lb-cap { font-family: var(--zh-serif); font-style: normal; font-size: 15px; line-height: 1.6; }
:lang(zh) .eyebrow, :lang(zh) .btn { letter-spacing: 0.04em; }
:lang(zh) .gv h3, :lang(zh) .card h3 { font-family: var(--zh-serif); letter-spacing: 0.02em; }
:lang(zh) .stat-label { line-height: 1.6; }
:lang(zh) .grade { font-family: var(--serif); }

/* Responsive */

@media (max-width: 1180px) {
  .site-header-inner { height: auto; min-height: var(--header-h); flex-wrap: wrap; row-gap: 0; }
  .site-nav { order: 3; flex: 1 0 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 10px); overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { min-height: 40px; font-size: 13px; }
  html { scroll-padding-top: calc(var(--header-h) + 48px); }
}

@media (max-width: 860px) {
  .split, .intro .split { grid-template-columns: minmax(0, 1fr); }
  .gv-row, .gv-row-narrow { grid-template-columns: minmax(0, 1fr); }
  .gv-row > * + * { margin-top: 40px; }
  .gv-narrow { max-width: 560px; }
  .gv-full .gv-cap { width: auto; margin: 12px 0 0; box-shadow: none; }
  .gv-full .pic-tag { bottom: 12px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .brand-name { font-size: 15px; }
  .site-header-inner { gap: 8px; }
  /* the hero button sits right below; the language switch has to stay reachable */
  .header-right .btn-sm { display: none; }
  .list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .credit-table { min-width: 620px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .head-row .v-title { display: none; }
  .gv-full { padding: 0; }
  .gv-full .gv-cap { margin: 12px var(--gutter) 0; }
  .gv-full .gv-pic, .gv-full .ph-frame { border-left: 0; border-right: 0; }
  .cmp-tag { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .gv-pic img, .btn, .card { transition: none; }
}


/* The European palaces, /xiyanglou: generated by scripts/xiyanglou_page.py */

.xy-intro .band-inner, .xy-b .band-inner { padding-top: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); }
.xy-h1 { margin-top: 20px; }
.xy-lead { max-width: 66ch; }
.xy-subh { margin: clamp(40px, 5vw, 64px) 0 16px; font-size: 22px; }
.xy-planwrap { overflow-x: auto; border: 1px solid var(--line-strong); }
.xy-plan { display: block; width: 100%; min-width: 760px; height: auto; }
.xy-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.xy-chips a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); color: var(--body); text-decoration: none; font-size: 15px; }
.xy-chips a:hover { color: var(--ink); border-color: var(--ink); }
.xy-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(40px, 5vw, 72px); }
.xy-cols h3 { margin: 0 0 10px; font-size: 19px; color: var(--ink); }
.xy-cols p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--body); }
.xy-h2 { margin: 14px 0 0; max-width: none; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.15; }
.xy-h2 [lang^="zh"] { font-family: var(--zh-serif); }
.xy-en { display: block; margin-top: 6px; font-size: 0.55em; font-weight: 400; color: var(--muted); }
.xy-3d { margin-top: 18px; border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; }
.xy-text { max-width: 70ch; margin-top: 24px; }
.xy-text h3, .xy-sub { margin: 28px 0 8px; font-size: 18px; color: var(--ink); }
.xy-sub { margin-top: 40px; }
.xy-text p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--body); text-wrap: pretty; }
.xy-side { margin: 22px 0 10px; font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.xy-plates { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.xy-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.xy-fig { margin: 0; min-width: 0; }
.xy-fig a { display: block; background: var(--surface); border: 1px solid var(--line-strong); }
.xy-fig img { display: block; width: 100%; height: auto; }
.xy-fig figcaption { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--body); }
.xy-fig figcaption b { font-weight: 500; color: var(--body); }
.xy-meta { color: var(--muted); font-size: 12px; }
.xy-credit { display: block; margin-top: 3px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.xy-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.xy-pair-note { grid-column: 1 / -1; margin: 0; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.45; color: var(--body); }
.xy-note { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.xy-note a { color: inherit; text-underline-offset: 2px; }
.xy-cards { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.xy-cards li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--body); }
.xy-cards a { color: var(--tile); text-underline-offset: 2px; white-space: nowrap; }
.xy-tablewrap { overflow-x: auto; }
.xy-dim { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; line-height: 1.4; color: var(--body); }
.xy-dim th { padding: 6px 10px 6px 0; text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.xy-dim td { padding: 6px 10px 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.xy-dim .num { white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--ink); }
.xy-dim .src { font-size: 12px; color: var(--muted); }
.xy-more { margin-top: 14px; }
.xy-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 15px; color: var(--body); }
.xy-frag { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.xy-frag li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.5; color: var(--body); max-width: 80ch; }
.xy-frag b { font-weight: 500; color: var(--ink); }
.xy-sources { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; line-height: 1.5; color: var(--body); }
.xy-sources li { padding: 3px 0; }
.xy-sources a { color: inherit; text-underline-offset: 2px; }
@media (max-width: 860px) { .xy-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .xy-pair { gap: 8px; } .xy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.xy-home { margin: 0 0 24px; max-width: 640px; }

/* The scene dossiers, /scenes: generated by scripts/scenes_page.py; they share the classes above */

.sc-plan { min-width: 900px; }
.sc-list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.sc-item { padding: 18px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.sc-item h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; color: var(--ink); }
.sc-item h3 [lang^="zh"] { font-family: var(--zh-serif); }
.sc-item h3 .xy-meta { margin-left: 6px; font-family: var(--mono); font-weight: 400; }
.sc-item h3 .xy-en { font-size: 15px; }
.sc-item p { margin: 6px 0 0; max-width: 78ch; font-size: 16px; line-height: 1.55; color: var(--body); }
.sc-item:target { background: var(--surface); }
.sc-public h3 { color: var(--tile); }
.sc-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sc-links .xy-3d { margin-top: 0; }
.sc-hero { margin-top: 28px; }
.xy-text p + p { margin-top: 12px; }
.band.paper + .band.paper { border-top: 1px solid rgba(23, 19, 15, 0.14); }

/* Round 20: the page on the surroundings (scripts/around_page.py): the plan's legend */
.ar-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--body); }
.ar-legend li { display: flex; align-items: center; gap: 7px; }
.ar-sw { width: 16px; height: 11px; border: 1.5px solid transparent; flex: none; }
.ar-ln { width: 20px; height: 0; border-top: 3px solid; flex: none; }
.ar-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.copy .credits-link { font-size: var(--fs-label); }
.credits-after { margin-top: 32px !important; }


/* Round 22: the locator map (one <symbol id="gmap"> per page from our own layers, the camera's dot and its field of view) and the filled gallery slots */
.gmap { flex: none; display: block; width: 150px; height: auto; background: #F3ECDC; border: 1px solid var(--line-strong); }
.gm-garden { fill: var(--gm-garden, #FCF9F1); }
.gm-hill { fill: var(--gm-hill, #4F8270); fill-opacity: var(--gm-hill-o, 0.5); }
.gm-water { fill: var(--gm-water, #6F93A8); fill-opacity: var(--gm-water-o, 0.58); }
.gm-wall { fill: none; stroke: var(--gm-wall, var(--ink)); stroke-opacity: var(--gm-wall-o, 0.72); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.gm-axis { fill: none; stroke: var(--gm-axis, var(--accent)); stroke-opacity: var(--gm-axis-o, 0.8); stroke-width: 0.8; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.gm-seal { fill: var(--gm-seal, var(--accent)); fill-opacity: 0.8; }
.gm-label { font-family: var(--serif); font-style: italic; fill: var(--gm-label, var(--muted)); paint-order: stroke; stroke: var(--gm-halo, #FCF9F1); stroke-width: 34px; stroke-linejoin: round; }
.gm-label[lang^="zh"] { font-family: var(--zh-serif); font-style: normal; }
.gm-north { fill: var(--ink); fill-opacity: 0.65; }
.gm-cone { fill: var(--gm-cone, var(--accent)); fill-opacity: var(--gm-cone-o, 0.2); stroke: var(--gm-cone, var(--accent)); stroke-opacity: 0.75; stroke-width: 0.9; vector-effect: non-scaling-stroke; }
.gm-dot { fill: var(--gm-dot, var(--accent)); stroke: var(--gm-dot-edge, var(--ink)); }

/* The filled gallery slots: what the AI added, and where the picture looks from */
.gv-ai { font-family: var(--serif); font-style: italic; color: var(--muted); }
.gv-where { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.gv-where-text { min-width: 0; flex: 1; }
.gv-from { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: 0.01em; color: var(--muted); text-wrap: pretty; }
.gv-cap .gv-from { margin: 0; max-width: none; font-size: 12px; line-height: 1.5; }
.gv-3d { display: inline-flex; align-items: center; min-height: 28px; margin-top: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--accent-ink); text-underline-offset: 3px; }
.gv-cap .gv-pages { margin: 0; font-size: 13px; line-height: 1.5; }
.gv-pages a { color: var(--accent-ink); text-underline-offset: 3px; }
.ph-link.gv-pic { aspect-ratio: auto; max-height: none; }
.scroll-track .gv-where { display: block; }
.scroll-track .gmap { width: 100%; max-width: 220px; margin-bottom: 10px; }
.scroll-track .gv-cap .gv-pages { font-size: 12px; }
.gv h3 [lang^="zh"], .gv-from [lang^="zh"] { white-space: nowrap; }
.scroll-track .gv-cap .gv-from { font-size: 11px; }
.scroll-track .gv-ai { font-size: 13px !important; line-height: 1.45; }
:lang(zh) .gv-ai, .gv-ai [lang^="zh"] { font-family: var(--zh-serif); font-style: normal; }
@media (max-width: 560px) { .gv-where { gap: 12px; } .gv-where .gmap { width: 112px; } }

/* the album leaf of 1744, moved from the hero to the intro as evidence */
.intro-leaf { width: 100%; max-width: 460px; justify-self: center; }
.intro-leaf figcaption { margin-top: 14px; font-size: 15px; text-align: left; }


/* Round 22b: the hero is the picture. A full-screen carousel of AI pictures from our model (tools/home_gallery.py writes it, main.js turns it),
   the headline on a soft scrim at the lower left, each slide's caption under the buttons, the dots in the middle, a small locator map at the
   right, and a paper hills edge into the light page below. Only the picture is rich; everything under it stays paper. */
.hero.hero-full {
  --edge-h: 0px;
  --paper: #FBF9F4;
  --scrim: 16, 12, 8;
  display: block;
  height: calc(100svh - var(--header-h) - var(--bar-h) - 1px);
  min-height: 620px;
  background: #6c6a5a;
  color: var(--paper);
}
.hero-show { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hero-slides { position: absolute; inset: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.hero-slide { position: absolute; inset: 0; background: linear-gradient(var(--bg-top, #a49b8d), var(--bg-bot, #62675f)); opacity: 0; visibility: hidden; transition: opacity 1200ms ease-in-out, visibility 0s linear 1200ms; }
.hero-slide.is-under { opacity: 1; visibility: visible; transition: none; }
.hero-slide.is-on { z-index: 1; opacity: 1; visibility: visible; transition: opacity 1200ms ease-in-out; }
.hero-slide picture, .hero-slide img { display: block; width: 100%; height: 100%; max-width: none; }
.hero-slide img { object-fit: cover; object-position: 50% 50%; transform-origin: 50% 58%; }
/* the slow zoom: 5 percent over a slide's time, carried on while the next fades in over it */
.hero-slide.is-on img, .hero-slide.is-under img { animation: hero-zoom 10s linear both; will-change: transform; }
.hero-full[data-still] .hero-slide img { animation-play-state: paused; }
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.05); } }

.hero-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(var(--scrim), 0.5) 0%, rgba(var(--scrim), 0.3) 16%, rgba(var(--scrim), 0.1) 32%, rgba(var(--scrim), 0) 46%);
}
/* the shade under the words goes with them: a soft dark glow behind the headline and behind the caption, wherever they stand */
.hero-full .hero-copy, .hero-caps { position: relative; }
.hero-full .hero-copy::before, .hero-caps::before { content: ''; position: absolute; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(var(--scrim), 0.76), rgba(var(--scrim), 0.66) 50%, rgba(var(--scrim), 0.32) 78%, rgba(var(--scrim), 0)); }
.hero-full .hero-copy::before { inset: -48% -42% -24% -32%; }
.hero-caps::before { inset: -70% -28% -50% -24%; background: radial-gradient(closest-side, rgba(var(--scrim), 0.8), rgba(var(--scrim), 0.72) 50%, rgba(var(--scrim), 0.36) 78%, rgba(var(--scrim), 0)); }

.hero-arrow { position: absolute; z-index: 4; top: 50%; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; padding: 0; border: 1px solid rgba(251, 249, 244, 0.38); background: rgba(var(--scrim), 0.24); color: var(--paper); cursor: pointer; opacity: 0.72; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity 200ms var(--ease-out), background-color 200ms var(--ease-out); }
.hero-arrow[hidden] { display: none; }
.hero-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hero-prev { left: clamp(10px, 1.6vw, 28px); }
.hero-next { right: clamp(10px, 1.6vw, 28px); }
@media (hover: hover) { .hero-arrow:hover { opacity: 1; background: rgba(var(--scrim), 0.46); } }
.hero-arrow:focus-visible { opacity: 1; outline-color: var(--paper); }
.hero-status { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.hero-inner { position: relative; z-index: 3; width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: auto auto 0; padding: 24px max(var(--gutter), 92px) calc(var(--edge-h) + 12px); pointer-events: none; } /* in the header's column, and clear of the arrows */
@media (min-width: 1300px) { .hero-inner { padding-left: var(--gutter); padding-right: var(--gutter); } }
@media (max-width: 900px) { .hero-inner { padding-left: var(--gutter); padding-right: var(--gutter); } }
.hero-full .hero-copy { max-width: 640px; pointer-events: auto; }
.hero-full .hero-copy, .hero-cap { text-shadow: 0 1px 2px rgba(var(--scrim), 0.4), 0 0 24px rgba(var(--scrim), 0.5); }
.hero-full .eyebrow { color: var(--paper); }
.hero-full .eyebrow span:last-child { padding: 3px 7px; background: rgba(var(--scrim), 0.4); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.hero-full h1 { margin-top: 14px; color: var(--paper); }
.hero-full .title-zh { display: flex; align-items: center; font-size: clamp(56px, 6.2vw, 100px); color: var(--paper); }
.hero-full .title-pinyin { margin-top: 10px; font-size: clamp(24px, 2.3vw, 34px); }
.hero-full .title-en { margin-top: 4px; font-size: clamp(20px, 1.9vw, 28px); color: #F7C6B4; }
.hero-full .hero-seal { position: static; flex: none; width: 0.6em; height: auto; margin-left: 0.24em; transform: rotate(-6deg); mix-blend-mode: normal; opacity: 0.97; filter: drop-shadow(0 2px 6px rgba(var(--scrim), 0.35)); }
.hero-full .tag { margin-top: 16px; background: rgba(251, 249, 244, 0.14); border-color: rgba(251, 249, 244, 0.5); color: #EEF4F7; text-shadow: none; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.hero-full .tag::before { background: #A9CDE2; }
.hero-full .actions { margin-top: 20px; text-shadow: none; }
.hero-full .btn-dark { background: var(--paper); color: var(--ink); }
.hero-full .btn-ghost { color: var(--paper); border-color: rgba(251, 249, 244, 0.66); background: rgba(var(--scrim), 0.2); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (hover: hover) {
  .hero-full .btn-dark:hover { background: #FFFFFF; color: var(--accent-ink); }
  .hero-full .btn-ghost:hover { border-color: var(--paper); background: rgba(var(--scrim), 0.36); }
}
.hero-full :focus-visible { outline-color: var(--paper); }

.hero-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; column-gap: clamp(16px, 2vw, 32px); margin-top: clamp(18px, 2.2vw, 28px); }
.hero-caps { display: grid; align-items: end; max-width: 560px; }
.hero-cap, .hero-loc { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transition: opacity 500ms ease, visibility 0s linear 500ms; }
.hero-cap.is-on, .hero-loc.is-on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 900ms ease 300ms; }
.hero-title { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.35; letter-spacing: -0.005em; color: var(--paper); text-wrap: balance; }
.hero-title [lang^="zh"] { font-family: var(--zh-serif); letter-spacing: 0.02em; white-space: nowrap; }
.hero-note { margin: 3px 0 0; font-family: var(--serif); font-style: italic; font-size: 15px; line-height: 1.4; color: rgba(251, 249, 244, 0.9); text-wrap: pretty; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 9px 0 0; text-shadow: none; }
.hero-ai { display: inline-block; padding: 4px 8px; background: rgba(251, 249, 244, 0.93); color: var(--ink); font-family: var(--mono); font-size: 11px; line-height: 1.35; letter-spacing: 0.02em; }
.hero-large { display: inline-flex; align-items: center; min-height: 24px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; padding: 0 6px; background: rgba(var(--scrim), 0.42); color: var(--paper); text-underline-offset: 3px; text-shadow: 0 1px 2px rgba(var(--scrim), 0.6); }

.hero-nav { position: relative; display: flex; align-items: center; padding: 0 2px; background: rgba(var(--scrim), 0.36); border: 1px solid rgba(251, 249, 244, 0.24); pointer-events: auto; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero-nav[hidden] { display: none; }
.hero-dots { display: flex; }
.hero-dot { width: 26px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.hero-dot::before { content: ''; display: block; width: 8px; height: 8px; margin: auto; border: 1.5px solid rgba(251, 249, 244, 0.92); transform: rotate(45deg); }
.hero-dot[aria-current="true"]::before { background: var(--accent); border-color: #F7C6B4; }
.hero-pause { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-left: 1px solid rgba(251, 249, 244, 0.24); background: transparent; color: var(--paper); cursor: pointer; }
.hero-pause svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-pause .i-play { display: none; fill: currentColor; }
.hero-pause[data-state="stopped"] .i-play { display: block; }
.hero-pause[data-state="stopped"] .i-pause { display: none; }
@media (hover: hover) { .hero-dot:hover::before { border-color: #FFFFFF; background: rgba(251, 249, 244, 0.4); } .hero-pause:hover { color: #FFFFFF; } }
.hero-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; background: rgba(251, 249, 244, 0.16); }
.hero-progress i { display: block; height: 100%; background: var(--paper); transform: scaleX(0); transform-origin: 0 50%; }
.hero-full[data-run] .hero-progress i { animation: hero-progress var(--dwell, 8000ms) linear forwards; }
.hero-full[data-still] .hero-progress i { animation-play-state: paused; }
@keyframes hero-progress { to { transform: scaleX(1); } }

.hero-where { display: grid; justify-self: end; justify-items: end; align-items: end; }
.hero-loc { display: flex; align-items: flex-end; gap: 10px; }
.hero-from { margin: 0; max-width: 13.5em; padding: 4px 7px; background: rgba(251, 249, 244, 0.93); color: var(--ink); font-family: var(--mono); font-size: 11px; line-height: 1.4; text-align: left; }
.hero-loc .gmap { width: clamp(96px, 8.4vw, 120px); box-shadow: 0 6px 20px -6px rgba(var(--scrim), 0.5); }


@media (max-width: 1180px) {
  /* the header's sections drop to a second row of 41 px */
  .hero.hero-full { height: calc(100svh - var(--header-h) - var(--bar-h) - 42px); }
}
@media (max-width: 900px) {
  .hero-foot { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "caps where" "nav nav"; row-gap: 14px; }
  .hero-caps { grid-area: caps; }
  .hero-where { grid-area: where; }
  .hero-nav { grid-area: nav; justify-self: center; }
  .hero-arrow { display: none; }
}
@media (max-width: 700px) {
  .hero.hero-full { min-height: 560px; }
  .hero-scrim {
    background:
      linear-gradient(to top, rgba(var(--scrim), 0.8) 0%, rgba(var(--scrim), 0.66) 30%, rgba(var(--scrim), 0.3) 50%, rgba(var(--scrim), 0) 64%),
      linear-gradient(to bottom, rgba(var(--scrim), 0.32) 0%, rgba(var(--scrim), 0) 14%);
  }
  .hero-full .hero-copy::before, .hero-caps::before { inset: -10% -12% -6% -12%; background: radial-gradient(closest-side, rgba(var(--scrim), 0.55), rgba(var(--scrim), 0.36) 60%, rgba(var(--scrim), 0)); }
  .hero-arrow { display: none; }
  .hero-inner { position: static; padding-top: 0; }
  .hero-full .hero-copy, .hero-caps { position: relative; z-index: 3; }
  .hero-foot { display: block; margin-top: 16px; }
  .hero-nav { position: absolute; z-index: 4; top: 10px; left: var(--gutter); }
  .hero-where { position: absolute; z-index: 4; top: 10px; right: var(--gutter); }
  .hero-from { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hero-loc .gmap { width: 80px; }
  .hero-full .eyebrow { display: none; }
  .hero-full h1 { margin-top: 0; }
  .hero-full .title-zh { font-size: 46px; }
  .hero-full .title-pinyin { margin-top: 4px; font-size: 21px; }
  .hero-full .title-en { font-size: 16.5px; }
  .hero-full .tag { margin-top: 10px; padding: 4px 8px; font-size: 11px; }
  .hero-full .actions { margin-top: 14px; gap: 8px; }
  .hero-full .actions .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
  .hero-title { font-size: 14px; }
  .hero-note { display: none; }
  .hero-meta { margin-top: 6px; gap: 4px 12px; }
  .hero-ai { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.is-on, .hero-cap, .hero-cap.is-on, .hero-loc, .hero-loc.is-on { transition: none; }
  .hero-slide.is-on img, .hero-slide.is-under img { animation: none; }
  .hero-full[data-run] .hero-progress i { animation: none; }
}
:lang(zh) .hero-note { font-family: var(--zh-serif); font-style: normal; line-height: 1.6; }
:lang(zh) .hero-title { font-family: var(--zh-serif); letter-spacing: 0.02em; }

/* Hero, calmer (Nov 6): no caption block, no containers; only the dots, a tiny AI mark and a translucent black-and-white locator. */
.hero-full .hero-title, .hero-full .hero-note, .hero-full .hero-large, .hero-from, .hero-progress { display: none; }
.hero-caps::before { display: none; }
.hero-meta { margin: 0; }
.hero-ai { padding: 0; background: none; color: rgba(251, 249, 244, 0.72); font-size: 10.5px; letter-spacing: 0.04em; text-shadow: 0 1px 3px rgba(var(--scrim), 0.7); }
.hero-nav { padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hero-pause { border-left: 0; }
.hero-dot::before { filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.55)); }
.hero-loc .gmap {
  background: transparent; border: 0; box-shadow: none; opacity: 0.82; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  --gm-garden: rgba(255, 255, 255, 0.1); --gm-hill: #fff; --gm-hill-o: 0.1; --gm-water: #fff; --gm-water-o: 0.3;
  --gm-wall: #fff; --gm-wall-o: 0.9; --gm-axis: #fff; --gm-axis-o: 0.6; --gm-seal: #fff; --gm-label: #fff; --gm-halo: rgba(0, 0, 0, 0.4);
  --gm-cone: #fff; --gm-cone-o: 0.3; --gm-dot: #fff; --gm-dot-edge: #000;
}
