:root {
    --project-padding: 30px;
}

/* Portfolio Scaling & Headers */
#portfolio {
    display: block;
    gap: 30px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    font-size: 28px;
    margin: 40px 0 20px;
}

.featured-section {
    background-color: #181818;
    border-radius: 20px;
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    grid-auto-rows: auto;
    gap: 30px;
    margin-bottom: 40px;
    align-items: stretch;

    --project-padding: 36px;
}

.other-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    grid-auto-rows: auto;
    gap: 30px;
    align-items: stretch;
    margin-bottom: 100px;
}
.featured-section > .project,
.other-grid > .project {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
}

#portfolio-text {
    text-align: center;
    margin-top: 0px;
}

/* Tags */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 60px;
}

.tag-btn {
    background-color: #2d2d2d;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.08s;
}

.tag-btn:hover {
    transform: scale(1.03);
}

.tag-btn.active {
    background-color: #0077cc;
    color: #fff;
    box-shadow: 0 6px 18px rgba(0, 119, 204, 0.18);
}

/* Expand button */
.expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.3s;
    z-index: 1;
    opacity: 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.project:hover .expand-btn {
    opacity: 1;
}

.expand-btn:hover {
    background: #555;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background-color: #1e1e1e;
    margin: 10% auto;
    padding: 30px;
    width: 80%;
    max-width: 800px;
    border-radius: 15px;
    max-height: 80vh;
    position: relative;
    animation: slideDown 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.modal-text {
    flex-grow: 1;
    overflow: auto;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff5b5b;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #e60000;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* Projects */
.project {
    background-color: #1e1e1e;
    border-radius: 15px;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px; 
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.project:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project img {
    width: auto;
    height: auto;
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.project-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.project-content p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.project-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    width: 100%;
    margin-top: auto;
    margin-bottom: 10px;
}

.button {
    flex: 1;
    padding: 12px;
    border-radius: 5px;
    background-color: #0077cc;
    color: white;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s;
    position: relative;
}

.button:hover {
    background-color: #005fa3;
}

/* Size Adjust For Smaller Screens */
@media (max-width: 1000px) {
    .featured-section,
    .other-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* Size Adjust For Even Smaller Screens */
@media (max-width: 600px) {
    .featured-section,
    .other-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    #portfolio {
        padding: 20px;
        gap: 15px;
    }

    .project {
        padding: 15px;
    }

    .project img {
        max-width: 60px;
        max-height: 60px;
        margin-bottom: 15px;
    }

    .project-content h2 {
        font-size: 18px;
    }

    .project-content p {
        font-size: 14px;
        line-height: 1.4;
    }

    .project-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    .button {
        padding: 10px;
    }
}