/* Falls (falls.js): seven pieces in a grid, edge to edge, red boxes over parts of three, and a pressed box's part in a
   window over the grid; and each piece's stage (falls-tibumana.js, and the "type" sketches of falls-sketches.js; the
   "tiles" ones are Lettered's, lettered.css): the photograph, the type over its water (cut to the water by the mask
   falls-water.js makes, which falls-tibumana.js places), and its own red boxes. */

.falls-piece {
  position: relative;
}

.falls-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: min(100%, 80svh * 1.6);
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  overflow: hidden;
  background: #0e120f;
}

.falls-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.falls-cell .falls-stage,
.falls-zoom .falls-stage {
  position: absolute;
  inset: 0;
}

/* A part pulled out of its box: a window the box's shape over the middle of the grid, its edge the same thin red line,
   standing a little off the grid. It grows out of the box into place, and goes back the same way. */
.falls-zoom {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  overflow: hidden;
  border: 2px solid #ff3434;
  background: #0e120f;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.35);
  cursor: pointer;
  transform-origin: 0 0;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .falls-zoom {
    transition: none;
  }
}

/* In its drawer on the list: the grid edge to edge in the frame. */
.work-frame.falls-mini {
  position: relative;
  padding: 0;
}

.falls-mini .falls-collage {
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
}

.falls-stage {
  position: relative;
  overflow: hidden;
}

.falls-canvas,
.falls-water,
.falls-hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.falls-canvas {
  display: block;
}

.falls-water {
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* A layer painted a pixel to a cell (the large picture's ground, the "type" sketches' dark grounds), stretched over the
   cells by the browser: smoothly, or cell by cell (.falls-blocks). Its size, the cells', is set by its script. */
.falls-cells {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

.falls-blocks {
  image-rendering: pixelated;
}

/* The red boxes: plain, thin, solid outlines, nothing more. Pressable ones (Falls opened as a project) are buttons that
   look just the same; only the keyboard's focus marks one, with a second red line round it. (Scoped to the layer so
   a page's own button styles, as the Work page's, don't take the line away.) */
.falls-hud {
  pointer-events: none;
}

.falls-hud .falls-box {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 2px solid #ff3434;
  border-radius: 0;
  background: none;
}

.falls-hud button.falls-box {
  pointer-events: auto;
  cursor: pointer;
  appearance: none;
}

.falls-hud button.falls-box:focus {
  outline: none;
}

.falls-hud button.falls-box:focus-visible {
  outline: 1px solid #ff3434;
  outline-offset: 3px;
}
