/* More UI folder: screens on colour, the prototype film in a phone, the
   dashboard tour in a screen, and the viewer. The layout is shared (../case.css). */

.shot {
  width: 100%;
}

.shot-wide {
  aspect-ratio: 16 / 10;
}

.shot-pair {
  aspect-ratio: 4 / 3;
}

.shot-film {
  aspect-ratio: 16 / 10;
}

/* a low slide for a row of landscape screens */
.shot-band {
  aspect-ratio: 2 / 1;
}

.stage {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: 7%;
  background: var(--bg);
}

/* a screen: the design itself, on the slide's colour, opening full size on a click */
.screen {
  position: relative;
  display: block;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  /* the slide's colour rather than white: where the rounded corners are
     anti-aliased the background shows through as a hairline, white around a dark screen */
  background: var(--bg, #fff);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  transition: scale 0.5s var(--ease-out);
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
}

/* a tall screen shows its top, the rest in the viewer */
.screen-tall {
  align-self: stretch;
  flex: 1;
  min-height: 0;
}

@media (hover: hover) {
  .screen:hover {
    scale: 1.012;
  }
}

.screen:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* a film of a desktop screen, as a screen but not opening full size */
.film-screen {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg, #fff);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.08);
}

.film-screen video {
  display: block;
  width: 100%;
  height: auto;
}

/* a row of phones or tablets, side by side */
.row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3%;
  width: 100%;
}

.row .screen {
  flex: none;
}

.row-phone .screen {
  width: 22%;
  border-radius: 6% / 2.8%;
}

.row-tablet .screen {
  width: 31%;
  border-radius: 10px;
}

/* the prototype film in a phone */
.shot-film .stage {
  padding: 5% 7%;
}

.phone {
  height: 100%;
  aspect-ratio: 590 / 1278;
  overflow: hidden;
  border: 8px solid #141413;
  border-radius: 34px;
  background: #141413;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.45);
}

.phone video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 26px;
}

@media (max-width: 699px) {
  .shot-wide,
  .shot-pair,
  .shot-band {
    aspect-ratio: 4 / 3;
  }

  .shot-film {
    aspect-ratio: 3 / 4;
  }

  .phone {
    border-width: 5px;
    border-radius: 24px;
  }

  .phone video {
    border-radius: 19px;
  }
}

/* ── The viewer: the page in a large window, scrolled by hand ── */

.viewer {
  --dim: 1;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px clamp(16px, 5vw, 64px);
  border: 0;
  background: none;
  overflow: hidden;
}

.viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer::backdrop {
  background: none;
}

/* the dim behind the window is a layer of the dialog rather than its ::backdrop, so it can fade (--dim) */
.viewer::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(20, 19, 17, calc(0.72 * var(--dim)));
}

.viewer-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1400px);
  max-height: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  transform-origin: 0 0;
}

.viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}

.viewer-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.viewer-close {
  position: absolute;
  top: 24px;
  right: clamp(16px, 2vw, 24px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #23221f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.viewer-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* the page behind stays put while the viewer is open */
.is-viewing,
.is-viewing body {
  overflow: hidden;
}

@media (max-width: 699px) {
  .viewer {
    padding: 64px 12px 0;
  }

  .viewer-close {
    top: 12px;
    right: 12px;
  }
}
