.page-menu {
  z-index: 100;
  transition: all 0.3s ease-in-out;
  position: fixed;
  width: 100%;
  top: 80px;
  left: 0;
  background-color: theme('colors.black');
  display: none;
  @screen lg {
    display: block;
  }
  .wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .pagemenu-item {
    top: 0;
    visibility: hidden;
    opacity: 0;
    // display: none;
    position: absolute;
    color: theme('colors.white');
    transition: all 0.6s ease-out;
    &.active {
      position: relative;
      // display: block;
      visibility: visible;
      opacity: 1;
    }

    &:before {
      content: '';
      position: absolute;
      height: 1px;
      width: 100%;
      bottom: 0;
      left: 0;
      transform-origin: center;
      transition: all 0.3s ease-in-out;
      background-color: theme('colors.white');
    }

    @screen lg {
      display: block;
      position: relative;
      visibility: visible;
      opacity: 1;
      text-align: center;
      height: auto;
      white-space: no-wrap;
      font-size: 8px;
      &:before {
        transform: scaleX(0);
      }

      &:not(:last-child) {
        &:after {
          content: '';
          position: absolute;
          display: block;
          width: 1px;
          height: 100%;
          background-color: theme('colors.white');
          margin: 0 auto;
          right: -2.5rem;
          top: 0;
        }
      }

      &:hover,
      &.active {
        &:before {
          transform: scaleX(1);
          color: theme('colors.white');
          transform: scaleX(1);
        }
      }
    }
    @screen xl {
      font-size: 10px;
    }
  }

  &.light {
    background-color: theme('colors.gray');
    .pagemenu-item {
      color: theme('colors.black');
      &:before {
        background-color: theme('colors.black');
      }
      &:not(:last-child) {
        &:after {
          background-color: theme('colors.black');
        }
      }
    }
  }
  &.dark {
    .pagemenu-item {
      color: theme('colors.white');
      &:before {
        background-color: theme('colors.white');
      }
      &:not(:last-child) {
        &:after {
          background-color: theme('colors.white');
        }
      }
    }
  }
}
body.scrolled {
  .page-menu {
    top: 0;
  }
}

.scrollspy:first-child {
  > h2:first-child {
    margin-top: 50px;
  }
  .flexible:first-child {
    // margin-top: 50px;
    @screen lg {
      margin-top: 50px;
    }
  }
  .flexible:last-child {
    margin-top: 0;
  }
  @screen xl {
    .flexible:first-child {
      margin-top: 58px;
    }
    .flexible:last-child {
      margin-top: 0px;
    }
  }
}

.no-pagemenu {
  .scrollspy:first-child {
    > h2:first-child {
      margin-top: 0px;
    }
    .flexible:first-child {
      margin-top: 00px;
      @screen lg {
        margin-top: 00px;
      }
    }
    .flexible:last-child {
      margin-top: 0;
    }
    @screen xl {
      .flexible:first-child {
        margin-top: 0px;
      }
      .flexible:last-child {
        margin-top: 0px;
      }
    }
  }
}
