:root {
    /* --- Fonts --- */
    --primary-font: "Inter";

    /* --- Colors --- */
    color-scheme: dark light;
    /* color-scheme: light; */
    --p1: #E5E743;
    /* - Dark Mode -      - Light Mode - */
    --d4: #999999;      --l4: #666666; 
    --d3: #666666;      --l3: #999999; 
    --d2: #333333;      --l2: #CCCCCC; 
    --d1: #222222;      --l1: #DDDDDD;  
    --d0: #000000;      --l0: #FFFFFF; 
}

*, html {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
        position: relative;
    }
    &.colormode-switch * {
        transition: .25s ease !important;
    }
}

main {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    background-color: light-dark(var(--l1), var(--d1));
    padding-bottom: 4rem;
    position: fixed;

    &:has(.anchor-nav) {
        flex-direction: row;
        @media (width <= 60em) {
            flex-direction: column;
        }
    }

    section {
        width: 100%;
        overflow-y: auto;
        display: flex; flex-direction: column;
        align-items: center; text-align: left;
        gap: 1rem;
        font-family: var(--primary-font);
        padding: 2rem 5rem;
        color: light-dark(var(--d1), var(--l1));
        scroll-behavior: smooth;
        @media (width <= 60em) {
            padding: 0rem;
        }  

        .container {
            display: flex; flex-direction: column;
            align-items: flex-start; text-align: left;
            gap: 1rem;
            max-width: 50rem;
            position: relative;
            padding: 1rem 2rem 1rem 5rem;
            width: 100%;
            /* border: 1px solid light-dark(var(--d3), var(--l3)); */

            &:not(:has(.img-container), :has(h1)) {
                min-height: 12rem; flex-shrink: 0;
            }

            img {
                min-width: 0;
                width: 100%;
                border-radius: .25rem;
            }

            .img-container {
                width: 100%;
                height: 60vh; 
                /* background-color: red; */
                display: flex; flex-direction: column;
                border-radius: .25rem;
                padding: .5rem;
                @media (width <= 60em) {height: 50vh;}

                &.long {
                    height: 75vh;
                    @media (width <= 60em) {height: 55vh;}
                }
                
                .track {
                    background-color: light-dark(var(--l2), var(--d2));
                    display: flex;           
                    overflow: hidden;
                    height: 100%;
                    transition: .5s ease;
                    /* padding: 1rem; */

                    &:hover {
                        background-color: light-dark(var(--l0), var(--d0));
                    }

                    img {
                        aspect-ratio: maintain;
                        min-height: 0; min-width: 0;
                        flex-shrink: 0;
                        height: 100%; width: 100%;
                        object-fit: contain;
                        transition: .5s ease;
                    }
                }

                .control-container {
                    display: flex;
                    justify-content: center;
                    padding: .5rem;
                    gap: 1rem;

                    button.img-nav {
                        width: fit-content;
                        padding: 0;
                        width: 1.5rem;
                        height: 1.5rem;
                        background-color: transparent;
                        font-weight: 500;
                        border-radius: .25rem;

                        /* border: none; */
                    }
                    
                    .button-track {
                        display: flex;
                        width: fit-content; align-items: center;
                        gap: .5rem;

                        button {
                            width: 1rem; height: 1rem;
                            border-radius: 100%;
                            padding: 0;
                            background-color: transparent;

                            &.active {
                                background-color: light-dark(var(--l4), var(--d4));
                                border-color: transparent;
                            }
                        }
                    }
                }
            }

            p {
                letter-spacing: -2.5%;
                font-size: 1.25rem;
                font-weight: 300;
                /* text-align: justify; */

                a {
                    color: inherit;
                }

                &:nth-of-type(1) b:nth-of-type(1)::after { transition-delay: 0.2s; }
                &:nth-of-type(1) b:nth-of-type(2)::after { transition-delay: 0.4s; }
                &:nth-of-type(1) b:nth-of-type(3)::after { transition-delay: 0.6s; }
                &:nth-of-type(2) b:nth-of-type(1)::after { transition-delay: 0.5s; }
                &:nth-of-type(2) b:nth-of-type(2)::after { transition-delay: 0.7s; }
                &:nth-of-type(2) b:nth-of-type(3)::after { transition-delay: 0.9s; }


                b {
                    font-weight: 800;
                    letter-spacing: 0%;
                    position: relative;
                    display: inline-block;
                    padding: 0 .25ch;

                    &::after {
                        content: '';
                        position: absolute;
                        left: 0; bottom: 0; top: 0;
                        width: 0%;
                        transition: .5s ease;
                        backdrop-filter: invert(1);
                    }

                    /* &:nth-child(1)::after {transition: .5s ease .3s;}
                    &:nth-child(2)::after {transition: .5s ease .6s;}
                    &:nth-child(3)::after {transition: .5s ease .9s;}
                    &:nth-child(4)::after {transition: .5s ease 1.2s;}
                    &:nth-child(5)::after {transition: .5s ease 1.5s;}
                    &:nth-child(6)::after {transition: .5s ease 1.8s;}
                    &:nth-child(7)::after {transition: .5s ease 2.1s;} */

                }
            }
            
            h2 {
                padding: 1rem;
                text-align: center;
                position: absolute;
                width: fit-content;
                white-space: nowrap;
                rotate: 90deg;
                bottom: 100%; left: 0;
                transform-origin: bottom left;
                background-color: transparent;
                color: light-dark(var(--d1), var(--l1));
                scroll-margin-top: 20vh; 
                /* border: 1px solid light-dark(var(--d3), var(--l3)); */
                @media (width <= 60em) {
                    font-size: 1.25rem;
                }

                &::after {
                    z-index: 5;
                    position: absolute; content: '';
                    left: 0; top: 0; bottom: 0;
                    width: 0%; 
                    transition: .4s ease;
                    background-color: transparent;
                    backdrop-filter: invert(1);
                }

                &:target {
                    &::after {
                        width: 100%;
                    }

                    ~ p b::after {
                        width: 100%;
                    }
                }
            }

            &:has(h1) {
                width: 100%;
                padding: 0;

                h1 {
                    align-self: flex-start;
                    font-size: 3.5rem; font-weight: 900;
                    line-height: 97.5%;

                    @media (width <= 60em) {
                        padding: 1rem 2rem;
                        font-size: 2.5rem;
                    }
                }
                
                @media (width <= 60em) {.tag-box {
                    padding: 0 2rem;
                }}


            }


            h3 {
                max-width: 50%;
                letter-spacing: -2.5%;
                line-height: 98%;
                font-size: 1.5rem;
                font-weight: 600;

                @media (width <= 60em) {
                    max-width: unset;
                }
            }
        }
        hr {
            width: 5rem;
            border-color: light-dark(var(--d1), var(--l1));
        }
    }

    nav, ul, ol {
        display: flex; flex-direction: column;
        padding: 2rem; 
        @media (width <= 60em) {
            padding: 1rem;
        }
    
        a, li, button:not(.sub-img)  {
            font-size: 5rem; font-weight: 800;
            font-family: var(--primary-font);
            text-decoration: none;
            background-color: transparent; border: none;
            color: light-dark(var(--l4), var(--d4));
            transition: .25s ease;
            position: relative;
            width: fit-content; max-width: 100%;
            padding: .5rem 1.5rem;
            letter-spacing: -.1rem;
            cursor: pointer;
            text-align: left;
            @media (width <= 60em) {
                padding: .5rem .5rem;
                line-height: 95%;
                font-size: 3.5rem;
            }
        
            &::after {
                z-index: 5;
                position: absolute; content: '';
                left: 0; top: 0; bottom: 0;
                width: 0;
                transition: .4s ease;
                background-color: transparent;
                backdrop-filter: invert(1);
            }
    
            &:hover {
                color: light-dark(var(--d1), var(--l1));
                padding-left: 3.5rem; @media (width <= 60em) {padding-left: 1.5rem;}
    
                &::after {
                    width: 100%;
                }
            }
        }

        &.anchor-nav {
            /* background-color: red; */
            @media (width <= 60em) { 
                flex-direction: row; flex-wrap: wrap;
                gap: 1rem;
            }

            a, li, button:not(.sub-img) {
                font-size: 2.5rem;
                padding: .5rem 1rem;
                padding-right: 2rem;
                max-width: 16ch;
                width: fit-content;
                line-height: 97.5%;

                @media (width <= 60em) {font-size: 1.5rem;}

                &:hover {padding-left: 2rem; padding-right: 1rem;}
            }
        }
    }

    .button {
        position: relative;
        cursor: pointer;

        transition: .25s ease;
        padding: 1rem 3rem;
        font-family: var(--primary-font);
        color: light-dark(var(--l3), var(--d3));
        border: 1px solid light-dark(var(--l3), var(--d3));
        outline: none;
        width: fit-content;
        text-decoration: none;
        font-size: .9rem; line-height: 1.25rem;
        font-weight: 700;
        
        &:hover {
            color: light-dark(var(--l4), var(--d4));
            border: 1px solid light-dark(var(--l4), var(--d4));
        }
    }

    form {
        align-self: center;
        font-family: var(--primary-font);
        width: 100%; max-width: 35rem;
        height: 100%;
        display: flex; flex-direction: column;
        align-items: flex-start; justify-content: center;
        gap: .25rem;
        padding: 2rem;

        label {
            font-weight: 700;
            font-size: .8rem;
            height: fit-content; width: fit-content;
            color: light-dark(var(--d2), var(--l2));
            transition: .25s ease;
            position: relative;
            padding: .5rem;

            &::after {
                z-index: 5;
                position: absolute; content: '';
                left: 0; top: 0; bottom: 0;
                width: 0;
                transition: .4s ease;
                background-color: transparent;
                backdrop-filter: invert(1);
            }

            &:has(+ input:focus, + textarea:focus) {
                color: light-dark(var(--d0), var(--l0));
                margin-left: .5rem;

                &::after {
                    width: 100%;
                }
            }
        }

        textarea {
            field-sizing: content;
            max-height: 30%;
            overflow-y: auto;
        }
        
        input, textarea, button {
            transition: .25s ease;
            padding: 1rem;
            font-family: var(--primary-font);
            resize: none;
            background-color: light-dark(var(--l1), var(--d1));
            color: light-dark(var(--l4), var(--d4));
            border: 1px solid light-dark(var(--l2), var(--d2));
            outline: none;
            margin-left: .5rem;
            margin-bottom: .75rem;
            width: 100%;
            /* border-radius: .25rem; */
            font-size: .9rem; line-height: 1.25rem;

            &[type="checkbox"] {
                width: fit-content; height: fit-content;
                appearance: none;
                position: relative;

                &::after {
                    transition: .25s ease;
                    content: '✓';
                    font-family: var(--primary-font);
                    font-weight: 900;
                    position: absolute;
                    background-color: light-dark(var(--d2), var(--l2));
                    color: light-dark(var(--l2), var(--d2));
                    top: 0; left: 0; right: 0; bottom: 0;
                    display: flex; align-items: center; justify-content: center;
                    margin: .25rem;
                    border-radius: 100%;
                    scale: 0;

                }

                &:checked {
                    &::after {scale: 1;}
                }
            }

            &[type="submit"] {
                position: relative;
                background-color: transparent;
                cursor: pointer;
            }
            /* &:invalid {
                border: 2px solid red;
            } */

            &::placeholder {color: light-dark(var(--l3), var(--d3)); transition: inherit;}

            &:focus {
                border-color: light-dark(var(--l3), var(--d3));
                &::placeholder {color: light-dark(var(--l2), var(--d2));}
            }

            &:hover {border-color: light-dark(var(--l3), var(--d3));}
        }

        .container {
            width: 100%;
            gap: inherit; column-gap: 2rem;
            
            &.grid {
                display: grid; 
                grid-template-rows: repeat(2, auto);
                grid-auto-flow: column;
            } 

            &.flex {
                display: flex; align-items: center;
                label {min-width: 40%;}
                input, textarea {margin-bottom: 0;}
            }

            &.hide-unchecked {
                overflow: hidden;
                transition: .25s ease;
                height: 0rem; opacity: 0;
                user-select: none;
                cursor: not-allowed;
            }
        }
        
        .container:has(#iscompany:checked) + .hide-unchecked {
                height: 6rem; opacity: 1;
        }
    }
}

.back-button {

}


footer {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    font-family: var(--primary-font);
    /* background: linear-gradient(0deg, light-dark(var(--l1), var(--d1)) 0%, light-dark(var(--l1), var(--d1)) 75%, transparent 100%); */

    .copyright {
        color: light-dark(var(--l3), var(--d3));
        font-size: .7rem;
        align-self: flex-end;
    }
    
    .left-container, .right-container {
        display: flex; align-items: center;
        gap: 1rem;

        a:not(.back-button) {
            color: light-dark(var(--l3), var(--d3));
            text-decoration: none;
            font-size: .9rem; font-weight: 700;
            transition: .25s ease;

            &:hover {
                color: light-dark(var(--l4), var(--d4));    
            }
        }

        button, a.back-button {
            text-decoration: none;
            width: 2rem; height: 2rem;
            font-family: var(--primary-font);
            background-color: transparent; border: none;
            font-size: 1.5rem;
            color: light-dark(var(--l3), var(--d3));
            stroke: light-dark(var(--l3), var(--d3));
            cursor: pointer;
            transition: .25s ease;

            &:hover {
                color: light-dark(var(--l4), var(--d4));    
                stroke: light-dark(var(--l4), var(--d4));   
            }
        }

        #color-mode-button {
            overflow: hidden;
            display: flex; flex-direction: column;
            align-items: center;
            gap: 1rem;
            
            svg {
                position: absolute;
                stroke: inherit;
                width: 2rem; height: 2rem;
                transition: .25s ease;
                flex-shrink: 0;
                /* translate: 0 1rem; */
                html[data-theme="dark"] & {
                    /* &#icon-light {translate: 0 0;} */
                    /* &#icon-light-lit {translate: 0 0%;} */
                    &#icon-light {opacity: 1; translate: 0 0;}
                    &#icon-light-lit {opacity: 0; translate: 0 100%;}
                }
                html[data-theme="light"] & {
                    /* &#icon-light {translate: 200% 0;} */
                    /* &#icon-light-lit {translate: 0 -3.5rem;} */
                    &#icon-light {opacity: 0; translate: 0 -100%;}
                    &#icon-light-lit {opacity: 1; translate: 0 0;}
                }
            }
        }
    }
}

main.post-contact {
    display: flex;
    align-items: center; justify-content: center;
    font-family: var(--primary-font);

    h3 {
        font-size: 3rem;
        font-weight: 900;
    }

    h5 {
        font-size: 1.5rem;
        font-weight: 200;
    }

    a.button {
        margin-top: 1.5rem;
    }
}

ul.project {
    overflow-y: auto;
    padding: 2rem;
    height: 100%;
    button {
        display: flex; flex-direction: column;

        & + div {
            z-index: 10;
            display: flex; justify-content: space-between;
            height: 0;
            width: fit-content; min-width: 0; max-width: 100%;
            background-color: light-dark(var(--l2), var(--d2));
            transition: all .25s ease, height .75s ease, width .75s ease;
            transform-origin: top;
            flex-shrink: 0;
            overflow: hidden;
            gap: 1rem;
            
            @media (width <= 60em) {
                flex-direction: column;
                width: 100%;
                 min-height: 0;
            }

            & * {opacity: 0; transition: .5s ease;}

            .left.container {
                display: flex; flex-direction: column;
                justify-content: flex-end;
                width: 16.5rem;

                @media (width <= 60em) {
                    /* flex-direction: row; */
                    width: 100%;
                }

                /* tag box (see below end .project) */
                
                a {
                    width: 100%;
                    font-size: 2.5rem;
                    white-space: nowrap;
                    line-height: 99%;

                    &.disabled {
                        pointer-events: none;
                        color: light-dark(var(--l3), var(--d3));
                    }
                }
            }

            .right.container {
                display: flex; flex-direction: row;
                gap: .5rem;
                width: fit-content;
                min-width: 0; min-height: 0;
                flex-grow: 0;

                @media (width <= 60em) {
                    /* flex-direction: column; */
                    width: 100%;
                }


                .main-img {
                    aspect-ratio: 1 / 1;
                    height: 100%;
                    border-radius: .25rem;
                    background-position: center;
                    background-repeat: no-repeat; background-size: cover;
                    @media (width <= 60em) {
                        width: 80%; height: unset;
                    }

                    &:hover {scale: 1.015;}
                }

                .img.container {
                    display: flex; flex-direction: column;
                    height: 100%; min-width: 0; min-height: 0; width: fit-content;
                    gap: .5rem;
                    align-items: flex-start;

                    
                    @media (width <= 60em) {
                        /* flex-direction: row; */
                        /* width: 100%; height: fit-content; */
                    }

                    .sub-img {
                        aspect-ratio: 1 / 3;
                        height: 100%; width: 100%;
                         min-height: 0; min-width: 0;
                        border-radius: .25rem;
                        background-position: center;
                        background-repeat: no-repeat; background-size: cover;
                        border: none;
                        cursor: pointer;
                        &:hover {scale: 1.05;}
                        
                    }
                }
            }
            &:has(ul) {
                width: 100%;
                
                ul {
                    height: fit-content;
                    padding: 0;

                    a {
                        font-size: 3.5rem;

                        @media (width <= 60em) {
                            font-size: 2rem;
                        }
                    }
                }
            }
        }

        &.open {
            background-color: light-dark(var(--l2), var(--d2));
            & + div {
                height: 55vh; 
                padding: 2rem;
                & * {opacity: 1;}

                @media (width <= 60em) {
                    height: fit-content;
                }
            }
        }
    }
}

.tag-box {
    /* background-color: red; */
    height: 100%;
    display: flex; flex-wrap: wrap-reverse;
    align-content: flex-start;
    gap: .5rem;
    margin-bottom: 1rem;

    span.tag {
        cursor: default;
        display: flex;
        font-family: var(--primary-font);
        height: fit-content; padding: .75rem;
        border-radius: .15rem;
        font-weight: 700;
        font-size: .75rem;
        opacity: .85;
        transition: .25s ease;

        &:hover {
            opacity: 1;
        }
    }
}

.tag.collaborative {background-color: light-dark(#e95555, #cf4343);} /* COLLABORATIVE  */
.tag.in-progress {background-color: light-dark(#4a9bdd, #3982be);} /* IN-PROGRESS */
.tag.fun {background-color: light-dark(#2abe32, #1cbe24);} /* FUN */
.tag.type {background-color: light-dark(#c2638f, #b45582);} /* WEBSITE, DESIGN MATERIALS */
.tag.client {background-color: light-dark(#869727, #7d8d1f);} /* VOLUNTEER WORK, CLIENT WORK, CLASS WORK */