/* ============================================================
   BASE TOKENS / RESET — identical to V1
   ============================================================ */
:root{
  --ink:#0A0A0A;
  --paper:#FFFFFF;
  --grey:#6F6F6F;
  --hair: rgba(10,10,10,0.14);
  --hair-strong: rgba(10,10,10,0.28);
}
*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior:auto; } *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; } }
body{ background:var(--paper); color:var(--ink); font-family:'Lora', serif; -webkit-font-smoothing:antialiased; min-height:100vh; }
img{ display:block; width:100%; height:100%; object-fit:cover; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--ink); color:var(--paper); }
:focus-visible{ outline:2px solid var(--ink); outline-offset:3px; }

.gx-body{ overflow:hidden; height:100vh; height:100dvh; background:#0A0A0A; }
.gx{ position:fixed; inset:0; width:100%; height:100%; overflow:hidden; }

/* ============================================================
   ENTRY / HERO — LOCKED. Copied verbatim from the approved V1
   mock. Typography, image, hierarchy and ENTER GALLERY are
   unchanged. Only what happens AFTER the click is new.
   ============================================================ */
.gx-mark{
  font-family:'Poppins', sans-serif; font-weight:700; font-size:14px;
  letter-spacing:-0.01em; color:#fff; margin-bottom:34px; opacity:0.92;
}
.gx-hero{
  position:absolute; inset:0; z-index:5; overflow:hidden;
  opacity:1; visibility:visible;
  transition: opacity 900ms cubic-bezier(.22,.61,.36,1), visibility 900ms;
}
.gx-hero.is-exited{ opacity:0; visibility:hidden; pointer-events:none; }
.gx-hero-img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:center 40%;
}
.gx-hero-scrim{
  position:absolute; inset:0; z-index:1;
  background:linear-gradient(180deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.22) 32%, rgba(0,0,0,0.32) 58%, rgba(0,0,0,0.82) 100%);
}
.gx-hero-content{
  position:relative; z-index:2; height:100%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:32px;
}
.gx-hero-eyebrow{
  font-family:'Poppins', sans-serif; font-weight:500; letter-spacing:0.28em;
  text-transform:uppercase; font-size:11px; color:rgba(255,255,255,0.78); margin-bottom:22px;
}
.gx-hero-title{
  font-family:'Poppins', sans-serif; font-weight:700; color:#fff;
  font-size:clamp(52px, 9vw, 108px); line-height:0.92; letter-spacing:-0.01em;
}
.gx-hero-sub{
  font-family:'Poppins', sans-serif; font-weight:500; letter-spacing:0.2em;
  text-transform:uppercase; font-size:12px; color:rgba(255,255,255,0.72);
  margin-top:20px; margin-bottom:52px;
}
.gx-enter{
  font-family:'Poppins', sans-serif; font-weight:500; font-size:11.5px;
  letter-spacing:0.22em; text-transform:uppercase; color:#fff;
  background:transparent; border:1px solid rgba(255,255,255,0.55);
  padding:16px 34px; cursor:pointer;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.gx-enter:hover, .gx-enter:focus-visible{
  background:#fff; color:#0A0A0A; border-color:#fff;
}

/* ============================================================
   3D GALLERY — new in V2
   ============================================================ */
.gx-stage{
  position:absolute; inset:0; z-index:3;
  background:#141311;
  overflow:hidden;
  opacity:0; visibility:hidden;
  transition: opacity 1400ms ease;
  touch-action:none;
}
.gx-stage.is-active{ opacity:1; visibility:visible; }

.gx-world{
  position:absolute; left:50%; top:50%; width:0; height:0;
  transform-style:preserve-3d;
  will-change:transform;
}
.gx-world.is-animating{ transition: transform 1500ms cubic-bezier(.19,.62,.24,1); }

/* generic 3D plane primitive: centered on its own middle, then placed */
.gx-plane{
  position:absolute; left:0; top:0;
  transform-style:flat;
}

.gx-wallplane{
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.03) 45%, rgba(0,0,0,0.12) 100%),
    linear-gradient(180deg, #EDEBE5 0%, #E4E2DA 55%, #D9D7CD 100%);
  background-image:
    repeating-linear-gradient(90deg, rgba(10,10,10,0.045) 0, rgba(10,10,10,0.045) 1px, transparent 1px, transparent 340px),
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.03) 45%, rgba(0,0,0,0.12) 100%),
    linear-gradient(180deg, #EDEBE5 0%, #E4E2DA 55%, #D9D7CD 100%);
}

.gx-floorplane{
  background:
    linear-gradient(180deg, rgba(10,9,8,0.55) 0%, rgba(14,13,11,0.94) 55%, rgba(8,7,6,0.98) 100%);
}

.gx-ceilplane{
  background: radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255,255,255,0.14), rgba(0,0,0,0) 70%),
              linear-gradient(180deg, #C9C7BE 0%, #DAD8CF 100%);
}

.gx-endcap{
  background: linear-gradient(180deg, #E9E7E0 0%, #DEDCD3 100%);
}

/* artwork panel — same visual vocabulary as V1 (.gx-frame / .gx-caption) */
.gx-panel{
  position:absolute; left:0; top:0;
  display:flex; flex-direction:column; align-items:center;
  cursor:zoom-in;
  transition: opacity 700ms ease;
}
.gx-panel.is-dim{ opacity:0.86; }
.gx-frame{
  position:relative; display:block; width:100%; height:100%; background:#FDFDFC;
  padding:2.6%;
  box-shadow:0 30px 70px rgba(0,0,0,0.34), 0 6px 18px rgba(0,0,0,0.18);
}
.gx-frame::before{
  content:""; position:absolute; inset:-16%; z-index:-1; opacity:0.85;
  background:radial-gradient(closest-side, rgba(255,255,255,0.5), rgba(255,255,255,0) 72%);
}
.gx-imgclip{
  display:block; width:100%; height:100%; overflow:hidden;
}
.gx-frame img{
  display:block; width:100%; height:100%; object-fit:contain;
  transform-origin:center center;
  touch-action:none;
}
.gx-frame.is-zoomed{ cursor:grab; }
.gx-frame.is-zoomed:active{ cursor:grabbing; }
.gx-caption{
  margin-top:3.4%; font-family:'Poppins', sans-serif;
  letter-spacing:0.14em; text-transform:uppercase; color:var(--grey);
  text-align:center; opacity:0; transition:opacity 900ms ease;
  white-space:nowrap;
}
.gx-panel.is-current .gx-caption{ opacity:1; }

.gx-vignette{
  position:absolute; inset:0; z-index:6; pointer-events:none;
  background: radial-gradient(ellipse 78% 78% at 50% 46%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.5) 100%);
  opacity:0; transition:opacity 800ms ease;
}
.gx-vignette.is-dimmed{ opacity:1; }

/* ===== MINIMAL NAV OVERLAY (unchanged in spirit from V1) ===== */
.gx-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:60;
  display:flex; align-items:center; justify-content:space-between;
  padding:24px clamp(20px, 4vw, 48px);
  opacity:0; visibility:hidden; pointer-events:none; color:#fff;
  transition: opacity 500ms ease, visibility 500ms;
}
.gx-nav.is-active{ opacity:1; visibility:visible; pointer-events:auto; }
.gx-nav-count{ font-family:'Poppins', sans-serif; font-size:11px; letter-spacing:0.14em; min-width:70px; }
.gx-nav-controls{ display:flex; gap:26px; }
.gx-nav-btn{
  font-family:'Poppins', sans-serif; font-weight:500; font-size:11px;
  letter-spacing:0.18em; text-transform:uppercase; color:inherit;
  background:none; border:none; cursor:pointer; padding:6px 2px;
  border-bottom:1px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gx-nav-btn:hover{ border-color:currentColor; }
.gx-nav-btn:disabled{ opacity:0.32; cursor:default; }
.gx-exit{ min-width:70px; text-align:right; }

/* ===== DETAIL INFO (title/meta only — the artwork itself IS the
   room's own panel, dollied close; no separate modal) ===== */
.gx-detail-info{
  position:fixed; left:0; right:0; bottom:104px; z-index:55;
  text-align:center; pointer-events:none;
  opacity:0; transition:opacity 700ms ease;
}
.gx-detail-info.is-active{ opacity:1; }
.gx-detail-title{
  font-family:'Poppins', sans-serif; font-weight:600; font-size:15px;
  letter-spacing:0.01em; color:#fff; margin-bottom:10px;
}
.gx-detail-meta{ display:flex; gap:20px; justify-content:center; flex-wrap:wrap; }
.gx-detail-meta > div{ display:flex; gap:7px; align-items:baseline; }
.gx-detail-meta dt{
  font-family:'Poppins', sans-serif; font-size:9.5px; letter-spacing:0.16em;
  text-transform:uppercase; color:rgba(255,255,255,0.42);
}
.gx-detail-meta dd{
  font-family:'Poppins', sans-serif; font-size:10.5px; letter-spacing:0.06em;
  color:rgba(255,255,255,0.82);
}
.gx-zoom{
  display:flex; align-items:center; justify-content:center; gap:14px;
  margin-top:16px; pointer-events:auto;
}
.gx-zoom-btn{
  font-family:'Poppins', sans-serif; font-weight:500; font-size:13px; line-height:1;
  color:rgba(255,255,255,0.75); background:none; border:1px solid rgba(255,255,255,0.32);
  width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.gx-zoom-btn:hover{ color:#fff; border-color:rgba(255,255,255,0.7); }
.gx-zoom-btn:disabled{ opacity:0.3; cursor:default; }
.gx-zoom-pct{
  font-family:'Poppins', sans-serif; font-size:10px; letter-spacing:0.1em;
  color:rgba(255,255,255,0.55); min-width:36px; text-align:center;
}

.gx-detail-close{
  position:fixed; top:28px; right:32px; z-index:55;
  font-family:'Poppins', sans-serif; font-size:11px; letter-spacing:0.18em;
  text-transform:uppercase; color:rgba(255,255,255,0.65);
  background:none; border:none; cursor:pointer; pointer-events:none;
  opacity:0; transition:opacity 0.4s ease, color 0.2s ease;
}
.gx-detail-close.is-active{ opacity:1; pointer-events:auto; }
.gx-detail-close:hover{ color:#fff; }

@media (max-width:720px){
  .gx-nav{ padding:18px 20px; }
  .gx-nav-controls{ gap:18px; }
  .gx-detail-info{ bottom:88px; }

  /* ============================================================
     MOBILE-ONLY CORRECTION PASS (this block only — nothing above
     this point in the file was changed from the live production
     CSS). Desktop/tablet (>720px) is completely unaffected.
     ============================================================ */

  /* Priority 5 — 44x44 minimum touch targets via an invisible,
     independently-sized hit area (::after). The visible label
     size, padding and typography of the buttons are untouched;
     only the tappable area grows. */
  .gx-nav-btn,
  .gx-zoom-btn{ position:relative; }
  .gx-nav-btn::after,
  .gx-zoom-btn::after{
    content:"";
    position:absolute;
    top:50%; left:50%;
    transform:translate(-50%,-50%);
    width:max(44px, 100%);
    height:44px;
  }

  /* Priority 6 — iOS safe-area inset so nav controls never sit
     under the home-indicator gesture zone. Falls back to the
     existing 18px on devices/browsers without env() support. */
  .gx-nav{
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  /* Option 1 (compositing-pressure reduction). There is no per-panel
     will-change anywhere in this file — checked before writing this —
     the only will-change is the always-on one above, on .gx-world itself.
     Because .gx-world uses preserve-3d, that always-on hint keeps its
     entire rendered subtree (every active panel + plane) promoted to a
     GPU-composited layer permanently, not just while the camera is
     actually moving. On mobile only, this makes the promotion apply just
     for the duration of an actual camera flight: gallery.js toggles the
     is-animating class in setCamera() to match. Desktop is untouched —
     this override only exists inside this mobile media query, so the
     always-on rule above still applies there exactly as before. */
  .gx-world{ will-change:auto; }
  .gx-world.is-animating{ will-change:transform; }
}

/* ============================================================
   MOBILE-ONLY 2D EXHIBITION VIEWER — a completely separate
   presentation from the desktop 3D gallery above (.gx-stage /
   .gx-world / .gx-panel / .gx-plane, all untouched by this
   block). No preserve-3d, no perspective, no GPU-heavy scene:
   one <img> pair crossfading, sized with object-fit:contain so
   the artwork can never be cropped.

   .gxm-viewer is display:none UNCONDITIONALLY here, outside any
   media query, so it is structurally inert on every desktop/
   tablet viewport regardless of JS state. It only becomes a
   flex layout inside the media query below, which mirrors the
   JS isMobile test exactly: Math.min(innerWidth, innerHeight) <
   700, expressed here as (max-width:700px) OR (max-height:700px)
   so a phone in landscape (e.g. 844x390) still matches.
   ============================================================ */
.gxm-viewer{ display:none; }

@media (max-width:700px), (max-height:700px){
  .gxm-viewer{
    display:flex; flex-direction:column;
    position:fixed; inset:0; z-index:4;
    background:#141311;
    opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity 900ms ease, visibility 900ms;
  }
  .gxm-viewer.is-active{ opacity:1; visibility:visible; pointer-events:auto; }

  .gxm-exit{
    position:absolute; top:0; right:0; z-index:2;
    padding: max(18px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px 14px;
    font-family:'Poppins', sans-serif; font-size:11px; letter-spacing:0.18em;
    text-transform:uppercase; color:rgba(255,255,255,0.65);
    background:none; border:none; cursor:pointer;
  }
  .gxm-exit::after{ content:""; position:absolute; top:0; right:0; width:56px; height:56px; }
  .gxm-exit:active{ color:#fff; }

  .gxm-stage{
    flex:1; min-height:0;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding: 64px 24px 12px;
    gap:14px;
  }

  .gxm-frame{
    position:relative;
    width:min(100%, calc((100dvh - 210px) * 1));
    aspect-ratio:1 / 1;
    max-width:560px;
    background:#FDFDFC;
    padding:2.6%;
    box-shadow:0 20px 50px rgba(0,0,0,0.34), 0 5px 14px rgba(0,0,0,0.18);
  }
  /* Soft glow behind the frame — same treatment as the desktop .gx-frame,
     so the white matte fades gradually into the black background on every
     edge instead of ending on a hard line. */
  .gxm-frame::before{
    content:""; position:absolute; inset:-14%; z-index:-1; opacity:0.75;
    background:radial-gradient(closest-side, rgba(255,255,255,0.35), rgba(255,255,255,0) 72%);
  }
  .gxm-imgclip{
    position:relative; display:block; width:100%; height:100%; overflow:hidden;
  }
  .gxm-image{
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:contain; object-position:center;
    opacity:0; transition:opacity 500ms ease;
    transform-origin:center center;
    touch-action:none;
  }
  .gxm-image.is-active{ opacity:1; }

  .gxm-title{
    font-family:'Poppins', sans-serif; font-weight:600; font-size:13px;
    letter-spacing:0.08em; text-transform:uppercase; color:#fff;
    text-align:center; max-width:90%;
  }

  .gxm-zoom{
    display:flex; align-items:center; justify-content:center; gap:14px;
  }
  .gxm-zoom-btn{
    position:relative;
    font-family:'Poppins', sans-serif; font-weight:500; font-size:13px; line-height:1;
    color:rgba(255,255,255,0.75); background:none; border:1px solid rgba(255,255,255,0.32);
    width:28px; height:28px; display:flex; align-items:center; justify-content:center;
    cursor:pointer;
  }
  .gxm-zoom-btn::after{ content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:44px; height:44px; }
  .gxm-zoom-btn:disabled{ opacity:0.3; }
  .gxm-zoom-pct{
    font-family:'Poppins', sans-serif; font-size:10px; letter-spacing:0.1em;
    color:rgba(255,255,255,0.55); min-width:36px; text-align:center;
  }

  .gxm-nav{
    display:flex; align-items:center; justify-content:space-between;
    padding: 14px 20px max(18px, env(safe-area-inset-bottom));
    color:#fff;
  }
  .gxm-count{ font-family:'Poppins', sans-serif; font-size:11px; letter-spacing:0.14em; min-width:60px; }
  .gxm-nav-controls{ display:flex; gap:22px; }
  .gxm-nav-btn{
    position:relative;
    font-family:'Poppins', sans-serif; font-weight:500; font-size:11px;
    letter-spacing:0.18em; text-transform:uppercase; color:inherit;
    background:none; border:none; cursor:pointer; padding:6px 2px;
  }
  .gxm-nav-btn::after{ content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:max(44px,100%); height:44px; }
  .gxm-nav-btn:disabled{ opacity:0.32; }
}

@media (max-height:430px) and (max-width:900px){
  /* short landscape phones — trim vertical padding so the frame
     isn't squeezed too small between the exit/title/nav chrome */
  .gxm-stage{ padding-top:44px; gap:8px; }
  .gxm-frame{ width:min(100%, calc((100dvh - 140px) * 1)); }
  .gxm-nav{ padding-top:8px; padding-bottom:max(8px, env(safe-area-inset-bottom)); }
}
