* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: #181818;
  background: linear-gradient(
    125deg,
    #ff6fae,
    #ff9b54,
    #e638b5,
    #ff718c
  );
  background-size: 400% 400%;
  animation: background-shift 22s ease-in-out infinite;
}

.title {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 9999;
  margin: 0;
  color: #fff;
  font: 400 clamp(1.5rem, 6vw, 4rem) / 1 Georgia, serif;
}

.canvas {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
}

.block {
  position: absolute;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 22%);
  box-shadow: 0 16px 35px rgb(48 15 38 / 18%);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font: clamp(0.9rem, 3.7vw, 1.3rem) / 1.15 Georgia, serif;
}

.block:active {
  cursor: grabbing;
}

.block a {
  position: relative;
  z-index: 3;
  color: inherit;
  text-decoration-thickness: 1px;
  user-select: text;
}

.block span {
  position: relative;
  z-index: 2;
  max-width: 16ch;
  pointer-events: none;
}

.block-1 {
  top: 20svh;
  left: 5vw;
  z-index: 2;
  width: clamp(138px, 46vw, 260px);
  height: 105px;
  background: #dadada;
}

.block-2 {
  top: 14svh;
  left: 41vw;
  z-index: 3;
  width: clamp(155px, 52vw, 320px);
  height: 150px;
  color: #f7f7f7;
  background: #909090;
}

.block-3 {
  top: 34svh;
  left: 11vw;
  z-index: 5;
  width: clamp(185px, 62vw, 390px);
  height: 88px;
  background: #ededed;
}

.block-4 {
  top: 39svh;
  left: 54vw;
  z-index: 4;
  width: clamp(130px, 43vw, 260px);
  height: 170px;
  color: #fff;
  background: #535353;
}

.block-5 {
  position: absolute; /* or relative, depending on your layout */
  top: 46svh;
  left: 4vw;
  z-index: 6;
  width: clamp(175px, 58vw, 360px);
  height: 145px;
  overflow: hidden;
  color: #fff;
  background: #777;
}

.block-5 img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.block-5::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background: linear-gradient(
    to top,
    rgb(0 0 0 / 65%),
    rgb(0 0 0 / 5%)
  );
  pointer-events: none;
}

@keyframes background-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@media (min-width: 760px) {
  .title {
    top: 2rem;
    left: 2.5rem;
  }

  .block {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.75rem;
    width: auto;
    height: auto;
    max-width: calc(100vw - 2rem);
  }

  .block > * {
    margin: 0;
  }

  .block p {
    width: 100%;
  }

  .block-1 {
    top: 20svh;
    left: 5vw;
    width: clamp(260px, 88vw, 560px);
    min-height: 105px;
    font-size: medium;
  }

  .block-2 {
    top: 14svh;
    left: 41vw;
    width: clamp(200px, 52vw, 400px);
    min-height: 150px;
    font-size: medium;
  }

  .block-3 {
    top: 34svh;
    left: 11vw;
    width: clamp(115px, 62vw, 300px);
    min-height: 88px;
    font-size: small;
  }

  .block-4 {
    top: 39svh;
    left: 54vw;
    width: clamp(130px, 43vw, 260px);
    min-height: 170px;
    font-size: small;
  }

  .block-5 {
    top: 58vh;
    left: 43vw;
    width: 400px;
    height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}