/*
  PLAYRS-MUSEUM-V1 -- owned by js/playrs-museum-v1.js.
  The museum behind ARCHER's frame. The hall is three.js; this file styles the chrome over it:
  top line, the work panel (bottom sheet on phones, right column on desktop), the index below.
  Theme tokens plus the site red; accents are red and black (Nate, 2026-10-25). The hall follows the
  theme in JS (white cube in light, dark gallery in dark).
*/
:root { --pmu-red: #e3261c; --pmu-black: #050505; }
:root[data-playrs-theme="light"] { --pmu-red: #d01f16; }
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--playrs-bg, #050505);
  color: var(--playrs-text, #f4f4f0);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
a { color: inherit; }

.pmu-shell { display: block; }

/* ---------- the hall ---------- */
.pmu-hall {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: var(--playrs-bg, #050505);
}
.pmu-stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y;          /* vertical scrolls the page, horizontal walks the hall */
  -webkit-tap-highlight-color: transparent;
}
.pmu-stage canvas { display: block; width: 100%; height: 100%; }
.pmu-stage.is-flat {            /* no WebGL: the current work, flat */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 340px;
}
.pmu-stage.is-flat img { max-height: 100%; max-width: 100%; box-shadow: 0 14px 40px rgba(0,0,0,.35); }

.pmu-top {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: max(20px, env(safe-area-inset-left, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: .16em;
  transition: opacity .4s ease;
}
.pmu-top p { margin: 0; }
.pmu-gate { justify-self: start; text-decoration: none; color: var(--playrs-text-muted, rgba(127,127,127,.9)); padding: 8px 0; }
.pmu-gate:hover, .pmu-gate:focus-visible { color: var(--playrs-text, currentColor); }
.pmu-mark { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; }
.pmu-mark::before, .pmu-eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--pmu-red); flex: none; }
.pmu-eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.pmu-mark span { font-weight: 400; color: var(--playrs-text-muted, rgba(127,127,127,.9)); }
.pmu-count { justify-self: end; font-variant-numeric: tabular-nums; color: var(--playrs-text-muted, rgba(127,127,127,.9)); }
.pmu-count #pmu-count-now { color: var(--pmu-red); font-weight: 700; }

/* ---------- the work panel ---------- */
.pmu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px max(20px, env(safe-area-inset-right, 0px))
           calc(var(--pmu-nav-h, 100px) + 14px)    /* clears the platform nav (measured in JS) */
           max(20px, env(safe-area-inset-left, 0px));
  background: var(--playrs-frosted, rgba(10,10,12,.55));
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border-top: 1px solid var(--playrs-border, rgba(255,255,255,.14));
  transition: transform .5s cubic-bezier(.16,1,.3,1), opacity .4s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pmu-panel { background: var(--playrs-frosted-fallback, rgba(7,7,8,.95)); }
}
.pmu-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pmu-eyebrow { margin: 0; font-size: 10px; font-weight: 500; letter-spacing: .16em; color: var(--playrs-text-muted, rgba(127,127,127,.9)); }
.pmu-title { margin: 0; font-size: clamp(20px, 5.6vw, 30px); font-weight: 700; letter-spacing: .1em; line-height: 1.15; }

.pmu-steps { display: flex; gap: 6px; }
.pmu-step {
  appearance: none;
  width: 40px;
  height: 36px;
  font: inherit;
  font-size: 14px;
  color: var(--playrs-text, currentColor);
  background: transparent;
  border: 1px solid var(--playrs-border-strong, rgba(255,255,255,.28));
  border-radius: 2px;
  cursor: pointer;
}
.pmu-step:disabled { opacity: .3; cursor: default; }

.pmu-rows { margin: 0; display: flex; flex-direction: column; }
.pmu-rows div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--playrs-border, rgba(255,255,255,.14));
  font-size: 11px;
  letter-spacing: .08em;
}
.pmu-rows div:first-child { border-top: 1px solid var(--playrs-border, rgba(255,255,255,.14)); }
.pmu-rows dt { color: var(--playrs-text-muted, rgba(127,127,127,.9)); font-size: 10px; letter-spacing: .14em; line-height: 1.7; }
.pmu-rows dd { margin: 0; overflow-wrap: anywhere; }
.pmu-rows .is-price dd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; }
.pmu-request { font-size: 10px; letter-spacing: .14em; color: var(--pmu-red); text-decoration: none; white-space: nowrap; }
.pmu-request:hover, .pmu-request:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.pmu-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.pmu-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-align: center;
  text-decoration: none;
  color: var(--playrs-text, currentColor);
  background: transparent;
  border: 1px solid var(--playrs-border-strong, rgba(255,255,255,.28));
  border-radius: 2px;
  cursor: pointer;
}
.pmu-btn.is-solid { background: var(--pmu-red); color: #fff; border-color: var(--pmu-red); }
.pmu-btn:hover, .pmu-step:not(:disabled):hover { background: var(--playrs-hover, rgba(255,255,255,.09)); }
.pmu-btn.is-solid:hover { background: var(--pmu-black); border-color: var(--pmu-black); color: #fff; }
.pmu-btn:focus-visible, .pmu-step:focus-visible, .pmu-close:focus-visible, .pmu-gate:focus-visible, .pmu-index a:focus-visible, .pmu-request:focus-visible {
  outline: 2px solid var(--playrs-focus, currentColor);
  outline-offset: 3px;
}
.pmu-note { margin: 0; font-size: 10px; line-height: 1.7; letter-spacing: .04em; color: var(--playrs-text-muted, rgba(127,127,127,.9)); }

.pmu-panel[hidden] { display: none; }   /* empty hall: no works, no panel */

/* Phones: keep the sheet short so the work stays the subject. */
@media (max-width: 899px) {
  .pmu-rows .pmu-row--medium, .pmu-panel .pmu-note { display: none; }
  .pmu-panel { gap: 10px; }
}

/* Desktop: the panel becomes a column beside the work. */
@media (min-width: 900px) {
  .pmu-panel {
    left: auto;
    right: 28px;
    top: 50%;
    bottom: auto;
    width: 350px;
    transform: translateY(-50%);
    padding: 22px;
    border: 1px solid var(--playrs-border, rgba(255,255,255,.14));
    border-radius: 3px;
    gap: 14px;
  }
}

/* VIEW: the work fills the hall, the chrome steps aside. */
.pmu-hall.is-viewing .pmu-panel { transform: translateY(105%); opacity: 0; pointer-events: none; }
@media (min-width: 900px) {
  .pmu-hall.is-viewing .pmu-panel { transform: translate(110%, -50%); }
}
.pmu-hall.is-viewing .pmu-top { opacity: 0; pointer-events: none; }
.pmu-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: max(16px, env(safe-area-inset-left, 0px));
  z-index: 4;
  appearance: none;
  min-height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--playrs-text, currentColor);
  background: var(--playrs-frosted, rgba(10,10,12,.55));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--playrs-border-strong, rgba(255,255,255,.28));
  border-radius: 2px;
  cursor: pointer;
}

/* ---------- index below the hall ---------- */
.pmu-index {
  padding: 56px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px));
  max-width: 1180px;
  margin: 0 auto;
}
.pmu-index-title { margin: 0 0 22px; font-size: 10px; font-weight: 500; letter-spacing: .18em; color: var(--playrs-text-muted, rgba(127,127,127,.9)); }
.pmu-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 16px;
}
@media (min-width: 900px) { .pmu-index-list { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pmu-index a { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.pmu-index a[aria-current="true"] img { border-color: var(--pmu-red); box-shadow: 0 0 0 1px var(--pmu-red); }
.pmu-index a[aria-current="true"] b { color: var(--pmu-red); }
.pmu-index img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border: 1px solid var(--playrs-border, rgba(255,255,255,.14));
}
.pmu-index-meta { display: flex; flex-direction: column; gap: 4px; font-size: 10px; letter-spacing: .12em; }
.pmu-index-meta b { font-size: 11px; letter-spacing: .1em; }
.pmu-index-meta span { color: var(--playrs-text-muted, rgba(127,127,127,.9)); }

/* ---------- veil: arrival from the gate, departure through a work ---------- */
.pmu-veil {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--pmu-black);
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s ease;
}
.pmu-veil.is-on { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  .pmu-veil, .pmu-panel, .pmu-top { transition: none; }
}
