input {
  display: none;
}

label {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 50px;
  height: 50px;
}

.menu{
    border-radius: 8px;
}


.menu--1 label,
.menu--2 label {
  bottom: 0;
}

.menu--3 label,
.menu--4 label {
  top: 0;
}

.menu--1 label,
.menu--3 label {
  right: 0;
}

.menu--2 label,
.menu--4 label {
  left: 0;
}

path {
  fill: none;
  stroke: #000;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  --length: 24;
  --offset: -38;
  stroke-dasharray: var(--length) var(--total-length);
  stroke-dashoffset: var(--offset);
  transition: all .4s cubic-bezier(.645, .045, .355, 1);
}

circle {
  fill: #fff3;
  opacity: 0;
}

label:hover circle {
  opacity: 1;
}

.cross input:checked + svg .line--1,
.cross input:checked + svg .line--3 {
  --length: 22.627416998;
}

.cross input:checked + svg .line--2 {
  --length: 0;
}

.back input:checked + svg .line--1,
.back input:checked + svg .line--3 {
  --length: 8.602325267;
}

.menu--1 {
    background-color: gold;
}

.menu--1 .line--1,
.menu--1 .line--3 {
  --total-length: 126.64183044433594;
}

.menu--1 .line--2 {
  --total-length: 70;
}

.menu--1 input:checked + svg .line--1,
.menu--1 input:checked + svg .line--3 {
  --offset: -94.1149185097;
}

.menu--1 input:checked + svg .line--2 {
  --offset: -50;
}



.debug {
  display: none;
}

.line--debug {
  opacity: 0;
  stroke-dasharray: none;
}

@media screen and (min-width: 800px) {
  .debug {
    opacity: 0.8;
    display: block;
    position: absolute;
    z-index: 1;
    font-family: sans-serif;
    transform: rotate(-45deg);
    transform-origin: 0% 100%;
    background: #000;
    color: #fff;
    width: 150px;
    height: 100px;
    line-height: 150px;
    text-align: center;
    user-select: none;
  }

  .debug:hover {
    opacity: 1;
  }

  .debug.active {
    background: #fff;
    color: #000;
  }

  .debug.active + .grid path.line--debug {
    opacity: 0.2;
  }
}