/* project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 300px);
    gap: 24px;
    margin-top: 32px;
    justify-content: center;
}

.project-card {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    background: var(--card);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px var(--shadow-strong);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* hover animation */
.project-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-overlay h3 {
    color: white;
    font-size: 1.3rem;
    text-align: center;
    padding: 0 10px;
}

.project-card:hover img, .project-card:focus-visible img {
    transform: scale(1.1);
}

.project-card:hover .project-overlay, .project-card:focus-visible .project-overlay {
    opacity: 1;
}

/* "View More"/"View Less" button */
.hidden-project {
    display: none;
}

.more-btn {
    margin: 24px auto 0;
    display: block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    cursor: pointer;
}

/* background dimming + modal window toggle */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--shadow-strong);
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* modal window */
.modal-content {
    background: var(--modal-bg);
    width: min(90%, 700px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px var(--shadow-strong);
}

.modal-content img {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
    border-radius: 8px;
}

.modal-tools {
    margin-top: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-tools h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: var(--accent);
}

.modal-tools-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 300px;
}

.modal-tools-row img {
    width: 40px;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.modal-tools-row img:hover {
    transform: translateY(-3px);
}

.modal-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    justify-content: center;
}

.modal-link img {
    max-width: 50px;
    height: auto;
    display: block;
    transition: 0.2s ease, opacity 0.2s ease;
}

.close-btn {
    position: absolute;
    top: 0px;
    right: 6px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover, .close-btn:focus-visible {
    opacity: 0.85;
    scale: 1.1;
}