nav {
    position: relative;
    display: flex;
    justify-content: space-around;
    width: calc(100% - 6rem);
    padding: 1rem;
    background: var(--main);
}

nav > a, nav > span {
    position: relative;
    width: 25%;
    padding: 0 1ch;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
    font-size: 1.25rem;
    white-space: nowrap;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

nav > span {
    font-weight: bold;
}

nav > a::before, nav > a::after {
    content: "";
    position: absolute;
    top: 0;
    width: 0.5rem;
    height: 100%;
    background: var(--main);
    clip-path: polygon(
        calc(100% - 1px) 0,
        100% 0,
        1px 50%,
        100% 100%,
        calc(100% - 1px) 100%,
        0 50%
    );
    opacity: 0;
    transition: left 100ms ease-in-out, right 100ms ease-in-out, opacity 100ms ease-in-out;
}

nav > a:hover {
    text-decoration: underline;
}

nav > a::before {
    left: 2rem;
}

nav > a:hover::before {
    opacity: 1;
    left: 0;
}

nav > a::after {
    right: 2rem;
    transform: scaleX(-1);
}

nav > a:hover::after {
    opacity: 1;
    right: 0;
}

nav, nav::after {
    clip-path: polygon(
        1rem 0,
        calc(100% - 1rem) 0,
        100% 50%,
        calc(100% - 1rem) 100%,
        1rem 100%,
        0 50%
    );
}

nav::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    background: var(--bg);
    z-index: -1;
}