:root {
    --home-nav-width: min(470px, 80vw);
}

.home-nav {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 200;
}

.home-nav__backdrop {
    flex: 1;
    background: rgba(3, 5, 8, 0.7);
    backdrop-filter: blur(28px) saturate(0.65);
    -webkit-backdrop-filter: blur(28px) saturate(0.65);
}

.home-nav__panel {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    background: #05080c;
    box-shadow: -34px 0 80px rgba(0, 0, 0, 0.72);
    padding: clamp(1.8rem, 4vw, 2.6rem) clamp(1.5rem, 3vw, 2.3rem);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: clamp(1.1rem, 2.2vw, 1.7rem);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
}

.home-nav__panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #05080c;
    pointer-events: none;
}

.home-nav__panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: radial-gradient(rgba(210, 184, 153, 0.2) 1px,
            transparent 0);
    background-size: 40px 40px;
    opacity: 0.1;
    pointer-events: none;
}

.home-nav__close {
    place-self: start end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(39, 38, 49, 0.18);
    background: transparent;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.home-nav__close span {
    position: absolute;
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 999px;
}

.home-nav__close span:first-child {
    transform: rotate(45deg);
}

.home-nav__close span:last-child {
    transform: rotate(-45deg);
}

.home-nav__close:hover {
    background: rgba(39, 38, 49, 0.08);
}

.home-nav__links {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(0.55rem, 1.2vw, 1.1rem);
    font-size: 1.1rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.home-nav__links a {
    color: #ffffff;
    text-decoration: none;
    position: relative;
    padding-bottom: 0.25rem;
}

.home-nav__links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.25s ease;
}

.home-nav__links a:hover::after {
    width: 100%;
}

.home-nav__aside {
    position: relative;
    z-index: 1;
    display: none;
    gap: 0.75rem;
    justify-items: end;
}

.home-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px 0 0 12px;
    background: var(--home-hero-panel, rgba(36, 38, 45, 0.62));
    color: #3f3428;
    font-size: 1.1rem;
    opacity: 0.88;
    transition: opacity 0.2s ease;
}

.home-nav__icon:hover {
    opacity: 1;
}

.home-nav__icon span {
    line-height: 1;
}

.home-nav__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

.home-nav__spinner {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ffffff;
    animation: projectSpinner 0.8s linear infinite;
}

body.is-home-nav-open .home-nav__loader {
    animation: homeNavLoaderFade 0.75s ease forwards;
}

@keyframes homeNavLoaderFade {
    0% { opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

body.is-home-nav-open {
    overflow: hidden;
}

body.is-home-nav-open .home-nav {
    opacity: 1;
    pointer-events: auto;
}

body.is-home-nav-open .home-nav__panel {
    transform: translateX(0);
}

@media (min-width: 769px) {
    .home-nav__panel {
        width: min(520px, 90vw);
    }

    .home-nav__aside {
        display: grid;
    }
}

@media (max-width: 768px) {
    .home-nav__backdrop {
        display: none;
    }

    .home-nav__panel {
        width: 100%;
        background: #05080c;
        box-shadow: none;
    }
}

@media (min-width: 1025px) {
    .home-nav__panel {
        width: var(--home-nav-width, min(470px, 80vw));
    }
}
