:root {
    --card-min-width: 350px;
    --card-gap: 1.5rem;
    --menu-font-size: clamp(1rem, 2vw + 0.1rem, 1.8rem);
    --section-title-margin: 5rem 0 2rem 0;
    --section-title-size: clamp(1.2rem, 3vw + 1rem, 1.8rem);
    --section-title-bg: hsl(0, 0%, 10%);
    --card-shadow-color: hsla(72, 93%, 48%, 0.05);
    --card-hover-color: hsla(48, 56%, 90%, 0.3);
    --section-title-color: hsl(52, 81%, 41%);
    --navbar-bg-color: rgba(150, 150, 150, 0.15);
    --float-nav-bg-color: hsla(258, 59%, 17%, 0.15);
    --section-title-gradient: hsl(50, 20%, 50%), hsl(60, 50%, 50%), hsl(60, 90%, 50%), hsl(50, 20%, 50%);
}

html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    background-color: black;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-block-size: 100svh;
    background-image: url(/img/background.jpg);
    color: white;
    font-family: 'system-ui', 'arial';
}

footer {
    margin: 0;
    background-color: hsl(0, 0%, 10%);
    text-align: center;
    padding-block: 1rem;
    font-size: clamp(0.8rem, 1vw + 0.5rem, 1.2rem);
    text-wrap: balance;
}

@property --glowAngle {
    syntax: '<angle>';
    inherits: true;
    initial-value: -45deg;
}

.section-title-left {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--section-title-size);
    font-weight: 600;
    border: 3px solid transparent;
    border-left: 0;
    border-radius: 0 100vh 100vh 0;
    width: 250px;
    padding-block: 1rem;
    margin: var(--section-title-margin);
    color: var(--section-title-color, white);
    position: relative;
    isolation: isolate;
    animation: autoRotate 4s linear infinite;
    background:
        linear-gradient(var(--section-title-bg) 0 0) padding-box,
        conic-gradient(from var(--glowAngle) at center, var(--section-title-gradient)) border-box;

    &::after, &::before {
        content: '';
        position: absolute;
        border-radius: inherit;
    }

    &::before {
        background: var(--section-title-bg);
        inset: 0.25rem;
        z-index: -1;
        filter: blur(0.2rem);
    }

    &::after {
        background: conic-gradient(from var(--glowAngle) at center, var(--section-title-gradient)) border-box;;
        inset: 0rem;
        z-index: -1;
        filter: blur(0.2rem);
        opacity: 0.15;
    }
}

@keyframes autoRotate {
    to {
        --glowAngle: 315deg;
    }
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
    gap: var(--card-gap);
    padding-inline: 1rem;
    margin: 1rem auto;
}

.card {
    display: flex;
    flex-direction: column;
    background-color: #171717;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 2px 2px 3px 3px var(--card-shadow-color);

    &:hover {
        background: var(--card-hover-color);
    }
}

.card-img {
    max-block-size: 100%;
    padding-bottom: 0.5rem;
}

.card h3 {
    color: #FFF;
    margin: auto 0 0 0;
    padding: 0;
}

.card h4 {
    color: #FFF;
    margin: 0.1rem 0 0 0;
    font-weight: 400;
    padding: 0;
}

.card p {
    color: #DDD;
    font-size: 0.95rem;
    margin: 0.75rem 0 0 0;
}

.hamburger {
    position: fixed;
    top: 0.5rem;
    right: 1rem;
    display: none;
    justify-self: flex-end;
    
    input[type="checkbox"] {
        display: none;
    }

    input[type="checkbox"]:checked {
        & ~ label {
            .bar1 {
                transform: translate(0, 0.6rem) rotate(-45deg);
            }
        
            .bar2 {
                opacity: 0;
            }

            .bar3 {
                transform: translate(0, -0.6rem) rotate(45deg);
            }
        }

        nav .navbar-items {
            right: 0;
        }
    }
    
    label {
        display: inline-block;
    }
    
    .bar1, .bar2, .bar3 {
        width: 2rem;
        height: 0.3rem;
        background-color: #555;
        border-radius: 100vh;
        margin: 0.3rem 0;
        transition: 0.4s;
    }
}

body:has(input[type="checkbox"]:checked) {
    nav {
        right: 0;
    }
}

nav {
    --_display-logo: flex;

    display: flex;
    position: sticky;
    height: 4rem;
    z-index: 1;
    background-color: var(--navbar-bg-color);
    backdrop-filter: blur(0.5rem);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
    margin-inline: auto;
    font-size: var(--menu-font-size, 1.8rem);
    top: 0;
    transition: 0.4s;

    @supports (animation-timeline: view()) {
        animation: nav-anim linear forwards;
        animation-timeline: view();
        animation-range-start: 100vh;
    }

    .nav-left {
        display: var(--_display-logo);
        margin-right: auto;
        align-items: center;
        column-gap: 2rem;
        
        > .logo {
            max-block-size: 4rem;
        }
    }

    .inst-dd,
    .acc-dd,
    .mon-dd,
    .rec-dd
    {
        list-style: none;
        margin-top: 1rem;
        background-color: rgba(0, 0, 0, 0.75);
        padding: 1rem 2rem;
        border-radius: 1rem;
        display: none;
        position: absolute;
        left: -2rem;
        text-wrap: nowrap;
        
        li {
            padding-bottom: 1rem;
        }
    }

    .rec-dd {
        left: -5rem;
    }

    .navbar-items {
        list-style-type: none;
        margin-block: 0;
        display: flex;
        align-items: center;
        padding: 1rem 3rem;
        gap: 2rem;

        a {
            text-decoration: none;
            color: white;

            &:hover {
                color: orange;
            }
        }
        
        [tabindex="0"]:focus-within .inst-dd {
            display: block;
        }
        
        [tabindex="1"]:focus-within .acc-dd {
            display: block;
        }
        
        [tabindex="2"]:focus-within .mon-dd {
            display: block;
        }

        [tabindex="3"]:focus-within .rec-dd {
            display: block;
        }

        #instruments, #accessories, #monitoring, #recording {
            position: relative;
        }       
    }
}

/* @keyframes nav-anim {
    0% {
        background-color: var(--navbar-bg-color);
        top: 0;
    }
    1%, 100% {
        top: 5rem;
        width: fit-content;
        border-radius: 100vw;
        background-color: var(--float-nav-bg-color);
        backdrop-filter: blur(2rem);
        --_display-logo: none;
    }
} */

@media screen and (width < 650px) {
    nav {
        width: fit-content;
        height: fit-content;
        border-radius: 1rem 0 0 1rem;
        position: fixed;
        background-color: hsl(0, 0%, 50%, 0.25);
        font-size: 1rem;
        margin-inline: auto 0;
        top: 3rem;
        right: -10rem;
        animation: none;
        --_display-logo: none;

        .navbar-items {
            padding: 1rem 1.5rem 1.5rem 1.5rem;
            flex-direction: column;
            align-items: flex-end;
            gap: 1rem;
            display: flex;
            transition: 0.4s;
        }
        
        .inst-dd,
        .acc-dd,
        .mon-dd,
        .rec-dd
        {
            padding-block: 1rem 0;
            left: -11rem;
            top: -1lh;
        }
    }

    .hamburger {
        display: flex;
    }
}

@media screen and (width < 400px) {
    :root {
        --card-min-width: 95%;
        --card-gap: 1rem;
        --section-title-margin: 1.5rem 0 1rem 0;
    }
}
