/* ============================================================
   Personal Site — Editorial / Archive style
   Reference: Readymag "Kira's Vers Libre"
   Core: scatter nav · collage waterfall · giant bg type ·
         typewriter bilingual body · scroll parallax
   ============================================================ */

:root{
  --ink:#1a1a1a;               /* main text — dark, for light bg */
  --paper:#ffffff;             /* page background — pure white */
  --paper-2:#ffffff;
  --white:#ffffff;             /* "card" base — white */
  --muted:#666666;
  --line:#e3e3e3;              /* hairlines — light */
  --accent:#1a1a1a;            /* solid fills that flip with theme */
  --orange:#F02282;            /* the single accent colour, from reference */
  --maxw:1280px;
  --font-display:"Archivo","Helvetica Neue",Arial,sans-serif;
  --font-mono:"JetBrains Mono","IBM Plex Mono",ui-monospace,Menlo,Consolas,monospace;
  --font-hand:"Caveat","Bradley Hand",cursive;
  --font-zh:"Huiwen-MinchoGBK","Source Han Serif TC","Noto Serif TC","PMingLiU",serif;
}

/* Chinese-only: apply Huiwen Mincho (Traditional). Targets explicit lang
   tags and Chinese text classes so Latin glyphs keep their own typeface. */
[lang="zh-Hant"],
[lang="zh"],
.ru, .zh, .q-ru, .quote-zh, .intro-guide{
  font-family:var(--font-zh);
  font-feature-settings:"palt" on;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:auto}  /* per-link behaviour is controlled in site.js */
body{
  font-family:var(--font-mono);
  color:var(--ink);
  background:var(--paper);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}

/* ---------- top sticky nav (left / center / right) ---------- */
.topbar{
  position:fixed;top:0;left:0;right:0;z-index:100;
  display:flex;align-items:flex-start;justify-content:space-between;
  padding:18px 26px;
  mix-blend-mode:difference;        /* nav stays readable on dark & light */
  color:#fff;
  pointer-events:none;
}
.topbar a,.topbar span{pointer-events:auto}
.topbar .nav-side{
  font-size:11px;letter-spacing:.12em;font-weight:600;text-transform:uppercase;
  font-family:var(--font-display);
}
.topbar .nav-side:hover{opacity:.6}
.topbar .brand{
  text-align:center;line-height:1.05;
  font-family:var(--font-display);font-weight:800;
  font-size:15px;letter-spacing:.04em;text-transform:uppercase;
}
@media(max-width:640px){
  .topbar{padding:14px 16px}
  .topbar .brand{font-size:12px}
  .topbar .nav-side{font-size:9px}
}

/* ============================================================
   HOME — full screen hero + scatter dots
   ============================================================ */
.hero{
  position:fixed;inset:0;height:100vh;width:100%;z-index:50;
  background:#222 center/cover no-repeat;
  overflow:hidden;
}
/* while the hero landing is showing, lock the page so you can ONLY enter a
   chapter by clicking a dot (no scrolling past the landing). */
body.hero-lock{overflow:hidden;height:100vh}
/* once a dot is clicked, dismiss the fixed hero so the chapters are reachable */
body.entered .hero{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .35s ease}
.hero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(to bottom,rgba(0,0,0,.32) 0%,rgba(0,0,0,0) 28%,rgba(0,0,0,0) 64%,rgba(0,0,0,.34) 100%)}
.hero-photo{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  object-position:center 32%;
}
/* Hero 轮播：所有 slide 叠在一起，默认透明，is-active 淡入 */
.hero-slider{position:absolute;inset:0;z-index:1;}
.hero-slide{opacity:0;transition:opacity 1.2s ease;}
.hero-slide.is-active{opacity:1;}

/* scatter dots */
.scatter{position:absolute;inset:0;z-index:5}
.dot{
  position:absolute;display:flex;align-items:center;gap:8px;
  color:#fff;font-family:var(--font-display);font-size:18px;font-weight:600;
  letter-spacing:.02em;cursor:pointer;
  transition:transform .35s cubic-bezier(.2,.7,.2,1),opacity .3s;
  text-shadow:0 1px 6px rgba(0,0,0,.5);
}
.dot::before{
  content:"";width:9px;height:9px;border-radius:50%;background:#fff;
  box-shadow:0 0 0 0 rgba(255,255,255,.5);
  transition:transform .35s,box-shadow .35s;
}
.dot:hover{transform:scale(1.18)}
.dot:hover::before{transform:scale(1.4);box-shadow:0 0 0 6px rgba(255,255,255,.18)}
.dot .dot-label{opacity:.85;transition:opacity .3s}
.dot:hover .dot-label{opacity:1}

.tag-left{position:absolute;left:26px;z-index:5;color:#fff;font-family:var(--font-display);
  font-size:11px;letter-spacing:.12em;font-weight:600;text-transform:uppercase;mix-blend-mode:difference}
.chapters-tag{bottom:18px}

.scroll-cue{
  position:absolute;left:50%;bottom:34px;transform:translateX(-50%);z-index:6;
  color:#fff;font-size:11px;letter-spacing:.18em;text-transform:uppercase;
  font-family:var(--font-display);opacity:.85;text-align:center;mix-blend-mode:difference;
}
.scroll-cue .arrow{display:block;margin-top:6px;animation:bob 1.6s infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(6px)}}

/* ---------- HOVER PREVIEW: hovering a dot transforms the whole hero ---------- */
/* dark scrim that deepens on hover */
.hero .scrim{position:absolute;inset:0;z-index:3;background:rgba(0,0,0,0);
  transition:background .5s ease;pointer-events:none}
/* faint grid that fades in on hover — responsive 10 cols × 6 rows, matches site.js */
.hero .grid{position:absolute;inset:0;z-index:4;opacity:0;transition:opacity .5s ease;pointer-events:none;
  background-image:linear-gradient(rgba(255,255,255,.12) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(255,255,255,.12) 1px,transparent 1px);
  background-size:10% 16.6667%}
/* per-chapter sticker removed */

/* preview layers — one per chapter, fade/scale in when .on */
.hero .preview-collage{position:absolute;inset:0;z-index:5;opacity:0;visibility:hidden;
  transition:opacity .5s ease,visibility .5s;pointer-events:none}
.hero .preview-collage.on{opacity:1;visibility:visible}
.hero .preview-collage figure{position:absolute;margin:0;filter:contrast(1.05);
  box-shadow:0 8px 24px rgba(0,0,0,.45);transform:scale(.84);transition:transform .5s ease;overflow:hidden}
.hero .preview-collage.on figure{transform:scale(1)}
.hero .preview-collage img{width:100%;height:100%;object-fit:cover;display:block}
.hero .preview-collage figure.frag{box-shadow:0 6px 18px rgba(0,0,0,.5)}
/* halftone dot cells (preset "dots") */
.hero .pv-dot{position:absolute;border-radius:50%;background:var(--shade);
  transform:scale(.5);transition:transform .45s ease}
.hero .preview-collage.on .pv-dot{transform:scale(1)}
.hero .pv-dot.boxed{border-radius:0;background:#1c1c1c;display:flex;align-items:center;justify-content:center}
.hero .pv-dot.boxed::after{content:"";width:72%;height:72%;border-radius:50%;background:var(--shade)}

/* active states toggled by JS class on .hero */
.hero.is-hovering .scrim{background:rgba(0,0,0,.55)}
.hero.is-hovering .grid{opacity:1}
/* keep dots & nav above the scrim */
.scatter{z-index:7}
.scroll-cue,.tag-left{z-index:8}

/* intro text block below hero on home */
.intro{
  max-width:760px;margin:0 auto;padding:120px 24px 140px;
}
.intro h2{
  font-family:var(--font-display);font-weight:800;font-size:clamp(28px,5vw,54px);
  line-height:1.05;letter-spacing:-.01em;margin-bottom:28px;
}
.intro p{font-size:14px;line-height:1.9;color:#c9c9c9;margin-bottom:18px;max-width:620px}
.intro .meta{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-top:30px}

/* ============================================================
   Page background image  (about.html / reference.html)
   ------------------------------------------------------------
   body.has-page-bg 时，整页铺一张大图作为背景。图片路径由
   pool.js 中的 about_bg / ref_bg 决定，JS 把它写入 CSS
   变量 --page-bg-img。叠一层暗色蒙版，保证白色正文/抬头
   能在任何照片之上保持可读。
   ============================================================ */
body.has-page-bg{
  background:#0c0c0c;
  color:#f3efe8;
}
/* 注: 实际背景图和蒙版由 about.html / reference.html 里的 #page-bg
   和 #page-bg-mask 这两个真实 DOM 元素承担,绕开 fixed-bg + body
   overflow:hidden 在某些浏览器下会失效的坑。 */
body.has-page-bg .topbar{background:transparent;color:#f3efe8;border-bottom-color:rgba(255,255,255,.18)}
body.has-page-bg .topbar a{color:#f3efe8}
body.has-page-bg .intro h2,
body.has-page-bg .ref-list h2{color:#f3efe8}
body.has-page-bg .intro p{color:#e3ddd1}
body.has-page-bg .intro .meta,
body.has-page-bg .ref-list .yr{color:#bdb4a3}
body.has-page-bg .ref-row{border-bottom-color:rgba(255,255,255,.18)}
body.has-page-bg .foot{background:transparent;color:#bdb4a3;border-top-color:rgba(255,255,255,.18)}
body.has-page-bg .foot a{color:#f3efe8}


/* ============================================================
   CHAPTER pages — collage + giant title + bilingual body
   ============================================================ */
.chapter{position:relative;min-height:100vh;background:var(--paper);padding-top:0}

/* collage layer (fixed-ish waterfall down the sides) */
.collage{position:absolute;inset:0;z-index:1;pointer-events:none;overflow:visible}
.collage figure{
  position:absolute;filter:contrast(1.05);
  box-shadow:0 8px 30px rgba(0,0,0,.12);
}
.collage img{width:100%;height:100%;object-fit:cover}

/* giant background title */
.giant{
  position:sticky;top:0;height:100vh;display:flex;align-items:center;justify-content:center;
  z-index:2;pointer-events:none;
}
.giant h1{
  font-family:var(--font-display);font-weight:800;
  font-size:clamp(60px,13vw,180px);line-height:.9;letter-spacing:-.03em;
  color:var(--ink);text-align:center;white-space:nowrap;
}
/* chapter keyword sticker removed */
@media(max-width:640px){
}
/* chapter subtitle — placed clearly BELOW the giant title (no overlap) */
.giant .subtitle{
  position:absolute;top:68%;left:50%;transform:translateX(-50%);
  font-family:var(--font-display);font-size:13px;font-weight:500;color:#c9c9c9;text-align:center;line-height:1.4;
  background:rgba(13,13,13,.0);padding:0 12px;
}
.giant .scroll-down{
  position:absolute;bottom:8%;left:50%;transform:translateX(-50%);
  width:180px;height:64px;pointer-events:none;
}
.giant .scroll-down span{
  position:absolute;
  font-family:var(--font-display);
  font-size:13px;letter-spacing:.04em;color:#9a9a9a;line-height:1;
}
/* "Scroll" sits upper-left, "Down" drops to lower-right — staggered, not aligned */
.giant .scroll-down .sd-a{left:0;top:0;animation:sd-bob 1.8s ease-in-out infinite}
.giant .scroll-down .sd-b{right:0;top:30px;animation:sd-bob 1.8s ease-in-out infinite .45s}
@keyframes sd-bob{
  0%,100%{transform:translateY(0);opacity:.55}
  50%{transform:translateY(10px);opacity:1}
}

/* ============================================================
   BUBBLE HERO — Chapter One first screen (DADA-style, WHITE bg)
   Floating image bubbles drifting on a clean white stage.
   To switch which photos appear, edit data-bubble-keys in index.html.
   ============================================================ */
.bubble-hero{
  background:#ffffff;                 /* white stage, overrides dark theme here only */
  overflow:hidden;
  pointer-events:auto;               /* allow mouse interaction with bubbles */
}
.bubble-hero .bubble-canvas{
  position:absolute;inset:0;
  width:100%;height:100%;
  display:block;z-index:1;
  cursor:default;
}
/* title sits on top of the bubbles */
.bubble-hero .bubble-title{
  position:relative;z-index:2;
  text-align:center;pointer-events:none;
  mix-blend-mode:normal;
}
.bubble-hero .bubble-title h1{
  color:#0a0a0a;                     /* dark ink on white */
}
.bubble-hero .bubble-title .subtitle{
  position:static;transform:none;left:auto;top:auto;
  margin-top:14px;color:#555;background:transparent;
}
.bubble-hero .scroll-down span{color:#777}
@media(max-width:640px){
  .bubble-hero .bubble-title h1{font-size:clamp(40px,18vw,90px)}
}

/* bilingual body cards floating above collage — STAGGERED editorial layout
   (cards are narrower than the column and step left / right, overlapping
   vertically so the reading rhythm feels layered, not centred & aligned) */
.body-wrap{position:relative;z-index:3;max-width:1080px;margin:0 auto;padding:60vh 24px 30vh}
.block{
  background:rgba(20,20,20,.92);backdrop-filter:blur(2px);
  padding:26px 30px;margin-bottom:54px;
  box-shadow:0 10px 40px rgba(0,0,0,.5);
  width:min(640px,86%);          /* narrower than the column → room to stagger */
  position:relative;
}
/* odd cards hug the left, even cards swing to the right; alternating cards
   pull up so neighbours overlap a little (depth / layering) */
.body-wrap .block:nth-of-type(odd){margin-right:auto;margin-left:0}
.body-wrap .block:nth-of-type(even){margin-left:auto;margin-right:0;margin-top:-32px;z-index:4}
.body-wrap .block:nth-of-type(3n){transform:translateX(40px)}
.body-wrap .block:nth-of-type(4n){transform:translateX(-28px)}
/* quote blocks break out further to the right and sit higher */
.body-wrap .block.quote{margin-left:auto;margin-right:0;transform:translateX(56px);margin-top:-20px;z-index:5}

.block .lang-row{display:flex;gap:18px;margin-bottom:18px}
.block .lang-tag{flex:0 0 48px;font-size:11px;color:var(--muted);padding-top:3px}
.block .lang-tag.ru{color:#b5b5b5}
.block p{font-size:14px;line-height:1.85}
.block .en{color:var(--ink)}
.block .ru{color:#9a9a9a}

@media(max-width:760px){
  /* on small screens drop the stagger so text stays readable */
  .body-wrap{max-width:760px}
  .block,.body-wrap .block:nth-of-type(odd),.body-wrap .block:nth-of-type(even),
  .body-wrap .block.quote{width:100%;margin-left:auto;margin-right:auto;margin-top:0;transform:none}
  .body-wrap .block:nth-of-type(3n),.body-wrap .block:nth-of-type(4n){transform:none}
}

/* centered media player */
.media{
  position:relative;z-index:3;max-width:620px;margin:0 auto 24px;
  aspect-ratio:16/10;background:#000 center/cover no-repeat;
  filter:none;box-shadow:0 16px 50px rgba(0,0,0,.3);
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.media .play{color:#fff;font-family:var(--font-display);font-weight:600;font-size:26px;letter-spacing:.05em;
  text-shadow:0 2px 12px rgba(0,0,0,.6)}
.media .caption{position:absolute;bottom:18px;left:0;right:0;text-align:center;color:#fff;
  font-size:15px;font-weight:600;text-shadow:0 1px 4px #000;padding:0 20px}
/* orange halftone-dot decoration that overlaps the media (single accent colour) */
.media-deco{position:relative;z-index:3;max-width:620px;margin:0 auto;height:0}
.media-deco i{position:absolute;display:block;
  background-image:radial-gradient(var(--orange) 32%,transparent 34%);
  background-size:11px 11px;opacity:.92}
.media-deco .d1{width:120px;height:60px;left:-26px;top:-300px;transform:rotate(0)}
.media-deco .d2{width:90px;height:40px;right:-18px;top:-70px}
.media-deco .b1{position:absolute;width:34px;height:34px;background:#5b6b86;right:34px;top:-46px}
.media-deco .b2{position:absolute;width:28px;height:28px;background:var(--orange);left:40px;top:-50px;border-radius:50%}
/* media label like "CHEKHOV'S MOTIFS, 2002" */
.media-label{position:relative;z-index:3;max-width:620px;margin:0 auto 70px;
  font-family:var(--font-display);font-size:11px;letter-spacing:.06em;font-weight:600;color:#c9c9c9}

/* QUOTE block — large black quote + grey translation */
.block.quote .lang-tag{color:var(--muted)}
.block.quote .q-en{font-family:var(--font-display);font-weight:700;font-size:17px;line-height:1.4;color:var(--ink);text-transform:uppercase;letter-spacing:.01em}
.block.quote .q-ru{font-size:13px;line-height:1.7;color:#9a9a9a;margin-top:14px}

/* ============================================================
   PER-CHAPTER CONTENT LAYOUTS (each chapter reads differently)
   applied via data-layout on .chapter
   ============================================================ */
/* shared wide container used by special layouts */
.wide{position:relative;z-index:3;max-width:var(--maxw);margin:0 auto;padding:0 24px}

/* layout: GALLERY (Chapter One — portrait thumbnails FRAME the giant title,
   ringing the left / right / top / bottom edges of the first viewport,
   exactly like the reference title screen) */
[data-layout="gallery"] .title-frame{
  position:absolute;inset:0;z-index:1;pointer-events:none;overflow:hidden;
}
[data-layout="gallery"] .title-frame figure{
  position:absolute;margin:0;overflow:hidden;
  filter:contrast(1.05);box-shadow:0 6px 20px rgba(0,0,0,.14);
}
[data-layout="gallery"] .title-frame img{width:100%;height:100%;object-fit:cover}
/* the giant title must sit ABOVE the framing portraits */
[data-layout="gallery"] .giant{z-index:3}

/* secondary gallery strip lower in the chapter (kept, but lighter) */
[data-layout="gallery"] .gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:40px 0}
[data-layout="gallery"] .gallery figure{margin:0;aspect-ratio:3/4;overflow:hidden}
[data-layout="gallery"] .gallery img{width:100%;height:100%;object-fit:cover}
[data-layout="gallery"] .gallery figure:nth-child(3){grid-row:span 2;aspect-ratio:3/8}

/* ── CHAPTER ONE ONLY · single-image browsing (daniilkotliar style) ──
   Scoped strictly to #one[data-view="single"] so chapters Two–Five keep
   their original grid. One image per screen, horizontally centered, native
   aspect ratio preserved (no cropping), generous vertical whitespace.
   Tweak: width  -> change min(58vw,1000px); whitespace -> change margin 14vh. */
#one[data-view="single"] .gallery{
  display:block;          /* drop the grid */
  grid-template-columns:none;
  gap:0;
  margin:8vh 0 0;
}
#one[data-view="single"] .gallery figure{
  margin:14vh auto;       /* big vertical gap between images, centered */
  width:min(29vw,500px); /* lock width, height follows the photo — halved */
  aspect-ratio:auto;      /* cancel the 3/4 crop ratio */
  overflow:visible;
  box-shadow:none;
}
#one[data-view="single"] .gallery figure:nth-child(3){
  grid-row:auto;          /* cancel the tall-3rd-cell rule */
  aspect-ratio:auto;
}
#one[data-view="single"] .gallery img{
  width:100%;
  height:auto;            /* native aspect ratio, no cropping */
  object-fit:contain;
  display:block;
}

/* lift chapter-one single-view gallery above any underlying collage */
#one[data-view="single"] .gallery{position:relative;z-index:3}
#one[data-view="single"] .gallery figure{position:relative;z-index:3}

/* ── GLOBAL · white-stage text card overrides ──
   With the palette flipped to white, the body cards (.block) — which were
   originally dark cards on a dark stage — need to become white cards with
   dark ink so they still read as elevated "cards" on the now-white page. */
.body-wrap .block,
.diag-text .block{
  background:rgba(255,255,255,.96);
  box-shadow:0 10px 36px rgba(0,0,0,.10);
  border:1px solid rgba(0,0,0,.06);
}
.body-wrap .block p,
.body-wrap .block .en,
.diag-text .block p,
.diag-text .block .en{color:#1a1a1a}
.body-wrap .block .ru,
.diag-text .block .ru{color:#555}
.body-wrap .block .lang-tag,
.body-wrap .block .lang-tag.ru,
.diag-text .block .lang-tag,
.diag-text .block .lang-tag.ru{color:#888}
.body-wrap .block.quote .q-en,
.diag-text .block.quote .q-en{color:#0a0a0a}
.body-wrap .block.quote .q-ru,
.diag-text .block.quote .q-ru{color:#555}
.media-label{color:#555}
/* giant background chapter title on white */
.giant h1{color:#0a0a0a}
.giant .subtitle{color:#555}
.giant .scroll-down span{color:#777}
/* chapter-end CTA on white */
.chapter-end .end-rule{background:#0a0a0a}
.chapter-end .continue{color:#0a0a0a;border-color:#0a0a0a}
.chapter-end .continue:hover{background:#0a0a0a;color:#ffffff}
/* intro paragraphs (home page below hero) on white */
.intro p{color:#444}
.intro .intro-guide{color:#555}


/* layout: STILLS (Chapter Two — full-bleed landscape stills) */
[data-layout="stills"] .bleed{position:relative;z-index:3;margin:50px 0;height:70vh;background:#000 center/cover no-repeat;filter:none}
[data-layout="stills"] .two-up{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:40px 0}
[data-layout="stills"] .two-up figure{margin:0;aspect-ratio:16/10;overflow:hidden;position:relative}
[data-layout="stills"] .two-up img{width:100%;height:100%;object-fit:cover}
/* lead pair sits right under the giant title */
[data-layout="stills"] .two-up.lead{margin:30px 0 40px}
[data-layout="stills"] .two-up figcaption{position:absolute;bottom:6px;left:6px;
  font-family:var(--font-display);font-size:10px;letter-spacing:.06em;font-weight:600;
  color:#fff;background:rgba(0,0,0,.45);padding:3px 7px}
[data-layout="stills"] .two-up figure.blurry img{filter:blur(3px) contrast(.95)}

/* layout: POSTER (Chapter Three — dadaist dot poster + manifesto) */
[data-layout="poster"] .dot-poster{position:relative;z-index:3;margin:50px auto;max-width:760px;
  display:grid;grid-template-columns:repeat(8,1fr);gap:10px}
[data-layout="poster"] .dot-poster span{aspect-ratio:1;border-radius:50%}
[data-layout="poster"] .manifesto{font-family:var(--font-display);font-weight:800;
  font-size:clamp(22px,4vw,40px);line-height:1.1;text-transform:uppercase;letter-spacing:-.01em;margin:30px 0}
[data-layout="poster"] .manifesto em{font-style:normal;color:var(--orange)}
/* inline hand-written orange sticker word inside the manifesto */
[data-layout="poster"] .hand-orange,
.manifesto .hand-orange{
  font-family:var(--font-hand);font-weight:700;color:var(--orange);
  text-transform:none;font-size:1.15em;display:inline-block;transform:rotate(-4deg);
}

/* two media players side-by-side, each wrapped in orange halftone decorations */
[data-layout="poster"] .media-grid{position:relative;z-index:3;display:grid;
  grid-template-columns:1fr 1fr;gap:40px;max-width:900px;margin:40px auto 10px}
[data-layout="poster"] .media-cell{position:relative}
[data-layout="poster"] .media-cell .media{aspect-ratio:16/10;margin:0;max-width:none}
[data-layout="poster"] .media-cell .media-label{margin:10px 0 0;max-width:none;text-align:left}
/* orange halftone-dot blocks that overlap the media corners */
[data-layout="poster"] .halftone{position:absolute;z-index:4;
  background-image:radial-gradient(var(--orange) 34%,transparent 36%);
  background-size:12px 12px;pointer-events:none}
[data-layout="poster"] .ht-tl{width:90px;height:90px;left:-18px;top:-18px}
[data-layout="poster"] .ht-tr{width:120px;height:70px;right:-16px;top:-18px}
[data-layout="poster"] .ht-bl{width:140px;height:46px;left:-12px;bottom:38px}
[data-layout="poster"] .sq{position:absolute;z-index:5;width:26px;height:26px;pointer-events:none}
[data-layout="poster"] .sq-orange{background:var(--orange);right:18px;top:-12px}
[data-layout="poster"] .sq-blue{background:#5b6b86;left:-10px;bottom:46px}
@media(max-width:640px){
  [data-layout="poster"] .media-grid{grid-template-columns:1fr;gap:48px}
}

/* layout: STEPS / DIAGONAL (Chapter Four — film stills stepped down the LEFT
   with coloured diagonal connector lines + captions; text column on the RIGHT) */
[data-layout="steps"] .diagonal{position:relative;z-index:3;display:grid;
  grid-template-columns:minmax(280px,440px) 1fr;gap:50px;margin:40px 0}
[data-layout="steps"] .diag-rail{position:relative}
[data-layout="steps"] .diag-shot{position:relative;margin:0 0 64px;width:62%;
  overflow:visible;filter:contrast(1.05);
  box-shadow:0 10px 28px rgba(0,0,0,.16)}
[data-layout="steps"] .diag-shot img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover}
/* each shot steps further to the right, forming a diagonal */
[data-layout="steps"] .diag-shot.s1{margin-left:0}
[data-layout="steps"] .diag-shot.s2{margin-left:24%}
[data-layout="steps"] .diag-shot.s3{margin-left:8%}
[data-layout="steps"] .diag-shot figcaption{position:absolute;bottom:-18px;left:0;
  font-family:var(--font-display);font-size:10px;letter-spacing:.06em;font-weight:600;color:#c9c9c9}
/* coloured diagonal stroke linking one still to the next */
[data-layout="steps"] .connector{position:absolute;width:4px;height:80px;
  bottom:-72px;right:18px;transform:rotate(28deg);transform-origin:top}
[data-layout="steps"] .c-green{background:#7a8c5a}
[data-layout="steps"] .c-blue{background:#5b6b86}
[data-layout="steps"] .c-black{background:#111;transform:rotate(-30deg);right:auto;left:24px}
[data-layout="steps"] .diag-shot:last-child .connector{display:none}
[data-layout="steps"] .diag-text .block{margin-bottom:40px}

/* legacy numbered steps (kept for reference / not used by Ch Four now) */
[data-layout="steps"] .steps{position:relative;z-index:3;margin:50px 0}
[data-layout="steps"] .step{display:flex;gap:24px;align-items:flex-start;margin-bottom:40px;max-width:820px}
[data-layout="steps"] .step:nth-child(even){flex-direction:row-reverse;margin-left:auto}
[data-layout="steps"] .step .num{font-family:var(--font-display);font-weight:800;font-size:54px;color:var(--orange);line-height:1;flex:0 0 auto}
[data-layout="steps"] .step figure{margin:0;width:240px;aspect-ratio:3/2;overflow:hidden;flex:0 0 auto}
[data-layout="steps"] .step img{width:100%;height:100%;object-fit:cover}
[data-layout="steps"] .step p{font-size:14px;line-height:1.8}

/* layout: FRAGMENTS (Chapter Five — close-up fragment mosaic) */
[data-layout="fragments"] .mosaic{position:relative;z-index:3;display:grid;
  grid-template-columns:repeat(6,1fr);grid-auto-rows:120px;gap:10px;margin:50px 0}
[data-layout="fragments"] .mosaic figure{margin:0;overflow:hidden;filter:contrast(1.05)}
[data-layout="fragments"] .mosaic img{width:100%;height:100%;object-fit:cover}
[data-layout="fragments"] .mosaic .big{grid-column:span 2;grid-row:span 2}
[data-layout="fragments"] .mosaic .tall{grid-row:span 2}

@media(max-width:640px){
  [data-layout="gallery"] .gallery{grid-template-columns:repeat(2,1fr)}
  /* chapter one keeps single-image flow on mobile (overrides the 2-col rule) */
  #one[data-view="single"] .gallery{grid-template-columns:none;display:block}
  #one[data-view="single"] .gallery figure{width:43vw;margin:9vh auto}
  [data-layout="stills"] .two-up{grid-template-columns:1fr}
  [data-layout="steps"] .step,[data-layout="steps"] .step:nth-child(even){flex-direction:column}
  [data-layout="steps"] .diagonal{grid-template-columns:1fr;gap:24px}
  [data-layout="steps"] .diag-shot,[data-layout="steps"] .diag-shot.s1,
  [data-layout="steps"] .diag-shot.s2,[data-layout="steps"] .diag-shot.s3{width:80%;margin-left:0;margin-bottom:40px}
  [data-layout="steps"] .connector{display:none}
  [data-layout="fragments"] .mosaic{grid-template-columns:repeat(3,1fr)}
}

/* chapter footer nav */
.chap-nav{
  position:relative;z-index:3;border-top:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:center;
  max-width:var(--maxw);margin:0 auto;padding:40px 24px 80px;
  font-family:var(--font-display);font-size:13px;letter-spacing:.04em;
}
.chap-nav a:hover{opacity:.55}

/* ---------- generic page footer ---------- */
.foot{
  border-top:1px solid var(--line);padding:48px 24px;
  max-width:var(--maxw);margin:0 auto;
  display:flex;flex-wrap:wrap;gap:24px;justify-content:space-between;
  font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:#888;
}
.foot a:hover{color:#fff}

@media(max-width:640px){
  .giant h1{font-size:clamp(40px,18vw,90px)}
  .collage figure{display:none}      /* drop collage on mobile, keep readable */
  .collage figure.keep{display:block}
  .body-wrap{padding:30vh 16px 20vh}
}

/* ============================================================
   SERIAL SCROLL — single continuous page, chapter after chapter
   ============================================================ */
html{scroll-padding-top:0}

/* all chapters share the same pure-black background (no alternating tone) */
.reader .chapter:nth-of-type(even){background:var(--paper)}
/* divider line between chapters removed */

/* intro guide line about the continuous-scroll reading mode */
.intro .intro-guide{
  font-size:12px;line-height:1.8;color:#aaa;margin-top:22px;
  border-left:2px solid var(--orange);padding-left:14px;max-width:560px;
}

/* chapter-end seam: a rule + a "continue to next chapter" cue that keeps you flowing */
.chapter-end{
  position:relative;z-index:3;max-width:760px;margin:0 auto;
  padding:0 24px 18vh;text-align:center;
}
.chapter-end .end-rule{
  display:block;width:60px;height:2px;background:var(--ink);
  margin:0 auto 26px;
}
.chapter-end .continue{
  display:inline-flex;align-items:center;gap:10px;
  font-family:var(--font-display);font-weight:600;font-size:13px;
  letter-spacing:.04em;color:var(--ink);padding:12px 20px;
  border:1px solid var(--ink);border-radius:40px;
  transition:background .25s ease,color .25s ease,transform .25s ease;
}
.chapter-end .continue:hover{background:var(--ink);color:#141414;transform:translateY(2px)}
.chapter-end .continue .arrow{display:inline-block;animation:bob 1.6s infinite}
.chapter-end.last .continue{border-color:var(--orange);color:var(--orange)}
.chapter-end.last .continue:hover{background:var(--orange);color:#fff}

/* fixed chapter-progress rail on the right edge */
.progress-rail{
  position:fixed;right:18px;top:50%;transform:translateY(-50%);
  z-index:90;display:flex;flex-direction:column;gap:14px;
  mix-blend-mode:difference;
}
.progress-rail .rail-item{
  display:flex;align-items:center;gap:10px;flex-direction:row-reverse;
  color:#fff;pointer-events:auto;
}
.progress-rail .rail-dot{
  width:9px;height:9px;border:1px solid #fff;border-radius:50%;
  transition:background .25s ease,transform .25s ease;flex:0 0 auto;
}
.progress-rail .rail-name{
  font-family:var(--font-display);font-size:10px;letter-spacing:.08em;
  text-transform:uppercase;opacity:0;transform:translateX(6px);
  transition:opacity .25s ease,transform .25s ease;white-space:nowrap;
}
.progress-rail .rail-item:hover .rail-name,
.progress-rail .rail-item.active .rail-name{opacity:1;transform:translateX(0)}
.progress-rail .rail-item.active .rail-dot{background:#fff;transform:scale(1.4)}
@media(max-width:640px){.progress-rail{display:none}}

/* ---------- scroll-reveal (paired with revealBlocks() in site.js) ---------- */
.reveal{opacity:0;transform:translateY(18px);transition:opacity .7s ease,transform .7s ease}
.reveal.in-view{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){
  .reveal{opacity:1;transform:none;transition:none}
}


/* ============================================================
   CHAPTER TWO · "SERPENT" LAYOUT
   Full-bleed cinematic background · sticky left text rail
   · asymmetric right image grid (Chen-Chuanduan inspired)
   ============================================================ */

[data-layout="serpent"]{
  position:relative;
  background:#0a1620;
  color:#f4ede0;
  overflow:hidden;
  padding-top:0;
}
[data-layout="serpent"] .serpent-bg{
  position:absolute;inset:0;z-index:0;
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  background-attachment:fixed;
  filter:saturate(.85) brightness(.78);
}
[data-layout="serpent"] .serpent-veil{
  position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(ellipse at 30% 38%, rgba(0,0,0,.0) 0%, rgba(0,0,0,.45) 70%, rgba(0,0,0,.62) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 70%, rgba(0,0,0,.55) 100%);
}

[data-layout="serpent"] .giant{
  position:relative;z-index:3;
  min-height:78vh;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:0 24px;
}
[data-layout="serpent"] .giant h1{
  color:#F02282;
  font-style:italic;
  font-weight:800;
  font-size:clamp(56px,11vw,180px);
  line-height:.95;
  letter-spacing:-.01em;
  text-shadow:0 2px 14px rgba(0,0,0,.45);
}
[data-layout="serpent"] .giant .subtitle{
  color:#f4ede0;
  margin-top:14px;
  font-size:clamp(14px,1.4vw,18px);
  letter-spacing:.32em;
  text-transform:none;
}
[data-layout="serpent"] .giant .scroll-down span{color:#f4ede0}

[data-layout="serpent"] .serpent-stage{
  position:relative;z-index:3;
  display:grid;
  grid-template-columns: minmax(280px, 28%) 1fr;
  gap:48px;
  max-width:1480px;
  margin:0 auto;
  padding:40px 40px 120px;
}

[data-layout="serpent"] .serpent-rail{
  position:relative;
  align-self:start;
  padding-right:18px;
  color:#f4ede0;
  font-family:var(--font-mono);
}
[data-layout="serpent"] .serpent-rail::-webkit-scrollbar{display:none}

[data-layout="serpent"] .rail-mark{
  display:flex;flex-direction:column;gap:2px;
  font-family:var(--font-display);
  font-size:10.5px;letter-spacing:.22em;text-transform:uppercase;
  color:#F02282;
  margin-bottom:28px;
}
[data-layout="serpent"] .rail-mark .rail-zh{color:#cfc7b6;letter-spacing:.14em}

[data-layout="serpent"] .rail-title{
  font-family:"Georgia","Times New Roman",serif;
  font-weight:400;
  font-size:clamp(22px,2vw,30px);
  line-height:1.2;
  margin-bottom:28px;
}
[data-layout="serpent"] .rail-title .rt-en{display:block;color:#f4ede0;font-style:italic}
[data-layout="serpent"] .rail-title .rt-zh{display:block;margin-top:6px;color:#F02282;font-size:.78em;letter-spacing:.04em}

[data-layout="serpent"] .rail-text p{
  font-size:13.5px;
  line-height:1.85;
  margin-bottom:18px;
}
[data-layout="serpent"] .rail-text p.en{color:#f4ede0;font-family:"Georgia",serif}
[data-layout="serpent"] .rail-text p.zh{color:#bdb4a3;font-family:var(--font-zh);font-size:12.5px}
[data-layout="serpent"] .rail-text p.quote-en{
  font-family:"Georgia",serif;font-style:italic;
  color:#F02282;font-size:15px;line-height:1.5;
  border-left:2px solid #F02282;padding-left:14px;margin:26px 0 6px;
}
[data-layout="serpent"] .rail-text p.quote-zh{
  color:#cfc7b6;font-size:12.5px;padding-left:16px;margin-bottom:26px;
}

[data-layout="serpent"] .rail-foot{
  margin-top:30px;padding-top:18px;
  border-top:1px solid rgba(244,237,224,.18);
  display:flex;justify-content:space-between;
  font-family:var(--font-display);
  font-size:10px;letter-spacing:.22em;text-transform:uppercase;
  color:#cfc7b6;
}

[data-layout="serpent"] .serpent-grid{
  display:flex;flex-direction:column;gap:16px;
}
[data-layout="serpent"] .serpent-grid .row{
  display:grid;
  gap:14px;
}
[data-layout="serpent"] .serpent-grid .cell{
  margin:0;overflow:hidden;
  background:rgba(0,0,0,.35);
  position:relative;
}
[data-layout="serpent"] .serpent-grid .cell img,
[data-layout="serpent"] .serpent-grid .cell[style*="background-image"]{
  width:100%;height:100%;object-fit:cover;
  display:block;
  transition:transform .8s ease, filter .8s ease;
  filter:saturate(.92);
}
[data-layout="serpent"] .serpent-grid .cell:hover img{
  transform:scale(1.02);
  filter:saturate(1) brightness(1.05);
}

/* ratio system — each cell strictly enforces its own aspect-ratio.
   Height is derived from the cell's actual rendered width, so 3:2 stays 3:2
   and 3:4 stays 3:4 regardless of column count or sticky sidebar width. */
[data-layout="serpent"] .serpent-grid .cell{
  width:100%;
  height:auto;             /* never force a row height */
  overflow:hidden;
}
[data-layout="serpent"] .serpent-grid .cell img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Row r-1: single horizontal 3:2 */
[data-layout="serpent"] .r-1{grid-template-columns:1fr;grid-auto-rows:auto}
[data-layout="serpent"] .r-1 .cell{aspect-ratio:3/2}

/* Row r-2: two cells side-by-side
   split-60-40 = 3:2 horizontal + 3:4 vertical
   split-40-60 = 3:4 vertical + 3:2 horizontal */
[data-layout="serpent"] .r-2{grid-template-columns:1fr 1fr;grid-auto-rows:auto;align-items:start}
[data-layout="serpent"] .r-2 .cell{aspect-ratio:3/2}

[data-layout="serpent"] .r-2.split-60-40{grid-template-columns:6fr 4fr}
[data-layout="serpent"] .r-2.split-40-60{grid-template-columns:4fr 6fr}
[data-layout="serpent"] .r-2.split-60-40 .cell:first-child{aspect-ratio:3/2}
[data-layout="serpent"] .r-2.split-60-40 .cell:last-child{aspect-ratio:1/1}   /* Row B 右图 1:1，与左 3:2 高度相等 */
[data-layout="serpent"] .r-2.split-40-60 .cell:first-child{aspect-ratio:1/1}  /* Row D 左图 1:1，与右 3:2 高度相等 */
[data-layout="serpent"] .r-2.split-40-60 .cell:last-child{aspect-ratio:3/2}

/* Row r-3 verticals: 3 cells, each strict 3:4 */
[data-layout="serpent"] .r-3{grid-template-columns:repeat(3,1fr);grid-auto-rows:auto}
[data-layout="serpent"] .r-3 .cell{aspect-ratio:3/4}
[data-layout="serpent"] .r-3.verticals .cell{aspect-ratio:3/4}

/* Row r-4: 4 cells, each strict 3:4 */
[data-layout="serpent"] .r-4{grid-template-columns:repeat(4,1fr);grid-auto-rows:auto}
[data-layout="serpent"] .r-4 .cell{aspect-ratio:3/4}

[data-layout="serpent"] .chapter-end{position:relative;z-index:3;padding-top:40px}
[data-layout="serpent"] .chapter-end .end-rule{background:#F02282}
[data-layout="serpent"] .chapter-end .continue{color:#f4ede0;border-color:#f4ede0}
[data-layout="serpent"] .chapter-end .continue:hover{background:#F02282;border-color:#F02282;color:#f4ede0}

@media (max-width:960px){
  [data-layout="serpent"] .serpent-bg{background-attachment:scroll}
  [data-layout="serpent"] .serpent-stage{
    grid-template-columns:1fr;gap:0;padding:28px 20px 80px;
  }
  [data-layout="serpent"] .serpent-rail{
    position:relative;top:0;max-height:none;overflow:visible;
    padding:0 0 40px;
    border-bottom:1px solid rgba(244,237,224,.18);
    margin-bottom:30px;
  }
  [data-layout="serpent"] .r-4{grid-template-columns:repeat(2,1fr)}
  [data-layout="serpent"] .r-3{grid-template-columns:1fr 1fr}
  [data-layout="serpent"] .r-3 .cell:nth-child(3){grid-column:span 2;aspect-ratio:3/2}
  [data-layout="serpent"] .r-2,
  [data-layout="serpent"] .r-2.split-60-40,
  [data-layout="serpent"] .r-2.split-40-60{grid-template-columns:1fr}
  [data-layout="serpent"] .r-2 .cell{aspect-ratio:3/2 !important}
}

/* ── Chapter background image layer · 仅作用于第三、第四章 ──
   不动前两章 (#one / #two) 的任何排版与背景 */
.chapter#three,
.chapter#four{position:relative;}
.chapter#three > .ch-bg,
.chapter#four  > .ch-bg{
  position:absolute;inset:0;z-index:0;pointer-events:none;
  background-position:center;background-size:cover;background-repeat:no-repeat;
}
/* 蒙版：仅在第三、第四章的背景上叠加 35% 黑色，让背景视觉上减淡 35% */
.chapter#three > .ch-bg::after,
.chapter#four  > .ch-bg::after{
  content:"";
  position:absolute;inset:0;
  background:rgba(255,255,255,.55);
  pointer-events:none;
}
.chapter#three > *:not(.ch-bg),
.chapter#four  > *:not(.ch-bg){position:relative;z-index:1;}
