/* Opening film */
.opening { display:block; min-height:420px; }
.opening .film-stage { position:absolute; inset:0; }
.opening .film-stage::after {
  background:linear-gradient(0deg,rgba(7,12,11,.64),rgba(8,13,12,.12) 34%,transparent 59%),
             linear-gradient(90deg,rgba(9,17,16,.23),transparent 58%);
}
.opening .opening-caption {
  position:absolute; inset:auto auto max(100px,13%) clamp(40px,8vw,155px);
  max-width:min(56%,720px); padding:0; background:transparent;
  color:#fff6e7; text-shadow:0 2px 18px #080d0ca6;
}
.opening .opening-caption h1 {
  font:400 clamp(60px,6.5vw,118px)/1.14 var(--ko);
  letter-spacing:-.08em;
}
.opening .opening-caption p {
  margin:14px 0 0; font:400 clamp(13px,1vw,17px)/1.65 var(--ui);
  letter-spacing:.07em; color:#f4eddf;
}
.opening .continue {
  margin-top:16px; min-height:41px; gap:22px; font-size:13px;
  border-color:#e5d9ba9c; text-shadow:0 1px 5px #0c0f0b;
}
.opening .film-tools { left:clamp(35px,7.6vw,148px); right:auto; bottom:max(20px,env(safe-area-inset-bottom)); gap:5px; }
.opening .film-button,.opening .sound-button { background-color:#17201d55; }
/* The chamber and the scroll share one centre. The full-size ink detail grows
   from the original paper rectangle; the mounting and rods recede separately. */
.gallery { position:relative; background:#252a23; scroll-margin-top:0; }
.gallery-stage {
  position:relative; width:100%; height:100vh; height:100svh; min-height:370px;
  overflow:hidden; isolation:isolate; background:#252a23; color:#fff0d7;
}
.gallery-wall,.gallery-detail,.gallery-pigment { position:absolute; inset:0; width:100%; height:100%; }
.gallery-wall { z-index:0; background:#31372c url("media/chamber-pc.webp") center/cover no-repeat; }
.gallery-detail { z-index:1; overflow:hidden; pointer-events:none; }
.gallery-pigment { display:block; object-fit:cover; object-position:50% 22%; }
.gallery-detail::after {
  content:""; position:absolute; inset:0;
  background:linear-gradient(0deg,#15150eab,transparent 49%),linear-gradient(90deg,#26221344,transparent 54%);
}
.hanging-scroll {
  display:none; position:absolute; z-index:2; top:46.5%; left:50%;
  width:clamp(215px,21vw,355px); margin:0; transform:translate(-50%,-50%);
  filter:drop-shadow(6px 14px 13px #13160eb3); pointer-events:none;
}
.scroll-mount {
  position:relative; padding:9.4% 5.5% 14.5%; border-inline:1px solid #a99d7d;
  background:repeating-linear-gradient(0deg,transparent 0 2px,#e6d3aa17 2px 3px),
             linear-gradient(90deg,#857a5c,#b5a786 5%,#ab9e80 94%,#8b7f63);
}
.scroll-paper { display:block; width:100%; aspect-ratio:2677/2950; }
.scroll-fabric { display:none; }
.scroll-mount::before,.scroll-mount::after {
  content:""; position:absolute; top:-3px; left:-4%; right:-4%; height:6px;
  border-inline:7px solid #403526; border-radius:2px;
  background:linear-gradient(#55402a,#b7975f 35%,#675033 62%,#342b20);
}
.scroll-mount::after { top:auto; bottom:-4px; height:8px; }
.scroll-cord {
  position:absolute; width:44%; height:18%; top:-17.7%; left:28%;
  background:linear-gradient(to bottom right,transparent 49%,#a29572 49.5% 50.5%,transparent 51%) left/50.4% 100% no-repeat,linear-gradient(to bottom left,transparent 49%,#a29572 49.5% 50.5%,transparent 51%) right/50.4% 100% no-repeat;
}
.gallery-credit {
  position:absolute; z-index:3; top:auto; bottom:7%; left:0; width:100%;
  text-align:center; font:400 14px/1.6 var(--ko); letter-spacing:.07em; color:#e5d7bc;
}
.gallery-copy { position:absolute; z-index:3; bottom:16%; left:clamp(36px,8.3vw,156px); max-width:min(70%,610px); }
.gallery-copy h2 { font:400 clamp(42px,5.2vw,87px)/1.18 var(--ko); letter-spacing:-.07em; word-break:keep-all; color:#fff3da; }
.gallery-copy p { margin-top:18px; max-width:35em; font:400 clamp(14px,1.12vw,18px)/1.78 var(--ui); color:#f6ecda; word-break:keep-all; }
.gallery-copy p span { display:block; }
.gallery-animated .hanging-scroll {
  display:block; z-index:1; transform:translate(-50%,calc(-50% + var(--roll-lift,0px))); opacity:var(--roll-opacity,1);
}
.gallery-animated .scroll-mount { background:none; border-color:transparent; }
.gallery-animated .scroll-fabric {
  display:block; position:absolute; inset:0; padding:9.4% 5.5% 14.5%;
  background:repeating-linear-gradient(0deg,transparent 0 2px,#e6d3aa17 2px 3px),linear-gradient(90deg,#857a5c,#b5a786 5%,#ab9e80 94%,#8b7f63);
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  mask-composite:exclude;
}
.gallery-animated .gallery-credit { bottom:12%; opacity:var(--credit-opacity,1); }
.gallery-animated .gallery-detail { z-index:2; clip-path:inset(var(--ap-top,35%) var(--ap-right,40%) var(--ap-bottom,35%) var(--ap-left,40%)); }
.gallery-animated .gallery-pigment {
  inset:auto; width:var(--paper-w,100%); height:var(--paper-h,100%);
  left:var(--paper-x,0px); top:var(--paper-y,0px); object-fit:fill; filter:saturate(.93) brightness(.97);
}
.gallery-animated .gallery-detail::after { opacity:var(--copy-opacity,0); }
.gallery-animated .gallery-copy { opacity:var(--copy-opacity,0); transform:translateY(var(--copy-lift,12px)); }
@media (max-aspect-ratio:999/1000) {
  .gallery-wall { background-image:url("media/chamber-mo.webp"); }
  .gallery-pigment { object-position:46% 50%; }
}
@media (max-width:779px) {
  .opening .opening-caption { inset:auto auto max(98px,12%) 7%; max-width:84%; }
  .opening .opening-caption h1 { font-size:clamp(48px,12.5vw,79px); line-height:1.13; }
  .opening .opening-caption p { font-size:12px; letter-spacing:.02em; margin-top:9px; }
  .opening .continue { min-height:38px; font-size:12px; margin-top:10px; }
  .opening .film-tools { left:calc(7% - 6px); right:auto; bottom:max(16px,env(safe-area-inset-bottom)); }
  .opening .film-stage::after { background:linear-gradient(0deg,#0c1310ba,rgba(11,17,14,.23) 27%,transparent 52%); }
  .hanging-scroll { width:clamp(153px,48vw,270px); }
  .gallery-copy { left:7%; bottom:13%; max-width:83%; }
  .gallery-copy h2 { font-size:clamp(35px,9.3vw,58px); }
  .gallery-copy p { line-height:1.68; font-size:14px; margin-top:13px; }
  .gallery-credit { font-size:12px; bottom:5%; }
  .gallery-animated .gallery-credit { bottom:15%; }
}
@media (max-height:530px) and (orientation:landscape) {
  .opening { min-height:310px; }
  .opening .opening-caption { bottom:68px; }
  .opening .opening-caption h1 { font-size:42px; }
  .opening .opening-caption p,.opening .continue { margin-top:4px; }
  .opening .film-tools { bottom:8px; }
  .hanging-scroll { width:141px; }
  .gallery-animated .gallery-credit { bottom:8%; }
}
