/*1. CSS Variables (Theme)*/
:root {
    --purple-500: #c300ff;
    --red-500: #ef4444;
    --red-800: #991b1b;
    --blue-600: #2563eb;
    --blue-800: #1e40af;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --white: #fff;
    /* --marquee-width: 100vw;
    --marquee-elements-displayed: 15;
    --marquee-element-width: 170px;
    --marquee-animation-duration: calc(var(--marquee-elements) * 3s); */
}

/*2. Base & Utility Styles*/
body {
    width: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--gray-900);
    color: var(--white);
    line-height: 1.6;
}

@media(max-width: 600px) {
    body {
        line-height: 1.3;
    }
}

a {
    text-decoration: none;
}

.hidden {
    display: none !important;
}

.fab {
    color: var(--purple-500);
    font-size: 60px;
}

/* --- Loading Overlay Styles --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111827;
    /* Matches your vanta-bg color */
    z-index: 9999;
    /* Highest layer */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Crucial: prevents the overlay from blocking clicks after hiding */
}

/* Example Spinner Styling */
.spinner {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #a855f7;
    /* Assuming purple accent color */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.container {
    max-width: 90rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.icon-main {
    width: 40px;
    height: 40px;
    padding: 0rem 1rem 0rem 0rem;
}

.icon {
    width: 80px;
}


.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    color: var(--purple-500);
    padding: 3rem;
}

@media(max-width:600px) {
    .section-title {
        font-size: 2rem;
        font-weight: 700;
        text-align: center;
        color: var(--purple-500);
        padding: 1.5rem;
    }
}

.logo-text {
    transition: opacity 0.3s ease-in-out;
    display: inline-block;
    opacity: 1;
}

.fade-out {
    opacity: 0;
}

.contact-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--white);
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 300ms, background-color 300ms;
}

.contact-button:hover {
    transform: scale(1.05);
}

.contact-button img.contact-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/*3. Header & Navigation*/
.main-header {
    background-color: rgba(31, 41, 55, 0.75);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.logo {
    display: flex;
    padding: 0rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple-500);
}

@media (max-width:768px) {
    .icon-main {
        padding: 0rem 0rem 0rem 0rem;
    }

    .logo {
        display: contents;
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--purple-500);
    }
}

.nav-links {
    display: none;
    gap: 1rem;
}

.nav-item {
    color: var(--gray-300);
    transition: color 300ms;
}

.nav-item:hover {
    color: var(--white);
}

.mobile-menu-button {
    color: var(--gray-300);
    transition: color 300ms;
    border: none;
    background: transparent;
    cursor: pointer;
}

.mobile-menu-button:hover {
    color: var(--white);
}

.mobile-menu-button .menu-icon,
.mobile-menu-button svg {
    width: 1.5rem;
    height: 1.5rem;
}

.mobile-menu-dropdown {
    background-color: var(--gray-800);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
}

.mobile-nav-item {
    display: block;
    text-align: center;
    color: var(--gray-300);
    padding: 0.5rem 0;
    transition: color 300ms;
    border-top: 1px solid var(--gray-700);
}

.mobile-nav-item:last-child {
    border-bottom: 1px solid var(--gray-700);
}

.mobile-nav-item:hover {
    color: var(--white);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .mobile-menu-button {
        display: none;
    }
}

/*4. Hero Section*/
.main-content {
    margin-top: 3.5rem;
}



.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.5rem;
}

.hero-content {
    max-width: 64rem;
    margin: auto;
    padding: 2rem;
    background-color: var(--gray-800);
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

@media (max-width: 600px) {
    .hero-section {
        min-height: 80vh;

    }

    .hero-content {
        margin: 0;
        padding: 1rem;
    }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
}

.text-purple {
    color: var(--purple-500);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-300);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--purple-500);
    color: var(--white);
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 300ms, background-color 300ms;
}

.cta-button:hover {
    background-color: color-mix(in srgb, var(--purple-500) 80%, black);
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }
}

/*5. About Section*/
.about-section {
    padding: 5rem 1rem;
}

.about-container {
    max-width: 80rem;
}

.about-content {
    background-color: var(--gray-800);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hobbies-content {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.about-image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.profile-pic {
    border-radius: 9999px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 12rem;
    height: 12rem;
    object-fit: cover;
}

.about-text-wrapper {
    width: 100%;
    text-align: center;
}

.about-text {
    color: var(--gray-300);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .about-text {
        font-size: 1rem;
    }

    .about-section {
        padding: 4rem 0rem;
    }

    .about-container {
        padding: 0.5rem;
    }
}

@media (min-width: 768px) {
    .about-content {
        flex-direction: row;
        gap: 3rem;
    }

    .about-image-wrapper {
        width: 33.333333%;
    }

    .profile-pic {
        width: 16rem;
        height: 16rem;
    }

    .about-text-wrapper {
        width: 66.666667%;
        text-align: left;
    }
}

/*6. Projects Section*/
.section {

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

/* Initial states (hidden) */

/* Image starts above and to the left (North West) */
.image-box img {

    opacity: 0;
    /* Start 100px left and 100px up */
    transform: translateY(-40px) translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.text-box {
    opacity: 0;
    /* Start 40px right and 40px down */
    transform: translateX(40px) translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.image-box-rev img {

    opacity: 0;
    /* Start 40px left and 40px up */
    transform: translateY(-40px) translateX(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* @media (max-width: 600px) {
    .image-box img {
        width: 100px;
    }


    .image-box-rev img {}
} */

/* Text starts below and to the right (South East) */
.text-box-rev {
    opacity: 0;
    /* Start 100px right and 100px down */
    transform: translateX(-100px) translateY(100px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Final states (visible) */
/* Image slides into final position */
.image-box-rev.is-visible img {
    opacity: 1;
    /* End at original position */
    transform: translateX(0) translateY(0);
}

/* Text slides into final position */
.text-box-rev.is-visible {
    opacity: 1;
    /* End at original position */
    transform: translateX(0) translateY(0);
}

/* Image slides into final position */
.image-box.is-visible img {
    opacity: 1;
    /* End at original position */
    transform: translateX(0) translateY(0);
}

/* Text slides into final position */
.text-box.is-visible {
    opacity: 1;
    /* End at original position */
    transform: translateX(0) translateY(0);
}

/* Layout and other styling (same as before) */
.scroll-section {
    padding: 5rem 1rem;
    /* min-height: 100vh; */
    display: flex;
    justify-content: center;
    align-items: center;
}

.content-container {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: auto;
    background-color: var(--gray-900);
    padding: 1.5rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--purple-500);
}

.content-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

.projects-section {
    padding: 3rem 1rem;

}

.image-box,
.text-box {
    justify-items: anchor-center;
    flex: 1;
}

.image-box-rev,
.text-box-rev {
    justify-items: anchor-center;
    flex: 1;
}

.hobbies-section {
    padding: 5rem 1rem;

}

.tools-section {
    padding: 3rem 1rem;

}

@media (max-width: 600px) {
    .scroll-section {
        padding: 2rem 0rem;
    }

    .projects-section {
        padding: 1rem 1rem;

    }

    .hobbies-section {
        padding: 1rem 1rem;

    }

    .content-container {
        flex-direction: column;
    }

    .tools-section {
        padding: 2rem 0rem;

    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--gray-900);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--gray-700);
    transition: border-color 300ms, transform 300ms;
}

.project-card:hover {
    border-color: var(--purple-500);
    transform: scale(1.05);
}

.project-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.project-image.loaded {
    opacity: 1;
}

.project-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
    text-align: center;
}
@media(max-width:600px){
    .project-title{
        font-size: 1.5rem;
    }
}
.project-description {
    color: var(--gray-400);
    margin-bottom: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/*7. Contact Section*/
.contact-section {
    padding: 5rem 1rem;
}

.contact-container {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.contact-text {
    color: var(--gray-300);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.contact-buttons-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.email-button {
    background-color: var(--red-500);
}

.email-button:hover {
    background-color: var(--red-800);
}

.linkedin-button {
    background-color: var(--blue-600);
}

.linkedin-button:hover {
    background-color: var(--blue-800);
}

/*8. Footer*/
.main-footer {
    background-color: var(--gray-900);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gray-400);
}

/*9. Image Modal*/
.image-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.image-modal.visible {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}

.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.1rem 0.5rem;
    font-size: 1.875rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 60;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/*10. Loading/Placeholder*/
.loading-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.loading-placeholder::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-top: 4px solid var(--purple-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/*11. Carousel (Swiper)*/
.swiper {
    width: 100%;
    height: 400px;
}

.swiper-slide {
    position: relative;
    background-position: center;
    background-size: cover;
    width: 400px;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
}

.slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 8px 10px;
    text-align: center;
    font-size: 1em;
    font-weight: 500;
    z-index: 10;
}

.swiper-pagination-bullets {
    display: none;
}

.hobbies-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.swiper-lazy-preloader {
    position: absolute;
    border-color: var(--purple-500) !important;
    border-top-color: transparent !important;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/*languages carousel*/
.marquee {
    justify-self: center;
    overflow: hidden;
    position: relative;
    width: 80%;
    height: 100px;
    background-color: var(--gray-800);
    padding-bottom: 2rem;
}

.marquee-content li img {
    width: 80px;
    padding-left: 3em;
    padding-right: 3rem;

}

.marquee-content {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: max-content;
    z-index: 1;

}

.marquee::before,
.marquee::after {
    content: "";
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--gray-800) 0%, transparent 100%);
}

.marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--gray-800) 0%, transparent 100%);
}

.marquee-left .marquee-content {
    animation: scroll-left 50s linear infinite;
}

.marquee-right .marquee-content {
    animation: scroll-right 30s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scroll-right {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    .marquee {
        width: 100%;
        height: 50px;
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .marquee-content li img {
        width: 50px;
        padding-left: 1em;
        padding-right: 1rem;
    }

    .marquee-left .marquee-content {
        animation: scroll-left 40s linear infinite;
    }

    .marquee-right .marquee-content {
        animation: scroll-right 30s linear infinite;
    }

    .marquee::before,
    .marquee::after {

        width: 40px;



    }
}


.fade-in-bounce {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.165, 0.84, 0.44, 1),
        /* Custom cubic-bezier for a subtle bounce */
        transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

.hero-section,
.about-section,
.projects-section,
.contact-section,


.hero-section.is-visible,
.about-section.is-visible,
.projects-section.is-visible,
.contact-section.is-visible,
#hobbies.is-visible {
    opacity: 1;
    transform: translateY(0);
}


.tools-container {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.tech-grid-wrapper {
    margin-bottom: 40px;
    padding-top: 20px;
}

.tech-grid-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 25px;
    font-weight: 600;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    justify-items: center;
    align-items: start;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.165, 0.84, 0.44, 1),
        transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}


.tech-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
}

.tech-title {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.tech-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 600px) {
    .tools-container {
        padding: 1rem;

    }

    .tech-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0px;
    }

    .tech-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 20px;
        justify-items: center;
        align-items: start;
    }
}