/* pp3d.css — /pixpicker's two WebGL scenes: the Aperture scroll story in
   "How it works" (aperture.js) and the Light Box in "Why was this set aside?"
   (lightbox.js). Loaded by pixpicker.html after site.css. The landing page's
   orbit lives in home.css with the rest of that page.

   Every scene has a flat version: html.no3d (set when WebGL or a module
   fails) and <noscript> both put it back. Classes are prefixed ap- and lb-;
   .pp3d-pause is the shared stop button, also styled in home.css. */

/* The stop button, as on the landing page. */
.pp3d-pause {
  position: absolute; right: 12px; top: 10px; z-index: 2;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(3, 52, 61, .6); color: #fff;
}
.pp3d-pause svg { width: 14px; height: 14px; fill: currentColor; }
.pp3d-pause .pp3d-i-play,
.pp3d-pause[aria-pressed="true"] .pp3d-i-pause { display: none; }
.pp3d-pause[aria-pressed="true"] .pp3d-i-play { display: block; }
.pp3d-pause:focus-visible { outline: 3px solid #00d0e8; outline-offset: 2px; }

/* ---------------------------------------------------------- Aperture --- */

/* Fixed dark in both themes, the way the chrome is: the frames fog into this
   ground in the shader, so it cannot follow the theme. Everything inside
   reads the chrome's text tokens, and the step hues take their bright values
   (the deep ones are for a pale ground). */
.ap-band {
  --ap-ink: #06171c;
  --ink: var(--chrome-text); --ink-dim: var(--chrome-dim);
  --line: rgba(228, 241, 243, .14); --edge: rgba(228, 241, 243, .3);
  --canvas-text: var(--chrome-text); --canvas-dim: var(--chrome-dim);
  --text-primary: var(--chrome-text); --text-secondary: var(--chrome-dim); --text-muted: var(--chrome-dim);
  --surface-2: #0b252c; --border: rgba(228, 241, 243, .14);
  --focus: #00d0e8;
  --fn-1: #00d0e8; --fn-2: #ff9e2c; --fn-3: #a78bfa; --fn-4: #fb7185; --fn-5: #40c830;
  background: var(--ap-ink); color: var(--chrome-text);
  padding-bottom: clamp(52px, 8vw, 88px);
}
.ap-band h2, .ap-band h3 { color: var(--chrome-text); }
.ap-band p { color: var(--chrome-dim); }
.ap-band .sec-intro { margin-bottom: 0; }

.ap-story { position: relative; }
/* The canvas stays on screen while the panels scroll over it. */
.ap-sticky {
  position: sticky; top: 0; z-index: 0;
  height: 100vh; height: 100svh; overflow: hidden;
}
.ap-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ap-labels { position: absolute; inset: 0; pointer-events: none; }
.ap-plabel {
  position: absolute; left: 0; top: 0; opacity: 0;
  text-align: center; white-space: nowrap; line-height: 1.25;
  font-size: 13px; font-weight: 600; color: var(--chrome-dim);
}
.ap-plabel b {
  display: block; font-size: 17px; font-weight: 760; color: var(--chrome-text);
  box-shadow: inset 0 -3px 0 var(--hue);
}
.ap-hud {
  position: absolute; right: clamp(18px, 4vw, 40px); top: 84px;
  text-align: right; pointer-events: none; transition: opacity .5s;
}
.ap-hud-n {
  display: block; min-height: 1em;
  font-size: clamp(38px, 4.4vw, 60px); font-stretch: 125%; font-weight: 800;
  line-height: 1; letter-spacing: -.02em; color: var(--chrome-text);
}
.ap-hud-l { font-size: 14px; color: var(--chrome-dim); }
.ap-pause { top: 168px; right: clamp(18px, 4vw, 40px); }
.ap-story:not(.is-live) .ap-pause { visibility: hidden; }

/* The panels: pulled up over the sticky stage, one screen each. */
.ap-panels {
  position: relative; z-index: 1;
  list-style: none; padding-top: 0; padding-bottom: 0;
  margin-top: -100vh; margin-top: -100svh;
}
.ap-panel {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding-block: 96px 64px;
}
.ap-card {
  max-width: 30rem;
  padding: 26px 28px 24px; border-radius: 20px;
  background: rgba(6, 23, 28, .78); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ap-card h3 {
  margin: 0 0 .45rem;
  font-size: clamp(28px, 3.4vw, 42px); font-stretch: 120%; font-weight: 780;
  line-height: 1.02; letter-spacing: -.02em;
}
.ap-card > p { margin: 0 0 .8rem; }
.ap-card > p:last-child { margin-bottom: 0; }
.ap-n {
  font-size: 15px; font-weight: 650; color: var(--chrome-text) !important;
  display: flex; align-items: center; gap: 10px;
}
.ap-n::before {
  content: ""; width: 22px; height: 6px; border-radius: 3px; background: var(--hue);
}
.ap-tally { font-variant-numeric: tabular-nums; }
.ap-tally:empty { display: none; }
.ap-tally b { color: var(--chrome-text); font-weight: 720; }
.ap-after { margin-top: clamp(28px, 4vw, 44px); }
.ap-after .step-card { background: #0b252c; border-color: var(--line); }

@media (max-width: 860px) {
  /* The iris sits in the top half; the cards ride up from the bottom. */
  .ap-panel { align-items: flex-end; padding-block: 50vh 32px; }
  .ap-card { padding: 20px 20px 18px; }
  .ap-hud { display: none; }
  .ap-pause { top: 72px; }
}

/* Flat: no canvas, the panels become a list of cards. */
.no3d .ap-sticky { display: none; }
.no3d .ap-panels { margin-top: clamp(28px, 4vw, 44px); }
.no3d .ap-panel { min-height: 0; padding-block: 0 16px; }

/* ---------------------------------------------------------- Light Box --- */

/* The desk on the left, the light box on the right. The desk is page
   furniture and follows the theme; the box is a light source, so it glows
   the same in both. */
.lb {
  display: grid; gap: clamp(20px, 3vw, 36px); align-items: center;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  margin-bottom: clamp(28px, 4vw, 44px);
}
.lb-desk { min-width: 0; }
.lb-desk-h {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  margin: 0 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--canvas-line);
}
.lb-desk-h > p:first-child { margin: 0; max-width: 18rem; color: var(--canvas-text); font-weight: 600; }
.lb-left { margin: 0; text-align: right; flex: none; }
.lb-left b {
  display: block; min-height: 1em;
  font-size: 40px; font-stretch: 120%; font-weight: 800; line-height: 1; color: var(--canvas-text);
}
.lb-left span { font-size: 13px; color: var(--canvas-dim); }
.lb-steps { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 10px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 640;
  color: var(--canvas-text); background: var(--canvas-2);
  border: 1.5px solid var(--canvas-line);
}
.lb-chip i {
  flex: none; display: grid; place-items: center; width: 16px; height: 16px;
  border-radius: 4px; border: 1.5px solid var(--canvas-dim);
}
.lb-chip i svg {
  width: 12px; height: 12px; opacity: 0;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.lb-chip small { font-size: 13px; font-weight: 520; color: var(--canvas-dim); }
.lb-chip small:empty { display: none; }
.lb-chip:hover { border-color: var(--canvas-edge); }
.lb-chip[aria-pressed="true"] { border-color: var(--hue, var(--canvas-text)); }
.lb-chip[aria-pressed="true"] i { background: var(--hue, var(--canvas-text)); border-color: var(--hue, var(--canvas-text)); }
.lb-chip[aria-pressed="true"] i svg { opacity: 1; }
/* The keeper ring is gold on the sheet; here gold is only a fill, under a
   dark tick, never text. */
.lb-keep { --hue: #e0a000; }
.lb-keep[aria-pressed="true"] i svg { stroke: #1d1600; }
.lb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lb-quiet {
  font: inherit; font-size: 15px; font-weight: 640; cursor: pointer;
  background: none; border: 0; padding: 8px 6px;
  color: var(--canvas-text); text-decoration: underline; text-underline-offset: 3px;
}

.lb-stage {
  position: relative; min-width: 0;
  height: clamp(420px, 66vh, 700px);
}
.lb-gl {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: pan-y; cursor: crosshair;
}
.lb-tag {
  position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none;
  padding: 8px 12px; border-radius: 10px; white-space: nowrap;
  font-size: 14px; line-height: 1.35; color: #f2fafb; background: #0f2a30;
  box-shadow: 0 8px 24px rgba(15, 42, 48, .22);
  transition: opacity .25s;
}
.lb-tag b { display: block; font-size: 13px; font-weight: 640; color: #9fc6cd; }
.lb .pp3d-pause { top: 8px; right: 8px; background: rgba(15, 42, 48, .7); }
.lb:not(.is-live) .pp3d-pause { visibility: hidden; }

/* Flat: a print of the sheet where the box was. */
.no3d .lb-stage canvas { display: none; }
.no3d .lb-stage { height: auto; aspect-ratio: 5 / 3; background: var(--lb-sheet) center / contain no-repeat; }

@media (max-width: 900px) {
  .lb { grid-template-columns: minmax(0, 1fr); }
  .lb-stage { order: -1; height: min(440px, 76vw); }
}
