* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    scroll-behavior: smooth;
    list-style: none;
}

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --section-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #000000;
    --header-bg: #ffffff;
    --header-border: #3b3b3b4d;
    --nav-link-color: #000000;
    --footer-text: #000000;
    --input-placeholder: #666;

    --main-gradient: linear-gradient(to right, rgb(0, 157, 255), rgb(255, 0, 255));
    --scrollbar-track: rgb(219, 219, 219);
}

/* ========== UNIVERSAL STYLES ========== */

section {
    min-height: 100vh;
    padding: 8rem 12%;
    width: 100%;
    position: relative;
    background-color: var(--section-bg);
}

.section-title {
    font-size: 4rem;
    font-weight: 600;
    background: var(--main-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-align: center;
}

.contain {
    max-width: 1170px;
    margin-inline: auto;
    padding-inline: 2rem;
}

.btn-group {
    display: flex;
    gap: 1rem;
}

.btn {
    border-radius: 3rem;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    background-color: transparent;
    cursor: pointer;
    font-weight: 500;
    text-wrap: nowrap;
    transition: 0.2s ease-in-out;

    &:hover {
        background-color: var(--text-color);
        color: var(--bg-color);
    }
}

a {
    position: relative;
    color: var(--nav-link-color);
    font-weight: 300;
    text-decoration: none;

    &::before {
        position: absolute;
        content: '';
        width: 0;
        left: 0;
        height: 5px;
        top: 25px;
        border-radius: 1rem;
        transition: 0.3s ease-in-out;
        background: var(--main-gradient);
    }

    &:hover::before {
        width: 100%;
    }
}

/* ========== UNIVERSAL SCROLLBAR ========== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background-color: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: linear-gradient(to bottom, #009dff, #ff00ff);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;

    &.dark-mode {
        --bg-color: #0f0f0f;
        --text-color: #ffffff;
        --section-bg: #0f0f0f;
        --card-bg: #1a1a1a;
        --card-border: #333333;
        --header-bg: #0f0f0f;
        --header-border: #ffffff26;
        --nav-link-color: #ffffff;
        --footer-text: #ffffff;
        --input-placeholder: #aaa;
    }
}

/* ========== HEADER ========== */

.header {
    padding-inline: .75rem;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 70px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--header-bg);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--header-border);

    .header-container {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        transition: padding 0.5s ease;

        .logo {
            color: var(--nav-link-color);
            font-size: 1.15rem;
            font-weight: 600;
            text-wrap: nowrap;
            transition: 0.3s ease-in-out;

            &:hover {
                transform: scale(1);
                opacity: .8;
            }

            &::before {
                display: none;
            }
        }

        .nav-links {
            display: flex;
            gap: 2rem;
            transform: translateX(2rem);

            li {
                a {
                    position: relative;
                    color: var(--nav-link-color);
                    font-weight: 300;
                    font-size: .85rem;
                    display: flex;
                    align-items: center;
                    column-gap: .5rem;

                    &::before {
                        position: absolute;
                        content: '';
                        width: 0;
                        left: 0;
                        height: 3px;
                        top: 20px;
                        border-radius: 1rem;
                        transition: 0.3s ease-in-out;
                        background: var(--main-gradient);
                    }

                    &:hover::before {
                        width: 100%;
                    }
                }
            }
        }

        .nav-right {
            display: flex;
            width: 200px;
            align-items: center;

            .visit-btn {
                padding: 0.8rem 1.5rem;
                border-radius: 3rem;
                border: none;
                font-weight: 500;
                font-size: 1rem;
                color: white;
                cursor: pointer;
                text-wrap: nowrap;
                transition: 0.3s ease-in-out;
                background: var(--main-gradient);

                &:hover {
                    background: linear-gradient(to right, rgb(255, 0, 255), rgb(0, 157, 255));
                    transform: scale(1);
                }
            }

            #menu-icon {
                font-size: 2rem;
                display: none;
                color: var(--nav-link-color);
                cursor: pointer;
            }
        }
    }

    &.scrolled {
        padding-top: 2.5rem;
        border-bottom: none;
        background-color: var(--header-bg);

        .header-container {
            padding: 0;
            padding-left: 2rem;
            width: 90%;
            max-width: 1000px;
            height: 65px;
            background-color: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
            border-radius: 4rem;
        }

        .logo,
        .nav-links li a,
        #menu-icon {
            color: white;
        }
    }
}

.theme-toggle {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--nav-link-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease-in-out;
    padding: 0.5rem;
    border-radius: 50%;

    &:hover {
        background: var(--main-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        transform: scale(1.1);
    }
}

.header.scrolled #theme-icon {
    color: white;
}

/* =========== ABOUT ========== */

.about {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--section-bg);

    .about-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10rem;

        img {
            width: 30vw;
            border-radius: 50%;
            border: 2px solid var(--card-border);
        }

        .info-box {
            display: flex;
            flex-direction: column;
            text-align: center;
            align-items: center;
            justify-content: center;
            gap: 1.5rem;

            h3 {
                font-size: 1.8rem;
                font-weight: 500;
                opacity: 0.8;
                color: var(--text-color);
            }

            h1 {
                font-size: 4rem;
                font-weight: 600;
                color: var(--text-color);
            }

            span {
                background: var(--main-gradient);
                background-clip: text;
                -webkit-background-clip: text;
                color: transparent;
                font-size: 2rem;
            }

            .socials {
                display: flex;
                gap: 2rem;

                i {
                    font-size: 2.5rem;
                    cursor: pointer;
                    transition: 0.2s ease-in-out;
                    color: var(--text-color);

                    &:hover {
                        transform: scale(1.1);
                        background: var(--main-gradient);
                        -webkit-background-clip: text;
                        -webkit-text-fill-color: transparent;
                    }
                }
            }
        }
    }
}

/* ========== EXPERIENCE ========== */

.experience {
    background-color: var(--section-bg);

    .experience-info {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5rem;
        margin-top: 3rem;

        .grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 2rem;

            .grid-card {
                padding: 2.5rem 3rem;
                display: flex;
                flex-direction: column;
                align-items: baseline;
                justify-content: center;
                row-gap: .5rem;
                background-color: var(--card-bg);
                border: 2px solid var(--card-border);
                border-radius: 2.5rem;
                color: var(--text-color);
                cursor: pointer;
                transition: 0.3s ease-in-out;
                height: 200px;

                &:hover {
                    border: 2px solid var(--text-color);
                    transform: scale(1.0);
                    background: var(--text-color);
                    color: var(--bg-color);

                    i,
                    h3,
                    p {
                        color: var(--bg-color);
                    }
                }

                i {
                    font-size: 1.3rem;
                    color: var(--text-color);
                }

                span {
                    font-size: 1rem;
                    font-weight: 700;
                    background: var(--main-gradient);
                    -webkit-background-clip: text;
                    background-clip: text;
                    color: transparent;
                }

                h3 {
                    font-size: 1rem;
                    font-weight: 600;
                    color: var(--text-color);
                }

                p {
                    font-size: 0.75rem;
                    font-weight: 300;
                    opacity: 0.8;
                    color: var(--text-color);
                }
            }
        }

        img {
            max-width: 400px;
            width: 100%;
            min-width: 300px;
            border-radius: 3rem;
            aspect-ratio: 1/1;
            object-fit: cover;
            object-position: center;
            border: 2px solid var(--card-border);
        }
    }
}

/* ========== PORTFOLIO =========== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-top: 4rem;
    background-color: var(--section-bg);

    .project-card {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 1.5rem;
        background-color: var(--card-bg);
        border: 2px solid var(--card-border);
        color: var(--text-color);
        border-radius: 3rem;
        cursor: pointer;
        transition: 0.3s ease-in-out;

        img {
            width: 100%;
            border-radius: 1rem;
            border: 1px solid var(--card-border);
        }

        h3 {
            font-size: 2rem;
            font-weight: 500;
            color: var(--main-gradient);
        }

        .btn {

            a {

                &::before {
                    display: none;
                }

                &:hover {

                    &::before {
                        display: none;
                    } 
                }
            }
        }

        &:hover {
            background-color: var(--text-color);
            color: var(--bg-color);
            transform: translateY(-10px) scale(1.02);

            .btn {
                border: 2px solid var(--bg-color);
                color: var(--bg-color);

                &:hover {
                    border: 2px solid var(--bg-color);
                    background-color: var(--bg-color);
                    color: var(--text-color);
                }
            }
        }
    }
}

/* ========== CONTACT ========== */

.input-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2rem;
    margin-top: 5rem;
    background-color: var(--section-bg);

    .input {
        position: relative;

        input {
            border-radius: 3rem;
            border: 2px solid var(--text-color);
            padding: 2rem 8rem;
            font-size: 3rem;
            background-color: var(--card-bg);
            color: var(--text-color);
            outline: none;

            &::placeholder {
                font-size: 3rem;
                color: var(--input-placeholder);
            }

            &:focus {
                border-color: var(--main-gradient);
            }
        }

        i {
            position: absolute;
            font-size: 4rem;
            top: 50%;
            left: 10px;
            transform: translate(50%, -50%);
            color: var(--text-color);
        }
    }
}

/* ========== FOOTER ========== */

footer {
    bottom: 0;
    left: 0;
    height: 10rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    background-color: var(--section-bg);

    ul {
        display: flex;
        align-items: center;
        gap: 3rem;

        li {
            list-style: none;

            a {
                color: var(--footer-text);
                font-weight: 600;
                text-decoration: none;
                transition: 0.3s ease;

                &:hover {
                    opacity: 0.7;
                }
            }
        }
    }

    .copyright {
        font-weight: 300;
        margin-top: 2rem;
        color: var(--footer-text);

        a {
            background: var(--main-gradient);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;

            &::before {
                display: none;
            }
        }
    }
}

/* ========== RESPONSIVENESS ========== */

/* Tablet and Small Laptops */
@media (max-width: 1024px) {
    section {
        padding: 6rem 5%;
    }

    .about-container {
        gap: 3rem !important;
    }

    .about-container img {
        width: 35vw;
    }

    .experience-info {
        flex-direction: column-reverse;
        gap: 3rem !important;
    }

    .input-box .input input,
    .input-box .input input::placeholder {
        font-size: 2rem;
        padding: 1.5rem 5rem;
    }
}

/* Mobile Devices (Menu Toggle logic) */
@media (max-width: 768px) {
    #menu-icon {
        display: block !important;
        margin-right: 1rem;
        color: var(--nav-link-color);
    }

    .visit-btn {
        display: none;
        /* Hide button on mobile to save space */
    }

    #menu-icon {
        display: block !important; /* Show hamburger */
        font-size: 2.2rem;
        cursor: pointer;
        z-index: 1100;
        color: var(--nav-link-color);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Start off-screen to the right */
        width: 70%;
        height: 100vh;
        background-color: var(--header-bg);
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: flex-start;
        padding-top: 6rem;
        gap: 1.5rem;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        padding-left: 1rem;
        color: var(--nav-link-color);

        a {
            color: var(--nav-link-color);
        }
    }

    /* When the 'open' class is added via JS */
    .nav-links.open {
        right: 0;
    }

    .nav-links li a {
        font-size: 1.2rem !important;
    }

    /* Keep the toggle and icon visible */
    .nav-right {
        width: auto !important;
        gap: 1.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .info-box h1 {
        font-size: 2.5rem !important;
    }

    header {

        &.scrolled {

            #menu-icon {
                color: #fff;
            }
        }
    }

    .about {
    
        .about-container {
            flex-direction: column;
    
            img {
                width: 250px;
            }
        }
    }

    .experience {

        .experience-info {

            .grid {
                grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));

                .grid-card {
                    align-items: center;
                    border-radius: 2rem;
                    height: 200px;

                    i {
                        font-size: 2.53rem;
                    }
                }
            }
        }
    }

    .input-box .input input,
    .input-box .input input::placeholder {
        font-size: 1.2rem;
        padding: 1rem 3rem;
    }

    .input-box .input i {
        font-size: 1.5rem;
    }

    footer {
        padding-bottom: 6rem;
        
        ul {
        gap: 1.5rem;
        flex-wrap: wrap;
        justify-content: start;
        text-align: left;
        flex-direction: column;
    }}

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
        gap: .5rem;

        .project-card {
            padding: .7rem;
            border-radius: 1rem;
            padding: 1rem;

            img {
                width: 100%;
                border-radius: 1rem;
                border: 1px solid var(--card-border);
            }
        }
    }
}