/* Requirement 07 prototype: the exhibition view and the series posters.
   Wall textures are generated from SVG noise, so they stay sharp at any
   resolution and cost almost nothing to download. */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --noise-fine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --noise-coarse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.011' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --noise-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45 0.006' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

/* Page-level rules apply to the exhibition page only, so the stylesheet can
   also be loaded by the upload studio for its miniature preview. */
body.exhibition-page {
  height: 100%;
  margin: 0;
}

html:has(> body.exhibition-page) {
  height: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.exhibition-icons {
  display: none;
}

/* ===== Exhibition page ===================================================== */

.exhibition-page {
  color-scheme: dark;
  overflow: hidden;
  background: #000;
  color: #f3f0ea;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.exhibition {
  --mx: 0;
  --my: 0;
  --art-w: 60vw;
  --art-h: 60vh;
  --art-y: 40vh;
  /* WALL_FRACTION in exhibition.js and studio-exhibition.js. */
  --wall-height: 86%;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  -webkit-user-select: none;
  user-select: none;
  /* Pinch still zooms; horizontal and vertical swipes belong to the viewer
     (page, and pull down to leave). */
  touch-action: pinch-zoom;
}

/* ----- Atmosphere around the work (phones and tablets) ---------------------- */

/* 留白 and 虚实相生: a blurred, slowly drifting copy of the work, with mist
   moving through it, surrounds the sharp photograph instead of black bars. */
.exhibition-ambient {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
  opacity: calc(1 - var(--close, 0) * 0.85);
  transform: translate3d(calc(var(--tilt-x, 0) * -16px), calc(var(--tilt-y, 0) * -16px), 0);
  transition: transform 500ms var(--ease-out);
}

[data-scene="screen"] .exhibition-ambient {
  display: block;
}

.ambient-layer {
  position: absolute;
  inset: -14%;
  background-position: center;
  background-size: cover;
  opacity: 0;
  filter: blur(44px) saturate(1.25) brightness(0.5);
  transition: opacity 1600ms var(--ease-standard);
  animation: ambient-drift 40s ease-in-out infinite alternate;
}

.ambient-layer.is-active {
  opacity: 1;
}

/* The grey series becomes a pale ink-wash haze rather than a dark glow. */
[data-series="grey"] .ambient-layer {
  filter: blur(48px) brightness(0.62) contrast(0.85);
}

@keyframes ambient-drift {
  from { transform: scale(1.1) translate3d(-1.6%, -1.2%, 0); }
  to { transform: scale(1.22) translate3d(1.6%, 1.4%, 0); }
}

.ambient-mist {
  position: absolute;
  inset: 0;
  background-image: var(--noise-coarse), var(--noise-coarse);
  background-size: 1500px 1500px, 960px 960px;
  opacity: 0.06;
  mix-blend-mode: screen;
  animation: mist-drift 90s linear infinite;
}

[data-series="grey"] .ambient-mist {
  opacity: 0.17;
}

@keyframes mist-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 1500px 160px, -960px -80px; }
}

/* Depth: the edges fall into shadow, keeping the eye on the work. */
.exhibition-ambient::after {
  position: absolute;
  inset: 0;
  content: "";
  background: radial-gradient(ellipse 85% 70% at 50% 50%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.6) 100%);
}

/* Phones held upright (concept D): the haze drawn from the work fades into
   near black, so the work in the upper part of the screen glows. */
[data-phone] .ambient-layer {
  filter: blur(44px) saturate(1.1) brightness(0.22);
}

[data-phone][data-series="grey"] .ambient-layer {
  filter: blur(48px) brightness(0.2) contrast(0.85);
}

[data-phone] .exhibition-ambient::after {
  background: radial-gradient(ellipse 90% 60% at 50% 40%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.78) 100%);
}

[data-scene="screen"] .exhibition-stage {
  transform: translate3d(calc(var(--tilt-x, 0) * 6px), calc(var(--tilt-y, 0) * 6px), 0);
  transition: transform 500ms var(--ease-out);
}

[data-scene="screen"] .exhibition-work {
  box-shadow: 0 28px 70px -24px rgba(0, 0, 0, 0.75);
}

/* Immersive view on a computer (concept C): while the menu shows, the top
   and bottom of the screen shade off so the bar, caption and thumbnails
   read over the work. */
.exhibition-stage::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.62));
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms var(--ease-standard);
}

[data-scene="screen"][data-mode="info"]:not([data-phone]) .exhibition-stage::after {
  opacity: 1;
}

/* Phones (concept D): the work's edges melt into the dark, and no shadow. */
[data-phone] .exhibition-work {
  box-shadow: none;
}

[data-phone] .exhibition-work img {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent),
    linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  mask-composite: intersect;
}

/* The photograph breathes: an almost imperceptible push in, as in a slow
   film, so a still work never feels frozen. */
[data-scene="screen"] .exhibition:not(.is-miniature) .exhibition-work img {
  animation: work-breathe 28s ease-in-out infinite alternate;
}

@keyframes work-breathe {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

/* While the photograph is pulled down to leave, the controls step aside. */
.exhibition[style*="--close"] .exhibition-overlay,
.exhibition[style*="--close"] .exhibition-preview,
.exhibition[style*="--close"] .exhibition-edge {
  opacity: 0 !important;
  transition: opacity 160ms var(--ease-standard);
}

/* Grey series: the next work spreads outward like ink on paper. */
.exhibition-work.is-ink-reveal {
  -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 calc(var(--ink) - 30%), transparent var(--ink));
  mask-image: radial-gradient(circle at 50% 55%, #000 calc(var(--ink) - 30%), transparent var(--ink));
}

.exhibition.is-idle,
.exhibition.is-idle .exhibition-edge {
  cursor: none;
}

/* ----- Walls and floors (hall scene) -------------------------------------- */

.exhibition-page[data-wall="white"] {
  /* Warm gallery plaster and polished concrete, as in the approved design. */
  --wall-base: #e6dccb;
  --wall-noise: var(--noise-fine), var(--noise-coarse);
  --wall-noise-size: 220px 220px, 900px 900px;
  --wall-noise-opacity: 0.3;
  --floor-top: #aca291;
  --floor-bottom: #6a6256;
  --caption-ink: rgba(38, 32, 25, 0.8);
  --caption-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.exhibition-page[data-wall="gray"] {
  /* The dark room (the default): a warm charcoal wall in near darkness, so
     the lit work seems to glow (design/exhibition-concepts-2026-11-01, A). */
  --wall-base: #2e2c2a;
  --wall-noise: var(--noise-fine), var(--noise-coarse);
  --wall-noise-size: 220px 220px, 900px 900px;
  --wall-noise-opacity: 0.3;
  --floor-top: #262422;
  --floor-bottom: #0f0e0d;
}

.exhibition-page[data-wall="concrete"] {
  --wall-base: #98948d;
  --wall-noise: var(--noise-fine), var(--noise-coarse);
  --wall-noise-size: 180px 180px, 520px 520px;
  --wall-noise-opacity: 0.62;
  --floor-top: #5d5a55;
  --floor-bottom: #302e2b;
  --caption-ink: rgba(24, 23, 21, 0.78);
  --caption-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  /* Formwork panel joints and tie holes of fair-faced concrete. */
  --wall-pattern:
    radial-gradient(circle, rgba(28, 26, 24, 0.55) 0 0.22vw, rgba(255, 255, 255, 0.12) 0.3vw, transparent 0.42vw),
    linear-gradient(90deg, rgba(40, 38, 35, 0.32) 0 1px, rgba(255, 255, 255, 0.08) 1px 2px, transparent 2px),
    linear-gradient(0deg, rgba(40, 38, 35, 0.28) 0 1px, rgba(255, 255, 255, 0.07) 1px 2px, transparent 2px);
  --wall-pattern-size: 12vw 9vw, 36vw 18vw, 36vw 18vw;
  --wall-pattern-position: 8vw 4.5vw, 14vw 0, 0 0;
}

.exhibition-page[data-wall="wood"] {
  --wall-base: #4b3326;
  --wall-noise: var(--noise-grain), var(--noise-coarse);
  --wall-noise-size: 480px 480px, 900px 900px;
  --wall-noise-opacity: 0.55;
  --floor-top: #2b2019;
  --floor-bottom: #120d0a;
  /* Vertical veneer panels with shadowed seams. */
  --wall-pattern:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0 2px, rgba(255, 220, 180, 0.06) 2px 3px, transparent 3px);
  --wall-pattern-size: 16vw 100%;
  --wall-pattern-position: 2vw 0;
}

.exhibition-page[data-wall="red"] {
  --wall-base: #77282a;
  --wall-noise: var(--noise-fine), var(--noise-coarse);
  --wall-noise-size: 220px 220px, 900px 900px;
  --wall-noise-opacity: 0.4;
  --floor-top: #34261d;
  --floor-bottom: #160f0b;
}

.exhibition-page[data-wall="green"] {
  --wall-base: #26392f;
  --wall-noise: var(--noise-fine), var(--noise-coarse);
  --wall-noise-size: 220px 220px, 900px 900px;
  --wall-noise-opacity: 0.4;
  --floor-top: #2b2925;
  --floor-bottom: #121110;
}

.exhibition-room {
  position: absolute;
  inset: -12px;
  display: none;
  transform: translate(calc(var(--mx) * -5px), calc(var(--my) * -3px));
  transition: transform 900ms var(--ease-out);
}

[data-scene="hall"] .exhibition-room {
  display: block;
}

/* Photographed rooms (the default): an empty gallery photographed with its
   own daylight, sunlit for 此间留彩 and overcast for 此间留灰
   (assets/art/room-sun.jpg, room-grey.jpg). exhibition.js (ROOM_PLATES)
   sets --plate-image and sizes it to cover the room. Its light is never
   quite still: a brighter copy of the photograph, masked to a soft patch,
   wanders across it and dims now and then as if a cloud passed
   (.room-plate-light); the sun's rays shimmer (.room-beams); a faint haze
   drifts through the grey room (.room-haze); dust drifts in the light
   (.room-particles, drawn by exhibition.js). */
.room-plate,
.room-plate-light {
  position: absolute;
  top: var(--plate-y, 0);
  left: var(--plate-x, 0);
  display: none;
  width: var(--plate-w, 100%);
  height: var(--plate-h, 100%);
  background: var(--plate-image, none) center / 100% 100% no-repeat;
  pointer-events: none;
}

.room-beams,
.room-haze,
.room-particles {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.exhibition-page[data-wall="room"] .room-plate,
.exhibition-page[data-wall="room"] .room-plate-light,
.exhibition-page[data-wall="room"] .room-particles {
  display: block;
}

.exhibition-page[data-wall="room"] .room-wall,
.exhibition-page[data-wall="room"] .room-floor,
.exhibition-page[data-wall="room"] .room-light::after {
  display: none;
}

/* The grey room keeps its plaster grey rather than brown. */
.exhibition-page[data-wall="room"][data-series="grey"] .room-plate,
.exhibition-page[data-wall="room"][data-series="grey"] .room-plate-light {
  filter: saturate(0.55);
}

/* Sunlight from the window on the left wanders over the window and leaf
   shapes, fades as a cloud passes, and the leaves' shadows stir. */
.room-plate-light {
  mix-blend-mode: screen;
  opacity: 0.3;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 62% 120%;
  mask-size: 62% 120%;
  animation:
    sun-wander 44s ease-in-out infinite alternate,
    sun-clouds 27s ease-in-out infinite,
    leaves-stir 7s ease-in-out infinite;
}

@keyframes sun-wander {
  from { -webkit-mask-position: 0% 30%; mask-position: 0% 30%; }
  to { -webkit-mask-position: 55% 70%; mask-position: 55% 70%; }
}

@keyframes sun-clouds {
  0%, 100% { opacity: 0.36; }
  30% { opacity: 0.1; }
  55% { opacity: 0.44; }
  80% { opacity: 0.22; }
}

@keyframes leaves-stir {
  0%, 100% { translate: 0 0; }
  35% { translate: 1.5px -1px; }
  70% { translate: -1px 1px; }
}

/* In the grey room the cold light from the high window on the right swells
   and fades slowly along its shaft. */
.exhibition-page[data-series="grey"] .room-plate-light {
  -webkit-mask-size: 70% 130%;
  mask-size: 70% 130%;
  animation:
    shaft-wander 60s ease-in-out infinite alternate,
    shaft-breathe 31s ease-in-out infinite;
}

@keyframes shaft-wander {
  from { -webkit-mask-position: 100% 0%; mask-position: 100% 0%; }
  to { -webkit-mask-position: 62% 55%; mask-position: 62% 55%; }
}

@keyframes shaft-breathe {
  0%, 100% { opacity: 0.18; }
  40% { opacity: 0.05; }
  70% { opacity: 0.26; }
}

/* Shafts of sunlight slanting down from the window, shimmering faintly. */
.exhibition-page[data-wall="room"][data-series="colour"] .room-beams {
  display: block;
  background:
    linear-gradient(42deg, transparent 30%, rgba(255, 232, 192, 0.2) 38%, transparent 46%),
    linear-gradient(42deg, transparent 44%, rgba(255, 232, 192, 0.13) 51%, transparent 58%),
    linear-gradient(42deg, transparent 56%, rgba(255, 232, 192, 0.08) 62%, transparent 68%);
  filter: blur(16px);
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to right, #000 10%, transparent 72%);
  mask-image: linear-gradient(to right, #000 10%, transparent 72%);
  animation: beams-shimmer 13s ease-in-out infinite alternate;
}

@keyframes beams-shimmer {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

/* A faint haze drifting through the grey room. */
.exhibition-page[data-wall="room"][data-series="grey"] .room-haze {
  display: block;
  background-image: var(--noise-coarse), var(--noise-coarse);
  background-size: 1500px 1500px, 960px 960px;
  mix-blend-mode: screen;
  opacity: 0.1;
  animation: mist-drift 140s linear infinite;
}

/* Around the work the room falls into shade: lightly in the sunlit room,
   deeply in the grey one. (Light presets set the same properties, so these
   name the light too.) */
.exhibition-page[data-wall="room"][data-series="colour"][data-light] {
  --vignette-mid: 0.05;
  --vignette-edge: 0.3;
  --pool-x: 1.8;
  --pool-y: 1.6;
}

.exhibition-page[data-wall="room"][data-series="grey"][data-light] {
  --vignette-mid: 0.24;
  --vignette-edge: 0.72;
  --pool-x: 1.3;
  --pool-y: 1.3;
}

/* The sunlit wall is pale: the text and controls on it are dark. */
.exhibition-page[data-wall="room"][data-series="colour"] {
  --caption-ink: rgba(40, 33, 26, 0.86);
  --caption-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.room-wall {
  position: absolute;
  inset: 0 0 auto;
  height: var(--wall-height);
  overflow: hidden;
  background-color: var(--wall-base);
  background-image: var(--wall-pattern, none);
  background-size: var(--wall-pattern-size, auto);
  background-position: var(--wall-pattern-position, 0 0);
}

.room-wall::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: var(--wall-noise);
  background-size: var(--wall-noise-size);
  opacity: var(--wall-noise-opacity);
  mix-blend-mode: overlay;
}

.room-floor {
  position: absolute;
  inset: auto 0 0;
  height: calc(100% - var(--wall-height));
  background:
    radial-gradient(ellipse calc(var(--art-w) * 0.75) 70% at 50% 0%, rgba(255, 236, 205, var(--floor-glow, 0.16)), transparent 70%),
    linear-gradient(var(--floor-top), var(--floor-bottom));
}

.room-floor::before {
  /* Skirting shadow where the wall meets the floor. */
  position: absolute;
  inset: 0 0 auto;
  height: 1.4vh;
  content: "";
  background: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0));
}

.room-floor::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image: var(--noise-fine), var(--noise-coarse);
  background-size: 220px 220px, 900px 900px;
  opacity: 0.28;
  mix-blend-mode: overlay;
}

/* ----- Light -------------------------------------------------------------- */

.exhibition-page {
  --vignette-mid: 0.24;
  --vignette-edge: 0.66;
  --glow: 0.34;
  --glow-color: 255, 228, 188;
  --pool-x: 1.05;
  --pool-y: 1.15;
}

.exhibition-page[data-light="spot"] {
  /* A warm wall with a soft halo under the ceiling light. The wall falls
     off into shade away from the work: against a darker surround the same
     image reads brighter (simultaneous contrast), so it seems to glow. */
  --vignette-mid: 0.16;
  --vignette-edge: 0.5;
  --glow: 0.62;
  --glow-color: 255, 222, 170;
  --pool-x: 1.5;
  --pool-y: 1.35;
  --floor-glow: 0.34;
}

.exhibition-page[data-light="daylight"] {
  --vignette-mid: 0.1;
  --vignette-edge: 0.34;
  --glow: 0.18;
  --glow-color: 214, 228, 255;
  --pool-x: 1.6;
  --pool-y: 1.6;
}

.exhibition-page[data-light="even"] {
  --vignette-mid: 0.04;
  --vignette-edge: 0.16;
  --glow: 0;
  --pool-x: 2;
  --pool-y: 2;
}

.room-light {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Darkness falls off around the lit area; the work sits in the pool of light. */
.room-light::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(
      ellipse calc(var(--art-w) * var(--pool-x) + 14vw) calc(var(--art-h) * var(--pool-y) + 16vh)
        at calc(50% + var(--mx) * 8px) calc(var(--art-y) - var(--art-h) * 0.08),
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, var(--vignette-mid)) 62%,
      rgba(0, 0, 0, var(--vignette-edge)) 100%
    );
  transition: opacity 900ms var(--ease-standard);
}

/* Warm hotspot of the ceiling light just above the work, plus a faint beam. */
.room-light::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(
      ellipse calc(var(--art-w) * 0.62) calc(var(--art-h) * 0.5)
        at calc(50% + var(--mx) * 10px) calc(var(--art-y) - var(--art-h) * 0.42),
      rgba(var(--glow-color), var(--glow)) 0%,
      rgba(var(--glow-color), 0) 100%
    ),
    radial-gradient(
      ellipse calc(var(--art-w) * 0.5) calc(var(--art-y) * 1.1) at calc(50% + var(--mx) * 14px) 0%,
      rgba(var(--glow-color), calc(var(--glow) * 0.28)) 0%,
      rgba(var(--glow-color), 0) 100%
    );
  mix-blend-mode: soft-light;
}

/* The spotlight beam: a warm cone from a light above, out of view, down
   over the work. Only the light is shown, never the lamp. */
.exhibition-page[data-light="spot"] .room-light::after {
  background:
    radial-gradient(
      ellipse calc(var(--art-w) * 0.9) calc(var(--art-h) * 0.62)
        at calc(50% + var(--mx) * 10px) calc(var(--art-y) - var(--art-h) * 0.46),
      rgba(var(--glow-color), var(--glow)) 0%,
      rgba(var(--glow-color), 0) 100%
    ),
    radial-gradient(
      ellipse calc(var(--art-w) * 0.62) calc(var(--art-y) * 1.05) at calc(50% + var(--mx) * 14px) 0%,
      rgba(var(--glow-color), calc(var(--glow) * 0.55)) 0%,
      rgba(var(--glow-color), 0) 100%
    );
}

.exhibition-page[data-light="daylight"] .room-light::after {
  /* Slowly passing clouds: the daylight brightens and fades across the wall. */
  background:
    linear-gradient(105deg, rgba(var(--glow-color), 0) 20%, rgba(var(--glow-color), 0.38) 45%, rgba(var(--glow-color), 0) 70%);
  background-size: 260% 100%;
  animation: daylight-drift 46s ease-in-out infinite alternate;
}

@keyframes daylight-drift {
  from { background-position: 100% 0; opacity: 0.55; }
  50% { opacity: 1; }
  to { background-position: 0% 0; opacity: 0.6; }
}

/* Real light is never perfectly still: the beam breathes very slowly. */
.exhibition:not(.is-miniature) .room-light {
  animation: light-breathe 12s ease-in-out infinite alternate;
}

@keyframes light-breathe {
  from { opacity: 0.88; }
  to { opacity: 1; }
}

/* Lights up on arrival; dims while the work is being changed. */
.exhibition-room::after {
  position: absolute;
  inset: 0;
  content: "";
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms var(--ease-standard);
}

.exhibition.is-dark .exhibition-room::after {
  opacity: 1;
  transition: none;
}

.exhibition.is-changing .exhibition-room::after {
  opacity: 0.38;
  transition-duration: 420ms;
}

/* ----- The work ------------------------------------------------------------ */

.exhibition-stage {
  position: absolute;
  inset: 0;
}

.exhibition-work {
  position: absolute;
  top: var(--art-y);
  left: 50%;
  width: var(--art-w);
  height: var(--art-h);
  margin: 0;
  transform: translate(-50%, -50%);
  transition: opacity 600ms var(--ease-out);
}

.exhibition-work img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exhibition.is-dark .exhibition-work {
  opacity: 0;
  transition: none;
}

.exhibition.is-changing .exhibition-work {
  opacity: 0;
  transition: opacity 360ms var(--ease-standard);
}

[data-scene="hall"] .exhibition-work {
  transition: opacity 1100ms var(--ease-out);
  /* Lit from above, the work casts a long soft shadow down the wall and a
     close one at its edge, so it stands off the wall. */
  box-shadow:
    calc(var(--mx) * -8px) calc(28px + var(--my) * -3px) 50px -14px rgba(0, 0, 0, 0.55),
    calc(var(--mx) * -3px) 7px 12px -3px rgba(0, 0, 0, 0.34),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Arrival: the visitor steps up to the work. Slow and small, since strong
   motion on a large view can unsettle. Scale composes with the parallax
   and tilt transforms. */
.exhibition.is-arriving .exhibition-room,
.exhibition.is-arriving .exhibition-stage {
  animation: arrive 2600ms var(--ease-out) both;
}

@keyframes arrive {
  from { scale: 0.955; }
  to { scale: 1; }
}

/* The work receives the same light as the wall: brighter at the top. */
[data-scene="hall"] .exhibition-work::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(rgba(var(--glow-color), calc(var(--glow) * 0.32)), rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, calc(var(--vignette-mid) * 0.32)));
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.exhibition.is-dark .exhibition-room,
.exhibition.is-dark .exhibition-work {
  will-change: opacity;
}

/* ----- Paging zones -------------------------------------------------------- */

.exhibition-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  width: 15%;
  padding: 0 clamp(10px, 2.4vw, 34px);
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.exhibition-edge-prev {
  left: 0;
  justify-content: flex-start;
  cursor: w-resize;
}

.exhibition-edge-next {
  right: 0;
  justify-content: flex-end;
  cursor: e-resize;
}

.exhibition-edge svg {
  width: clamp(30px, 3.2vw, 46px);
  height: clamp(30px, 3.2vw, 46px);
  padding: 9px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.26);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  backdrop-filter: blur(6px);
  transition: opacity 320ms var(--ease-standard);
}

/* Viewing mode hides the arrows but they still turn the page. */
[data-mode="info"] .exhibition-edge svg {
  opacity: 0.62;
}

/* In the room the controls are thin outline circles drawn in the wall ink. */
[data-scene="hall"] .exhibition-edge {
  color: var(--caption-ink, rgba(255, 255, 255, 0.86));
}

[data-scene="hall"] .exhibition-edge svg {
  border: 1px solid currentColor;
  background: transparent;
  stroke-width: 1.2;
  backdrop-filter: none;
}

[data-scene="hall"][data-mode="info"] .exhibition-edge svg {
  opacity: 0.5;
}

.exhibition-edge:focus-visible svg {
  opacity: 0.9;
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.exhibition-edge:focus {
  outline: none;
}

/* ----- Information overlay -------------------------------------------------- */

.exhibition-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms var(--ease-standard);
}

[data-mode="info"] .exhibition-overlay {
  opacity: 1;
}

[data-mode="info"] .exhibition-menu,
[data-mode="info"] .exhibition-preview {
  pointer-events: auto;
}

.exhibition-menu {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 18px;
  max-width: 340px;
}

.exhibition-brand {
  color: rgba(255, 255, 255, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(13px, 1.05vw, 17px);
  letter-spacing: 0.34em;
  text-decoration: none;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  text-transform: uppercase;
}

/* Phones: the series counter needs the top line. */
@media (max-width: 720px) {
  .exhibition-brand {
    display: none;
  }
}

[data-scene="hall"] .exhibition-brand {
  color: var(--caption-ink, rgba(255, 255, 255, 0.82));
  text-shadow: var(--caption-shadow, 0 1px 10px rgba(0, 0, 0, 0.45));
}

.exhibition-menu-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.34);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

[data-scene="hall"] .exhibition-menu-toggle {
  border-color: currentColor;
  background: transparent;
  color: var(--caption-ink, #fff);
  backdrop-filter: none;
}

.exhibition-menu-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.exhibition-menu-panel {
  display: grid;
  flex-basis: 100%;
  gap: 2px;
  min-width: 180px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(12, 12, 12, 0.62);
  backdrop-filter: blur(14px);
}

.exhibition-menu-panel[hidden] {
  display: none;
}

.exhibition-menu-panel a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #f3f0ea;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.exhibition-menu-panel a:hover,
.exhibition-menu-panel a:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.exhibition-language {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 12px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.exhibition-language button {
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(243, 240, 234, 0.6);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.exhibition-language button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Gallery or immersive full screen, chosen on a computer (exhibition.js). */
.exhibition-view-switch {
  position: absolute;
  top: max(24px, calc(env(safe-area-inset-top) + 6px));
  left: 50%;
  display: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.28);
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (hover: hover) and (pointer: fine) {
  .exhibition-view-switch {
    display: flex;
  }

  [data-mode="info"] .exhibition-view-switch {
    pointer-events: auto;
  }
}

.exhibition-view-switch button {
  padding: 5px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(243, 240, 234, 0.62);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.exhibition-view-switch button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.exhibition-series {
  position: absolute;
  top: max(30px, calc(env(safe-area-inset-top) + 12px));
  right: max(24px, env(safe-area-inset-right));
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--serif);
  font-size: clamp(13px, 1vw, 16px);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ----- Caption: the semi-transparent introduction --------------------------- */

.exhibition-caption {
  --caption-color: var(--caption-ink, rgba(245, 241, 233, 0.8));
  --edge-reserve: calc(clamp(10px, 2.4vw, 34px) + clamp(30px, 3.2vw, 46px));
  position: absolute;
  max-width: min(34rem, 72vw);
  color: var(--caption-color);
  text-shadow: var(--caption-shadow, 0 1px 14px rgba(0, 0, 0, 0.45));
}

[data-scene="screen"] .exhibition-caption {
  --caption-color: rgba(255, 255, 255, 0.84);
  --caption-shadow: 0 1px 16px rgba(0, 0, 0, 0.7);
  max-width: min(30rem, 82vw);
}

.exhibition-caption-title {
  margin: 0 0 0.7em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.45vw, 24px);
  letter-spacing: 0.06em;
  opacity: 0.94;
}

/* English introductions are set in italic, as in the concepts; Chinese has
   no true italic, so it stays upright. */
html[lang="en"] .exhibition-caption-text {
  font-style: italic;
}

/* On a phone the title leads the space below the work (concept D). */
[data-phone] .exhibition-caption-title {
  font-size: 22px;
}

.exhibition-caption-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(15px, 1.15vw, 19px);
  line-height: 1.95;
  letter-spacing: 0.04em;
}

/* Nine positions chosen per work in the admin (requirement 03). */
[data-caption-position^="top"] .exhibition-caption { top: 13%; }
[data-caption-position^="middle"] .exhibition-caption { top: 50%; transform: translateY(-50%); }
[data-caption-position^="bottom"] .exhibition-caption { bottom: calc(max(22px, env(safe-area-inset-bottom)) + 92px); }
[data-caption-position$="left"] .exhibition-caption { left: 8%; text-align: left; }
[data-caption-position$="right"] .exhibition-caption { right: 8%; text-align: right; }
[data-caption-position$="center"] .exhibition-caption { left: 50%; text-align: center; translate: -50% 0; }

/* In the room the text belongs to the wall, placed relative to the work:
   beside it, above or below it, or (middle-centre) on the photograph. */
[data-scene="hall"] .exhibition-caption {
  --caption-gap: 2.6vw;
  /* Clear of the page arrows (.exhibition-edge padding + icon). */
  --caption-column: max(140px, calc((100% - var(--art-w)) / 2 - var(--caption-gap) * 2 - var(--edge-reserve)));
  --caption-lines: 7;
}

[data-scene="hall"][data-caption-position$="left"] .exhibition-caption {
  right: calc(50% + var(--art-w) / 2 + var(--caption-gap));
  left: auto;
  width: var(--caption-column);
  text-align: right;
}

[data-scene="hall"][data-caption-position$="right"] .exhibition-caption {
  right: auto;
  left: calc(50% + var(--art-w) / 2 + var(--caption-gap));
  width: var(--caption-column);
  text-align: left;
}

[data-scene="hall"][data-caption-position$="center"] .exhibition-caption {
  width: min(34rem, var(--art-w));
}

[data-scene="hall"][data-caption-position^="top"] .exhibition-caption {
  top: calc(var(--art-y) - var(--art-h) / 2);
  bottom: auto;
}

[data-scene="hall"][data-caption-position^="middle"] .exhibition-caption {
  top: var(--art-y);
  bottom: auto;
  transform: translateY(-50%);
}

[data-scene="hall"][data-caption-position^="bottom"] .exhibition-caption {
  top: calc(var(--art-y) + var(--art-h) / 2);
  bottom: auto;
  transform: translateY(-100%);
}

[data-scene="hall"][data-caption-position="top-center"] .exhibition-caption {
  --caption-lines: 3;
  top: auto;
  bottom: calc(100% - var(--art-y) + var(--art-h) / 2 + 2.2vh);
  transform: none;
}

[data-scene="hall"][data-caption-position="bottom-center"] .exhibition-caption {
  --caption-lines: 3;
  top: calc(var(--art-y) + var(--art-h) / 2 + 2.6vh);
  transform: none;
}

[data-scene="hall"][data-wall="room"] .exhibition-caption {
  /* PLATE_CAPTION_GAP in exhibition.js. */
  --caption-gap: 1.8vw;
}

/* A photographed room's wall label (concept A): a small card beside the
   work, the title over a short warm rule; dark in the grey room, light on
   the sunlit wall. */
[data-scene="hall"][data-wall="room"][data-caption-position="bottom-right"] .exhibition-caption {
  width: min(var(--caption-column), 17rem);
  padding: 18px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  background: rgba(22, 20, 18, 0.6);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.65);
  text-shadow: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

[data-scene="hall"][data-wall="room"][data-caption-position="bottom-right"] .exhibition-caption-title {
  font-size: clamp(16px, 1.25vw, 20px);
}

[data-scene="hall"][data-wall="room"][data-caption-position="bottom-right"] .exhibition-caption-title::after {
  display: block;
  width: 28px;
  height: 1px;
  margin-top: 12px;
  background: rgba(214, 186, 150, 0.6);
  content: "";
}

[data-scene="hall"][data-wall="room"][data-series="colour"][data-caption-position="bottom-right"] .exhibition-caption {
  border-color: rgba(70, 50, 30, 0.08);
  background: rgba(252, 249, 243, 0.62);
  box-shadow: 0 14px 34px -18px rgba(70, 45, 20, 0.35);
}

[data-scene="hall"][data-wall="room"][data-series="colour"][data-caption-position="bottom-right"] .exhibition-caption-title::after {
  background: rgba(150, 112, 70, 0.6);
}

[data-scene="hall"][data-caption-position="middle-center"] .exhibition-caption {
  --caption-color: rgba(255, 255, 255, 0.88);
  --caption-shadow: 0 1px 18px rgba(0, 0, 0, 0.62);
}

/* Automatic placement (data-caption-auto, exhibition.js): on the full screen
   the text, too, is placed relative to the work, in the space the page's
   shape leaves free: beside it, below or above it, or with no free space
   over the photograph's own lower-left corner. exhibition.js sets the
   number of lines that fit (--caption-lines). */
[data-scene="screen"][data-caption-auto][data-caption-position="bottom-right"] .exhibition-caption {
  --caption-lines: 7;
  top: auto;
  right: auto;
  /* Level with the work's lower edge, but never down in the thumbnail strip. */
  bottom: max(calc(100% - var(--art-y) - var(--art-h) / 2), calc(max(16px, env(safe-area-inset-bottom)) + 70px));
  left: calc(50% + var(--art-w) / 2 + 2.6vw);
  width: min(22rem, max(140px, calc((100% - var(--art-w)) / 2 - 5.2vw - var(--edge-reserve))));
  text-align: left;
  translate: none;
}

[data-scene="screen"][data-caption-auto][data-caption-position="bottom-center"] .exhibition-caption {
  --caption-lines: 4;
  top: calc(var(--art-y) + var(--art-h) / 2 + 2.6vh);
  bottom: auto;
  width: min(30rem, 86vw);
}

[data-scene="screen"][data-caption-auto][data-caption-position="bottom-left"] .exhibition-caption {
  top: auto;
  bottom: max(calc(100% - var(--art-y) - var(--art-h) / 2 + 3vh), calc(max(16px, env(safe-area-inset-bottom)) + 70px));
  /* Clear of the work's corner, and of the screen's edge when the work is
     wider than the screen. */
  left: max(calc(50% - var(--art-w) / 2 + max(20px, 4vw)), max(20px, 4vw));
  width: min(26rem, calc(var(--art-w) - max(40px, 8vw)), calc(100% - max(40px, 8vw)));
}

/* Over the work in the immersive view (concept C): a large serif title. */
[data-scene="screen"]:not([data-phone])[data-caption-auto][data-caption-position="bottom-left"] .exhibition-caption {
  width: min(34rem, calc(100% - max(40px, 8vw)));
}

[data-scene="screen"]:not([data-phone])[data-caption-auto][data-caption-position="bottom-left"] .exhibition-caption-title {
  margin-bottom: 0.45em;
  font-size: clamp(22px, 2.2vw, 36px);
  letter-spacing: 0.02em;
}

[data-scene="screen"][data-caption-auto][data-caption-position="top-center"] .exhibition-caption {
  --caption-lines: 3;
  top: auto;
  bottom: calc(100% - var(--art-y) + var(--art-h) / 2 + 2.2vh);
  width: min(30rem, 86vw);
}

/* Semi-transparent: the text is a quiet companion to the work, a little
   fainter in the introduction than in the title. */
[data-caption-auto] .exhibition-caption-title {
  opacity: 0.86;
}

[data-caption-auto] .exhibition-caption-text {
  opacity: 0.72;
}

.exhibition-caption-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--caption-lines, 6);
}

[data-caption-style="vertical"] .exhibition-caption-text {
  display: block;
}

[data-scene="hall"] .exhibition-series {
  color: var(--caption-ink, rgba(255, 255, 255, 0.72));
  text-shadow: var(--caption-shadow, 0 1px 8px rgba(0, 0, 0, 0.5));
}

/* Style: serif fade. */
[data-mode="info"][data-caption-style="serif"] .exhibition-caption {
  animation: caption-rise 900ms var(--ease-out) both;
}

@keyframes caption-rise {
  from { opacity: 0; filter: blur(3px); margin-top: 10px; }
  to { opacity: 1; filter: blur(0); margin-top: 0; }
}

/* Style: vertical, read top to bottom, right to left. */
[data-caption-style="vertical"] .exhibition-caption {
  display: flex;
  flex-direction: row-reverse;
  gap: 1.4em;
  max-width: none;
  max-height: 62vh;
  writing-mode: horizontal-tb;
}

[data-caption-style="vertical"] .exhibition-caption-title,
[data-caption-style="vertical"] .exhibition-caption-text {
  margin: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  max-height: 62vh;
}

[data-caption-style="vertical"] .exhibition-caption-text {
  letter-spacing: 0.24em;
  line-height: 2.1;
}

[data-caption-style="vertical"][data-caption-position^="bottom"] .exhibition-caption {
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 92px);
  max-height: 46vh;
}

[data-mode="info"][data-caption-style="vertical"] .exhibition-caption {
  animation: caption-fade 1200ms var(--ease-out) both;
}

@keyframes caption-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Style: words (or characters) surface one after another. */
[data-caption-style="reveal"] .exhibition-caption-text span {
  display: inline-block;
  opacity: 0;
}

[data-mode="info"][data-caption-style="reveal"] .exhibition-caption-text span {
  animation: caption-reveal 700ms var(--ease-out) both;
  animation-delay: calc(var(--reveal-index) * 45ms + 120ms);
}

[data-mode="info"][data-caption-style="reveal"] .exhibition-caption-title {
  animation: caption-fade 700ms var(--ease-out) both;
}

@keyframes caption-reveal {
  from { opacity: 0; filter: blur(6px); transform: translateY(0.3em); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

/* ----- Thumbnail strip (as in Apple Photos) ---------------------------------- */

/* As in Apple Photos on iPad: thumbnails sit straight on the scene near the
   bottom edge, with no panel behind them, and fade out at both ends. With the
   menu they are always there; in viewing mode they surface briefly when the
   visitor pages or reaches for them. */
.exhibition-preview {
  --strip-h: 40px;
  position: absolute;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0;
  z-index: 5;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 480ms var(--ease-standard), transform 480ms var(--ease-out);
}

.exhibition-preview[hidden] {
  display: none;
}

[data-scene="hall"] .exhibition-preview {
  --strip-h: 46px;
}

[data-mode="info"] .exhibition-preview,
.exhibition.is-strip-awake .exhibition-preview {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.exhibition-strip {
  display: flex;
  align-items: flex-start;
  column-gap: 2px;
  /* Room above for the soft top edge. */
  height: calc(var(--strip-h) + 6px);
  /* Half the strip on each side, so the first and last can sit centred. */
  padding: 6px 50% 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

/* A series that fits (exhibition.js) sits centred as a group, every
   thumbnail in full. */
.exhibition-strip.is-fitting {
  justify-content: center;
  padding: 6px 0 0;
  -webkit-mask-image: none;
  mask-image: none;
}

.exhibition-strip::-webkit-scrollbar {
  display: none;
}

/* exhibition.js centres the strip with the same narrow width (0.62) and
   current-thumbnail margin (6px). */
.exhibition-thumb {
  position: relative;
  flex: none;
  width: calc(var(--strip-h) * 0.62);
  height: var(--strip-h);
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition:
    width 420ms var(--ease-out),
    margin 420ms var(--ease-out);
}

/* The thumbnail: a soft top edge rising to 80% opaque; around the middle it
   fades, and the whole lower half is almost transparent (95%). */
.exhibition-thumb img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  /* Only a faint placeholder while the thumbnail loads; the image covers it. */
  background: rgba(128, 128, 128, 0.16);
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.8) 14%, rgba(0, 0, 0, 0.8) 36%, rgba(0, 0, 0, 0.05) 52%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.8) 14%, rgba(0, 0, 0, 0.8) 36%, rgba(0, 0, 0, 0.05) 52%);
}

/* A blurred ghost of the image along the top edge, so the border is soft
   rather than cut. The image comes from --thumb-src (exhibition.js). */
.exhibition-thumb::before {
  position: absolute;
  top: -4px;
  right: -2px;
  left: -2px;
  height: 45%;
  background: var(--thumb-src, none) center top / cover no-repeat;
  content: "";
  filter: blur(3px);
  opacity: 0.45;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

.exhibition-thumb:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}

.exhibition-thumb[aria-current="true"] {
  width: calc(var(--strip-h) * var(--thumb-ratio, 1));
  margin: 0 6px;
}

/* A soft line of light under the work on show, just below the visible
   upper half (the lower half is almost transparent). It fades across as
   the work changes. */
.exhibition-thumb::after {
  position: absolute;
  top: calc(52% + 3px);
  right: 16%;
  left: 16%;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 246, 228, 0.92);
  box-shadow: 0 0 8px 1px rgba(255, 236, 200, 0.6);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease-standard);
}

.exhibition-thumb[aria-current="true"]::after {
  opacity: 1;
}

/* On the sunlit oak floor a faint shadow sets the light line off. */
.exhibition-page[data-wall="room"][data-series="colour"][data-scene="hall"] .exhibition-thumb::after {
  background: rgba(255, 252, 244, 0.98);
  box-shadow: 0 1px 3px rgba(70, 45, 20, 0.5), 0 0 8px 1px rgba(255, 240, 210, 0.7);
}

/* ----- Hint and status ------------------------------------------------------ */

.exhibition-hint {
  position: absolute;
  bottom: max(96px, calc(env(safe-area-inset-bottom) + 86px));
  left: 50%;
  z-index: 5;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.5);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(10px);
  animation: caption-fade 900ms 1200ms var(--ease-out) both;
  transition: opacity 500ms var(--ease-standard);
}

.exhibition-hint.is-leaving {
  opacity: 0;
}

.exhibition-status {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-align: center;
}

.exhibition-status[hidden] {
  display: none;
}

.exhibition-status p {
  margin: 0;
}

.exhibition-status button {
  justify-self: center;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

/* ----- Prototype panel (?proto=1, removed after approval) -------------------- */

.exhibition-proto {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 8;
  width: 228px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.78);
  color: #f3f0ea;
  font-size: 12px;
  backdrop-filter: blur(14px);
}

.exhibition-proto-heading {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.exhibition-proto-fields {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.exhibition-proto.is-collapsed .exhibition-proto-fields {
  display: none;
}

.exhibition-proto label {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
}

.exhibition-proto select {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: #1b1b1b;
  color: inherit;
  font: inherit;
}

.exhibition-proto p {
  margin: 4px 0 0;
  color: rgba(243, 240, 234, 0.6);
  line-height: 1.6;
}

[data-proto-open] .exhibition-series {
  right: 260px;
}

/* ===== Reduced motion ====================================================== */

@media (prefers-reduced-motion: reduce) {
  .exhibition-room,
  .exhibition-work {
    transition-duration: 1ms !important;
  }

  .exhibition.is-arriving .exhibition-room,
  .exhibition.is-arriving .exhibition-stage {
    animation: none !important;
  }

  .room-plate-light,
  .room-beams,
  .room-haze {
    animation: none !important;
  }

  .ambient-layer,
  .ambient-mist,
  .room-light,
  .exhibition-work img {
    animation: none !important;
  }

  .exhibition-page[data-light="daylight"] .room-light::after,
  [data-mode="info"] .exhibition-caption,
  [data-mode="info"] .exhibition-caption span {
    animation: none !important;
  }

  [data-caption-style="reveal"] .exhibition-caption-text span {
    opacity: 1;
  }
}

/* ===== Upload studio: exhibition display settings (requirement 03) ======== */

.studio-exhibit-note {
  margin: -4px 0 16px;
  color: var(--muted, #62666d);
  font-size: 13px;
  line-height: 1.6;
}

/* The editor column is narrow: the miniature spans it, controls follow. */
.studio-exhibit-layout {
  display: grid;
  gap: 20px;
}

.studio-exhibit-preview {
  order: -1;
}

.studio-exhibit-controls {
  display: grid;
  gap: 18px;
}

.studio-exhibit-controls fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.studio-exhibit-controls legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.studio-exhibit-walls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 6px;
}

.studio-exhibit-walls label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line, rgba(17, 17, 17, 0.12));
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.studio-exhibit-walls label:has(input:checked) {
  border-color: var(--ink, #111);
  box-shadow: inset 0 0 0 1px var(--ink, #111);
}

.studio-exhibit-walls label:has(input:focus-visible),
.studio-exhibit-grid label:has(input:focus-visible) {
  outline: 2px solid var(--accent, #2f5f7f);
  outline-offset: 2px;
}

.studio-exhibit-walls input,
.studio-exhibit-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.studio-exhibit-swatch {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.studio-exhibit-swatch[data-swatch="white"] { background: #e7e3db; }
.studio-exhibit-swatch[data-swatch="gray"] { background: #46474a; }
.studio-exhibit-swatch[data-swatch="concrete"] { background: radial-gradient(circle at 50% 50%, #4d4a46 0 2px, transparent 3px), #98948d; }
.studio-exhibit-swatch[data-swatch="wood"] { background: repeating-linear-gradient(90deg, #4b3326 0 3px, #563b2c 3px 5px); }
.studio-exhibit-swatch[data-swatch="red"] { background: #77282a; }
.studio-exhibit-swatch[data-swatch="green"] { background: #26392f; }

.studio-exhibit-grid {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 4px;
  width: max-content;
  padding: 6px;
  border: 1px solid var(--line, rgba(17, 17, 17, 0.12));
  border-radius: 6px;
}

.studio-exhibit-grid label {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  border-radius: 4px;
  background: rgba(17, 17, 17, 0.05);
  cursor: pointer;
}

.studio-exhibit-grid label span {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: rgba(17, 17, 17, 0.28);
}

.studio-exhibit-grid label:has(input:checked) {
  background: var(--ink, #111);
}

.studio-exhibit-grid label:has(input:checked) span {
  background: #fff;
}

.studio-exhibit-position-label {
  margin: 6px 0 0;
  color: var(--muted, #62666d);
  font-size: 12px;
}

.studio-exhibit-replay {
  justify-self: start;
}

.studio-exhibit-tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 8px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(17, 17, 17, 0.06);
}

.studio-exhibit-tabs button {
  padding: 5px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.studio-exhibit-tabs button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.studio-exhibit-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #0d0d0d;
}

.studio-exhibit-miniature {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  pointer-events: none;
}

.studio-exhibit-miniature .exhibition.is-miniature {
  position: absolute;
}

.studio-exhibit-miniature .exhibition-work img {
  max-width: none;
}
