/* ============================================================= *
 *  Musée Fabre — Galerie des Colonnes
 *  Overlay design system. Editorial museum aesthetic tied to the
 *  interior: warm cream ink, terracotta, rose-marble, gilt gold.
 * ============================================================= */
:root {
  /* ink */
  --ink: #f5efe4;
  --ink-dim: rgba(245, 239, 228, 0.64);
  --ink-faint: rgba(245, 239, 228, 0.40);
  /* accents drawn from the room */
  --gold: #cca24b;
  --gold-soft: #e7d09a;
  --terra: #c46a45;
  --rose: #d9b6a0;
  /* surfaces */
  --bg: #0b0a08;
  --panel: rgba(16, 12, 8, 0.66);
  --hair: rgba(201, 162, 75, 0.30);
  --hair-soft: rgba(245, 239, 228, 0.16);

  /* type */
  --f-display: "Playfair Display", Georgia, serif;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-sans: "Inter", system-ui, sans-serif;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* layering */
  --z-scrim: 4;
  --z-grain: 6;
  --z-stage-ui: 15;
  --z-hud: 20;
  --z-detail: 25;
  --z-loader: 60;

  /* rhythm (spacious) */
  --pad-x: clamp(18px, 4vw, 52px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  /* Tall scroll track — the fixed canvas reads scroll progress from this height */
  height: 600vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* Global keyboard focus treatment */
:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 3px;
}
button:focus:not(:focus-visible) { outline: none; }

/* ---------- Atmosphere: vignette + legibility scrims + film grain ---------- */
/* Cinematic vignette over the 3D stage */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: var(--z-scrim); pointer-events: none;
  background: radial-gradient(125% 100% at 50% 40%, transparent 44%, rgba(8, 6, 4, 0.58) 100%);
}
.scrim {
  position: fixed; left: 0; right: 0; z-index: var(--z-scrim);
  pointer-events: none; height: 22vh;
}
.scrim-top { top: 0; background: linear-gradient(180deg, rgba(6, 5, 3, 0.55), transparent); }
.scrim-bottom { bottom: 0; height: 26vh; background: linear-gradient(0deg, rgba(6, 5, 3, 0.6), transparent); }
/* Fine gallery-photograph grain */
.grain {
  position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: radial-gradient(120% 90% at 50% 40%, #17130d 0%, #0b0a08 72%);
  display: grid;
  place-items: center;
  transition: opacity 1.1s ease 0.2s, visibility 1.1s ease 0.2s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; }
.loader-mark {
  font-family: var(--f-display); font-weight: 600;
  letter-spacing: 0.5em; font-size: clamp(20px, 4vw, 34px);
  color: var(--ink); padding-left: 0.5em;
}
.loader-bar {
  width: 190px; height: 2px; margin: 22px auto 14px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden; border-radius: 2px;
}
.loader-bar span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: slide 1.3s infinite ease-in-out;
}
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(360%); } }
.loader-note { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; left: 0; right: 0; z-index: var(--z-hud);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: clamp(16px, 2.6vw, 26px) var(--pad-x);
  pointer-events: none;
}
.hud-top { top: 0; animation: uiDown 0.9s var(--ease-out) 0.5s both; }
/* The hall's ceiling and skylights are near-white, so light HUD text can land
   on a blown-out background — worst in portrait, where the crop shows more
   ceiling. A soft top scrim guarantees legibility without a visible bar. */
.hud-top::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 190%;
  background: linear-gradient(to bottom, rgba(12, 8, 5, 0.55), rgba(12, 8, 5, 0));
  pointer-events: none; z-index: -1;
}
.hud-bottom { bottom: 0; animation: uiUp 0.9s var(--ease-out) 1.05s both; }
.wordmark {
  font-family: var(--f-display);
  font-weight: 600; letter-spacing: 0.26em; font-size: 15px;
  display: inline-flex; align-items: baseline; flex-wrap: wrap;
}
.wordmark span {
  font-family: var(--f-sans); font-weight: 300;
  letter-spacing: 0.16em; font-size: 10.5px; color: var(--ink-dim);
  margin-left: 12px; text-transform: uppercase;
}
.hud-meta, #credit {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-dim);
}
.hud-right { display: flex; align-items: center; gap: clamp(12px, 2vw, 22px); pointer-events: auto; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  background: rgba(20, 16, 10, 0.38); color: var(--ink-dim);
  border: 1px solid var(--hair); border-radius: 999px;
  cursor: pointer; font-family: var(--f-sans);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition:
    color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    background 0.35s var(--ease-out),
    transform 0.35s var(--ease-out);
}
.ghost-btn:hover { color: var(--ink); border-color: var(--gold); transform: translateY(-1px); }
.ghost-btn:active { transform: translateY(0); }
.ghost-btn.on { color: var(--gold); border-color: var(--gold); background: rgba(201, 162, 75, 0.14); }
.ghost-btn .audio-ico { font-size: 13px; }

/* ---------- Room navigation ---------- */
.room-nav {
  position: fixed; z-index: var(--z-hud); left: var(--pad-x); top: 50%;
  transform: translateY(-50%); display: flex; flex-direction: column; gap: 15px;
  pointer-events: auto; animation: uiFade 1s ease 0.85s both;
}
.nav-item {
  display: flex; align-items: center; gap: 14px;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--ink-dim); font-family: var(--f-sans);
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
  transition: color 0.35s var(--ease-out);
}
.nav-dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%; flex: none;
  border: 1px solid var(--hair); background: transparent;
  transition:
    background 0.35s var(--ease-out),
    transform 0.45s var(--ease-out),
    border-color 0.35s var(--ease-out),
    box-shadow 0.45s var(--ease-out);
}
.nav-text {
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out);
  will-change: opacity, transform;
}
.nav-item:hover .nav-text, .nav-item.active .nav-text { opacity: 1; transform: translateX(0); }
.nav-item:hover { color: var(--ink); }
.nav-item:hover .nav-dot { border-color: var(--gold); }
.nav-item.active { color: var(--gold); }
.nav-item.active .nav-dot { background: var(--gold); border-color: var(--gold); transform: scale(1.3); box-shadow: 0 0 0 4px rgba(201, 162, 75, 0.14); }

/* ---------- Portrait / artwork detail ---------- */
.detail {
  position: fixed; z-index: var(--z-detail); right: clamp(18px, 5vw, 68px); top: 50%;
  transform: translateY(-50%) translateX(28px); width: min(360px, 84vw);
  padding: 34px 34px 30px; border-radius: 5px;
  background: var(--panel); border: 1px solid var(--hair);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.6s var(--ease-out),
    visibility 0.5s;
  will-change: opacity, transform;
}
.detail.show { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); pointer-events: auto; }
.detail-kicker {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 16px;
}
.detail-title {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 32px);
  line-height: 1.08; margin-bottom: 16px;
}
.detail-title::after {
  content: ""; display: block; width: 34px; height: 1px;
  background: var(--hair); margin-top: 16px;
}
.detail-sub { font-weight: 300; font-size: 14px; line-height: 1.7; color: var(--ink-dim); }
.detail-close {
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink-dim);
  font-size: 24px; line-height: 1; cursor: pointer; transition: color 0.3s ease;
}
.detail-close:hover { color: var(--gold); }

/* ---------- Portrait lighting picker (inside detail panel) ---------- */
.detail-lighting { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--hair-soft); }
.detail-lighting-label {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 12px;
}
.detail-lighting-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lit-btn {
  min-height: 36px; padding: 8px 4px;
  background: rgba(20, 16, 10, 0.55); color: var(--ink-dim);
  border: 1px solid var(--hair); border-radius: 999px;
  cursor: pointer;
  font-family: var(--f-sans); font-size: 10.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  transition:
    color 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}
.lit-btn:hover { color: var(--ink); border-color: var(--gold); transform: translateY(-1px); }
.lit-btn:active { transform: translateY(0); }
.lit-btn.is-active {
  color: var(--gold); border-color: var(--gold);
  background: rgba(201, 162, 75, 0.14);
}

/* ---------- Intro ---------- */
.intro {
  position: fixed; z-index: var(--z-stage-ui); inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px; pointer-events: none;
  transition:
    opacity 0.85s var(--ease-out),
    transform 1.05s var(--ease-out),
    filter 0.85s var(--ease-out);
  will-change: opacity, transform, filter;
}
.intro::before {
  content: ""; position: absolute; z-index: -1;
  width: min(120vw, 1180px); height: min(92vh, 660px);
  background: radial-gradient(closest-side, rgba(8, 6, 4, 0.66), transparent 72%);
}
.intro.gone { opacity: 0; transform: translateY(-28px); filter: blur(7px); }
.intro-kicker {
  font-size: 12px; letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 22px;
  animation: introRise 1s var(--ease-out) 0.7s both;
}
.intro-title {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(58px, 15vw, 200px); line-height: 0.9;
  letter-spacing: 0.005em; text-shadow: 0 10px 70px rgba(0, 0, 0, 0.55);
  animation: introRise 1.1s var(--ease-out) 0.82s both;
}
.intro-sub {
  max-width: 34ch; margin: 28px auto 0;
  font-weight: 300; font-size: clamp(14px, 1.6vw, 17px); line-height: 1.75;
  color: var(--ink-dim);
  animation: introRise 1s var(--ease-out) 0.98s both;
}
.scroll-hint {
  position: absolute; bottom: 7.5vh; display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim);
  animation: uiFade 1s ease 1.4s both;
}
.scroll-hint i {
  width: 1px; height: 44px;
  background: linear-gradient(var(--gold), transparent);
  animation: drop 1.9s infinite ease-in-out;
}
@keyframes drop {
  0%, 100% { transform: scaleY(0.4); opacity: 0.3; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* ---------- Room label ---------- */
.room-label {
  position: fixed; z-index: var(--z-stage-ui); left: var(--pad-x); bottom: 12vh;
  display: flex; align-items: baseline; gap: 18px;
  opacity: 0; transform: translateY(20px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  pointer-events: none;
  will-change: opacity, transform;
}
.room-label::before {
  content: ""; position: absolute; left: 2px; top: -20px;
  width: 40px; height: 1px; background: var(--hair);
  opacity: 0; transition: opacity 0.7s ease 0.1s;
}
.room-label.show { opacity: 1; transform: translateY(0); }
.room-label.show::before { opacity: 1; }
.room-num {
  font-family: var(--f-serif); font-size: clamp(40px, 5vw, 56px); font-weight: 500;
  font-style: italic; color: var(--gold); line-height: 1;
}
.room-name {
  font-family: var(--f-display); font-size: clamp(21px, 3vw, 34px);
  font-weight: 500; max-width: 12ch;
}

/* ---------- Progress rail ---------- */
.progress-rail {
  position: fixed; z-index: var(--z-hud); right: clamp(14px, 3vw, 32px); top: 50%;
  transform: translateY(-50%); width: 2px; height: 36vh;
  background: rgba(245, 239, 228, 0.12); border-radius: 2px; overflow: hidden;
  animation: uiFade 1s ease 1.1s both;
}
#progressFill {
  position: absolute; top: 0; left: 0; width: 100%; height: 0%;
  background: linear-gradient(var(--gold-soft), var(--terra));
}

/* ---------- Entrance keyframes ---------- */
@keyframes uiFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes uiDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes uiUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes introRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Finale portal hint ---------- */
.enter-hint {
  position: fixed; z-index: 26; left: 50%; bottom: 9vh; transform: translate(-50%, 14px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s var(--ease-out), visibility 0.7s;
}
.enter-hint.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.enter-kicker { font-size: 11px; letter-spacing: 0.36em; text-transform: uppercase; color: #ef7ab4; }
.enter-line { font-family: var(--f-display); font-size: clamp(16px, 2vw, 20px); color: var(--ink); }
.enter-dest {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: #f2a7cd;
  padding-top: 4px; position: relative;
}
.enter-dest::after {
  content: ""; display: block; width: 26px; height: 1px; margin: 8px auto 0;
  background: linear-gradient(90deg, transparent, #ef7ab4, transparent); animation: pulseLine 1.8s ease-in-out infinite;
}
@keyframes pulseLine { 0%, 100% { opacity: 0.3; transform: scaleX(0.6); } 50% { opacity: 1; transform: scaleX(1); } }

/* ---------- Portal transition: the painting dissolves into particles ---------- */
#portal {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: 0; visibility: hidden;
}
#portal.active { opacity: 1; visibility: visible; }
/* gentle radial darkening so the swarm floats on deepening plum */
.portal-veil {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(125% 105% at 50% 45%, rgba(22, 10, 20, 0) 26%, rgba(22, 10, 20, 0.9) 100%);
}
#portal.active .portal-veil { animation: portalVeil 2.4s ease forwards; }
@keyframes portalVeil { 0% { opacity: 0; } 35% { opacity: 0.5; } 100% { opacity: 0.92; } }
/* final settle: the portfolio's deep-plum field with molecular glows */
.portal-end {
  position: absolute; inset: 0; opacity: 0;
  background:
    radial-gradient(42vmin 42vmin at 24% 30%, rgba(239, 122, 180, 0.18), transparent 62%),
    radial-gradient(52vmin 52vmin at 76% 66%, rgba(200, 90, 150, 0.15), transparent 62%),
    radial-gradient(30vmin 30vmin at 62% 18%, rgba(255, 190, 224, 0.12), transparent 60%),
    #160a14;
}
#portal.active .portal-end { animation: portalEnd 2.4s ease-in forwards; }
@keyframes portalEnd { 0%, 58% { opacity: 0; } 100% { opacity: 1; } }
/* the gallery UI bows out while the particles carry you through */
body.portal-on .hud, body.portal-on .room-nav, body.portal-on .progress-rail,
body.portal-on .exit-gallery, body.portal-on .grain {
  transition: opacity 0.8s ease; opacity: 0 !important; pointer-events: none;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .progress-rail { height: 28vh; }
}
@media (max-width: 640px) {
  .hud-meta { display: none; }
  .wordmark span { display: none; }
  .room-nav { gap: 13px; }
  .nav-text { display: none; }
  .room-label { bottom: 15vh; gap: 14px; }
  .progress-rail { height: 22vh; right: 12px; }
  .detail {
    right: 12px; left: 12px; width: auto; bottom: 5vh; top: auto;
    transform: translateY(28px);
  }
  .detail.show { transform: translateY(0); }
  #credit { font-size: 9.5px; letter-spacing: 0.14em; }
}

/* ---------- "View full size" button in the detail card ---------- */
.detail-enlarge {
  display: inline-flex; align-items: center; margin: 2px 0 18px;
  background: rgba(201, 162, 75, 0.10); color: var(--gold);
  border: 1px solid var(--hair); border-radius: 999px;
  padding: 8px 16px; min-height: 38px; cursor: pointer;
  font-family: var(--f-sans); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.detail-enlarge:hover { background: rgba(201, 162, 75, 0.2); border-color: var(--gold); color: var(--ink); }

/* ---------- Full-size zoomable lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(120% 120% at 50% 45%, rgba(10, 7, 5, 0.9), rgba(4, 3, 2, 0.97));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lightbox.show { opacity: 1; visibility: visible; pointer-events: auto; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
/* The frame wraps the artwork so the copyright mark zooms and pans WITH the
   image instead of floating over the viewport — you cannot scroll out from
   under it. */
.lb-frame {
  position: relative; line-height: 0;
  transform-origin: center center; transition: transform 0.12s ease-out;
  will-change: transform;
}
.lb-img {
  max-width: 88vw; max-height: 84vh; object-fit: contain; border-radius: 3px;
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(201, 162, 75, 0.25);
  user-select: none; -webkit-user-drag: none;
}
/* Tiled diagonal signature. Two stacked layers — a dark offset copy under a
   light one — so it stays legible on both pale and dark paintings. */
.lb-mark {
  position: absolute; inset: 0; pointer-events: none; border-radius: 3px;
  overflow: hidden; opacity: 0.55;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='188'%3E%3Ctext x='150' y='96' transform='rotate(-30 150 94)' text-anchor='middle' font-family='Georgia,Times,serif' font-size='19' letter-spacing='3' fill='rgba(0,0,0,0.30)'%3Eaanyaloyalka%3C/text%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='188'%3E%3Ctext x='150' y='94' transform='rotate(-30 150 94)' text-anchor='middle' font-family='Georgia,Times,serif' font-size='19' letter-spacing='3' fill='rgba(255,255,255,0.62)'%3Eaanyaloyalka%3C/text%3E%3C/svg%3E");
  background-repeat: repeat, repeat;
}
@media (prefers-reduced-motion: reduce) { .lb-frame { transition: none; } }
.lb-close {
  position: fixed; top: 22px; right: 26px; z-index: 2;
  width: 46px; height: 46px; display: grid; place-items: center;
  background: rgba(20, 16, 10, 0.5); color: var(--ink-dim);
  border: 1px solid var(--hair); border-radius: 999px;
  font-size: 26px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.lb-close:hover { color: var(--gold); border-color: var(--gold); }
.lb-meta {
  position: fixed; left: clamp(20px, 5vw, 60px); bottom: 8vh; z-index: 2; max-width: 60ch;
  pointer-events: none; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}
.lb-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 3vw, 38px); color: var(--ink); line-height: 1.05; }
.lb-sub { margin-top: 6px; font-weight: 300; font-size: 14px; color: var(--ink-dim); }
.lb-hint {
  position: fixed; left: 0; right: 0; bottom: 22px; z-index: 2; text-align: center;
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); pointer-events: none;
}
@media (max-width: 640px) {
  .lb-img { max-width: 94vw; max-height: 74vh; }
  .lb-meta { left: 16px; right: 16px; bottom: 12vh; }
  .lb-close { top: 14px; right: 14px; }
}


/* ---------- End-of-gallery "return to the main site" (fades in at the finale) ---------- */
.exit-gallery {
  position: fixed; z-index: 26; left: 50%; bottom: 9vh; transform: translate(-50%, 16px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; text-decoration: none;
  background: rgba(20, 16, 10, 0.5); color: var(--ink); border: 1px solid var(--gold);
  font-family: var(--f-sans); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out), visibility 0.6s, background 0.3s ease, color 0.3s ease;
}
.exit-gallery.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.exit-gallery:hover { background: rgba(201, 162, 75, 0.18); color: var(--gold-soft); }
