/* ---------- lab scaffolding (lb- prefix; card chrome mirrors .feat__card) ---------- */
.lb-wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: clamp(48px, 8vh, 96px) var(--gutter) 120px; }
.lb-head { margin-bottom: clamp(40px, 7vh, 72px); }
.lb-head .section-sub { max-width: 62ch; }
.lb-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.lb-note { margin-top: 14px; font-size: 0.62rem; color: rgb(var(--ink-low)); }

.lb-cand { display: grid; grid-template-columns: 360px 1fr; gap: clamp(28px, 4vw, 64px); align-items: start; padding: clamp(40px, 6vh, 64px) 0; border-top: 1px solid rgb(var(--hairline) / 0.55); }
.lb-card { width: 360px; max-width: 100%; }
.lb-shot { position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid rgb(255 255 255 / 0.08); }
.lb-txt { margin: 18px 2px 0; color: rgb(var(--ink-muted)); font-size: 1rem; line-height: 1.55; }
.lb-txt strong { color: rgb(var(--ink-strong)); font-weight: 600; }

.lb-notes { padding-top: 6px; }
.lb-notes h3 { margin: 10px 0 0; font-weight: 600; letter-spacing: -0.02em; font-size: clamp(1.3rem, 2vw, 1.7rem); color: rgb(var(--ink-strong)); }
.lb-notes h3 .serif { color: rgb(var(--accent)); }
.lb-notes dl { margin: 20px 0 0; display: grid; grid-template-columns: 92px 1fr; row-gap: 12px; column-gap: 18px; font-size: 0.92rem; }
.lb-notes dt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-low)); padding-top: 3px; }
.lb-notes dd { margin: 0; color: rgb(var(--ink-muted)); max-width: 52ch; }
@media (max-width: 860px) { .lb-cand { grid-template-columns: 1fr; } .lb-card { margin: 0 auto; } }

/* shared chip / badge recipes (mirrors scp__chip / scp__badge) */
.lb-chip { font-family: var(--mono); font-size: 10.5px; line-height: 1; padding: 6px 10px; border-radius: 7px; cursor: pointer; background: rgb(var(--card)); border: 1px solid rgb(var(--hairline)); color: rgb(var(--ink-muted)); transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease); }
.lb-chip:hover { color: rgb(var(--ink)); }
.lb-chip.is-on { color: rgb(var(--accent)); border-color: rgb(var(--accent) / 0.5); background: rgb(var(--accent) / 0.1); }
.lb-chips { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 6px; justify-content: center; z-index: 5; }
.lb-badge { position: absolute; left: 10px; top: 10px; z-index: 5; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(255 255 255 / 0.75); background: rgb(8 8 10 / 0.55); border: 1px solid rgb(255 255 255 / 0.14); padding: 4px 8px; border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none; }

/* ---------- V1 · the colour card ---------- */
.cc { background: radial-gradient(120% 100% at 50% 0%, #131317 0%, #0c0c0f 60%, #09090b 100%); }
.cc__mount { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: 322px; background: #17171b; border: 1px solid rgb(255 255 255 / 0.10); border-radius: 10px; padding: 13px 13px 9px; box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.05); }
.cc__grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 2.5px; }
.cc__grey { display: grid; grid-template-columns: repeat(20, 1fr); gap: 1.5px; margin-top: 6px; }
.cc__grey .cc__p { aspect-ratio: auto; height: 13px; border-radius: 1.5px; }
.cc__p { aspect-ratio: 1; border-radius: 2px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.28); transition: background-color 0.55s var(--ease); cursor: crosshair; }
.cc__meta { display: flex; justify-content: space-between; margin-top: 9px; font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.18em; text-transform: uppercase; color: rgb(var(--ink-low)); }
.cc__tick { position: absolute; width: 9px; height: 9px; border-color: rgb(255 255 255 / 0.4); border-style: solid; border-width: 0; }
.cc__tick--tl { left: 5px; top: 5px; border-left-width: 1px; border-top-width: 1px; }
.cc__tick--tr { right: 5px; top: 5px; border-right-width: 1px; border-top-width: 1px; }
.cc__tick--bl { left: 5px; bottom: 5px; border-left-width: 1px; border-bottom-width: 1px; }
.cc__tick--br { right: 5px; bottom: 5px; border-right-width: 1px; border-bottom-width: 1px; }
.cc__read { position: absolute; left: 0; right: 0; bottom: 44px; text-align: center; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--ink-muted)); transition: color 0.3s; }
.cc__read b { color: rgb(var(--accent)); font-weight: 400; }

/* ---------- V2 · the drum scanner ---------- */
.dr { background: radial-gradient(120% 90% at 50% 20%, #101014 0%, #0a0a0d 55%, #060608 100%); }
.dr canvas.dr__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dr::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(115% 85% at 50% 36%, transparent 52%, rgb(0 0 0 / 0.5) 100%); }
.dr__floor { position: absolute; left: 10%; right: 10%; bottom: 24%; height: 40px; background: radial-gradient(50% 100% at 50% 50%, rgb(0 0 0 / 0.55), transparent 70%); filter: blur(6px); pointer-events: none; }
.dr__strip { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 44px; height: 54px; border-radius: 6px; overflow: hidden; background: #0b0b0e; border: 1px solid rgb(255 255 255 / 0.1); }
.dr__strip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 100% 0 0); }
.dr__strip::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: rgb(var(--accent)); left: var(--scan, 0%); opacity: var(--scanon, 0); box-shadow: 0 0 8px rgb(var(--accent) / 0.8); transition: opacity 0.4s; }
.dr__read { position: absolute; z-index: 2; left: 14px; bottom: 16px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-muted)); }
.dr__read b { color: rgb(var(--accent)); font-weight: 400; }
.dr__dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--accent)); margin-right: 7px; vertical-align: 1px; animation: drblink 1.1s steps(2, start) infinite; }
@keyframes drblink { to { visibility: hidden; } }
.dr.no3d canvas.dr__gl { display: none; }
.dr__fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: rgb(var(--ink-low)); font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.dr.no3d .dr__fallback { display: flex; }

/* ---------- V3 · the densitometer ---------- */
.dn { background: #0b0b0e; }
.dn__strip { position: absolute; left: 0; right: 0; top: 0; height: 38%; cursor: ew-resize; touch-action: none; }
.dn__strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dn__probe { position: absolute; top: 0; bottom: 0; left: 30%; width: 0; pointer-events: none; }
.dn__probe::before { content: ""; position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px; background: rgb(var(--accent) / 0.65); }
.dn__probe i { position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; transform: translate(-50%, -50%); border: 1px solid rgb(var(--accent)); border-radius: 50%; background: rgb(8 8 10 / 0.4); box-shadow: 0 0 10px rgb(var(--accent) / 0.5); }
.dn__probe i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; transform: translate(-50%, -50%); border-radius: 50%; background: rgb(var(--accent)); }
.dn__graph { position: absolute; left: 0; right: 0; top: 38%; bottom: 0; border-top: 1px solid rgb(255 255 255 / 0.08); }
.dn__graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dn__ro { position: absolute; right: 12px; top: 10px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--ink-muted)); }
.dn__ro b { color: rgb(var(--accent)); font-weight: 400; }
.dn__hint { position: absolute; left: 12px; top: 10px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-low)); transition: opacity 0.5s; }
.dn.touched .dn__hint { opacity: 0; }

/* ---------- V4 · the emulsion stack ---------- */
.dy { background: radial-gradient(120% 100% at 50% 0%, #121216 0%, #0b0b0e 60%, #08080a 100%); }
.dy__space { position: absolute; inset: 0 0 48px; perspective: 1100px; }
.dy__stack { position: absolute; left: 50%; top: 45%; width: 200px; aspect-ratio: 4 / 5; transform: translate(-50%, -50%); transform-style: preserve-3d; }
.dy__layer { position: absolute; inset: 0; border-radius: 6px; background: #fdfdfb; padding: 7px; box-shadow: 0 16px 34px -16px rgb(0 0 0 / 0.75); transition: transform 0.9s var(--ease), opacity 0.6s var(--ease); backface-visibility: hidden; }
.dy__layer canvas { width: 100%; height: 100%; display: block; border-radius: 3px; }
.dy__tag { position: absolute; left: 13px; bottom: 13px; font-family: var(--mono); font-size: 7.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(255 255 255 / 0.85); background: rgb(8 8 10 / 0.6); border: 1px solid rgb(255 255 255 / 0.15); padding: 3px 7px; border-radius: 999px; opacity: 0; transition: opacity 0.5s var(--ease) 0.4s; white-space: nowrap; }
.dy__full { position: absolute; inset: 0; border-radius: 6px; overflow: hidden; background: #000; transition: opacity 0.55s var(--ease), transform 0.9s var(--ease); z-index: 4; box-shadow: 0 16px 34px -16px rgb(0 0 0 / 0.75); }
.dy__full canvas { width: 100%; height: 100%; display: block; }
.dy.is-split .dy__full { opacity: 0; transform: rotateX(56deg) translate3d(0, -102px, 34px); pointer-events: none; }
.dy.is-split .dy__layer[data-l="y"] { transform: rotateX(56deg) translate3d(0, -102px, 34px); }
.dy.is-split .dy__layer[data-l="m"] { transform: rotateX(56deg) translate3d(0, 0, 0); }
.dy.is-split .dy__layer[data-l="c"] { transform: rotateX(56deg) translate3d(0, 102px, -34px); }
.dy.is-split .dy__tag { opacity: 1; }
.dy__read { position: absolute; left: 0; right: 0; bottom: 44px; text-align: center; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(var(--ink-muted)); }

/* ---------- V5 · spot the film ---------- */
.ab { background: #000; cursor: ew-resize; touch-action: none; }
.ab__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ab__img--b { clip-path: inset(0 0 0 var(--cut, 50%)); }
.ab__div { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 0; z-index: 3; pointer-events: none; }
.ab__div::before { content: ""; position: absolute; top: 0; bottom: 0; left: -0.5px; width: 1px; background: rgb(255 255 255 / 0.75); box-shadow: 0 0 10px rgb(0 0 0 / 0.6); }
.ab__div i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: rgb(10 10 12 / 0.62); border: 1px solid rgb(255 255 255 / 0.35); backdrop-filter: blur(4px); }
.ab__div i::before { content: "↔"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: rgb(255 255 255 / 0.8); }
.ab__tag { position: absolute; top: 10px; z-index: 4; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: rgb(255 255 255 / 0.85); background: rgb(8 8 10 / 0.5); border: 1px solid rgb(255 255 255 / 0.16); padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(6px); }
.ab__tag--a { left: 10px; } .ab__tag--b { right: 10px; }
.ab__ask { position: absolute; left: 0; right: 0; bottom: 44px; z-index: 4; text-align: center; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgb(255 255 255 / 0.85); text-shadow: 0 1px 8px rgb(0 0 0 / 0.8); transition: opacity 0.4s; }
.ab__ask b { color: rgb(var(--accent)); font-weight: 400; }
.ab__scrim { position: absolute; inset: auto 0 0; height: 120px; background: linear-gradient(to top, rgb(0 0 0 / 0.62), transparent); z-index: 2; pointer-events: none; }
.ab__frame { position: absolute; inset: 0; z-index: 3; opacity: 0; transition: opacity 0.7s var(--ease); pointer-events: none; }
.ab__frame.on { opacity: 1; }
.ab__frame .sp { position: absolute; left: 0; right: 0; height: 26px; background: rgb(6 6 8 / 0.92); display: flex; align-items: center; justify-content: space-around; }
.ab__frame .sp--t { top: 0; } .ab__frame .sp--b { bottom: 0; }
.ab__frame .sp i { width: 13px; height: 9px; border-radius: 2px; background: #17171c; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.07); }
.ab__frame .ed { position: absolute; left: 12px; top: 30px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.22em; color: rgb(255 151 24 / 0.85); text-transform: uppercase; }
.ab.revealed { cursor: default; }

/* the assembled section: an index RAIL of four chapters on the left, ONE exhibit frame on the
   right. The rail stretches to exactly the exhibit's height (owner: "graphic same height as the
   text") — its top and bottom hairlines land on the frame's edges, and the OPEN chapter absorbs
   the slack like an accordion in a fixed frame, so the two columns read as one rectangle. */
.lb-stagewrap { max-width: 1080px; margin: clamp(14px, 2.5vh, 28px) auto 0; padding: 0 var(--gutter); }
.lb-stage { position: relative; display: grid; grid-template-columns: minmax(236px, 290px) 1fr; gap: clamp(26px, 4.5vw, 60px); align-items: stretch; }
.lb-rail { display: flex; flex-direction: column; border-top: 1px solid rgb(var(--ink-low) / 0.28); min-width: 0; }
.lb-chap { border-bottom: 1px solid rgb(var(--ink-low) / 0.28); display: flex; flex-direction: column; }
.lb-chap.is-on { flex: 1; }
.lb-chap__name { display: block; width: 100%; text-align: left; padding: 15px 2px; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: rgb(var(--ink-low)); transition: color 0.25s var(--ease); }
.lb-chap__name i { font-style: normal; margin-right: 9px; color: rgb(var(--ink-low) / 0.7); transition: color 0.25s var(--ease); }
.lb-chap__name:hover { color: rgb(var(--ink-muted)); }
.lb-chap.is-on .lb-chap__name { color: rgb(var(--ink-strong)); cursor: default; }
.lb-chap.is-on .lb-chap__name i { color: rgb(var(--accent)); }
/* the open chapter's lesson unfolds inside the row (0fr -> 1fr keeps it in document flow) */
.lb-chap__drop { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.55s var(--ease); }
.lb-chap.is-on .lb-chap__drop { grid-template-rows: 1fr; }
.lb-chap__inner { overflow: hidden; min-height: 0; }
.lb-chap__inner > * { opacity: 0; transition: opacity 0.4s var(--ease); }
.lb-chap.is-on .lb-chap__inner > * { opacity: 1; transition-delay: 0.18s; }
.lb-sbody { margin: 4px 2px 0; color: rgb(var(--ink-muted)); font-size: 0.95rem; line-height: 1.55; }
.lb-sbody strong { color: rgb(var(--ink-strong)); font-weight: 600; }
/* the exhibit's one gesture, named quietly under the lesson */
.lb-cue { margin: 14px 2px 18px; font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(var(--ink-low)); }
.lb-chap__inner .lb-sbody:last-child { margin-bottom: 18px; }
/* right column: the exhibits, stacked in one frame; the ACTIVE one sets the column height */
.lb-exhibits { position: relative; min-width: 0; }
.lb-slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease), transform 0.55s var(--ease); transform: translateY(12px); }
.lb-slide.is-on { position: relative; opacity: 1; pointer-events: auto; transform: none; }
.lb-slidemedia { position: relative; min-width: 0; }
.lb-stage .lb-shot { position: relative; inset: auto; width: 100%; aspect-ratio: 4 / 3; }
.lb-stage .cc__mount { width: min(62%, 430px); }
.lb-stage .cc__grey .cc__p { height: 15px; }
/* Centre the portrait print in the lab frame and keep the whole exhibit PROPORTIONAL so it fits at
   every width (it was a fixed 244px print + fixed ±128px fan tuned for one frame size — anywhere
   narrower/shorter it jammed at the top, clipped at the bottom, and ran into the caption + chips):
   - the print caps at 40% of the frame width (244px unchanged on desktop);
   - the fan spread is a PERCENTAGE of the print (±42% ≡ the old ±128px at full size);
   - splitting LIFTS the stack a touch (top 50%→44%, animated) and FADES the caption — the fan gets
     the caption's room, the per-layer pills carry the labels, and the chips stay clear. */
.lb-stage .dy__stack { width: min(244px, 40%); top: 50%; transition: top 0.9s var(--ease); }
.lb-stage .dy.is-split .dy__stack { top: 44%; }
.lb-stage .dy__read { transition: opacity 0.45s var(--ease); }
.lb-stage .dy.is-split .dy__read { opacity: 0; }
.lb-stage .dy.is-split .dy__full,
.lb-stage .dy.is-split .dy__layer[data-l="y"] { transform: rotateX(56deg) translate3d(0, -42%, 42px); }
.lb-stage .dy.is-split .dy__layer[data-l="c"] { transform: rotateX(56deg) translate3d(0, 42%, -42px); }
@media (max-width: 820px) {
  /* single column: the chapter index first (a compact table of contents), the exhibit under it */
  .lb-stage { grid-template-columns: 1fr; gap: 18px; }
  .lb-slide:not(.is-on) { display: none; }
  .lb-stage .lb-shot { aspect-ratio: 4 / 3; }
}
/* Phones: the 4/3 frame is short, so the dye stack reserves the caption + chips zone (the space no
   longer runs under them), sits a touch smaller, and fans a touch tighter — keeps the split view
   fully inside the frame instead of running into "one frame · three dye layers" and the chips. */
@media (max-width: 560px) {
  .lb-stage .dy__space { inset: 0 0 88px; }
  .lb-stage .dy__stack { width: min(244px, 38%); }
  .lb-stage .dy.is-split .dy__stack { top: 50%; }   /* the space already excludes the caption zone here — no lift */
  .lb-stage .dy.is-split .dy__full,
  .lb-stage .dy.is-split .dy__layer[data-l="y"] { transform: rotateX(56deg) translate3d(0, -36%, 34px); }
  .lb-stage .dy.is-split .dy__layer[data-l="c"] { transform: rotateX(56deg) translate3d(0, 36%, -34px); }
}


/* solo capture mode: #solo=asm (the section) or #solo=v5 (for screenshots) */
body.solo .lb-head, body.solo .lb-note, body.solo .lb-cand, body.solo .lb-notes, body.solo .feat { display: none; }
body.solo .lb-cand.solo-on { display: grid; grid-template-columns: 360px; justify-content: center; border-top: 0; }
body.solo .feat.solo-on { display: block; }
.lb-stage { touch-action: pan-y; }

/* reduced motion: the exhibit appears settled, the open chapter is simply open */
@media (prefers-reduced-motion: reduce) {
  .lb-slide, .lb-chap__drop, .lb-chap__inner > *, .lb-chap__name { transition: none !important; }
  .lb-slide { transform: none; }
}
