.projects {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 3rem 10%;
}

.projects-hero {
    display: grid;
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
}

.projects-hero h1 {
    font-size: clamp(2.75rem, 4vw, 4.25rem);
    margin-bottom: 1rem;
}

.projects-intro {
    max-width: 42rem;
    color: #a0a0a0;
    line-height: 1.8;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
}

.project-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    color: inherit;
    text-align: left;
    font-family: monospace;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.24);
    outline: none;
}

.project-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #111827;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card-body {
    padding: 1.25rem;
    display: grid;
    gap: 0.55rem;
}

.project-card-body h3 {
    font-size: 1.15rem;
    margin: 0;
}

.project-card-body p {
    margin: 0;
    color: #a0a0a0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-modal {
    position: fixed;
    inset: 0;
    padding: 1.5rem;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.project-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.project-modal-content {
    width: min(1000px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
}

.modal-body {
    display: grid;
    gap: 1rem;
}

.modal-image {
    width: min(100%, 380px);
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    background: #111827;
}

.modal-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.modal-body h2 {
    font-size: 1.6rem;
    margin: 0;
}

.modal-body p {
    color: #d1d5db;
    line-height: 1.75;
    margin: 0;
}

.modal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: #e5e7eb;
}

.modal-links a {
    color: #7dd3fc;
    text-decoration: none;
}

.modal-links a.disabled {
    color: #6b7280;
    pointer-events: none;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-tags span {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: #7dd3fc;
    font-size: 0.85rem;
}

@media (max-width: 860px) {
    .projects {
        padding: 2rem 5%;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }
}