*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --base: #764529;
    --base-100: #9d6c50;
    --base-400: #c6b193;
    --base-500: #ded0bd;
    --base-700: #5b321a;
    --base-800: #391704;
    --base-900: #1d0c02;
    --green: #98B66E;
    --green-100: #cedfc7;
    --green-200: #cbd5c0;
    --green-300: #819171;
    --green-400: #647c4e;
    --green-800: #b1cfaa;
    --yellow: #f3ebd5;
    --yellow-100: rgb(239, 239, 220);
    --yellow-400: var(--yellow);
    --yellow-800: var(--yellow);
    --cream: #ffffe7;
}

body {
    font-family: "Roboto Slab", serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-size: 20px;
    margin-left: 0px;
    margin-right: 0px;
}

p {
    color: var(--base-800);
}

a {
    text-decoration: none;
    color: var(--base-800);

    &:hover {
        text-decoration: underline;
    }
}

header {
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    max-width: 1440px;
    margin: auto;
    border-bottom: 1px solid rgba(0, 0, 0);

    .logo-holder {
        display: flex;
        padding: 10px;
        align-items: center;
        font-weight: 600;
        color: var(--base-800);

        .logo {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            background-color: var(--base-400);
            color: var(--base-400);
            height: 64px;
            width: 64px;
            margin-right: 20px;
            border-radius: 50%;
        }
    }

    nav {
        display: flex;
        align-items: center;

        ul {
            display: flex;
            list-style-type: none;
            gap: 5px;

            li {
                display: inline-block;

                a {
                    display: inline-block;
                    padding: 10px 20px;
                    color: var(--base-800);

                    &:hover {
                        background-color: var(--base-400);
                        border-radius: 10px;
                        text-decoration: none;
                    }
                }
            }
        }

        .mobile-toggle {
            display: none;
            color: var(--base-800);
            padding: 10px;

            @media (max-width: 768px) {
                display: inline-block;
                position: absolute;
                top: 20px;
                right: 20px;
            }
        }
    }

    @media (max-width: 1024px) {
        flex-direction: column;
        align-items: center;
    }

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: center;

        nav {
            margin-top: 10px;
            width: 100%;

            ul {
                display: none;
                flex-direction: column;
                text-align: center;
                width: 100%;

                a {
                    width: 100%;
                }

                &.active {
                    display: flex;
                }
            }
        }
    }
}

.container {
    max-width: 1440px;
    margin: auto;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    padding-left: 30px;
    padding-right: 30px;

    @media (max-width: 1440px) {
        padding-left: 30px;
        padding-right: 30px;
    }
}

.button {
    display: inline-block;
    padding: 10px 30px;
    color: var(--base-800);
    border-radius: 10px;
    transition: ease 0.3s all;

    &.yellow {
        background-color: var(--yellow);
        color: var(--base-800);

        &:hover {
            text-decoration: none;
            color: var(--base-900);
            background-color: var(--base-400);
        }
    }

    &.beige {
        background-color: var(--base-400);
        color: var(--base-800);

        &:hover {
            background-color: var(--base-500);
            color: var(--base-900);
        }
    }

    &.brown {
        background-color: var(--base-800);
        color: var(--base-400);

        &:hover {
            background-color: var(--base-500);
            color: var(--base-900);
        }
    }

    &.green {
        background-color: var(--green);
        color: var(--base-800);
        margin-right: 10px;
        margin-top: 10px;

        &:hover {
            background-color: var(--green-400);
            color: var(--yellow);
            text-decoration: none;
        }
    }

    &.close {
        padding: 2px 20px;
        border-radius: 20px;
        color: var(--base-400);
        cursor: pointer;

        &:hover {
            background-color: var(--yellow);
            color: var(--base-800);
        }
    }
}

h1 {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--base-800);

    small {
        display: block;
        font-weight: 100;
    }

    @media (max-width: 1024px) {
        font-size: 48px;
    }
}

h2 {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 10px;
    text-align: center;
    color: var(--base-800);

    small {
        display: block;
        font-weight: 100;
        font-size: 0.5em;
        color: var(--base);
    }

    @media(max-width: 1024px) {
        font-size: 32px;
    }
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.popup-content {
    background-color: var(--yellow-100);
    padding: 50px;
    
    border-radius: 20px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-content h2 {
    font-size: 42px;
    margin-bottom: 10px;
    text-align: left;
}

.popup-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--base-400);
}

.popup-meta-item {
    display: flex;
    flex-direction: column;
}

.popup-meta-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--base-100);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.popup-meta-value {
    font-size: 16px;
    color: var(--base-800);
    font-weight: 500;
}

.popup-content p {
    font-size: 18px;
    text-align: left;
    margin: 20px 0;
    line-height: 1.6;
}

.popup-section {
    margin: 30px 0;
}

.popup-section h3 {
    font-size: 24px;
    color: var(--base-800);
    margin-bottom: 15px;
    border-left: 4px solid var(--base-100);
    padding-left: 15px;
}

.popup-section ul {
    list-style: none;
    padding-left: 20px;
}

.popup-section li {
    font-size: 16px;
    line-height: 1.8;
    color: var(--base-800);
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.popup-section li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--base-100);
    font-weight: bold;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tech-badge {
    padding: 8px 16px;
    background-color: var(--green-200);
    color: var(--base-800);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.popup-content img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    margin: 30px 0;
    border-radius: 10px;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.close {
    position: absolute;
    font-size: 48px;
    font-weight: bold;
    top: 10px;
    right: 15px;

    &:hover {
        color: var(--base-800);
    }
}

@media (max-width: 768px) {
    .popup-content {
        padding: 40px 25px;
        max-width: 95%;
        
        h2 {
            font-size: 28px;
        }
        
        p {
            font-size: 16px;
        }

        .popup-section h3 {
            font-size: 20px;
        }

        .popup-section li {
            font-size: 15px;
        }
    }

    .popup-content img {
        max-height: 250px;
    }

    .close {
        font-size: 36px;
        top: 5px;
        right: 10px;
    }

    .popup-meta {
        gap: 15px;
    }
}

/* ===== NEW PROJECTS GRID STYLES ===== */
.projects-section {
    padding: 40px 20px;
}

/* Project Tabs */
.project-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 24px;
    background-color: var(--base-400);
    color: var(--base-800);
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Roboto Slab", serif;
}

.tab-button:hover {
    background-color: var(--base-100);
    transform: translateY(-2px);
}

.tab-button.active {
    background-color: var(--base-800);
    color: var(--yellow);
}

@media (max-width: 768px) {
    .tab-button {
        padding: 10px 18px;
        font-size: 14px;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.project-card {
    background-color: var(--yellow-100);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
    background-color: var(--base-500);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 24px;
    margin-bottom: 5px;
    color: var(--base-800);
    font-weight: 600;
}

.project-tag {
    font-size: 14px;
    color: var(--base-100);
    font-style: italic;
    margin-bottom: 12px;
    font-weight: 500;
}

.project-description {
    font-size: 16px;
    line-height: 1.5;
    color: var(--base-800);
    margin-bottom: 15px;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.project-tags .tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--base-400);
    color: var(--base-800);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.project-card:hover .project-tags .tag {
    background-color: var(--base-100);
}

@media (max-width: 768px) {
    .project-image {
        height: 200px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 20px;
    }
    
    .project-description {
        font-size: 15px;
    }

    .blog article h3 {
        font-size: 20px;
    }

    .blog article p {
        font-size: 15px;
    }

    .blog article {
        padding: 20px;
    }
}

/* ===== BLOG SECTION ===== */
.blog {
    padding: 40px 20px;

    .blog-posts {
        display: flex;
        gap: 30px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px 0;

        @media (max-width:1024px) {
            flex-direction: column;
        }

        article {
            background-color: var(--yellow-100);
            padding: 25px;
            border-radius: 20px;
            flex: 1;
            transition: transform 0.3s ease, box-shadow 0.3s ease;

            h3 {
                margin-top: 15px;
                margin-bottom: 5px;
                color: var(--base-800);
                font-size: 24px;
                font-weight: 600;
            }

            tags {
                display: inline-block;
                padding: 6px 12px;
                background-color: var(--base-400);
                color: var(--base-800);
                font-size: 11px;
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                margin-left: 5px;
                border-radius: 5px;
                transition: background-color 0.2s ease;
            }

            div {
                font-size: 14px;
                font-weight: 500;
                margin-bottom: 12px;
                margin-top: 5px;
                color: var(--base-100);
            }

            p {
                font-size: 16px;
                line-height: 1.5;
                color: var(--base-800);
                margin-bottom: 3px;
            }

            figure {
                width: 100%;
                padding-top: 56.25%;
                overflow: hidden;
                position: relative;
                border-radius: 15px;

                img {
                    position: absolute;
                    top: 0;
                    left: 0;
                    height: 100%;
                    object-fit: cover;
                }

                figcaption {
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    background-color: var(--base-800);
                    color: var(--base-400);
                    text-align: center;
                    padding: 10px;
                    opacity: 0;
                    visibility: hidden;
                    transition: ease 0.3s all;
                }
            }

            &:hover {
                figcaption {
                    opacity: 1;
                    visibility: visible;
                }

                transform: translateY(-8px);
                box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
            }

            &:hover tags {
                background-color: var(--base-100);
            }
        }

        a {
            &:hover {
                text-decoration: none;
            }
        }
    }
}



/* ===== HERO SECTION ===== */
.hero {
    display: flex;
    margin: 40px 20px;
    padding-left: 70px;

    @media (max-width: 1024px) {
        flex-direction: column;
    }

    .hero-yellow1 {
        flex: 1;
        background-color: var(--yellow);
        border-radius: 30px;
        padding: 30px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;

        span {
            @media (max-width: 1024px) {
                display: none;
            }
        }

        .call-to-action {
            margin-top: 20px;
            margin-bottom: 10px;

            a {
                margin-right: 10px;
                margin-bottom: 10px;
            }
        }
    }

    .social-links {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 15px;

        a {
            &:hover {
                text-decoration: none;
            }
        }
    }

    .social-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .hero-yellow2 {
        flex: 0 0 auto;
        background-color: none;
        border-radius: 30px;
        padding: 0px 3px;
        display: flex;
        justify-content: center;
        align-items: flex-end;

        img {
            margin-top: -30px;
            max-width: 420px;
            margin-bottom: -10px;
        
        }

         @media (max-width: 1024px) {
            margin-top: 50px;

            img {
                max-width: 40g0px;
            }
        }
    }
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--base-800);
    color: var(--yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.back-to-top:hover {
    background-color: var(--base-700);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}