/* ============================================================
   LAB page  ·  lab.css   — immersive WebGL gallery (needs base.css)
   ============================================================ */

/* When the WebGL gallery is active, the page is a fixed canvas. */
body.lab-active { overflow: hidden; height: 100svh; }
/* In immersive WebGL mode the footer would float into view (everything else is
   fixed/absolute). Nav already covers navigation, so hide it. The no-WebGL
   fallback is NOT .lab-active, so it keeps its scrollable footer. */
body.lab-active .footer { display: none; }

.lab-canvas {
  position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%;
  cursor: grab; touch-action: none;
}
.lab-canvas:active { cursor: grabbing; }
@media (hover: none) { .lab-canvas { cursor: auto; } }

/* Shared dark UI card look (intro + caption) */
.lab-intro, .lab-hud__item {
  background: rgba(15, 15, 17, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* Intro card (top-left) — compact, title left + copy on the right */
.lab-intro {
  position: fixed; left: var(--pad); top: clamp(5.5rem, 12vw, 7.5rem); z-index: 5;
  max-width: min(44ch, 90vw); pointer-events: none;
  display: flex; align-items: center; gap: clamp(0.8rem, 1.8vw, 1.2rem);
  padding: clamp(0.65rem, 1.5vw, 0.95rem) clamp(0.95rem, 2.2vw, 1.35rem);
}
.lab-intro__title { font-family: var(--ff-display); font-weight: 700; font-size: clamp(1.8rem, 4.4vw, 2.9rem); line-height: 0.85; letter-spacing: -0.03em; }
.lab-intro__desc {
  font-size: clamp(0.76rem, 0.95vw, 0.9rem); color: var(--cream-dim); line-height: 1.4; max-width: 30ch;
  padding-left: clamp(0.8rem, 1.8vw, 1.2rem); border-left: 1px solid var(--line);
}
.lab-intro__dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 0.45rem;
  box-shadow: 0 0 0 0 var(--accent); animation: lab-pulse 2.2s infinite;
}
@keyframes lab-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); }
  70%  { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* Caption (bottom): name + category, on hover AND tap. Drag hint on the right. */
.lab-hud {
  position: fixed; left: 0; right: 0; bottom: clamp(1.5rem, 4vw, 2.5rem); z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 var(--pad); pointer-events: none;
}
.lab-hud__item {
  padding: 0.7rem 1.1rem; display: flex; flex-direction: column; gap: 0.2rem;
  opacity: 0; transform: translateY(12px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.lab-hud.is-on .lab-hud__item { opacity: 1; transform: translateY(0); }
.lab-hud__name { font-family: var(--ff-display); font-weight: 700; font-size: clamp(1.2rem, 2.6vw, 1.9rem); letter-spacing: -0.02em; line-height: 1; }
.lab-hud__cat { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.lab-hud__hint { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-dim); display: flex; align-items: center; gap: 0.6rem; padding-bottom: 0.4rem; }
.lab-hud__hint i { width: 26px; height: 1px; background: currentColor; display: inline-block; }
@media (max-width: 600px) { .lab-hud__hint { display: none; } }

/* ---------- Fallback CSS grid (no WebGL / reduced motion) ---------- */
.lab-fallback { display: none; }
.lab-fallback.is-on { display: block; padding: clamp(8rem, 16vw, 11rem) var(--pad) 4rem; }
.lab-fallback__masonry { columns: 3; column-gap: clamp(0.8rem, 2vw, 1.5rem); }
.lab-fallback__item { break-inside: avoid; margin-bottom: clamp(0.8rem, 2vw, 1.5rem); position: relative; border-radius: 6px; overflow: hidden; }
.lab-fallback__item img { width: 100%; height: auto; display: block; }
.lab-fallback__cap { position: absolute; left: 0; bottom: 0; padding: 0.8rem 1rem; }
.lab-fallback__cap h4 { font-family: var(--ff-display); font-weight: 700; font-size: 1.1rem; }
.lab-fallback__cap span { font-size: 0.7rem; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 900px) { .lab-fallback__masonry { columns: 2; } }
@media (max-width: 540px) { .lab-fallback__masonry { columns: 1; } }
