/* ════════ Museum Piece theme — one painting, up close ════════ */

.mp-page {
  --ink: #16181c;
  --ink-2: #4a4f57;
  --paper: #f5f4f1;
  --paper-2: #e9e7e1;
  --rule: #d6d3cc;
  --accent: #1e4f6e;
  --gold: #a8823c;
  --serif: 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  position: relative;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.68;
}
.mp-page a { color: inherit; text-decoration: none; cursor: pointer; }
.mp-page .dim { color: var(--ink-2); opacity: 0.75; }

/* ── nav ── */
.mp-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px clamp(18px, 3.4vw, 44px);
  background: rgba(245, 244, 241, 0.96);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(3px);
}
.mp-brand b {
  display: block;
  font-family: var(--ui);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.mp-brand em { display: block; font-size: 11px; font-style: italic; color: var(--ink-2); }
.mp-nav nav { display: flex; gap: 22px; margin-left: auto; }
.mp-nav nav a {
  font-family: var(--ui);
  font-size: 13px;
  color: var(--ink-2);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.mp-nav nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.mp-btn {
  font-family: var(--ui);
  font-size: 12.5px;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  background: none;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.mp-btn:hover { background: var(--ink); color: var(--paper); }
.mp-btn.solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.mp-btn.solid:hover { background: #15384f; }

/* ── hero ── */
.mp-hero { padding: clamp(26px, 3.6vw, 46px) clamp(18px, 3.4vw, 44px) 34px; scroll-margin-top: 66px; }
.mp-hero-head { max-width: 64ch; margin-bottom: 22px; }
.mp-eyebrow {
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.mp-hero h1 { font-size: clamp(27px, 3.6vw, 42px); line-height: 1.14; font-weight: 400; }
.mp-by { margin-top: 8px; font-style: italic; color: var(--ink-2); }
.mp-lede { margin-top: 14px; color: var(--ink-2); max-width: 54ch; }

/* ── the viewer ── */
.mp-viewer { max-width: 1200px; margin: 0 auto; }
/* Height-led so the painting always fits inside the frame; width follows from
   the panel's real proportions, and drops back to the available width on
   narrow screens (height follows, ratio kept). */
.mp-stage {
  position: relative;
  height: clamp(280px, 44vh, 430px);
  aspect-ratio: var(--r, 1.7);
  max-width: 100%;
  margin-inline: auto;
  overflow: hidden;
  background: #10120f;
  border: 1px solid var(--rule);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  cursor: default;
  touch-action: none;
  /* keeps the light wash blending against the painting and nothing else */
  isolation: isolate;
}
.mp-viewer.is-zoomed .mp-stage { cursor: grab; }
.mp-stage.is-dragging { cursor: grabbing; }

.mp-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;              /* above the placeholder, so the points stay clickable */
  transform-origin: 0 0;
  will-change: transform;
}
.mp-art { position: absolute; inset: 0; z-index: 1; }

/* points of interest */
.mp-spots { position: absolute; inset: 0; z-index: 2; }
.mp-spot {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: rgba(30, 79, 110, 0.86);
  color: #fff;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.mp-spot span { display: block; line-height: 1; }
.mp-spot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  opacity: 0;
  animation: mp-ping 3.4s ease-out infinite;
}
.mp-spot:nth-child(2n)::after { animation-delay: 1.1s; }
.mp-spot:nth-child(3n)::after { animation-delay: 2.2s; }
.mp-spot:hover { background: var(--gold); }
.mp-spot.is-on { background: var(--gold); box-shadow: 0 0 0 4px rgba(168, 130, 60, 0.35); }
.mp-spot.is-on::after { animation: none; opacity: 0; }
@keyframes mp-ping {
  0% { opacity: 0.85; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.9); }
}

/* controls */
.mp-tools {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(16, 18, 15, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(3px);
}
.mp-tools button {
  width: 32px;
  height: 30px;
  font-family: var(--ui);
  font-size: 15px;
  color: #f2f0ec;
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 2px;
}
.mp-tools button:hover { background: rgba(255, 255, 255, 0.16); }
.mp-zoom {
  font-family: var(--ui);
  font-size: 11.5px;
  color: #cfcac2;
  padding: 0 8px 0 4px;
  min-width: 46px;
  text-align: right;
}

.mp-grab {
  position: absolute;
  left: 12px;
  bottom: 16px;
  z-index: 4;
  font-family: var(--ui);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.mp-grab.gone { opacity: 0; }

/* the detail card */
.mp-card {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  width: min(330px, 62%);
  padding: 16px 18px 14px;
  background: rgba(245, 244, 241, 0.97);
  border-left: 3px solid var(--gold);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44);
  animation: mp-card-in 0.28s ease-out;
}
@keyframes mp-card-in { from { opacity: 0; transform: translateY(-8px); } }
.mp-card-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.mp-card-x:hover { color: var(--ink); }
.mp-card-n {
  font-family: var(--ui);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.mp-card h3 { font-size: 18px; font-weight: 400; margin: 4px 0 6px; }
.mp-card p { font-size: 14px; color: var(--ink-2); }
.mp-card-nav { display: flex; gap: 8px; margin-top: 12px; }
.mp-card-nav button {
  font-family: var(--ui);
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.mp-card-nav button:hover { border-color: var(--ink); color: var(--ink); }

.mp-caption {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.mp-caption .dim { display: block; font-size: 11.5px; margin-top: 2px; }

.mp-note {
  margin-top: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(168, 130, 60, 0.09);
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 78ch;
}
.mp-note code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }

.mp-tourbar {
  max-width: 1200px;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
}

/* ── sections ── */
.mp-sec { padding: clamp(28px, 3.8vw, 50px) clamp(18px, 3.4vw, 44px); scroll-margin-top: 66px; border-top: 1px solid var(--rule); }
.mp-dark { background: var(--paper-2); }
.mp-head { margin-bottom: 22px; max-width: 64ch; }
.mp-head h2 { font-size: clamp(20px, 2.4vw, 27px); font-weight: 400; }
.mp-head p { margin-top: 8px; color: var(--ink-2); }

.mp-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2px 22px; max-width: 1200px; }
.mp-list button {
  display: flex;
  gap: 14px;
  width: 100%;
  /* keeps a row clear of the sticky header when it is scrolled or focused into view */
  scroll-margin-top: 84px;
  text-align: left;
  padding: 13px 12px 13px 4px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.mp-list button:hover { background: rgba(30, 79, 110, 0.06); }
.mp-list button.is-on { background: rgba(168, 130, 60, 0.11); }
.mp-list b {
  font-family: var(--ui);
  font-size: 12px;
  color: var(--gold);
  padding-top: 3px;
  flex: 0 0 auto;
}
.mp-list strong { display: block; font-weight: 400; font-size: 15.5px; margin-bottom: 2px; }
.mp-list span { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

.mp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px 36px; max-width: 1100px; }
.mp-cols h3 { font-weight: 400; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); padding-bottom: 7px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.mp-cols p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }

.mp-visit { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 30px; max-width: 760px; }
.mp-visit table { border-collapse: collapse; width: 100%; }
.mp-visit th { text-align: left; font-weight: 400; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.mp-visit td { text-align: right; padding: 8px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.mp-visit p { margin-bottom: 12px; }

.mp-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(18px, 3.4vw, 44px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  font-size: 12px;
}

/* ════════ the living layer — depth, weather, light ════════ */

/* the picture, inside the camera */
.lv-root { position: absolute; inset: 0; }
.lv-planes { position: absolute; inset: 0; will-change: filter; }

/* one copy of the source per depth plane, each masked to its own slice */
.lv-plane {
  position: absolute;
  inset: 0;
  will-change: transform;
  backface-visibility: hidden;
}
.lv-plane > * {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.lv-plane img {
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.mp-standin svg { display: block; width: 100%; height: 100%; }

/* the air in front of it, outside the camera */
.lv-air {
  --air: 1;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* the light of the hour, laid over the painting */
.lv-wash {
  position: absolute;
  inset: 0;
  mix-blend-mode: soft-light;
  transition: background 0.5s linear;
}
.lv-vig {
  position: absolute;
  inset: 0;
  background: radial-gradient(126% 104% at 50% 44%, transparent 34%, rgba(0, 0, 0, 0.92) 100%);
  opacity: 0.2;
  transition: opacity 0.5s linear;
}

/* cold air sitting on the ice */
.lv-mist {
  position: absolute;
  inset: 42% -12% -8%;
  overflow: hidden;
  opacity: calc(var(--air) * 0.9);
}
.lv-mist i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(236, 242, 246, 0.32), rgba(236, 242, 246, 0));
  filter: blur(7px);
  animation: lv-drift 54s ease-in-out infinite alternate;
}
.lv-mist i:nth-child(1) { left: -6%; top: 14%; width: 62%; height: 46%; }
.lv-mist i:nth-child(2) { left: 34%; top: 44%; width: 74%; height: 40%; opacity: 0.7; animation-duration: 71s; animation-delay: -22s; }
.lv-mist i:nth-child(3) { left: 12%; top: 66%; width: 52%; height: 34%; opacity: 0.55; animation-duration: 43s; animation-delay: -9s; }
@keyframes lv-drift {
  from { transform: translateX(-13%); }
  to   { transform: translateX(13%); }
}

.lv-snow { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the time of day, in reach */
.lv-clock {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(16, 18, 15, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(3px);
  pointer-events: auto;
  touch-action: auto;
  font-family: var(--ui);
  color: #e7e3db;
}
.lv-play {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: #f2f0ec;
  font-size: 10px;
  cursor: pointer;
}
.lv-play:hover { background: rgba(255, 255, 255, 0.16); }
.lv-time { width: 94px; accent-color: var(--gold); cursor: pointer; }
.lv-hour {
  min-width: 68px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cfcac2;
}

/* ── ?tune ── */
.lv-tuner {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 60;
  width: 250px;
  padding: 12px 14px;
  background: #12161b;
  border: 1px solid #2c3742;
  color: #dbe4ea;
  font-family: var(--ui);
  font-size: 12px;
  pointer-events: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}
.lv-tuner b { display: block; font-size: 13px; margin-bottom: 6px; }
.lv-tuner label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: #93a3b0; }
.lv-tuner input { flex: 1; accent-color: #1e4f6e; min-width: 0; }
.lv-tuner i { font-style: normal; width: 32px; text-align: right; color: #dbe4ea; }
.lv-tuner textarea {
  width: 100%;
  margin-top: 6px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  background: #0a0e12;
  color: #9fe0b4;
  border: 1px solid #2c3742;
  padding: 7px;
  resize: vertical;
}
.lv-tuner button {
  margin-top: 7px;
  width: 100%;
  padding: 7px;
  font: inherit;
  background: #1e4f6e;
  color: #fff;
  border: 0;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .lv-mist i { animation: none; }
}

/* ── hotspot editor ── */
.mp-editor {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  width: 300px;
  padding: 12px 14px;
  background: #12161b;
  border: 1px solid #2c3742;
  color: #dbe4ea;
  font-family: var(--ui);
  font-size: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}
.mp-editor b { display: block; font-size: 13px; margin-bottom: 3px; }
.mp-editor p { color: #93a3b0; margin-bottom: 8px; }
.mp-editor textarea {
  width: 100%;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  background: #0a0e12;
  color: #9fe0b4;
  border: 1px solid #2c3742;
  padding: 7px;
  resize: vertical;
}
.mp-editor button {
  margin-top: 7px;
  width: 100%;
  padding: 7px;
  font: inherit;
  background: #1e4f6e;
  color: #fff;
  border: 0;
  cursor: pointer;
}
.mp-viewer.is-editing .mp-spot { cursor: move; background: rgba(200, 60, 60, 0.9); }

@media (max-width: 820px) {
  .mp-nav nav { display: none; }
  .mp-card { left: 8px; top: 8px; width: min(300px, 78%); }
  .mp-grab { display: none; }
  .lv-hour { display: none; }
  .lv-time { width: 66px; }
}

/* ── the dust sheet arrival ── */
.unveil-overlay {
  position: absolute;
  inset: -4% -6% 0;
  z-index: 30;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.5));
}
.unveil-overlay .cloth-body {
  flex: 1;
  background:
    repeating-linear-gradient(97deg, rgba(120, 105, 78, 0.09) 0 2px, transparent 2px 27px),
    repeating-linear-gradient(-84deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 44px),
    linear-gradient(102deg, #efe9db 0%, #d6cebb 38%, #f2ece0 56%, #cbc3ae 100%);
}
.unveil-overlay .cloth-hem { flex: 0 0 58px; width: 100%; margin-top: -1px; }
.unveil-overlay .cloth-hem path { fill: #cbc3ae; }

.docked-obj.unveiling { animation: obj-glint 0.5s ease-out; }
@keyframes obj-glint {
  45% { filter: brightness(1.9) drop-shadow(0 0 18px rgba(255, 214, 130, 0.85)); transform: scale(1.05); }
}
