* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    font-family: 'atkinson hyperlegible', sans-serif;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-repeat: no-repeat;

}
nav {
    background-color: #A82F2F;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}
.logo {
    color: #0affcf;
    font-size: 24px;
    font-weight: bold;
}
.logo img {
    transition: transform 0.6s ease;
}
.logo img:hover{
    transform: scale(0.85);
}
.navlinks {
    list-style: none;
    display: flex;
    gap: 40px;
    justify-content: center;
}
.navlinks a {
    color: #ffe9d9;
    text-decoration: none;
    font-size: 35px;
    display:inline-block;
    transition: transform 0.6s ease;
    margin-right: 23px;
}
.navlinks a:hover {
    color: #0AFFCF;
    transform: scale(0.85);
}
/* burger */
.burgertoggle {
    display: none;
    font-size: 28px;
    color: #ffe9d9;
    cursor: pointer;
}

/*footer*/
footer{
    text-align: center;
    padding: 20px;
    background: #a82f2f;
    color: #380f00;
    display: flex;
    flex-direction: column;
    gap: 10px;

}
.footer-links a {
    margin: 0 10px;
    text-decoration: none;
    color: #380f00;
    transition: transform 0.6s ease;

}
.footer-links a:hover{
    text-decoration:underline;
    color: #FFE9D9;
    text-decoration-color:#FFE9D9;
}
footer a{
    margin: 0 10px;
    text-decoration: none;
    color: #380f00;
    transition: transform 0.6s ease;

}
footer a:hover{
    text-decoration:underline;
    color: #FFE9D9;
    text-decoration-color:#FFE9D9;
}
footer a img{
    transition: transform 0.6s ease;
}
footer a img:hover{
    transform: scale(0.85);
}
/* MAIN LAYOUT */
.app {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 100vh;
    align-items: start;
    background-color: #FFE9D9;
    padding: 10px;
}
/* SIDE PANELS */
.panel {
    background: #380f001f;
    padding: 20px;
    display: flex;
    flex-direction: row;
    margin: 5px;

}
.right{
    display: flex;
    flex-direction: column;
}
.left{
    display: flex;
    flex-direction: column;
}
/* CENTER */
.creator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
    background-color: #380f001f;
    margin:5px;
    height: auto;
}
/* MODE BUTTONS */
.modes {
    display: flex;
    gap: 10px;
}
.modes button {
    padding: 10px;
    cursor: pointer;
}
/* AVATAR PREVIEW*/
.preview {
    position: relative;
    width: 400px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #FFE9D9;
}

/* THIS is the important anchor system */
.avatar-stack {
    position: absolute;
    inset: 0;
}

/* all layers share SAME anchor point */
.avatar-stack img {
    position: absolute;
    left: 50%;
    bottom: 0;

    transform: translateX(-50%);
    transform-origin: bottom center;

    width: 100%;
    height: auto;

    pointer-events: none;
}
#physicaltraits-layer{
    z-index: 1;
}
#pants-layer{
    z-index: 2;
}
#shirts-layer{
    z-index: 3;
}
#overclothes-layer{
    z-index: 4;
}
/* OPTIONS GRID */
.controls {
    flex: 1;
    min-height: 0;
}
.options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #ccc;
    overflow-y:scroll;
    max-height: 150px;
    background-color: #FFF5ED;
    font: inherit;         /* important */

}
.option:hover {
    background: #cccccc;
}
.hidden {
    display: none;
}
.silhouette-mode img {
    filter: grayscale(1) brightness(0);
}
.category-group button.active {
    background: #380f00a1;
    color: #FC6735;
}
.modes button.active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
.category-group button.active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
.options .active {
    background-color: #A86A4A;
    color: #FFE9D9;
}
/*proportion sliders*/
.options input[type="range"] {
    width: 100%;
}
.options label {
    display: block;
    margin-top: 10px;
    font-size: 14px;
}
.option{
    border: 2px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson hyperlegible', sans-serif;
}
.mode{
    border: 2px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson-hyperlegible', sans-serif;
}
.cat{
    border: 1px solid #A82F2F;
    background-color: #FFF5ED;
    font-family: 'atkinson hyperlegible', sans-serif;
}
.option:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.mode:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.cat:focus-visible {
    outline: 2px solid #005C47;
    outline-offset: 2px;
    border-radius: 4px;
}
.nd{
    background-color: #A82F2F;
    color: #FC6735
}

.buttos{
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 35px;
    right: 30px;
    gap: 10px;

}
#scrollTopBtn {
    display: none; /* hidden until scroll */
    background-color: #380f00;
    color: #0AFFCF;
    border: none;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
#scrollTopBtn:hover{
    display: none; /* hidden until scroll */
    background-color: #380f00;
    color: #0AFFCF;
    border: none;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    cursor: pointer;
    transform: scale(1.3);
    color: #F28907;
    background-color:#0F565D;
    text-shadow:
            1px 0 currentColor,
            -1px 0 currentColor,
            0 1px currentColor,
            0 -1px currentColor;
}
#themeToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    z-index: 9999;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    background-color: #380f00;
    color: #0AFFCF;
    cursor: pointer;
    transition: transform 0.2s ease;

}
#themeToggle:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    z-index: 9999;
    border-radius: 50%;
    height: 50px;
    width: 50px;
    font-size: 25px;
    cursor: pointer;
    transform: scale(1.3);
    color: #F28907;
    background-color:#0F565D ;
    text-shadow:
            1px 0 currentColor,
            -1px 0 currentColor,
            0 1px currentColor,
            0 -1px currentColor;
}

body.dark #scrollTopBtn{
    background-color: #F5F5F5;
    color: #001629;
}
body.dark #themeToggle{
    background-color: #F5F5F5;
    color: #001629;
}
body.dark #scrollTopBtn:hover{
    color: #F28907;
    background-color:#0F565D;
    text-shadow:
            1px 0 currentColor,
            -1px 0 currentColor,
            0 1px currentColor,
            0 -1px currentColor;
}
body.dark #themeToggle:hover{
    color: #F28907;
    background-color:#0F565D;
    text-shadow:
            1px 0 currentColor,
            -1px 0 currentColor,
            0 1px currentColor,
            0 -1px currentColor;
}
#themeRipple {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;

    background: #001629;

    transform: scale(0);
    transform-origin: center;

    z-index: 9998;
    pointer-events: none;

    transition: transform 2s ease-out;
}
#themeRipple.active {
    transform: scale(290);
}

body.dark {
    background-color: #121212;
    color: #F5F5F5;
    font-size: 30px;
}
body.dark .app {
    background-color: #121212;
    color: #F5F5F5;
    font-size: 30px;
    height: fit-content;
}
body.dark p{
    color: #F5F5F5;
}
body.dark a{
    color: #F5F5F5;
}
body.dark .panel, body.dark .creator{
    background-color: #001629;
}
body.dark .preview{
    background-color: #121212;
    height: 75dvh;
    width: auto;
}
body.dark footer{
    background-color: #001629;
    color: #F5F5F5;
}
body.dark nav{
    background-color: #001629;
    color: #F5F5F5;
}
body.dark .navlinks a{
    font-size: 50px;
}
body.dark  .logo, body.dark .logoimg{
    filter: grayscale(100) brightness(100);
    height: 20dvh;
    width: auto;
}
body.dark .neutral-layer{
    filter: grayscale(100) brightness(100);
}
body.dark .options{
    background-color: #121212;
    color: #F5F5F5;
    border: none;
}
body.dark .option{
    background-color: #F5F5F5;
    color: #001629;
    border: none;
    font-size: 20px;
}
body.dark .option.active{
    background-color:#F28907;
    color:  #F5F5F5;
    border: none;
}
body.dark .cat{
    background-color: #F5F5F5;
    color: #001629;
    border: none;
    font-size: 23px;
}
body.dark .cat.active{
    background-color:#F28907;
    color:  #F5F5F5;
    border: none;
}
body.dark .mode{
    background-color: #F5F5F5;
    color: #001629;
    border: none;
    font-size: 27px;
}
body.dark .mode.active{
    background-color:#F28907;
    color:  #F5F5F5;
    border: none;
}
body.dark .silhouette-mode img{
    filter: brightness(0%) invert(100%);
}



/* responsive scale */
@media (max-width: 768px) {
    .burgertoggle {
        display: block;
    }
    .navlinks {
        display: none;
        flex-direction: column;
        background-color: #A82F2F;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 20px;
        z-index: 10;
    }
    .navlinks.active {
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: 11;
    }
    body.dark .burgertoggle{
        font-size: 100px;
        color: #F5F5F5;
    }
    body.dark .navlinks{
        background-color: #001629;
        color: #F5F5F5;
    }
    body.dark .controls{
        width: 65dvh;
    }
    body.dark .panel{
        width: 71dvh;
    }
    body.dark .preview{
        height: 65dvh;
        width: auto;
    }
    body.dark .creator {
        width: fit-content;
    }
    .left h2,
    .left p {
        margin-bottom: 10px;
    }
    .app {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        height: fit-content;
    }

    .left,
    .right,
    .creator {
        width: 100%;
        max-width: 500px;
    }
.left{
    order: 2;
}

.creator{
    order: 1
}

.right{
    order: 3;
}

    footer {
        padding: 20px;
        height: auto;   /* IMPORTANT */
        gap: 15px;
        color: #FFE9D9;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        color: #FFE9D9;
    }

    footer p{
        display: flex;
        justify-content: center;
    }
    .footer-links a{
        color: #FFE9D9;
    }
    footer a {
        display: block;
        color: #FFE9D9;
    }
    footer{
        color: #FFE9D9;
    }
.panel{
    overflow: scroll;
}

}


