/* ==========================================================================
   MUHCINE / lab
   One ring of tests, one of them able to come to the middle.
   ========================================================================== */

body.lab {
  overflow: hidden;
}

.lab-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  /* The ring takes the swipe itself, in any direction, instead of the page
     scrolling underneath it. */
  touch-action: none;
}

.lab-tile {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--tile-w, 64px);
  height: var(--tile-h, 85px);
  margin-left: calc(var(--tile-w, 64px) / -2);
  margin-top: calc(var(--tile-h, 85px) / -2);
  /* Deliberately not promoted to its own layer. A held layer is rasterised
     once at the size it was promoted at, which is exactly what blurred a test
     when it grew. Letting the browser redraw keeps every size sharp. */
  opacity: 0;
  cursor: pointer;
}

.lab-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.55s var(--ease);
  -webkit-user-drag: none;
}

.lab-tile img.is-ready {
  opacity: 1;
}

/* --- centre type ---------------------------------------------------------- */

.lab-lines {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 0 14vw;
  z-index: 10;
}

.lab-line {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  font-size: clamp(18px, var(--lab-text, 3.4vw), 90px);
  opacity: 0;
  max-width: 16ch;
}

html[dir="rtl"] .lab-line {
  letter-spacing: 0;
  line-height: 1.25;
}

/* Narrow screens show the top of the ring only. The tests sit across the
   middle of the page and the line goes above them. */
@media (max-width: 700px) {
  .lab-lines {
    padding: 0 8vw;
  }

  .lab-line {
    transform: translateY(-24vh);
    font-size: clamp(20px, 7vw, 34px);
    max-width: 14ch;
  }
}
