@import url("https://fonts.googleapis.com/css2?family=Muli&display=swap");

:root {
  --primary-color: #5290f9;
}

* {
  box-sizing: border-box;
}

body {
  display: grid;
  place-content: center;
  min-height: 100vh;
  margin: 0;
  font-family: Muli, sans-serif;
  background-color: #eafbff;
  background-image: linear-gradient(
    to bottom,
    #eafbff 0%,
    #eafbff 50%,
    var(--primary-color) 50%,
    var(--primary-color) 100%
  );
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  padding: 20px;
  background-color: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: width 0.6s linear;
  ul {
    list-style: none;
    display: flex;
    align-items: center;
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: width 0.6s linear;
    li {
      flex: 1;
      opacity: 0;
      transform: rotateY(0deg);
      transition: transform 0.6s linear, opacity 0.6s linear;
    }
    a {
      margin-inline: 10px;
      color: #000;
      text-decoration: none;
      &:hover {
        color: var(--primary-color);
      }
    }
  }
  &.active {
    width: 350px;
    ul {
      width: calc(100% - 30px);
      li {
        opacity: 1;
        transform: rotateY(360deg);
      }
    }
  }
}

.icon {
  appearance: none;
  position: relative;
  display: block;
  padding: 0;
  width: 30px;
  height: 30px;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  &:focus {
    outline: 0;
  }
  .line {
    display: block;
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--primary-color);
    left: 5px;
    transition: transform 0.6s linear;
  }
  .line--1 {
    top: 10px;
    .active & {
      transform: rotate(-765deg) translateX(-2.5px) translateY(3px);
    }
  }
  .line--2 {
    bottom: 10px;
    .active & {
      transform: rotate(765deg) translateX(-2.5px) translateY(-3px);
    }
  }
}
