:root,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background-color: oklch(1 0 0);
}

#canvas {
  display: block;
  width: 100vw;
  height: 100dvh;
  position: fixed;
  inset: 0;
  z-index: -1;
}

/*letters*/

.cont-letters {
  width: min(60vmin, 400px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
  place-content: center;
  place-items: center;
  margin-inline: auto;
  position: fixed;
  inset-inline: 0;
  top: 55%;

  & .letters {
    --width: min(20vmin, 100px);
    display: block;
    position: relative;
    font-size: 5vmax;
    width: var(--width);
    aspect-ratio: 1/1;
    text-indent: 100vw;
    opacity: 0;
    -webkit-animation: 5s flicker 4s ease infinite;
            animation: 5s flicker 4s ease infinite;
    &::before,
    &::after {
      content: "";
      position: absolute;
      inset: 0;
      width: inherit;
      height: inherit;
    }

    &.letter-2 {
      background: url("https://assets.codepen.io/453571/numero-2.avif") 0%
        center/cover no-repeat;

      &.black {
        background-position-x: 100%;
      }
    }
    &.letter-0 {
      background: url("https://assets.codepen.io/453571/numero-0.avif") 0%
        center/cover no-repeat;
    }
    &.letter-6 {
      background: url("https://assets.codepen.io/453571/numero-6.avif") 0%
        center/cover no-repeat;

      &::before,
      &::after {
        --b: 0.5px;

        height: 30px;
        width: 25px;
        background: #edc951;
        -webkit-mask: radial-gradient(
            oklch(0 0 0 / 0) 71%,
            oklch(0 0 0) 72% calc(72% + var(--b)),
            oklch(0 0 0 / 0) calc(73% + var(--b))
          )
          10000% 10000% / 99.5% 99.5%;
                mask: radial-gradient(
            oklch(0 0 0 / 0) 71%,
            oklch(0 0 0) 72% calc(72% + var(--b)),
            oklch(0 0 0 / 0) calc(73% + var(--b))
          )
          10000% 10000% / 99.5% 99.5%;
      }
      &::before {
        height: 15px;
        width: 12.5px;
        top: 80%;
        left: 10%;
      }
      &::after {
        left: 80%;
        --b: 10px;
      }
    }
  }
}

/*anim*/
@-webkit-keyframes flicker {
  6%,
  12.9%,
  22%,
  62.9%,
  64%,
  64.9%,
  70%,
  100% {
    opacity: 0.99;
  }
  7%,
  13%,
  21.9%,
  63%,
  63.9%,
  65%,
  69.9% {
    opacity: 0.4;
  }
}
@keyframes flicker {
  6%,
  12.9%,
  22%,
  62.9%,
  64%,
  64.9%,
  70%,
  100% {
    opacity: 0.99;
  }
  7%,
  13%,
  21.9%,
  63%,
  63.9%,
  65%,
  69.9% {
    opacity: 0.4;
  }
}