:root {
  --wall: #ecebe7;
  --wall-deep: #dedcd6;
  --ink: #262625;
  --ink-rgb: 38 38 36;
  --ink-soft: #6b6b68;
  --paper: #fefefd;
  --shadow-warm: 90 90 86;

  --w-top: #dcdad4;
  --w-hi: #e9e8e3;
  --w-lit: #f1f0ec;
  --w-mid: #efeeea;
  --w-low: #e8e6e0;
  --w-bottom: #dbd9d2;

  --pool-rgb: 255 255 255;
  --pa1: 0.95;
  --pa2: 0.8;
  --pa3: 0.8;
  --pa4: 0.95;
  --pa-wide: 0.5;

  --amb-rgb: 46 48 54;
  --amb-a: 0.14;
  --side-rgb: 38 40 46;
  --side-a: 0.46;

  --grain-blend: multiply;
  --grain-op: 0.42;

  --halo-a: 0.62;
  --halo-a2: 0.2;
  --beam-a: 0.5;
  --beam-a2: 0.16;
  --sheen-op: 0.7;
  --h1-shadow: rgba(255, 255, 255, 0.85);
  --ring: rgba(38, 38, 36, 0.07);
  --cast: 80 80 76;

  --toggle-bg: rgba(255, 255, 255, 0.55);
  --toggle-border: rgba(38, 38, 36, 0.16);
}

[data-theme="dark"] {
  --wall: #1a1a1c;
  --wall-deep: #101012;
  --ink: #ededec;
  --ink-rgb: 237 237 236;
  --ink-soft: #9a9a96;
  --paper: #232327;
  --shadow-warm: 0 0 0;

  --w-top: #0a0a0c;
  --w-hi: #121215;
  --w-lit: #27272d;
  --w-mid: #1c1c20;
  --w-low: #111113;
  --w-bottom: #07070a;

  --pool-rgb: 255 243 219;
  --pa1: 0.5;
  --pa2: 0.36;
  --pa3: 0.36;
  --pa4: 0.5;
  --pa-wide: 0.26;

  --amb-rgb: 0 0 0;
  --amb-a: 0.5;
  --side-rgb: 0 0 0;
  --side-a: 0.62;

  --grain-blend: overlay;
  --grain-op: 0.22;

  --halo-a: 0.16;
  --halo-a2: 0.05;
  --beam-a: 0.22;
  --beam-a2: 0.07;
  --sheen-op: 0.32;
  --h1-shadow: rgba(0, 0, 0, 0.55);
  --ring: rgba(255, 255, 255, 0.08);
  --cast: 0 0 0;

  --toggle-bg: rgba(255, 255, 255, 0.08);
  --toggle-border: rgba(255, 255, 255, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  position: relative;
  min-height: 100vh;
  font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background-color: var(--wall-deep);
  overflow-x: hidden;
  overflow-x: clip;
  transition: color 0.5s ease;
}

/* the wall itself: scrolls with the artworks */
.wall-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--wall);
  background-image:
    radial-gradient(ellipse 44% 300px at 12% 200px, rgba(var(--pool-rgb), var(--pa1)), rgba(var(--pool-rgb), 0) 70%),
    radial-gradient(ellipse 44% 300px at 38% 200px, rgba(var(--pool-rgb), var(--pa2)), rgba(var(--pool-rgb), 0) 70%),
    radial-gradient(ellipse 44% 300px at 62% 200px, rgba(var(--pool-rgb), var(--pa3)), rgba(var(--pool-rgb), 0) 70%),
    radial-gradient(ellipse 44% 300px at 88% 200px, rgba(var(--pool-rgb), var(--pa4)), rgba(var(--pool-rgb), 0) 70%),
    radial-gradient(ellipse 120% 420px at 50% 150px, rgba(var(--pool-rgb), var(--pa-wide)), rgba(var(--pool-rgb), 0) 70%),
    linear-gradient(180deg, var(--w-top) 0px, var(--w-hi) 130px, var(--w-lit) 460px, var(--w-mid) 72%, var(--w-low) 94%, var(--w-bottom) 100%);
  transition: background-color 0.5s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 62% 62% at 50% 34%, rgba(0, 0, 0, 0) 44%, rgba(var(--amb-rgb), var(--amb-a)) 100%);
}

/* side returns of the wall: the surface turns away and falls into shadow */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg,
      rgba(var(--side-rgb), var(--side-a)) 0,
      rgba(var(--side-rgb), calc(var(--side-a) * 0.65)) 1vw,
      rgba(var(--side-rgb), calc(var(--side-a) * 0.22)) 3vw,
      rgba(var(--side-rgb), 0) 7.5vw),
    linear-gradient(270deg,
      rgba(var(--side-rgb), var(--side-a)) 0,
      rgba(var(--side-rgb), calc(var(--side-a) * 0.65)) 1vw,
      rgba(var(--side-rgb), calc(var(--side-a) * 0.22)) 3vw,
      rgba(var(--side-rgb), 0) 7.5vw);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-blend);
  transition: opacity 0.5s ease;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%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(%23s)' opacity='0.13'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.009' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 160px 160px, 900px 900px;
}

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: fixed;
  top: 22px;
  right: 26px;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 2px 10px rgba(60, 58, 52, 0.12);
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease,
              transform 0.35s ease, box-shadow 0.35s ease;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(60, 58, 52, 0.2);
}

.theme-toggle:active { transform: translateY(0) scale(0.95); }

.theme-toggle svg {
  position: absolute;
  width: 19px;
  height: 19px;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.theme-toggle .icon-moon { opacity: 0; transform: rotate(-60deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(60deg) scale(0.6); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

@media (max-width: 560px) {
  .theme-toggle { top: 16px; right: 16px; width: 40px; height: 40px; }
}

/* ---------- header ---------- */
.exhibit-head {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 108px 24px 34px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.exhibit-head h1 {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-weight: 500;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--ink);
  text-shadow: 0 1px 0 var(--h1-shadow);
}

.exhibit-head .sub {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

.head-line {
  width: 54px;
  height: 1px;
  margin: 30px auto 0;
  background: linear-gradient(90deg, transparent, rgba(var(--ink-rgb), 0.45), transparent);
}

/* ---------- wall grid ---------- */
.wall {
  position: relative;
  z-index: 3;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px clamp(22px, 5vw, 76px) 90px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(40px, 4.4vw, 72px) clamp(26px, 3vw, 48px);
}

.poster {
  position: relative;
  cursor: pointer;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--i) * 55ms);
}

.poster.reveal {
  opacity: 1;
  transform: translateY(0);
}

/* artworks melt into the wall as they leave the viewport */
.poster.reveal .poster-frame,
.poster.reveal .poster-caption,
.poster.reveal::before,
.poster.reveal .poster-frame::before {
  opacity: var(--fade, 1);
}

.poster-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--paper);
  padding: 9px;
  border-radius: 2px;
  box-shadow:
    0 1px 1px rgba(var(--shadow-warm), 0.14),
    0 3px 6px -2px rgba(var(--shadow-warm), 0.24),
    0 14px 22px -12px rgba(var(--shadow-warm), 0.42),
    0 34px 44px -26px rgba(var(--shadow-warm), 0.5),
    0 60px 80px -50px rgba(var(--shadow-warm), 0.55);
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.55s ease;
}

.poster:hover .poster-frame {
  transform: translateY(-7px);
  box-shadow:
    0 1px 1px rgba(var(--shadow-warm), 0.12),
    0 6px 12px -4px rgba(var(--shadow-warm), 0.24),
    0 26px 34px -16px rgba(var(--shadow-warm), 0.42),
    0 52px 64px -32px rgba(var(--shadow-warm), 0.48),
    0 84px 110px -60px rgba(var(--shadow-warm), 0.5);
}

/* soft cast shadow on the wall, offset downward like overhead light */
.poster-frame::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -14px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(var(--cast), 0.32), rgba(var(--cast), 0) 72%);
  filter: blur(9px);
  z-index: -1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.poster:hover .poster-frame::after {
  opacity: 0.72;
  transform: translateY(3px) scaleX(1.04);
}

/* spotlight beam falling from the ceiling onto each artwork */
.poster::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 62%;
  width: 150%;
  height: 340px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 32% 100% at 50% 100%,
              rgba(255, 255, 255, var(--beam-a)),
              rgba(255, 255, 255, var(--beam-a2)) 52%,
              rgba(255, 255, 255, 0) 82%);
}

/* halo of light pooling on the wall around each artwork */
.poster-frame::before {
  content: "";
  position: absolute;
  inset: -34% -30%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 48% 44% at 50% 50%,
              rgba(255, 255, 255, var(--halo-a)),
              rgba(255, 255, 255, var(--halo-a2)) 46%,
              rgba(255, 255, 255, 0) 76%);
}

.poster-art {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.poster-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.poster-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-art img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(48vw - 24px), 620px);
  max-height: calc(80vh - 24px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.poster-art img {
  filter: saturate(0.98) contrast(1.01) brightness(1.02);
}

/* glass sheen over the print */
.glass {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg,
      rgba(255, 255, 255, 0.34) 0%,
      rgba(255, 255, 255, 0.08) 20%,
      rgba(255, 255, 255, 0) 42%,
      rgba(255, 255, 255, 0) 66%,
      rgba(255, 255, 255, 0.1) 88%,
      rgba(255, 255, 255, 0.24) 100%);
  mix-blend-mode: screen;
  opacity: var(--sheen-op);
}

.poster-caption {
  margin-top: 15px;
  padding-left: 3px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cap-club {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.cap-title {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */
.exhibit-foot {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 76px) 74px;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(24, 21, 17, 0.86);
  backdrop-filter: blur(10px) saturate(0.8);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.lightbox.open { opacity: 1; visibility: visible; }

.lb-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 60px);
  max-width: 1240px;
  width: 100%;
  justify-content: center;
  margin: auto;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lightbox.open .lb-inner { transform: translateY(0) scale(1); }

.lb-frame {
  position: relative;
  width: fit-content;
  max-width: min(48vw, 644px);
  max-height: 80vh;
  margin-left: 0;
  transform: translateX(clamp(-90px, -4.5vw, -28px));
  padding: 12px;
  background: var(--paper);
  box-shadow:
    0 30px 60px -24px rgba(0, 0, 0, 0.7),
    0 80px 120px -60px rgba(0, 0, 0, 0.8);
}

.lb-art { position: relative; max-width: 100%; max-height: 100%; overflow: hidden; }
.lb-art svg { display: block; width: 100%; height: 100%; }

.lb-info { max-width: 300px; color: #f0f0ee; }
.lb-club {
  font-size: 22px;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}
.lb-desc {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 13px;
  line-height: 2;
  color: #c8c8c4;
  margin-bottom: 18px;
}
.lb-meta {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: #94948f;
}

.lb-close {
  position: fixed;
  top: 26px;
  right: 30px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(240, 232, 220, 0.28);
  background: transparent;
  color: #f0f0ee;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease, transform 0.3s ease;
}
.lb-close:hover { background: rgba(240, 232, 220, 0.12); transform: rotate(90deg); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exhibit-head { padding-top: 76px; }
}
@media (max-width: 560px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 18px; }
  .exhibit-foot { flex-direction: column; letter-spacing: 0.2em; }
  .lightbox { padding: 20px 18px; }
  .lb-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .lb-inner {
    flex-direction: column;
    gap: 16px;
    justify-content: flex-start;
    margin: auto;
  }
  .lb-frame { width: auto; max-width: min(68vw, 340px); transform: none; flex: 0 0 auto; margin: 0 auto; }
  .lb-art img { max-width: min(calc(68vw - 24px), 316px); max-height: 60vh; }
  .lb-info { text-align: center; max-width: min(340px, 100%); margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
  .poster { opacity: 1; transform: none; }
}
