﻿.nav-link,
.nav-link-inline {
    position: relative;
    padding: .125rem .5rem;
    margin: 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: large;
    transition: color .2s ease;
    background-repeat: no-repeat;
    background-image: linear-gradient(currentColor 0 0), linear-gradient(currentColor 0 0), linear-gradient(currentColor 0 0);
    background-position: 100% 100%, 100% 0, 0 0;
    background-size: 2px 0, 0 2px, 2px 0;
}

    .nav-link-inline {
        padding: 0;
        margin: 0;
    }

    .nav-link::after,
    .nav-link-inline::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        height: 2px;
        width: 0;
        background: #ffd700;
        transition: width .25s ease;
    }

        .nav-link:hover,
        .nav-link-inline:hover {
            color: #ffd700;
        }

            .nav-link:hover::after,
            .nav-link-inline:hover::after {
                width: 100%;
            }

    .nav-link[aria-current="page"] {
        color: #ffd700;
        animation: box-draw 1.2s ease-out forwards;
    }

        .nav-link[aria-current="page"]::after {
            width: 100%;
        }

/* draw sequence:
   0–33%: right side climbs up
   33–66%: top runs right→left
   66–100%: left drops down
*/
@keyframes box-draw {
    0% {
        background-size: 2px 0, 0 2px, 2px 0;
    }

    33% {
        background-size: 2px 100%, 0 2px, 2px 0;
    }

    66% {
        background-size: 2px 100%, 100% 2px, 2px 0;
    }

    100% {
        background-size: 2px 100%, 100% 2px, 2px 100%;
    }
}
