.how {
  padding: 110px 0 40px;
  background: var(--background-subtle);
}

.how-stage {
  position: relative;
  container-type: size;
  height: min(clamp(560px, 70vh, 700px), calc(100svh - var(--header-height)));
  overflow: hidden;
}

.how-scene {
  position: absolute;
  inset: 0;
}

.how-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.how-trail-path {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 11;
}

.how-stage:focus {
  outline: none;
}

.how-stage:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.how-envelope {
  --envelope-width: min(500px, 80vw, 90cqh);

  position: absolute;
  left: 50%;
  top: 56%;
  margin: calc(var(--envelope-width) * -0.31) 0 0 calc(var(--envelope-width) * -0.5);
  will-change: transform, filter;
  z-index: 2;
}

.how-origami {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}

.how-phone {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  transform-origin: 50% 100%;
}

.how-hand {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  font-size: var(--hand-size, 64px);
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  opacity: var(--hand-opacity, 0);
  transform-origin: 45% 4%;
  filter: drop-shadow(0 8px 12px rgb(25 31 40 / 18%));
}

.how-replay {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.how-replay[data-visible] {
  opacity: 1;
  pointer-events: auto;
}

@media (height <= 520px) {
  .how-envelope {
    --envelope-width: min(500px, 80vw, 70cqh);
  }
}

@media (width <= 960px) {
  .how {
    padding: 80px 0 24px;
  }

  .how-head {
    padding-bottom: 36px;
  }

  .how-stage {
    height: min(600px, calc(100svh - var(--header-height)));
  }
}
