:root {
  --ink: #08080c;
  --ink-elev: #0f0f16;
  --paper: #f6f4ef;
  --acc: #ece9e0;
  --muted: #b8b4c2;
  --dim: #7f7c8a;
  --line: #22222c;
  --line-hi: #3a3948;
}

* { box-sizing: border-box; }
html { background: var(--ink); color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--acc);
  font: 15px/1.6 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: auto; }

.mono { font-family: "Fragment Mono", "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.serif { font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif; }
.caps { letter-spacing: .22em; text-transform: uppercase; }

/* ─── Header & Navigation ─── */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 34px;
  background: linear-gradient(to bottom, rgba(8,8,12,.88) 0%, rgba(8,8,12,.42) 65%, rgba(8,8,12,0) 100%);
  pointer-events: none;
}
header > * { pointer-events: auto; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  transition: opacity .2s ease;
}
.wordmark:hover { opacity: .8; }
.wordmark svg { width: 22px; height: 18px; fill: var(--acc); flex-shrink: 0; }

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.topnav a {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.topnav a:hover, .topnav a.active { color: var(--acc); }
.topnav a.active { border-bottom-color: var(--line-hi); }
.topnav .ext { font-size: 9px; opacity: .65; margin-left: 3px; letter-spacing: 0; }

#menubtn {
  display: none;
  font-size: 10px;
  color: var(--dim);
  cursor: pointer;
  background: none;
  border: 0;
  letter-spacing: .24em;
  text-transform: uppercase;
  padding: 6px 0;
}
#menubtn:hover { color: var(--acc); }

#menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 8, 12, .96);
  backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
}
#menu.open { display: flex; }
#menu ul { list-style: none; margin: 0; padding: 0; text-align: center; }
#menu li { margin: 24px 0; }
#menu a {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 400;
  letter-spacing: .04em;
  transition: color .15s;
}
#menu a:hover { color: var(--dim); }
#menu .small a {
  font-family: "Fragment Mono", monospace;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .22em;
}
#menuclose {
  position: absolute;
  top: 22px;
  right: 24px;
  font-size: 10px;
  color: var(--dim);
  cursor: pointer;
  background: none;
  border: 0;
  letter-spacing: .24em;
  text-transform: uppercase;
}
#menuclose:hover { color: var(--acc); }

/* ─── Layout Shell ─── */
main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 116px 34px 48px;
}
footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 34px 40px;
  font-size: 10px;
  color: var(--dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line);
}
footer a:hover { color: var(--acc); }

.kicker { font-size: 10px; color: var(--dim); }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0 32px; }

/* ─── Swatch Dots & Pills ─── */
.swatches {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.swatch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid transparent;
  color: var(--dim);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  transition: all .18s ease;
}
.swatch-btn:hover { color: var(--acc); border-color: var(--line); }
.swatch-btn.on {
  color: var(--acc);
  border-color: var(--line-hi);
  background: rgba(255,255,255,.035);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18);
  flex-shrink: 0;
}

/* ─── Works Exhibition Grid ─── */
.page-head {
  display: block;
}
.page-title {
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 400;
  line-height: 1.08;
  margin: 8px 0 0;
  letter-spacing: .02em;
}
.epigraph {
  max-width: 66ch;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--muted);
  margin: 18px 0 6px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 34px;
}
.filters, .seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.filters button, .seg button {
  background: none;
  border: 0;
  color: var(--dim);
  cursor: pointer;
  padding: 6px 13px;
  border-radius: 999px;
  font-family: "Fragment Mono", monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: color .18s ease, background .18s ease;
}
.filters button:hover, .seg button:hover { color: var(--acc); }
.filters button.on, .seg button.on {
  color: var(--acc);
  background: rgba(255,255,255,.08);
}

.wgrid {
  display: grid;
  gap: 44px 30px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.wcard {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.wcard-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #050508;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  transition: border-color .28s ease, transform .4s cubic-bezier(.2,.7,.2,1);
}
.wcard-frame.poster-mode {
  aspect-ratio: 3 / 4;
  background: var(--paper);
}
.wcard-frame:hover {
  border-color: var(--line-hi);
}
.wcard-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.16,1,.3,1), opacity .28s ease;
}
.wcard-frame:hover img.main-img {
  transform: scale(1.03);
}
.wcard-frame img.detail-peek {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.wcard-frame.peeking img.detail-peek { opacity: 1; }

.badge-motion {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8,8,12,.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 9px;
  color: var(--acc);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.peek-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8,8,12,.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14);
  font-size: 9px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease, color .15s;
}
.wcard-frame:hover .peek-btn, .wcard-frame.peeking .peek-btn {
  opacity: 1;
  transform: none;
}
.peek-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }

.wcard-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
}
.wcard-title {
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .01em;
}
.wcard-num {
  font-size: 10px;
  color: var(--dim);
  margin-right: 8px;
}
.wcard-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 10px;
  color: var(--dim);
}
.mini-dots {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.mini-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: .48;
  transform: scale(.92);
  box-shadow: 0 0 0 1px rgba(255,255,255,.22);
  transition: opacity .18s, transform .18s, box-shadow .18s;
}
.mini-dot:hover { opacity: .85; transform: scale(1.08); }
.mini-dot.on {
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 3px var(--acc);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.status-pill.live { color: var(--acc); }
.status-pill.live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8be28b;
  box-shadow: 0 0 8px #8be28b99;
}

/* ─── Piece Page ─── */
.piece-wrap { max-width: 980px; }
.piece-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}
.piece-heading {
  margin: 6px 0 0;
  font-size: clamp(32px, 4.6vw, 50px);
  font-weight: 400;
  line-height: 1.06;
}
.piece-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 20px;
}

.stage-box {
  position: relative;
  background: #040407;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}
.stage-box.is-poster {
  background: #121217;
  padding: clamp(18px, 4vw, 48px);
}
.stage-box.is-poster img {
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 22px 60px rgba(0,0,0,.65);
}
.stage-box img {
  transition: opacity .26s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.stage-box video {
  max-height: 76vh;
  width: 100%;
  object-fit: contain;
  background: #040406;
}
.stage-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 10px;
  color: var(--dim);
}

/* Optical Magnifier Loupe */
.loupe {
  position: absolute;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 14px 40px rgba(0,0,0,.8), inset 0 0 18px rgba(255,255,255,.08);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.92);
  transition: opacity .16s ease, transform .16s ease;
  background-repeat: no-repeat;
  background-color: #050508;
  z-index: 10;
}
.loupe.on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Museum Specification Plate */
.plate-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: start;
  margin-top: 30px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.plate {
  display: grid;
  grid-template-columns: 112px 1fr;
  row-gap: 10px;
  column-gap: 16px;
  font-size: 11.5px;
}
.plate .k { color: var(--dim); font-size: 10px; padding-top: 1px; }
.plate .eq-note { color: var(--dim); font-size: 10.5px; display: block; margin-top: 2px; }

.cta-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--acc);
  color: var(--ink);
  background: var(--acc);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.cta-btn:hover {
  background: transparent;
  color: var(--acc);
}
.cta-btn.ghost {
  background: transparent;
  color: var(--acc);
  border-color: var(--line-hi);
}
.cta-btn.ghost:hover { border-color: var(--acc); }
.cta-sub { font-size: 10px; color: var(--dim); }

/* Prev / Next Strip */
.pn {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 48px;
  font-size: 10px;
  color: var(--dim);
  gap: 16px;
}
.pn a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: color .18s ease;
}
.pn a:hover { color: var(--acc); }
.pn a:last-child { justify-self: end; text-align: right; }
.pn-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
  opacity: .8;
  transition: opacity .2s, border-color .2s;
}
.pn a:hover .pn-thumb { opacity: 1; border-color: var(--line-hi); }

/* Fullscreen Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 5, 8, .96);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 90px #000;
}
#lb-close {
  position: fixed;
  top: 22px;
  right: 28px;
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 10px;
  cursor: pointer;
}
#lb-close:hover { color: var(--acc); }

@media (max-width: 760px) {
  header { padding: 16px 20px; }
  .topnav { display: none; }
  #menubtn { display: inline-block; }
  main { padding: 94px 20px 36px; }
  footer { padding: 26px 20px 34px; }
  .wgrid { grid-template-columns: 1fr; gap: 36px; }
  .plate-grid { grid-template-columns: 1fr; gap: 20px; }
  .cta-box { align-items: flex-start; }
  .pn-thumb { display: none; }
}
