/* ----------------------------------------------------------------
   Shader Shapes
   ----------------------------------------------------------------
   Sizes and places the shader canvases: the hero background, the
   pink A, and the X and K at the bottom of the work section.

   Related files:
     • JS:  js/hero-shader.js
---------------------------------------------------------------- */

/* Hero background */
.hero-shader {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  /* !important is needed because the shader script sets its own pixel size */
  width: 100% !important;
  height: 100% !important;
}

/* Pink "A" shape, overlapping the bottom of the hero */
.section-a-shader {
  --a-size: clamp(20rem, 43vw, 52rem);
  position: absolute;
  top: calc(var(--a-size) * -0.48);
  left: calc(3.3vw - var(--a-size) * 0.12);
  z-index: 1;
  /* !important is needed because the shader script sets its own pixel size */
  width: var(--a-size) !important;
  height: var(--a-size) !important;
  pointer-events: none;
}

/* Phones: the A moves in line with the page edge */
@media (max-width: 37.5rem) {
  .work-section .section-a-shader {
    left: calc(1rem - var(--a-size) * 0.12);
  }
}

/* K and X, the same size as the A, under the last project: the K out on
   the left, the X on the right and lower, over the top of the footer.
   Sizes come from --shape-size and --card-width on .work-about. */
.work-shape {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  will-change: transform; /* moved every frame by js/hero-shader.js */
  /* !important is needed because the shader script sets its own pixel size */
  width: var(--shape-size) !important;
  height: var(--shape-size) !important;
}

.work-shape-k {
  top: calc(var(--shape-size) * -0.17);
  left: calc(50% - var(--card-width) / 2 - var(--shape-size) * 0.55);
  rotate: 7.49deg;
}

.work-shape-x {
  bottom: calc(var(--shape-size) * -0.28);
  left: calc(50% + var(--card-width) / 2 - var(--shape-size) * 0.42);
}

/* Phones: the card is the full width, so the shapes hang off the two edges */
@media (max-width: 37.5rem) {
  .work-shape-k {
    left: calc(var(--shape-size) * -0.32);
  }

  .work-shape-x {
    left: auto;
    right: calc(var(--shape-size) * -0.32);
  }
}
