#root {
    font-family: Quicksand;

    /* base colours */
    --light-blue: #61D0FF;
    --dark-blue: #1661E4;
    --red: #ff4753;
    --green: #50e667;
    --black: black;
    --white: white;
    --nice-blue: #12a4ff;
    --nice-gray: #f0f0f0;
    --sun-rays: rgb(253, 209, 99);
    --sun: rgb(252, 190, 33);
    --moon: rgb(243, 255, 167);
    --midnight: rgb(91, 91, 91);
    --dark-gray: rgb(45, 45, 45);
    --transparent: transparent;
    --light-gray: lightgray;
    --mid-gray: gray;
    --aliceblue: aliceblue;

    /* fonts */
    --font-family: Quicksand; /* loaded via html, should add backup? default is okay */
      
    /* static variables */
    --background-color: var(--white);

    --textbox-background-color: var(--nice-gray);

    --nickname-static: var(--black);
    --nickname-valid: var(--green);
    --nickname-invalid: var(--red);
    --nickname-hover-time: 200ms;
    --nickname-focus-time: 100ms;

    --vertical-flex-title-height: 40vh;

    --title-font-size: clamp(30px, 45px, 10vh);
    --title-margin: 20px;

    --textbox-top: auto;
    --textbox-left: auto;
    --textbox-font-size: clamp(15px, 25px, 10vh);
    --textbox-border-width: 3px;
    --textbox-border-radius: 15px;
    --textbox-max-height: 50px;
    --textbox-height: 80%;
    --textbox-max-width: 400px;

    --vertical-flex-logo-height: 85vh;
    
    --horizontal-flex-logo-flex-basis: 30vh;

    --logo-height: 100%;
    --logo-final-height: 25px;
    --logo-padding: 5px;

    --title-page-transition-time: 1000ms;
    --title-transition-time: 350ms;

    --textbox-header-border-bottom-width: 2px;
    --textbox-header-final-font-size: 18px;
    --textbox-header-padding-js: 4px;

    --menu-flex-container-top: 40px;

    --menu-item-transition-time: 200ms;
    --menu-item-hover-time: 400ms;
    --menu-item-opacity: 0;
    --menu-item-max-height: 150px;
    --menu-item-border-radius: 15px;
    --menu-item-margin: 6px;
    --menu-item-border-width: 2.5px;
    --menu-item-flex-basis: 31%;

    --tictactoe-darkmode-multiplier: 0;

    --header-height: 30px;
    
    --nickname-valid: var(--green);
    --nickname-invalid: var(--red);
    --nickname-static: var(--light-gray);

    --textbox-header-color: var(--midnight);
    --title-color: var(--nice-gray);
    --background-color: var(--dark-gray);
    --background-border-color: var(--black);
    --text-color: var(--light-gray);
    --textbox-background-color: var(--dark-gray);

    --ray-color: var(--transparent); /* default transparent for now */
    --sun-color: var(--sun); /* --sun */
    --moon-color: var(--moon); /* moon */
    
    /* derived variables for js */
    --nickname-hover: var(--nice-blue);
    --nickname-focused: var(--red);
    --nickname-blurred: var(--mid-gray);

    --js-light-mode: -50px;
    --js-theme-button: -38px;
    --js-dark-mode: -52px;
    --js-menu: -100px;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    height: 100%;
}

#vertical-flex-title {
    position: fixed;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: var(--vertical-flex-title-height);
    z-index: 2;
}

#vertical-helper-nickname {
    width: 100%;
    
    /* animated */
    flex-grow: 1;
    
    animation-name: vertical-helper-nickname;
    animation-duration: var(--title-page-transition-time);
    animation-delay: 1ms;
    animation-fill-mode: forwards;
    animation-play-state: paused;
}

#title {
    text-align: center;
    font-size: var(--title-font-size);
    font-family: var(--font-family);
    font-weight: 900;
    color: var(--title-color);
    margin: var(--title-margin);
    left: 0;
    right: 0;
    
    /* animated */
    opacity: 1;
    
    animation-name: title;
    animation-duration: var(--title-transition-time);
    animation-fill-mode: forwards;
    animation-play-state: paused;
}

.textbox-container {
    display: flex;
    justify-content: center;
    align-content: center;
    height: 20%;
    max-height: 50px;
    min-height: 40px;
    width: 100%;
}

.textbox { /* instead of animation, just change the class and apply a transition instead */
    z-index: 3;
    display: flex;
    vertical-align: center;
    border-style: solid;
    border-width: var(--textbox-border-width);
    font-size: var(--textbox-font-size);
    font-family: var(--font-family);
    max-height: var(--textbox-max-height);
    min-height: 30px;
    text-align: center;
    
    /* transitions */
    transition-duration: var(--nickname-hover-time);
    border-color: var(--nickname-blurred);
    
    /* animated */
    background-color: var(--textbox-background-color);
    max-width: var(--textbox-max-width);
    width: 75%;
    border-radius: var(--textbox-border-radius);
    color: var(--nickname-static);
    height: var(--textbox-height);
    
    /*
    animation-duration: var(--title-page-transition-time);
    animation-delay: 1ms;
    animation-fill-mode: forwards;
    animation-play-state: paused;
    animation-name: textbox;
    */
}
.textbox:hover {
    transition-duration: var(--nickname-hover-time);
    border-color: var(--nickname-hover);
}
.textbox:focus {
    border-color: var(--nickname-focused);
    outline: none;
    /*transition-timing-function: linear;*/
    transition-duration: var(--nickname-focus-time);
}
.textbox:active {
    transition-duration: var(--nickname-focus-time);
    transform: scale(0.9);
    line-height: 0;
}

#vertical-flex-logo {
    height: var(--vertical-flex-logo-height);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 0;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#vertical-helper-logo {
    width: 100%;
    
    /* animated */
    flex-grow: 1;
    
    animation-duration: var(--title-page-transition-time);
    animation-delay: 1ms;
    animation-fill-mode: forwards;
    animation-play-state: paused;
    animation-name: vertical-helper-logo;
}

#horizontal-flex-logo {    
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: flex-start;
    flex-grow: 0;
    width: 100%;
    height: 0; /* saved a lot of trouble with image sizing */
    
    /* animated */
    flex-basis: var(--horizontal-flex-logo-flex-basis);
    
    animation-duration: var(--title-page-transition-time);
    animation-delay: 1ms; /* fixed all my problems */
    animation-fill-mode: forwards;
    animation-play-state: paused;
    animation-name: horizontal-flex-logo;
}

#logo {
    z-index: 10;
    padding: var(--logo-padding);
    height: var(--logo-height);
}

#logo-link {
    position: fixed;
    left: 0;
    top: 0;
}

#horizontal-helper-logo {    
    /* animated */
    flex-grow: 0;
    
    animation-duration: var(--title-page-transition-time);
    animation-delay: 1ms;
    animation-fill-mode: forwards;
    animation-play-state: paused;
    animation-name: horizontal-helper-logo;
}

/* static header classes */
.textbox-header {
    /*position: fixed; we don't want fixed here until after the animation
    top: 0;*/
    margin-top: 0;
    text-align: center;
    font-size: 18px;
    font-family: var(--font-family);
    background-color: var(--textbox-header-color);
    border-style: solid;
    border-width: 0;
    border-bottom-width: var(--textbox-header-border-bottom-width);
    border-color: transparent transparent var(--background-border-color) transparent;
    border-radius: 0;
    color: var(--title-color);
    min-height: var(--header-height);
    max-height: var(--header-height);
    height: var(--header-height);
    max-width: 100%;
    width: 100%;
    padding-top: 4px;
    padding-bottom: 0px;
    z-index: 2;
    transition-duration: var(--title-page-transition-time);
}

/* theme stuff */
.light-mode {
    position: fixed;
    margin: 0;
    padding: 0;
    top: 10px;
    right: var(--js-light-mode); /* 50px */
    height: 15px;
    width: 15px;
    background-color: var(--sun-color);
    border-radius: 50%;
    border: none;
    z-index: 3;
    box-shadow: 5px 3px 0px 0px var(--transparent);
    transition-duration: 200ms;
}

.ray {
    position: absolute;
    margin: 0;
    padding: 0;
    height: 6px;
    width: 2px;
    background-color: var(--ray-color);
    border-radius: 2px;
    z-index: 3;
    transform: translate(6.5px, -8px); /* top */
    transition-duration: 100ms;
    cursor: pointer;
}

#ray-1 {
    transform: translate(6.5px, -8px); /* top */
}

#ray-2 {
    transform: translate(15.5px, -4.5px) rotate(45deg); /* top right */
}

#ray-3 {
    transform: translate(19px, 4.5px) rotate(90deg); /* right */
}

#ray-4 {
    transform: translate(15.5px, 13.5px) rotate(135deg); /* bottom right */
}

#ray-5 {
    transform: translate(6.5px, 17px); /* bottom */
}

#ray-6 {
    transform: translate(-2px, 13.5px) rotate(45deg); /* bottom left */
}

#ray-7 {
    transform: translate(-6px, 4.5px) rotate(90deg); /* left */
}

#ray-8 {
    transform: translate(-2px, -4.5px) rotate(135deg); /* top left */
}

#theme-button {
    position: fixed;
    background-color: transparent;
    top: -1px;
    right: var(--js-theme-button); /* 38 px */
    height: 35px;
    width: 40px;
    cursor: pointer;
    z-index: 10;
}

#theme-button:hover {
    background-color: rgba(0, 0, 0, 0.1)
}

.dark-mode {
    position: fixed;
    margin: 0;
    padding: 0;
    top: 2px;
    right: var(--js-dark-mode); /* 52px */
    height: 25px;
    width: 25px;
    background-color: var(--textbox-header-color);
    border-radius: 50%;
    border: none;
    z-index: 3;
    box-shadow: 5px 3px 0px 0px var(--moon-color);
    transition-duration: 200ms;
}

#menu {
    position: fixed;
    right: var(--js-menu);
    top: 0;
    z-index: 3;
    background-color: transparent;
    height: 34px;
    width: 38px;
    transition-duration: 200ms;
}

#menu-button {
    position: absolute;
    right: 0px;
    top: 0px;
    background-color: transparent;
    height: 34px;
    width: 38px;
}
#menu-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

#menu-button-1 {
    position: absolute;
    height: 3.5px;
    width: 30px;
    right: 4px;
    top: 4.85px;
    background-color: var(--title-color);
    border-radius: 3px;
}

#menu-button-2 {
    position: absolute;
    height: 3.5px;
    width: 30px;
    right: 4px;
    top: 14.85px;
    background-color: var(--title-color);
    border-radius: 3px;
}

#menu-button-3 {
    position: absolute;
    height: 3.5px;
    width: 30px;
    right: 4px;
    top: 24.25px;
    background-color: var(--title-color);
    border-radius: 3px;
}

#menu-link-container {
    top: 36px;
    right: -102px;
    display: flex;
    position: absolute;
    flex-direction: column;
    justify-content: flex-start;
    transition-duration: 100ms;
}

.menu-link {
    height: 20px;
    width: 100px;
    background-color: var(--textbox-header-color);
    border-style: solid;
    border-top: none;
    border-right: none;
    border-color: var(--background-border-color);
    border-width: 2px;
    z-index: 10;
    color: var(--title-color);
    text-align: center;
    padding-top: 7px;
    padding-bottom: 8px;
    text-decoration: none;
    transition-duration: 100ms;
}
.menu-link:hover {
    background-color: var(--menu-hover-color);
    cursor: pointer;
    transition-duration: 100ms;
}

#contact {
    border-bottom-left-radius: 10px;
}

/* menu options */
#menu-flex-container {
    position: absolute;
    top: var(--menu-flex-container-top); /* double for portrait mode devices */
    display: flex;
    flex-flow: wrap;
    align-items: flex-start;
    justify-content: center;
    margin-top: 0px;
    width: 100%;
    z-index: 1;
}

.menu-item-hidden {
    border-radius: var(--menu-item-border-radius);
    aspect-ratio: 2 / 1;
    background-size: contain;
    background-color: transparent;
    border-width: var(--menu-item-border-width);
    border-color: var(--black);
    border-style: solid;
    flex-basis: var(--menu-item-flex-basis);
    /*max-height: var(--menu-item-max-height); */
    margin: var(--menu-item-margin); /* double for portrait mode devices */
    
    /* transition */
    transition-duration: var(--menu-item-hover-time);
    opacity: 0;
}

.menu-item {
    display: block;
    border-radius: var(--menu-item-border-radius);
    aspect-ratio: 2 / 1;
    background-size: contain;
    background-color: transparent;
    border-width: var(--menu-item-border-width);
    border-color: var(--black);
    border-style: solid;
    flex-basis: var(--menu-item-flex-basis);
    /*max-height: var(--menu-item-max-height); /* double for portrait mode devices */
    margin: var(--menu-item-margin); /* double for portrait mode devices */
    background-color: var(--textbox-header-color);
    overflow: hidden;
    box-sizing: content-box;
    
    /* transition */
    transition-duration: var(--menu-item-hover-time);
    opacity: 1;
    transform: translateZ(0);
    
}
.menu-item:hover {
    border-color: var(--nice-blue);
    filter: drop-shadow(0 0 0.75rem var(--nice-blue));
    transform: translateZ(0);
}
.menu-item-js-hover {
    border-radius: var(--menu-item-border-radius);
    aspect-ratio: 2 / 1;
    background-size: contain;
    background-color: transparent;
    border-width: var(--menu-item-border-width);
    border-color: var(--black);
    border-style: solid;
    flex-basis: var(--menu-item-flex-basis);
    /*max-height: var(--menu-item-max-height); /* double for portrait mode devices */
    margin: var(--menu-item-margin); /* double for portrait mode devices */
    background-color: var(--textbox-header-color);
    overflow: hidden;
    transform: translateZ(0);
    
    /* transition */
    transition-duration: var(--menu-item-hover-time);
    opacity: 0.3;
}

.icon-img-wrapper {
    width: 100%;
    padding: 0;
}

.icon-img {
    width: 100%;
    /*-webkit-mask-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));*/
    cursor: pointer;
}

.icon-img-inverted {
    width: 100%;
    aspect-ratio: 2 / 1;
    filter: invert(var(--tictactoe-darkmode-multiplier));
    cursor: pointer;
    transform: translateZ(0);
    /*-webkit-mask-image:-webkit-gradient(linear, left top, right top, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));*/
}

.menu-item-link {
    height: 100%;
    width: 100%;
}

img { /* some buggy stuff happening with my images with text in them... */
    -khtml-user-select: none;
    -o-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
}

.icon-title {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 24pt;
    color: var(--white);
    transform: translateZ(0);
    text-shadow: 0 0 3px var(--black), 0 0 3px var(--black), 0 0 3px var(--black), 0 0 30px var(--black);
    font-weight: bold;
    background-color: var(--green);
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 10px;
    filter: drop-shadow(0 0 3px var(--black));
}


/* ANIMATIONS */
@keyframes vertical-helper-nickname {
    from {
        flex-grow: 1;
    } to {
        flex-grow: 0;
    }
}

@keyframes vertical-helper-logo {
    from {
        flex-grow: 1;
    } to {
        flex-grow: 0;
    }
}

@keyframes horizontal-flex-logo {
    from {
        /*flex-basis: 40%; */
    } to {
        flex-basis: var(--logo-final-height);
    }
}

@keyframes horizontal-helper-logo {
    from {
        flex-grow: 0;
    } to {
        flex-grow: 1;
    }
}

@keyframes title {
    from {
        opacity: 1;
    } to {
        opacity: 0;
    }
}

/* media queries for theme and screen size stuff */

@media only screen and (max-aspect-ratio: 10/11) { /* not SUPER precise but it works */
    @media (prefers-color-scheme: dark) {
        #root {
            --vertical-flex-logo-height: 70vh;
            --horizontal-flex-logo-flex-basis: 25vh;
            --menu-item-flex-basis: 90%;

            --nickname-valid: var(--green);
            --nickname-invalid: var(--red);
            --nickname-static: var(--light-gray);
    
            --textbox-header-color: var(--midnight);
            --title-color: var(--nice-gray);
            --background-color: var(--dark-gray);
            --background-border-color: var(--black);
            --text-color: var(--light-gray);
            --textbox-background-color: var(--dark-gray);
            
            /* derived variables for js */
            --nickname-hover: var(--nice-blue);
            --nickname-focused: var(--red);
            --nickname-blurred: var(--mid-gray);
            --tictactoe-darkmode-multiplier: 0.9;
        }
    }
    
    @media (prefers-color-scheme: light) {
        #root {
            --vertical-flex-logo-height: 70vh;
            --horizontal-flex-logo-flex-basis: 25vh;
            --menu-item-flex-basis: 90%;

            --nickname-valid: var(--green);
            --nickname-invalid: var(--red);
            --nickname-static: var(--black);
    
            --textbox-header-color: var(--nice-gray);
            --title-color: var(--black);
            --background-color: var(--white);
            --background-border-color: var(--nice-blue);
            --text-color: var(--black);
            --textbox-background-color: var(--nice-gray);
            
            /* derived variables for js */
            --nickname-hover: var(--nice-blue);
            --nickname-focused: var(--red);
            --nickname-blurred: var(--black);
            --tictactoe-darkmode-multiplier: 0;
        }
    }
}

@media (prefers-color-scheme: dark) {
    #root {
        --nickname-valid: var(--green);
        --nickname-invalid: var(--red);
        --nickname-static: var(--light-gray);

        --textbox-header-color: var(--midnight);
        --title-color: var(--nice-gray);
        --background-color: var(--dark-gray);
        --background-border-color: var(--black);
        --text-color: var(--light-gray);
        --textbox-background-color: var(--dark-gray);
        
        /* derived variables for js */
        --nickname-hover: var(--nice-blue);
        --nickname-focused: var(--red);
        --nickname-blurred: var(--mid-gray);
        --tictactoe-darkmode-multiplier: 0.9;
    }
}

@media (prefers-color-scheme: light) {
    #root {
        --nickname-valid: var(--green);
        --nickname-invalid: var(--red);
        --nickname-static: var(--black);

        --textbox-header-color: var(--nice-gray);
        --title-color: var(--black);
        --background-color: var(--white);
        --background-border-color: var(--nice-blue);
        --text-color: var(--black);
        --textbox-background-color: var(--nice-gray);
        
        /* derived variables for js */
        --nickname-hover: var(--nice-blue);
        --nickname-focused: var(--red);
        --nickname-blurred: var(--black);
        --tictactoe-darkmode-multiplier: 0;
    }
}