body {
    margin: 0;
    background-color: #dbc499;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

nav {
    display: flex;
    flex: none;
}
main {
    flex: 1;
    min-height: 0; /* lets main shrink instead of overflowing */
    display: flex;
    flex-direction: column;
}
#top_left {
    position: relative;
    display: flex;
}

#head {
    width: 200px;
    display: block;
}

#logo {
    position: absolute;
    width: 120px;
    left: 35px;
    top: 19px;
    transition: transform 0.1s ease-in-out;
}
#logo:hover {
    transform: scale(1.05);
}
.fret {
    height: 80px;
}

#neck {
    display: flex;
    width: 100%;
    background-image: url(../images/neck_pattern.webp);
    background-repeat: repeat-x;
    background-size: 110px;
}

#nut {
    height: 70px;
    position: absolute;
    right: -10px;
}

#neck_links {
    width: 100%;
    height: 70px;
    display: flex;
    margin-right: 130px;
    justify-content: space-evenly;
    align-items: center;
}
#neck_img {
    height: 87.5px;
    width: 100%;
}

.nav_link {
    font-family: "Tangerine", sans-serif;
    font-weight: 700;
    font-size: 2.2em;
    padding-top: 5px;
    padding-right: 5px;
    font-style: italic;
    text-decoration: none;
    color: #ebebeb;
    top: auto;
    bottom: auto;
}
#peg_container {
    position: absolute;
}
.peg {
    position: absolute;
}
.peg_still {
    display: block;
}
.peg_spin {
    display: none;
}
nav:has(#logo:hover) .peg_still {
    display: none;
}
nav:has(#logo:hover) .peg_spin {
    display: block;
}
#neck_spacer {
    width: 130px;
}
#hole_wrapper {
    border-radius: 50%;
    overflow: hidden;
    width: 188px;
    height: 188px;
    position: absolute;
    top: -60px;
    right: -50px;
    display: flex;
    justify-content: center;
}
#hole {
    width: 100%;
    position: absolute;
}
#pick {
    width: 30%;
    left: 30%;
    top: 40%;
    position: absolute;
}
.underline {
    position: relative;
    text-decoration: none;
}

.underline::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 90%;
    height: 2px;
    background-color: #9b7938;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
@keyframes wobble {
    0%,
    100% {
        rotate: -5deg;
    }
    50% {
        rotate: 5deg;
    }
}
.rotate {
    transition: transform 0.5s ease-in-out;
}
#hole_wrapper:hover .rotate {
    animation: spin 50s linear infinite;
}
#hole_wrapper:hover #pick {
    animation: wobble 1.5s ease-in-out infinite;
}
.scale {
    transition: scale 0.1s ease-in-out;
}
.scale:hover {
    scale: 1.02;
}
.nav_box:has(#hamburger) {
    display: none;
}
#topbar {
    flex: 2.5 1 0;
    min-height: 0;
    display: flex;
    justify-content: center;
}
#topbar img {
    margin-top: 10px;
    display: block;
    max-height: 60%;
}
#fretboard_view {
    flex: 3 1 0; /* the fretboard gets the biggest share */
    min-height: 0;
    width: 75%;
    margin: 0 auto;
    overflow: hidden;
}
#fretboard {
    display: block;
    width: 100%;
    height: 100%;
}
#notes {
    font-family: "Barlow Semi Condensed", sans-serif;
    font-weight: 700;
    font-size: 30px;
    text-align: center;
}
#fret_nums {
    font-size: 24px;
    fill: black;
    font-weight: 800;
}
#controls {
    flex: 4 1 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: 25%;
}
.knob {
    width: 150px;
    height: 150px;
    justify-content: center;
}
.knob h3 {
    font-family: "Barlow Semi Condensed", sans-serif;
    font-weight: 700;
    font-style: italic;
    font-size: 30px;
    text-align: center;
    margin: 10px;
}
.knob p {
    position: absolute;
    font-size: 50px;
    color: #ebebeb;
}
#type_knob p {
    font-size: 18px;
}
.knob img {
    width: 100%;
}
.knob_div {
    display: flex;
    width: 100px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
}
@media screen and (max-width: 800px) {
    #hole_wrapper {
        width: 24%;
        aspect-ratio: 1 / 1;
        display: block;
        max-width: 188px;
        min-width: 160px;
    }
    #neck_links {
        margin-right: 24%;
        margin-left: 10px;
    }
    #hamburger {
        display: block;
        width: 48px;
        height: 40px;
        background: none;
        background-image: url(../images/hamburger.webp);
        background-size: cover;
        border: none;
    }
    .nav_link {
        display: none;
    }
    .fret {
        display: none;
    }
    .nav_box {
        display: none;
    }
    .nav_box:has(#hamburger) {
        width: 100%;
        height: 70px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: none;
        border: none;
    }
}
@media screen and (max-width: 800px) {
    #neck_links.responsive {
        width: 100%;
        height: 70px;
        display: block;
    }
    .responsive .nav_link {
        display: block;
        color: black;
        padding: 0;
    }
    .responsive .nav_box {
        width: 100%;
        height: 70px;
        background-color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        border: solid black 3px;
        border-top: none;
    }
    .underline::after {
        content: "";
        position: absolute;
        left: 3px;
        width: 100%;
        height: 3px;
        background-color: #9b7938;
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.3s ease;
    }
}
@media screen and (max-width: 500px) {
    #hole_wrapper {
        display: none;
    }
    #neck_links {
        margin-right: 0;
        min-width: 100px;
    }
}
