/* A new version of the image mosaic from the original m-tk.info portfolio. */
.work-showcase .portfolio_bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  min-height: clamp(540px, 43vw, 720px);
  background: #242424;
}

.work-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  pointer-events: none;
}

.work-mosaic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 52%);
}

.work-mosaic__tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  background: #242424;
}

.work-mosaic__tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-showcase .center-block {
  position: relative;
  z-index: 1;
  padding: 72px 24px;
  pointer-events: none;
}

.work-showcase .content_block {
  width: min(36rem, 100%);
  min-width: 0;
  max-width: none;
  padding: clamp(24px, 3vw, 40px);
  pointer-events: auto;
}

.work-showcase .profile_text {
  max-width: 30rem;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .work-showcase[data-work-motion="active"] .work-mosaic__tile {
    pointer-events: auto;
  }

  .work-showcase[data-work-motion="active"] .work-mosaic__tile img {
    /* Individual scale composes with the independent slideshow transform. */
    transition: scale 550ms cubic-bezier(.22, .61, .36, 1);
  }

  .work-showcase[data-work-motion="active"] .work-mosaic__tile:hover img {
    scale: 1.055;
  }
}

.work-motion-toggle {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: 0;
  background: rgb(0 0 0 / 72%);
  color: #fff;
  font: inherit;
  font-size: .8125rem;
  line-height: 1.4;
  cursor: pointer;
}

.work-motion-toggle[hidden] {
  display: none;
}

.work-motion-toggle:hover {
  background: #242424;
}

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

@media (max-width: 1100px) {
  .work-showcase .portfolio_bg {
    min-height: 540px;
  }

  .work-mosaic {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .work-mosaic__tile:nth-child(n + 13) {
    display: none;
  }
}

@media (max-width: 640px) {
  .work-showcase .portfolio_bg {
    min-height: 620px;
  }

  .work-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .work-mosaic__tile:nth-child(n + 9) {
    display: none;
  }

  .work-showcase .center-block {
    padding: 88px 20px;
  }

  .work-showcase .content_block {
    width: 100%;
    padding: 24px 20px;
  }

  .work-motion-toggle {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-motion-toggle {
    display: none;
  }
}
