/* Let the gallery grids span the row instead of shrink-wrapping. */
main {
    width: 100%;
}

/* ---- category tabs ---- */
.categories {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 8px;
}

.category-btn {
    font-family: inherit;
    font-size: 22px;
    color: #9a9a9a;
    background: none;
    border: none;
    padding: 4px 2px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: color 0.2s ease-out, transform 0.2s ease-out;
}

.category-btn:hover {
    color: #f5f5f5;
    transform: translateY(-2px);
}

.category-btn.active {
    color: #d96666;
}

/* ---- content sections ---- */
.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.content[hidden] {
    display: none !important;
}

.content[data-category="projects"],
.content[data-category="art"] {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 24px 96px;
}

/* ---- projects grid ---- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    width: 100%;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    background: #101010;
    border: 2px solid #333333;
    cursor: pointer;
    transition: transform 0.2s ease-out, border-color 0.2s ease-out;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: #d96666;
}

.project-card .preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.project-card .name {
    margin: 0;
    font-size: 22px;
    font-weight: normal;
    color: #f5f5f5;
    text-align: center;
}

/* ---- art masonry ---- */
.art-grid {
    columns: 3 260px;
    column-gap: 20px;
    width: 100%;
}

.art-cell {
    break-inside: avoid;
    margin-bottom: 20px;
}

.art-cell img {
    width: 100%;
    display: block;
    border: 2px solid #333333;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    transition: border-color 0.2s ease-out, transform 0.2s ease-out;
}

.art-cell img:hover {
    border-color: #d96666;
    transform: scale(1.02);
}

/* ---- project modal ---- */
.project-modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px;
    overflow-y: auto;
    background: rgba(10, 10, 10, 0.88);
}

.project-modal.open {
    display: flex;
}

.project-modal-box {
    position: relative;
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
    background: #161616;
    border: 2px solid #d96666;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-family: inherit;
    font-size: 32px;
    line-height: 1;
    color: #9a9a9a;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease-out;
}

.modal-close:hover {
    color: #d96666;
}

.modal-title {
    margin: 0;
    padding-right: 32px;
    font-size: 28px;
    font-weight: normal;
    color: #ffffff;
}

.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-gallery img {
    width: 100%;
    display: block;
    border: 2px solid #333333;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.modal-link {
    align-self: flex-start;
    font-size: 22px;
    color: #d96666;
    text-decoration: none;
    border: 2px solid #d96666;
    padding: 6px 16px;
    background: rgba(217, 102, 102, 0.08);
    transition: background 0.2s ease-out;
}

.modal-link:hover {
    background: rgba(217, 102, 102, 0.2);
}

@media (max-width: 600px) {
    .categories {
        gap: 18px;
    }

    .category-btn {
        font-size: 18px;
    }

    .art-grid {
        columns: 2 150px;
    }

    .project-modal-box {
        padding: 20px;
    }
}
