@mixin for-mobile-up {
  @media (min-width: 350px) and (max-width: 500px) {
    @content;
  }
}

:root {
  --mouse-sensitivity: 3;
}

.scrub-scroll {
  height: calc(100vh * var(--mouse-sensitivity, 3));
  pointer-events: none;

  &:before {
    content: '';
    width: 100%;
    height: 100%;
    position: relative;
    bottom: 0;
    top: 0;
    z-index: -2;
  }

  canvas {
    position: fixed;
    max-height: 100vh;
    max-width: 100vw;
    object-fit: cover;
    object-position: center;
    top: 0;
    width: 100%;
    z-index: -1;

    @include for-mobile-up {
      position: fixed;
      height: 100%;
      max-height: 100vh;
      max-width: 100vw;
      object-fit: cover;
      object-position: center;
      top: 0;
      width: 100%;
      z-index: -1;
    }

    &.scroll-finished {
      position: -webkit-sticky;
      position: sticky;
    }
  }

  .text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate3d(-50%, -50%, 0);
    opacity: 0;
    text-transform: uppercase;
    width: 100%;
    transition: opacity 0.3s ease-in-out;
    text-align: center;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    flex-direction: column;

    &.active {
      opacity: 1;
    }
  }
}