@font-face { font-family: "Instrument Serif"; src: url(../vendor/fonts/instrument-serif-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Serif"; font-style: italic; src: url(../vendor/fonts/instrument-serif-400-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat"; src: url(../vendor/fonts/caveat-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(../vendor/fonts/jetbrains-mono-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 400; src: url(../vendor/fonts/inter-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Inter"; font-weight: 500 700; src: url(../vendor/fonts/inter-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Serif SC"; font-weight: 400; src: url(../vendor/fonts/noto-serif-sc-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Serif SC"; font-weight: 600; src: url(../vendor/fonts/noto-serif-sc-600.woff2) format("woff2"); font-display: swap; }

:root {
  --ink: #1d2a3f;
  --ink-soft: #46546b;
  --ink-faint: rgba(29, 42, 63, .55);
  --paper: #f3eee3;
  --navy: #1e2f55;
  --line: rgba(29, 42, 63, .22);
  --serif: "Instrument Serif", "Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --serif-zh: "Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --hand: "Caveat", "Segoe Print", cursive;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --pad: clamp(18px, 3vw, 40px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background: #9db2c8;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
em { font-style: italic; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }

/* ---------- background ---------- */
#sky, #night { position: fixed; inset: 0; z-index: 0; }
#sky {
  background:
    radial-gradient(120% 80% at 70% 0%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(90% 70% at 10% 100%, rgba(120,146,180,.55), transparent 70%),
    linear-gradient(170deg, #c9d6e3 0%, #a9bdd2 45%, #8ea6c0 100%);
}
#sky::after { /* fine paper grain */
  content: ""; position: absolute; inset: 0; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.35 0 0 0 0 0.45 0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#night {
  background: radial-gradient(100% 80% at 50% 30%, #2a4274 0%, #1a2b52 55%, #121e3c 100%);
  opacity: 0; transition: opacity 1.2s var(--ease);
}
body.is-end #night { opacity: 1; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; touch-action: none; }

/* ---------- chrome ---------- */
.chrome { position: fixed; z-index: 20; transition: color .8s var(--ease), opacity .6s; }
.chrome--tl { top: var(--pad); left: var(--pad); display: flex; align-items: center; gap: 10px; }
.chrome--tl .plus { width: 28px; height: 28px; position: relative; border: 1px solid currentColor; border-radius: 50%; transition: transform .5s var(--ease); }
.chrome--tl .plus::before, .chrome--tl .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1px; background: currentColor; transform: translate(-50%, -50%); }
.chrome--tl .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.chrome--tl[aria-expanded="true"] .plus { transform: rotate(45deg); }
.chrome--tr { top: calc(var(--pad) + 6px); right: var(--pad); }
.chrome--tr b { font-weight: 400; display: inline-block; min-width: 2.4em; }
.chrome--bl { left: var(--pad); bottom: var(--pad); display: flex; align-items: center; gap: 14px; }
.chrome--bl .circle { width: 42px; height: 42px; border: 1px solid currentColor; border-radius: 50%; display: grid; place-items: center; letter-spacing: .05em; font-size: 12px; }
.ch-name { font-family: var(--serif); font-size: 19px; font-style: italic; line-height: 1; display: block; margin-bottom: 8px; }
.progress { width: 120px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.progress i { position: absolute; inset: 0; background: currentColor; transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.chrome--br { right: var(--pad); bottom: calc(var(--pad) + 12px); opacity: .75; }
.chrome--bc { left: 50%; bottom: calc(var(--pad) + 4px); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; opacity: .7; }
.chrome--bc button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); font-size: 13px; transition: background .3s, border-color .3s; }
.chrome--bc button:hover { background: rgba(255,255,255,.4); border-color: currentColor; }
body.is-end .chrome, body.is-end .chrome--bc button { color: #e9eef7; }
body.is-end .progress { background: rgba(233,238,247,.25); }

/* ---------- chapters (HTML text layer) ---------- */
#chapters { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.chapter {
  position: absolute; left: calc(var(--pad) + 2vw); top: 50%;
  width: min(440px, 40vw);
  transform: translateY(-46%);
  opacity: 0; visibility: hidden;
  transition: opacity .7s var(--ease), transform .9s var(--ease), visibility 0s .9s;
}
.chapter.is-active { opacity: 1; visibility: visible; transform: translateY(-50%); pointer-events: auto; transition: opacity .9s var(--ease) .35s, transform 1.1s var(--ease) .3s, visibility 0s; }
.chapter.is-leaving-up { transform: translateY(-58%); }

.chapter--cover { left: 50%; top: calc(var(--pad) + 3vh); transform: translate(-50%, -8px); text-align: center; width: min(760px, 90vw); }
.chapter--cover.is-active { transform: translate(-50%, 0); }
.chapter--cover .kicker { margin: 0 0 6px; opacity: .7; }
.title { font-family: var(--serif); font-weight: 400; font-size: clamp(54px, 8.4vw, 118px); line-height: .9; margin: 0; letter-spacing: -.01em; }
.title br { display: none; }
.title em { margin-left: .12em; }
.title-zh { font-family: var(--serif-zh); font-size: 16px; letter-spacing: .14em; margin: 14px 0 4px; color: var(--ink-soft); }
.chapter--cover .sub { margin: 6px 0 0; opacity: .7; }
.chapter--cover .btn { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--pad) + 70px); display: none; }

.ch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--ink-soft); }
.ch-head .num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; letter-spacing: 0; font-size: 10px; }
.chapter h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 5.4vw, 80px); line-height: .95; margin: 0; letter-spacing: -.01em; }
.chapter--work .title-zh { margin-top: 10px; }
.hand { font-family: var(--hand); font-size: 26px; color: var(--navy); margin: 4px 0 10px; transform: rotate(-2deg); transform-origin: left; }
.desc { color: var(--ink-soft); margin: 18px 0 22px; max-width: 34em; }
.lead { margin: 0 0 22px; }
.lead strong { font-family: var(--serif-zh); font-weight: 600; }

.meta, .facts { margin: 0 0 26px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.meta div, .facts div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.meta dt, .facts dt { color: var(--ink-faint); font-size: 10px; }
.meta dd, .facts dd { margin: 0; font-size: 13.5px; line-height: 1.55; }
.meta dd.featured { display: flex; flex-wrap: wrap; gap: 6px; }
.meta dd.featured span { padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.7); font-family: var(--serif-zh); font-size: 12.5px; }

.scrollable { max-height: min(56vh, 520px); overflow-y: auto; padding-right: 14px; margin-right: -14px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; overscroll-behavior: contain; }
.chapter--about h4 { margin: 0 0 10px; font-weight: 400; color: var(--ink-faint); font-size: 10px; }
.tip { margin: -8px 0 22px; font-size: 10px; color: var(--navy); }
.only-m { display: none; }
.chips { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.32); font-family: var(--serif-zh); font-size: 13px; }
.chapter--about > * { transition: opacity .5s var(--ease), filter .5s var(--ease); }
body.paper-focus .chapter--about > * { opacity: .3; filter: blur(1px); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 22px; border-radius: 999px;
  background: var(--navy); color: #f2f4f8; font-size: 14px; letter-spacing: .04em;
  box-shadow: 0 10px 30px -12px rgba(20, 35, 70, .6);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .3s;
}
.btn span { transition: transform .4s var(--ease); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(20, 35, 70, .7); }
.btn:hover span { transform: translateX(4px); }
.btn--ghost { background: transparent; color: inherit; border: 1px solid currentColor; box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.1); box-shadow: none; }

/* contact */
.chapter--contact { color: #eef2f9; width: min(620px, 80vw); left: 50%; transform: translate(-50%, -46%); text-align: center; }
.chapter--contact.is-active { transform: translate(-50%, -50%); }
.chapter--contact .ch-head { justify-content: center; color: rgba(238,242,249,.7); }
.chapter--contact h2 { font-size: clamp(44px, 6vw, 86px); }
.chapter--contact .title-zh { color: rgba(238,242,249,.75); letter-spacing: .06em; margin: 22px 0 28px; }
.contact-row { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.email { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 44px); text-decoration: none; border-bottom: 1px solid rgba(238,242,249,.4); line-height: 1.2; transition: border-color .3s; }
.email:hover { border-color: #fff; }
.credit { margin-top: 48px; opacity: .55; }

/* ---------- annotations ---------- */
#annotations { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.anno { position: absolute; left: 0; top: 0; color: var(--navy); opacity: 0; transition: opacity .8s var(--ease); will-change: transform; }
.anno.is-on { opacity: 1; }
body.paper-focus .anno { opacity: 0; }
.anno span { font-family: var(--hand); font-size: 26px; white-space: nowrap; display: block; transform: rotate(-4deg); }
.anno svg { display: block; overflow: visible; }
.anno path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 220; stroke-dashoffset: 220; transition: stroke-dashoffset 1.2s var(--ease) .3s; }
.anno.is-on path { stroke-dashoffset: 0; }
.anno--front { transform-origin: 0 0; }
.anno--front svg { margin: 0 0 0 -10px; }
.anno--front { flex-direction: column-reverse; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; opacity: 0; visibility: hidden; transition: opacity .55s var(--ease), visibility 0s .55s; }
.overlay.is-open { opacity: 1; visibility: visible; transition: opacity .55s var(--ease), visibility 0s; }

#index-menu { z-index: 15; background: rgba(214, 224, 236, .72); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); display: grid; place-items: center; }
#index-menu ol { list-style: none; margin: 0; padding: 0; width: min(640px, 86vw); }
#index-menu li { border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
#index-menu.is-open li { opacity: 1; transform: none; }
#index-menu.is-open li:nth-child(2) { transition-delay: .04s; } #index-menu.is-open li:nth-child(3) { transition-delay: .08s; }
#index-menu.is-open li:nth-child(4) { transition-delay: .12s; } #index-menu.is-open li:nth-child(5) { transition-delay: .16s; }
#index-menu.is-open li:nth-child(6) { transition-delay: .2s; } #index-menu.is-open li:nth-child(7) { transition-delay: .24s; }
#index-menu li button { width: 100%; display: flex; align-items: baseline; gap: 22px; padding: 14px 4px; font-family: var(--serif); font-size: clamp(30px, 4.4vw, 52px); line-height: 1.1; text-align: left; transition: padding .4s var(--ease); }
#index-menu li button:hover { padding-left: 18px; }
#index-menu li button .mono { font-size: 11px; color: var(--ink-faint); width: 26px; }
#index-menu li button small { margin-left: auto; font-family: var(--serif-zh); font-size: 14px; color: var(--ink-soft); letter-spacing: .1em; }

#gallery { background: rgba(225, 232, 240, .86); backdrop-filter: blur(26px) saturate(1.1); -webkit-backdrop-filter: blur(26px) saturate(1.1); overflow-y: auto; overscroll-behavior: contain; }
.gal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; padding: calc(var(--pad) + 4px) var(--pad) 18px; background: linear-gradient(rgba(225,232,240,.96) 70%, rgba(225,232,240,0)); }
.gal-head p { margin: 0 0 6px; color: var(--ink-faint); }
.gal-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.4vw, 60px); line-height: 1; }
.x-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); font-size: 24px; line-height: 1; display: grid; place-items: center; transition: transform .4s var(--ease), background .3s; background: rgba(255,255,255,.35); }
.x-btn:hover { transform: rotate(90deg); background: rgba(255,255,255,.7); }

.gal-grid { padding: 8px var(--pad) 80px; display: flex; flex-wrap: wrap; column-gap: 18px; align-items: flex-start; }
.gal-group { margin: 0 0 30px; flex: 1 1 100%; min-width: 0; }
.gal-group.is-single { flex: 0 0 calc((100% - 72px) / 5); }
.gal-group header { display: flex; align-items: baseline; gap: 14px; padding: 0 0 12px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.gal-group.is-single header { gap: 8px; }
.gal-group.is-single h4 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-group header .mono { font-size: 10px; color: var(--ink-faint); }
.gal-group h4 { margin: 0; font-family: var(--serif-zh); font-weight: 600; font-size: 19px; letter-spacing: .06em; }
.gal-cols { columns: 5 200px; column-gap: 18px; }
.gal-cols.is-single { columns: auto; }
.card { break-inside: avoid; margin: 0 0 18px; display: block; width: 100%; text-align: left; position: relative; opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .7s var(--ease); }
.card.is-in { opacity: 1; transform: none; }
.card .sleeve { display: block; padding: 7px; border-radius: 6px; background: linear-gradient(160deg, rgba(255,255,255,.75), rgba(255,255,255,.35)); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 18px 30px -20px rgba(30, 50, 90, .45); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.card img { display: block; width: 100%; height: auto; border-radius: 3px; background: #d8e0ea; }
.card:hover .sleeve { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 26px 40px -20px rgba(30, 50, 90, .55); }
.card .cap { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 0; font-size: 12.5px; color: var(--ink-soft); }
.card .cap .mono { font-size: 9.5px; color: var(--ink-faint); padding-top: 3px; }
.card .play { position: absolute; top: 16px; right: 16px; padding: 4px 9px; border-radius: 99px; background: rgba(20, 32, 60, .78); color: #fff; font-size: 9.5px; }

#lightbox { z-index: 50; background: rgba(16, 24, 44, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #eef2f9; display: grid; place-items: center; padding-bottom: 104px; }
.lb-strip { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: min(1100px, 100vw - 2 * var(--pad)); display: flex; align-items: center; gap: 6px; padding: 8px 10px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.lb-strip::-webkit-scrollbar { display: none; }
.lb-strip button { flex: 0 0 auto; width: 40px; height: 68px; border-radius: 4px; overflow: hidden; opacity: .4; transition: opacity .3s, transform .35s var(--ease), box-shadow .3s; }
.lb-strip button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-strip button:hover { opacity: .85; }
.lb-strip button.is-current { opacity: 1; transform: translateY(-3px) scale(1.12); box-shadow: 0 0 0 1.5px #eef2f9, 0 10px 20px -8px rgba(0,0,0,.6); }
.lb-sep { flex: 0 0 1px; height: 40px; margin: 0 6px; background: rgba(255,255,255,.2); }
.lb-hint { position: fixed; left: var(--pad); bottom: 44px; margin: 0; font-size: 9.5px; opacity: .45; }
.lb-stage { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 92vw; }
.lb-media { height: min(calc(90vh - 150px), 1000px); display: grid; place-items: center; }
.lb-media img, .lb-media video { max-height: min(calc(90vh - 150px), 1000px); max-width: 88vw; height: auto; width: auto; border-radius: 6px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.6); transition: opacity .35s var(--ease), transform .5s var(--ease); }
.lb-media.is-loading img { opacity: 0; transform: scale(.985); }
.lb-stage figcaption { display: flex; gap: 18px; align-items: baseline; margin-top: 14px; font-family: var(--serif-zh); font-size: 15px; letter-spacing: .06em; }
.lb-stage figcaption .mono { opacity: .6; font-size: 10px; }
#lightbox .x-btn { position: fixed; top: var(--pad); right: var(--pad); color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
/* navigation is wheel / thumbnails / neighbour peeks / keys — no arrow buttons */
.lb-arrow { display: none; }
/* neighbours wait beside the main work: tilted toward it, breathing, a card queued behind each */
#lightbox { --lb-l: 30vw; --lb-r: 70vw; --lb-cy: 45vh; --lb-h: 70vh; --peek-gap: 28px; perspective: 1400px; }
.lb-peek { position: fixed; top: var(--lb-cy); margin: 0; width: calc(var(--lb-h) * .62 * 9 / 16); max-width: 15vw; display: flex; flex-direction: column; gap: 10px; align-items: center; color: #eef2f9; transition: left .5s var(--ease), right .5s var(--ease), top .5s var(--ease), width .5s var(--ease); }
.lb-peek .pk { display: block; position: relative; width: 100%; opacity: .5; filter: brightness(.7) saturate(.85); transition: opacity .4s var(--ease), filter .4s var(--ease), transform .5s var(--ease); }
.lb-peek img { position: relative; z-index: 1; display: block; width: 100%; aspect-ratio: 9 / 16; height: auto; object-fit: cover; border-radius: 5px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.lb-peek .pk::before { content: ""; position: absolute; inset: 0; border-radius: 5px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); transform: translate(var(--q, 10px), 8px) scale(.94); transition: transform .5s var(--ease); }
.lb-peek .pk::after { content: ""; position: absolute; z-index: 2; inset: 0; border-radius: 5px; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.16) 50%, transparent 65%) no-repeat; background-size: 250% 100%; animation: lb-shimmer 3.6s ease-in-out infinite; pointer-events: none; }
.lb-peek span { font-size: 9.5px; letter-spacing: .08em; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .55; }
.lb-peek--prev { right: calc(100vw - var(--lb-l) + var(--peek-gap)); left: auto; transform: translateY(-50%); --q: -10px; }
.lb-peek--next { left: calc(var(--lb-r) + var(--peek-gap)); transform: translateY(-50%); }
.lb-peek--prev .pk { transform: rotateY(16deg); transform-origin: right center; animation: lb-wait 3.2s ease-in-out infinite; }
.lb-peek--next .pk { transform: rotateY(-16deg); transform-origin: left center; animation: lb-wait 3.2s ease-in-out -1.6s infinite; }
.lb-peek:hover .pk { opacity: .95; filter: none; animation-play-state: paused; }
.lb-peek:hover .pk::before { transform: translate(calc(var(--q, 10px) * 1.6), 12px) scale(.94); }
.lb-peek.is-bump .pk { animation: lb-bump .55s var(--ease), lb-wait 3.2s ease-in-out .55s infinite; }
@keyframes lb-wait { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes lb-shimmer { 0%, 55% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
@keyframes lb-bump { from { opacity: 0; translate: 0 14px; scale: .94; } to { opacity: .5; translate: 0 0; scale: 1; } }
/* the main work arrives from the side the viewer moved toward */
#lightbox[data-dir="next"] .lb-media img { animation: lb-in-r .5s var(--ease); }
#lightbox[data-dir="prev"] .lb-media img { animation: lb-in-l .5s var(--ease); }
@keyframes lb-in-r { from { translate: 26px 0; } }
@keyframes lb-in-l { from { translate: -26px 0; } }
.lb-media img, .lb-media video { max-width: min(88vw, 100vw - 2 * (var(--pad) + 15vw + 40px)); }
@media (prefers-reduced-motion: reduce) { .lb-peek .pk, .lb-peek .pk::after, .lb-peek.is-bump .pk, #lightbox .lb-media img { animation: none !important; } }

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 12px; background: #b2c3d6; transition: opacity .9s var(--ease), visibility 0s .9s; }
#loader.is-done { opacity: 0; visibility: hidden; }
.loader-bar { width: 180px; height: 1px; background: var(--line); }
.loader-bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .3s; }
#loader .mono { color: var(--ink-faint); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 200; background: #b2c3d6; margin: 0; }

body.ui-hidden .chrome, body.ui-hidden #chapters, body.ui-hidden #annotations { opacity: 0; pointer-events: none; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  body { font-size: 14px; }
  .chapter { left: var(--pad); right: var(--pad); width: auto; top: auto; bottom: calc(var(--pad) + 64px); transform: translateY(14px); }
  .chapter.is-active { transform: none; }
  .chapter.is-leaving-up { transform: translateY(-14px); }
  .chapter--work, .chapter--about { padding: 18px 18px 20px; border-radius: 14px; background: rgba(238, 242, 248, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.7); }
  .chapter h2 { font-size: 40px; }
  .ch-head { margin-bottom: 10px; }
  .desc { margin: 10px 0 14px; font-size: 13.5px; }
  .meta { display: none; }
  .scrollable { max-height: 42vh; }
  .chapter--about .hand { display: none; }
  .chapter--cover { top: calc(var(--pad) + 52px); bottom: auto; left: 50%; right: auto; width: 92vw; transform: translate(-50%, -8px); }
  .chapter--cover.is-active { transform: translate(-50%, 0); }
  .title br { display: block; }
  .title em { margin-left: 0; }
  .chapter--cover .btn { display: inline-flex; position: static; transform: none; margin-top: 22px; }
  .chapter--contact { top: 50%; bottom: auto; left: 50%; width: 90vw; transform: translate(-50%, -46%); }
  .chapter--contact.is-active { transform: translate(-50%, -50%); }
  .chrome--br { display: none; }
  .chrome--bc { left: auto; right: var(--pad); transform: none; }
  .chrome--bc .mono { display: none; }
  .progress { width: 80px; }
  .anno { display: none; }
  .gal-grid { padding: 4px 12px 60px; column-gap: 12px; }
  .gal-group.is-single { flex-basis: calc((100% - 12px) / 2); }
  .gal-cols { columns: 2; column-gap: 12px; }
  .gal-group h4 { font-size: 16px; }
  .card { margin-bottom: 12px; }
  .lb-peek { display: none; }
  body.paper-focus .chapter--about.is-active { opacity: 0; pointer-events: none; }
  .only-d { display: none; } .only-m { display: inline; }
  /* phone: thumbnails become a vertical rail on the right, image fills the rest */
  #lightbox { padding: 0 78px 0 0; justify-items: center; }
  .lb-media img, .lb-media video { max-width: calc(100vw - 78px - 24px); }
  .lb-media, .lb-media img, .lb-media video { max-height: 74vh; }
  .lb-strip { left: auto; right: 0; top: 0; bottom: 0; transform: none; width: 66px; max-width: none; flex-direction: column; padding: 70px 8px 24px; gap: 6px; overflow-x: hidden; overflow-y: auto; border-radius: 0; border: 0; border-left: 1px solid rgba(255,255,255,.08); mask-image: linear-gradient(180deg, transparent 50px, #000 90px, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(180deg, transparent 50px, #000 90px, #000 calc(100% - 40px), transparent); }
  .lb-strip button { width: 46px; height: 78px; }
  .lb-strip button.is-current { transform: translateX(-3px) scale(1.08); }
  .lb-sep { flex: 0 0 1px; width: 34px; height: 1px; margin: 4px 0; }
  .lb-hint { display: none; }
  #lightbox .x-btn { right: 84px; }
  .lb-stage figcaption { flex-wrap: wrap; justify-content: center; padding: 0 10px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
