/* Lab index — a wall of work rather than a list of links.
   Scoped to this page: the shared stylesheet is untouched, and the page's CSP
   is style-src 'self', so this has to be a file, not an inline <style>. */

/* The grid needs more room than the reading measure the rest of the site uses. */
.lab-page { max-width: 74rem; }

.lab-lede { color: var(--dim); margin: 0 0 2.6rem; }

.lab-grid {
  list-style: none;
  margin: 0 0 3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
  gap: clamp(1.1rem, 3vw, 1.9rem);
}

.lab-tile { display: block; text-decoration: none; color: inherit; }

/* Painted as a background rather than an <img>: same call the galleries make,
   so there is no native save-as target anywhere in the Lab. The work's name
   sits beside it as real text, so nothing is lost to a screen reader. */
.lab-shot {
  display: block;
  aspect-ratio: 1000 / 1414;
  background-size: cover;
  background-position: center;
  background-color: #0a0a0c;
  border: 1px solid var(--hair);
  transition: border-color .18s ease, transform .18s ease;
}
.lab-tile:hover .lab-shot,
.lab-tile:focus-visible .lab-shot {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.lab-tile:focus-visible { outline: none; }

.lab-name {
  display: block;
  margin: 0.85rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.lab-tile:hover .lab-name { color: var(--accent); }

.lab-note {
  display: block;
  margin: 0.3rem 0 0;
  color: var(--dim);
  font-size: 0.92rem;
  line-height: 1.6;
}

.shot-halation   { background-image: url("/lab/halation.jpg"); }
.shot-kasure     { background-image: url("/lab/kasure.jpg"); }
.shot-electrical { background-image: url("/lab/electrical.jpg"); }
.shot-engram     { background-image: url("/lab/engram.jpg"); }
.shot-rosette    { background-image: url("/lab/rosette.jpg"); }

.lab-more { font-size: 0.92rem; color: var(--faint); border-top: 1px solid var(--hair); padding-top: 1.6rem; }

@media (prefers-reduced-motion: reduce) {
  .lab-shot { transition: none; }
  .lab-tile:hover .lab-shot, .lab-tile:focus-visible .lab-shot { transform: none; }
}

/* On a phone a single full-width tile is most of a screen each, so four of
   them is a long scroll past one picture at a time. Two up reads as a wall. */
@media (max-width: 40rem) {
  .lab-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .lab-name { font-size: 0.92rem; }
  .lab-note { font-size: 0.84rem; }
}

/* The baked JPEG is the first paint and the fallback; the live canvas fades in
   over it once its engine has produced a frame. */
.lab-shot { position: relative; overflow: hidden; }
.lab-live {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity .45s ease;
}
.lab-shot.is-live .lab-live { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .lab-live { transition: none; }
}
