/* ---------- Spatial gallery hero ---------- */
.mv-hero {
  --hx-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  overflow: clip; isolation: isolate; background: var(--mv-bg);
}
.mv-hero__stage { position: absolute; inset: 0; }

/* WebGL wall */
.mv-hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1;
  opacity: 0; transition: opacity .9s var(--mv-ease);
  cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none;
}
.mv-hero.is-live .mv-hero__canvas { opacity: 1; }
.mv-hero.is-drag .mv-hero__canvas { cursor: grabbing; }
.mv-hero.is-hover .mv-hero__canvas { cursor: pointer; }
.mv-hero.is-detail .mv-hero__canvas { cursor: default; }

/* Static wall (no WebGL / reduced motion / no JS) */
.mv-hero__fallback { position: absolute; inset: 0; overflow: hidden; perspective: 1400px; transition: opacity .6s; }
.mv-hero.is-live .mv-hero__fallback { opacity: 0; visibility: hidden; }
/* With JS the static wall stays hidden until the script decides it's needed (no placeholder flash) */
html.js .mv-hero:not(.is-static) .mv-hero__fallback { opacity: 0; visibility: hidden; }
.mv-hero__wall {
  position: absolute; left: 50%; top: 46%; width: 132%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 7vw 5vw;
  transform: translate(-50%, -50%) rotateX(9deg) scale(1.02);
}
.mv-hero__frame { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mv-surface); }
.mv-hero__frame:nth-child(4n+1), .mv-hero__frame:nth-child(4n) { filter: blur(3px); opacity: .55; }
.mv-hero__frame img, .mv-hero__frame canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Shade so the headline always reads */
.mv-hero__shade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(to top, var(--mv-bg) 0%, color-mix(in srgb, var(--mv-bg) 78%, transparent) 16%, transparent 46%),
    linear-gradient(to bottom, color-mix(in srgb, var(--mv-bg) 70%, transparent) 0%, transparent 18%);
  transition: opacity .8s var(--mv-ease);
}
.mv-hero.is-detail .mv-hero__shade { opacity: .55; }

/* Cursor label */
.mv-hero__cursor {
  position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none;
  padding: 6px 10px; border-radius: 2px;
  background: var(--mv-text); color: var(--mv-bg);
  font: 500 .62rem/1 var(--hx-mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translate3d(-100px, -100px, 0) scale(.85); transition: opacity .25s, scale .25s;
}
.mv-hero.is-hover:not(.is-detail):not(.is-drag) .mv-hero__cursor { opacity: 1; scale: 1.18; }
@media (hover: none), (pointer: coarse) { .mv-hero__cursor { display: none; } }

/* Headline block */
.mv-hero__copy {
  position: absolute; z-index: 3; left: var(--mv-gutter); right: var(--mv-gutter); bottom: clamp(26px, 5vh, 52px);
  pointer-events: none; transition: opacity .6s var(--mv-ease), transform .8s var(--mv-ease);
}
.mv-hero.is-detail .mv-hero__copy { opacity: 0; transform: translateY(24px); }
.mv-hero__title {
  display: flex; flex-direction: column;
  font-family: var(--mv-font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.1rem, 4.4vw, 4.9rem); line-height: .95; letter-spacing: -.032em;
  color: var(--mv-text);
}
.mv-hero__line { display: block; width: max-content; max-width: none; white-space: nowrap; min-height: .9em; }
.mv-hero__title { position: relative; }
.mv-hero__ch { display: inline-block; will-change: transform, filter, opacity; }
.mv-hero__rule {
  position: absolute; left: 0; bottom: -.12em; width: min(100%, 4.2em); height: 2px;
  background: var(--mv-accent); transform: scaleX(0); pointer-events: none;
}
.mv-hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; margin-top: clamp(14px, 2.2vh, 22px); }
.mv-hero__hint { font: 500 .64rem/1.4 var(--hx-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mv-text-2); }
.mv-hero__hint::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; background: var(--mv-accent); transform: rotate(45deg) translateY(-1px); }
.mv-hero__btn { pointer-events: auto; }

/* Detail view */
.mv-hero__detail { position: absolute; inset: 0; z-index: 4; pointer-events: none; visibility: hidden; }
.mv-hero.is-detail .mv-hero__detail { visibility: visible; }
.mv-hero__detail > * { pointer-events: auto; opacity: 0; transform: translateY(14px); transition: opacity .5s var(--mv-ease), transform .7s var(--mv-ease); }
.mv-hero.is-detail .mv-hero__detail > * { opacity: 1; transform: none; transition-delay: .45s; }
.mv-hero__back {
  position: absolute; left: var(--mv-gutter); top: calc(var(--mv-header-h) + 8px);
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  font: 500 .64rem/1 var(--hx-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mv-text);
  border: 1px solid var(--mv-line-strong); border-radius: 4px; background: color-mix(in srgb, var(--mv-bg) 50%, transparent);
  transition: border-color .3s, background-color .3s;
}
.mv-hero__back svg { width: 15px; height: 15px; }
.mv-hero__back:hover { border-color: var(--mv-text); }
.mv-hero__info { position: absolute; left: var(--mv-gutter); bottom: clamp(26px, 5vh, 52px); max-width: min(440px, 42vw); }
.mv-hero__count, .mv-hero__dmeta { font: 500 .62rem/1.4 var(--hx-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mv-text-2); }
.mv-hero__count [data-d-num] { color: var(--mv-accent); }
.mv-hero__dtitle { margin-top: 12px; font-family: var(--mv-font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.6rem, 2.6vw, 2.5rem); line-height: .95; letter-spacing: -.035em; }
.mv-hero__dmeta { margin-top: 10px; }
.mv-hero__dtext { margin-top: 12px; font-size: .9rem; line-height: 1.55; color: var(--mv-text-2); }
.mv-hero__more[hidden] { display: none; }
.mv-hero__more { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font: 500 .66rem/1 var(--hx-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mv-accent); border-bottom: 1px solid currentColor; padding-bottom: 5px; }
.mv-hero__nav { position: absolute; right: var(--mv-gutter); bottom: clamp(26px, 5vh, 52px); display: flex; align-items: center; gap: 16px; }
.mv-hero__nav button { display: inline-flex; align-items: center; gap: 8px; font: 500 .66rem/1 var(--hx-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mv-text-2); padding: 10px 2px; transition: color .3s; }
.mv-hero__nav button:hover { color: var(--mv-text); }
.mv-hero__nav svg { width: 15px; height: 15px; }
.mv-hero__sep { width: 1px; height: 14px; background: var(--mv-line-strong); }

/* Black / white switch */
.mv-hero__mode { position: absolute; z-index: 4; right: var(--mv-gutter); bottom: clamp(26px, 5vh, 52px); display: flex; border: 1px solid var(--mv-line-strong); border-radius: 4px; overflow: hidden; transition: opacity .5s; }
.mv-hero__mode button { width: 38px; height: 38px; display: grid; place-items: center; color: var(--mv-text-2); transition: background-color .3s, color .3s; }
.mv-hero__mode button[aria-pressed="true"] { background: var(--mv-text); color: var(--mv-bg); }
.mv-hero.is-detail .mv-hero__mode { opacity: 0; pointer-events: none; }

/* Keyboard access to frames */
.mv-hero__list { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mv-hero__list:focus-within { position: absolute; z-index: 6; left: var(--mv-gutter); top: calc(var(--mv-header-h) + 8px); width: auto; height: auto; clip: auto; display: flex; flex-wrap: wrap; gap: 6px; max-width: 60vw; }
.mv-hero__list button { padding: 6px 10px; border: 1px solid var(--mv-line-strong); border-radius: 4px; background: var(--mv-bg); font: 500 .62rem/1 var(--hx-mono); letter-spacing: .12em; text-transform: uppercase; }

/* Entrance (only when JS animates it) */
html.js:not(.reduce) .mv-hero__title, html.js:not(.reduce) .mv-hero__meta, html.js:not(.reduce) .mv-hero__mode { visibility: hidden; }

@media (max-width: 899px) {
  .mv-hero__wall { grid-template-columns: repeat(2, 1fr); width: 150%; gap: 8vw; }
  .mv-hero__frame:nth-child(4n+1), .mv-hero__frame:nth-child(4n) { filter: none; opacity: 1; }
  .mv-hero__frame:nth-child(odd) { filter: blur(2px); opacity: .6; }
  .mv-hero__info { max-width: none; right: var(--mv-gutter); bottom: 84px; }
  .mv-hero__dtext { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .mv-hero__nav { left: var(--mv-gutter); right: var(--mv-gutter); bottom: 26px; justify-content: space-between; border-top: 1px solid var(--mv-line); padding-top: 8px; }
  .mv-hero__sep { display: none; }
}
@media (max-width: 599px) {
  .mv-hero__title { font-size: clamp(2.1rem, 10.5vw, 3.2rem); }
  .mv-hero__copy { bottom: 28px; }
  .mv-hero__meta { padding-right: 90px; }
  .mv-hero__meta { gap: 12px; }
  .mv-hero__mode { bottom: 28px; }
  .mv-hero__mode button { width: 36px; height: 36px; }
}
