:root {
    --nav-bg-color : #0060f4;
    --gray-color: #151515;// #232323;
    --gray-color2: #252525;
    --scroll: 0;

}
@font-face {
    font-family: KanitRegular;
    src: url("font/Kanit-Regular.ttf");
}
@font-face {
    font-family: KanitLight;
    src: url("font/Kanit-Light.ttf");
}
a {
    text-decoration: none;
    color: #cfcfcf;
}

html, body {
    margin: 0;
    padding: 0;
    animation-name: scroll;
    animation-duration: 3.5s;
    scroll-behavior: smooth;
    font-family: KanitRegular, "roboto", sans-serif;

    line-height: 1;

}
body {
    display: flex;
    flex-flow: column;
    background: url("img/bg.jpg") center, black;
    background-size: 100% auto;

    animation: scale 1s linear infinite;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1s);

    animation-iteration-count: 1;
    animation-fill-mode: both;
}
pre {
    display:block;
    overflow: auto;
    word-wrap: normal;
    overflow-y: hidden;
}
code {
    overflow: visible;
}
body:after {
    content: "";
    position: fixed;
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 90%,rgba(0,0,0,1) 100%);
    border-radius: 0;
    top: 0; left: 0;
    z-index: -3;

    animation: bg-v 1s linear infinite;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1s);

    animation-iteration-count: 1;
    animation-fill-mode: both;
}

#nav {
    background: black;
    width: 100%;
    height: 60px;
    position: fixed;
    background: var(--nav-bg-color);
    z-index: 2;
}
#nav img {
    position: fixed;

    height: 50px;
    top: 0;
    margin: 5px 5px 5px 20px;
}
#nav_btn {
    position: fixed;
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
    visibility: hidden;
    background: url("img/icons/menu.png") center;
    background-size: cover;
    transition: .3s;

}
#nav_btn:hover {
    cursor: pointer;
    scale: 1.1;
}
/*TODO remove?*/
#msg_dialog {
    width: 100%;
    height: 100%;
    position: fixed;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: rgba(0, 0, 0, 0.9);
    font-size: 20px;

    z-index: 4;
    transition: .3s;

}
#msg_dialog > div {
    display: flex;
    flex-flow: column;
    position: fixed;
    align-content: stretch;
    scale: 0;
    margin-top: -100px;
    width: 400px;
    height: 300px;
    background: var(--gray-color2);
    transition: .3s;
}
#msg_dialog > div > div {
    flex-grow: 2;
    display: flex;
    flex-flow: column;
    width: 100%;
    align-self: center;
    justify-content: center;

}
#msg_txt {
    text-align: center;
}

#msg_dialog div a {
    width: 60%;
    padding: 10px 0;
    margin: auto auto 10px;
    text-align: center;
    align-self: center;
    background: var(--gray-color);
    border-radius: 20px;
    transition: .3s;
}
#msg_dialog div a:hover {
    cursor: pointer;
    background: #0064ff;
}


#logo1 {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;

}

#nav ul {
    display: flex;
    position: fixed;
    height: 60px;
    margin: 0 20px 0 0;
    align-items: center;
    top: 0;
    right: 0;
    animation-name: nav-item;
    animation-duration: 3.5s;
}
#nav ul li {
    margin:0 10px;
    list-style: none;


}
#nav ul li a {
    height: 40px;
    width: 300px;
    padding:10px;
    text-decoration: none;
    color: white;
    border-radius: 20px;
    transition: .3s;
}
#nav ul li a:hover {
    /*background: #aeb0b2;*/
    background: var(--gray-color);
}
.active {

    background: var(--gray-color);
}

#main {
    margin-top: 60px;
    color: white;
}

.section {

    scroll-margin-top: 60px;
    min-width: 900px;
    margin: auto;
    display: flex;
}
pre {
    max-width: 900px;
}
.section > h2 {
    margin: 10px 30px;
    font-size: 30px;
}

#home {
    min-height: 90vh;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    text-align: center;
}
#home h1 {
    margin-bottom: 5px;
    font-size: 60px;

}
#home h3 {
    margin-top: 5px;
    font-size: 30px;
    color: #cfcfcf;
}


#home div {
    animation: home-scale 1s linear infinite;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.5s);
}

#education, #skills, #projects,#versions,#screenshots {
    flex-flow: column;
    min-height: 50vh;


}
#projects {
    height: 100vh;
}
.section:not(#home) > div,.section:not(#home) >h2 {
    opacity: 1;
    animation: c-animate 1s linear infinite;
    animation-play-state: paused;
    animation-delay: calc(var(--scroll) * -1.5s);

    animation-iteration-count: 1;
    animation-fill-mode: both;
}

#contacts,#links, #screenshots {
    flex-flow: column;
}

#projects_container {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: center;
}
#versions-container {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 20px;
    margin: 10px 30px;
}
#screenshots img {
    float: left;
    max-height: 550px;
    max-width: 100%;
    object-fit: contain;
    transition: .3s;
}

#screenshots img:hover {
    scale: 1.03;
}

#screenshots-container {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 20px;
    margin: 10px 30px;
}

#projects_container a {
    text-decoration: none;
    color: white;
    width: 170px;
    max-width: 250px;
    height: auto;
    flex-grow: 4;
}

#projects_container a > div {
    /*width: 170px;*/
    /*max-width: 250px;*/
    display: flex;
    flex-flow: column;
    align-content: stretch;
    height: 220px;
    background: var(--gray-color);
    margin: 10px;

    transition: .3s;
}
#projects_container a > div img {
    width: 100%;
    height: 220px;
    min-height: 100px;
    object-fit: cover;
    object-position: center;
}

#contact_container,#links-container {
    display: flex;
    background: var(--gray-color);
    margin: 10px 30px;
    padding: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
#links-container {
    justify-content: center;
}

#versions-container div {
    display: flex;
    flex-flow: column;
    align-content: stretch;
    background: var(--gray-color);
    margin: 10px;
    padding: 15px;

    transition: .3s;
}
#versions-container div > h3 {
    margin: 5px;
}

#versions-container div > a {
    color: var(--nav-bg-color);
}

#versions-container div > a:hover {
    color: white;
}
#links-container a{
    display: flex;
    flex-flow: column;
    align-items: center;
}

#links-container a> h4 {
    margin: 5px;
}

#mail {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--gray-color2);
    border-radius: 20px;
    padding: 10px;
    transition: .3s;
}
#mail:hover {
    scale: 1.05;
}
#contact_container p {
    height: 100%;
    font-size: 20px;
}

#contact_container img,#links-container img {
    width: 40px;
    height: 40px;
    filter: grayscale(100%);
    transition: .3s;
}
#links-container img {
    filter: none;
}

#contact_container a img:hover,#links-container img:hover {
    scale: 1.1;
}
#projects_container{
    font-family: KanitLight, "roboto", sans-serif;
}

#projects_container a > div:hover  {
    cursor: pointer;
    scale: 1.05;
}

#projects_container a div h3 {
    margin: 5px 15px;
}
#projects_container a div h4 {
    margin: 5px 15px 7px 15px;
    color: #cfcfcf;
}

#copy {
    display: flex;
    margin-bottom: 10px;
    justify-content: center;
    font-size: 16px;
}


@media only screen and (max-width: 900px) {

    #nav_btn {
        visibility: visible;
    }
    #nav ul {
        position: fixed;
        flex-flow: column;
        background: var(--nav-bg-color);

        right: -190px;
        height: auto;
        margin: 5px;
        top: 60px;

        padding:5px 20px;
        border-radius: 20px;

        transition: .3s;

    }
    #nav ul.open {
        right: 0;
    }
    #nav ul li {
        margin:10px 0;
        list-style: none;
    }
    #nav ul li a {
        height: 40px;
        width: 300px;
        padding:10px;
        text-decoration: none;
        color: white;
        border-radius: 20px;
        transition: .3s;
    }
    .section {
        min-width: 500px;
    }

    pre {
        max-width: 500px;
    }
    #mail p {
        display: none;
    }
    #mail {
        background: none;
    }
    #mail:hover {
        scale: 1;
    }
    #contact_container{
        justify-content: center;
    }
}
@media only screen and (max-device-width: 480px){
    #home div {
        transform: translateY(-10vh);
    }
    .section {
        min-width: 280px;
    }
    pre {
        max-width: 280px;
    }
    #mail {
        background: none;
    }
    #mail:hover {
        scale: 1;
    }
}
.link {
    margin-top: 60px;
    padding: 10px 30px 10px 30px;
    border-radius: 20px;
    background-color: #252525;
    transition: .3s;
}

.link:hover {

    background: #0060f4;
}

.corner {
    border-radius: 20px;
}
.corner-top {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

@keyframes scale {
    from {
        background-size: 140% auto;
    }
    to {
        background-size: 100% auto;
    }
}
@keyframes c-animate {
    from {
        transform: translateY(200px);
        opacity: 0;
    }
    to {
        transform: translateY(0px);
        opacity: 1;
    }
}

@keyframes bg-v {
    0% {
        opacity: 1;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    80%{
        opacity: 0;
    }
    100% {
        background: none;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}
@keyframes home-scale {
    from {
        scale: 100%;
        opacity: 1;
    }
    to {
        scale: 70%;
        opacity: 0;
    }
}

::-webkit-scrollbar{
    width: 10px;
    height: 10px;
    background: var(--nav-bg-color);
}
div > ::-webkit-scrollbar{
    background: none;
}



::-webkit-scrollbar-track {
    box-shadow: inset 0 0 2px var(--gray-color);
    background: black;
}
html > ::-webkit-scrollbar-track {
    margin-top: 60px;
}

div > ::-webkit-scrollbar-track {
    border-radius: 20px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: 20px;

}

div > ::-webkit-scrollbar-thumb {
    background: var(--nav-bg-color);
    border-radius: 20px;

}

::-webkit-scrollbar-thumb:hover{
    background: var(--nav-bg-color);
}

div > ::-webkit-scrollbar-thumb:hover{
    background: var(--gray-color2);
}

