@import "fonts.css";

:root [data-theme="light"] {
    --text: #020308;
    --background: #f7f9fd;
    --primary: #3f70d9;
    --secondary: #e9ea95;
    --accent: #60e174;
}

:root [data-theme="dark"] {
    --text: #f7f8fd;
    --background: #020408;
    --primary: #2657c0;
    --secondary: #696a15;
    --accent: #1e9f31;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    scroll-margin-block-start: 90px;
    transition: all 0.1s;
    font-family: "MonospaceXenon", monospace;
}

body {
    font-style: normal;
    color: var(--text);
    background-color: var(--background);
    opacity: 1;
    background-image: radial-gradient(var(--primary) 1.3px, transparent 1.3px),
        radial-gradient(var(--primary) 1.3px, var(--background) 1.3px);
    background-size: 52px 52px;
    background-position: 0 0, 26px 26px;
}

a {
    text-decoration: none;
}

a:visited {
    color: inherit;
}

li {
    list-style-type: none;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    font-weight: 400;
}

h3 {
    font-size: 1.5rem;
    font-weight: 400;
}

p {
    font-size: 1rem;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

header {
    position: fixed;
    top: 0;
    z-index: 10;
    width: 100%;
    border-bottom: var(--text) solid 1px;
    backdrop-filter: blur(10px);

    nav {
        width: 80%;
        margin: auto;
        display: flex;
        align-items: center;

        >img{
            display: none;
        }

        div {
            margin-left: auto;
            display: flex;
            gap: 2rem;
    
            a {
                color: var(--text);
                font-size: 1rem;
            }
        }

        h3{
            position: relative;
        }

        h3::after{
            position: absolute;
            content: '';
            display: block;
            width: 0;
            height: 2px;
            background: var(--accent);
            left: 50%;
            transform: translateX(-50%);
            transition: width 0.5s;
        }


    }

    > div {
        display: none;
    }

    

    img {
        height: 70px;
    }

    

    a:hover {
        color: var(--accent);
        
        h3::after{
            width: 100%;
        }
    }
}

main {
    padding-top: 100px;
    width: 100%;
    section {
        width: 80%;
        margin: auto;
    }
}

#home > div {
    min-height: 80dvh;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap-reverse;

    img {
        max-height: 400px;
        min-width: 250px;
        border-radius: 50%;
        opacity: 0;
        animation: fadeIn 1s forwards;
    }

    div {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    div:first-child {
        border-radius: 1rem;
        flex: 3;

        h1 {
            padding: 1.5rem;
            background: var(--accent);
            border-top-left-radius: 2rem;
            border-bottom-right-radius: 2rem;
            opacity: 0;
            animation: fadeIn 2s forwards;
        }

        h1:hover {
            border-top-left-radius: 0;
            border-bottom-right-radius: 0;
            border-top-right-radius: 2rem;
            border-bottom-left-radius: 2rem;
            padding: 2rem;
        }

        h2 {
            padding: 1rem;
            border-top-right-radius: 2rem;
            border-bottom-left-radius: 2rem;
            background: rgb(63,112,217);
            background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 63%);
            opacity: 0;
            animation: fadeIn 1s 1s forwards;
        }
    }

    div:last-child {
        flex: 2;
        align-items: flex-end;

        img {
            border: 2px solid var(--primary);
            box-shadow: 0px 0px 20px 0px var(--primary);
        }
    }

}

#about > div {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    justify-content: center;
    gap: 1rem;

    > div:first-child {
        background: transparent;
        backdrop-filter: blur(2px);
        border: 2px solid var(--primary);
        padding: 1rem;

        h3 {
            padding: 1rem;
            font-style: italic;
        }
    }

    > div:first-child:hover {
        box-shadow: 0px 0px 20px 0px var(--primary);
    }

    > h2 {
        font-weight: 600;
        border: 2px solid var(--accent);
        border-bottom: none;
        backdrop-filter: blur(2px);
        padding: 1rem;
        margin-bottom: -2rem;
    }

    > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
        backdrop-filter: blur(2px);
        border: 2px solid var(--accent);
        border-top: none;
        padding: 1rem;

        div {
            display: flex;
            gap: 1rem;
            flex-direction: column;
            padding: 1rem;
            border-right: 2px solid var(--accent);
            border-left: 2px solid var(--accent);
            border-radius: 0.5rem;
        }

        img {
            height: 50px;
        }

        ul {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
    }
}

#projects > div {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    justify-content: center;
    gap: 1.5rem;

    h1{
        backdrop-filter: blur(2px);
    }


    .project-card {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap-reverse;
        border: 3px solid var(--primary);
        padding: 1rem;
        backdrop-filter: blur(2px);

        > div:first-child {
            display: flex;
            justify-content: center;
            flex: 2;
            position: relative;
            
            >img {
                width: 300px;
                height: 200px;
                object-fit: cover;
                filter: blur(2px);
            }

            ul {
                position: absolute;
                display: flex;
                gap: 1rem;
                left: 50%;
                top: 50%;
                transform: translate(-50%, -50%);
                backdrop-filter: blur(2px);
                padding: 1rem;
                border-radius: 5px;
            }

            ul::after {
                content: "Visit";
                position: absolute;
                top: -1.5rem;
                left: 2.8rem;
                color: var(--text);
                background-color: var(--accent);
                padding: 4px;
                border-radius: 0.5rem;
            }

            ul img {
                height: 50px;
                width: 50px;
            }

            ul img:hover{
                scale: 1.05;
            }
        }

        > div:last-child {
            flex: 3;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 0.5rem;

            p {
                display: block;
            }

            img {
                height: 50px;
            }

            ul {
                display: flex;
                gap: 0.5rem;
            }
        }
    }

    .project-card:hover {
        box-shadow: 0px 0px 20px 0px var(--accent);
        border-radius: 0.5rem;
        scale: 1.01;

        
        > div:first-child >img {
            filter: blur(0);
        }    
    }

    
}

footer {
    border-top: 1px solid var(--text);
    margin-top: 10rem;
    backdrop-filter: blur(2px);

    #contact {
        width: 80%;
        margin: auto;
        display: flex;
        align-items: start;
        gap: 1rem;
        min-height: 50dvh;
        flex-wrap: wrap;
        padding: 1rem;

        img {
            height: 80px;
        }

        div:first-child {
            flex: 4;
            ul {
                display: flex;
                gap: 1rem;
            }
        }

        div:last-child {
            flex: 5;
        }

        form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            backdrop-filter: blur(2px);
            border: 1px solid var(--primary);
            border-radius: 1rem;
            padding: 1rem;
            input,
            textarea {
                padding: 0.5rem;
                border: none;
                border-bottom: 1px solid var(--text);
                background: var(--background);
                color: var(--text);
                resize: none;
            }

            button {
                padding: 0.5rem;
                border: none;
                background: var(--accent);
                color: var(--background);
                cursor: pointer;
                font-family: "MonospaceXenon", monospace;
                border-radius: 0.5rem;
            }

            button:hover {
                background: var(--primary);
            }
        }
    }

    h4 {
        display: flex;
        width: 100%;
        padding: 1rem;
        background: var(--secondary);
        align-items: start;
        justify-content: space-between;

        a{
            color: var(--accent) !important;
            text-decoration: underline;
        }

        span{
            text-align: end;
        }
    }
}

.theme {
    filter: invert(100%);
}

#theme-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 10;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    img {
        height: 50px;
    }
}

.menuOpen{
    margin-top: 0;
}

.response{
    background: var(--accent);
    width: 100%;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    width: fit-content;
}


@media only screen and (max-width: 768px) {  
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
        font-weight: 400;
    }
    
    h3 {
        font-size: 1.2rem;
        font-weight: 400;
    }
    
    p {
        font-size: 1rem;
    }

    header{
        border-bottom: none;
        min-height: 70px;

        nav{
            width: 100%;
        }
        nav img{
            display: block;
            padding: 0.5rem;
        }
        nav div{       
            display: none;
        }

        >div{
            display: flex;
            flex-direction: column;
            gap: 1rem;
            width: 100%;
            align-items: center;
            justify-content: center;
            margin-top: -100%;
            backdrop-filter: blur(10px);
            transition: margin-top 0.5s;

            a{
                border-bottom: 1px solid var(--text);
                width: 100%;
                text-align: center;
                padding-bottom: 1rem;
            }
        }

    }

    main{
        padding-top: 30px;
        section{
            width: 100%;
            padding: 1rem;
            margin-top: 2rem;
        }
    }

    #home > div {
        div:last-child {
            flex: 2;
            align-items: center;
        }

        img {
            max-height: 300px;
            min-width: 250px;
            border-radius: 50%;
        }
    }

    #projects > div {
        & .project-card {
            & > div:first-child {
                >img {
                    width: 250px;
                    height: 200px;
                    object-fit: cover;
                    filter: blur(2px);
                }
            }
        }
    }
}


@media only screen and (max-width: 1024px) {
    *{
        scroll-margin-block-start: 100px;
    }
    main{
        section{
            width: 100%;
            padding: 1rem;
            margin-top: 2rem;
        }
    }
}

@keyframes fadeIn{
    0%{
        opacity: 0;;
    }
    100%{
        opacity: 1;
    }
}
