* {
    font-family: "DM Mono", monospace;
    font-weight: 300;
    color: white;
}

html {
    background-color: #090911;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
}

.material-symbols-rounded {
    font-variation-settings: 'wght' 300;
}

/* NAVIGATION STYLES (Keep as is) */
.navigation {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 15px 0px;
    position: fixed;
    z-index: 999;
    background-color: rgba(9, 9, 17, 0.001);
    backdrop-filter: blur(0px);
}

.navigation .desktop-nav {
    display: flex;
    flex-direction: row;
    gap: 100px;
    justify-content: center;
    align-items: center;
}

.navigation .item {
    font-size: 20px;
    width: 100px;
    text-align: center;
    text-wrap: nowrap;
    cursor: pointer;
}

.navigation .logo {
    width: 75px;
    cursor: pointer;
    transition: scale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.navigation .logo:hover {
    scale: 1.1;
}

.mobile-nav-header,
.mobile-nav-overlay {
    display: none;
}

/* PORTFOLIO SECTION STYLES (Keep as is) */
.portfolio {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100vw;
    padding-top: 150px;
}

.portfolio .maintext {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 2rem;
}

.portfolio .bigtext {
    font-size: 55px;
    font-family: 'Gloock', monospace;
    text-align: center;
}

.portfolio .smalltext {
    font-size: 17px;
    opacity: 0.5;
    text-align: center;
}

.portfolio .portfolio-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, 350px);
    gap: 2rem;
    padding: 20px 40px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
}

/* ===== START: UPDATED PORTFOLIO ITEM STYLES ===== */

.portfolio-item {
    display: flex;
    flex-direction: column;
    background-color: #1a1a22;
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    cursor: pointer;
    width: 350px;
}

.portfolio-item:hover {
    transform: translateY(-8px);
}

.portfolio-item__image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* This is now the transparent container for the text content */
.portfolio-item__details {
    position: relative;
    /* Crucial for positioning the ::before pseudo-element */
    isolation: isolate;
    /* Creates a new stacking context */
    display: flex;
    flex-direction: column;
    padding: 12px;
    flex-grow: 1;
    gap: 10px;
    margin-top: -200px;
    padding-top: 150px;
    /* Background and blur are REMOVED from here */
}

/* This new pseudo-element holds the background, blur, and MASK */
.portfolio-item__details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    /* Places this layer BEHIND the text content */

    /* The dynamic background from your JS will be applied here via a CSS variable */
    background: var(--card-gradient, linear-gradient(to bottom, transparent, #1a1a22 40%));
    /* Fallback gradient */

    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    /* Safari support */

    /* THE MASK! This fades the pseudo-element out at the top */
    mask-image: linear-gradient(to top,
            black 58%,
            /* Bottom 60% is fully visible */
            transparent 100%
            /* Fades to transparent at the very top */
        );
    -webkit-mask-image: linear-gradient(to top, black 58%, transparent 100%);
}

.portfolio-item__title {
    font-size: 30px;
    font-family: 'Gloock', monospace;
    color: white;
}

.portfolio-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-item__tags .tag {
    padding: 5px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    /* Slightly more opaque for readability */
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 400;
    border-radius: 30px;
    white-space: nowrap;
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.02);
}

.portfolio-item__content {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
    /* Slightly more opaque for readability */
    margin: 0;
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

.portfolio-item__button {
    margin-top: auto;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    align-self: flex-start;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
    color: #090911;
}

.portfolio-item__button:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.portfolio-item__button.is-light-bg {
    background-color: #090911;
    color: #ffffff;
}


/* MOBILE RESPONSIVE STYLES (Adjustments for mobile) */
@media (max-width: 768px) {

    /* Navigation adjustments for mobile */
    .navigation {
        padding: 10px 20px;
        /* Less padding, more space on sides */
        justify-content: space-between;
        /* Logo on left, hamburger on right */
        background-color: rgba(9, 9, 17, 0.8);
        /* Slightly more opaque background for mobile */
        backdrop-filter: blur(15px);
    }

    .navigation .desktop-nav {
        display: none;
        /* Ensure desktop nav is hidden on mobile */
    }

    .navigation .mobile-nav-header {
        display: flex;
        /* Show mobile header */
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .navigation .logo {
        width: 50px;
        /* Smaller logo for mobile */
    }

    .hamburger-menu span,
    .close-menu span {
        font-size: 36px;
        cursor: pointer;
        color: white;
    }

    .mobile-nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(9, 9, 17, 0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .close-menu {
        position: absolute;
        top: 30px;
        right: 30px;
        cursor: pointer;
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .mobile-nav-links .item {
        font-size: 24px;
        font-weight: 400;
        text-decoration: none;
        color: white;
        -webkit-tap-highlight-color: transparent;
    }

    /* Portfolio section adjustments for mobile */
    .portfolio {
        padding-top: 100px;
        /* Less padding on mobile due to smaller nav */
    }

    .portfolio .maintext {
        margin-bottom: 1.5rem;
    }

    .portfolio .bigtext {
        font-size: 36px;
        /* Smaller main title on mobile */
        text-align: center;
        padding: 0 15px;
        /* Add horizontal padding */
    }

    .portfolio .smalltext {
        font-size: 15px;
        text-align: center;
        padding: 0 15px;
    }

    .portfolio .portfolio-items {
        grid-template-columns: 1fr;
        /* Single column on mobile */
        padding: 15px;
        /* Less padding on the sides */
        gap: 1.5rem;
        /* Slightly less gap */
    }

    .portfolio-item {
        border-radius: 18px;
        /* Slightly less rounded on mobile */
    }

    .portfolio-item:hover {
        transform: translateY(-5px);
        /* Less lift on mobile */
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
        /* Smaller shadow */
    }

    .portfolio-item__image {
        aspect-ratio: 16 / 11;
        /* Slightly taller image ratio on mobile */
    }

    .portfolio-item__details {
        padding: 18px;
        /* Less padding inside details */
    }

    .portfolio-item__title {
        font-size: 24px;
        /* Smaller title */
    }

    .portfolio-item__tags .tag {
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 6px;
    }

    .portfolio-item__content {
        font-size: 14px;
        /* Smaller content text */
    }

    .portfolio-item__button {
        padding: 10px 20px;
        /* Smaller button padding */
        font-size: 13px;
    }
}

/* Add any other existing CSS here, ensuring it doesn't conflict with the new portfolio item styles */