/* Portfolio module presentation (SPEC-003 sections 6, 7, 8, 9).
 * Modern, clean, recruiter-oriented and accessible: responsive project grid,
 * reusable cards with hover elevation, and screenshot scrolling for full-page
 * captures that exceed the visible container (SPEC-003-REQ-006).
 */

.portfolio-page__lead {
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Responsive project grid (SPEC-003 section 7): 3 / 2 / 1 columns. */

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 640px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .project-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Project card (SPEC-003-REQ-003, section 8). */

.project-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(11, 28, 44, 0.06);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

/* Hover elevation, shadow enhancement and smooth transition (SPEC-003-REQ-005). */

.project-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 12px 24px rgba(11, 28, 44, 0.14);
}

.project-card:focus-within {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

.project-card__title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.project-card__summary {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9375rem;
}

.project-card__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Screenshot scrolling (SPEC-003-REQ-006): full-page screenshots are taller
 * than the container; on user interaction the image scrolls until its bottom
 * edge aligns with the container bottom.
 */

.project-card__screenshot {
    position: relative;
    height: 240px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-bg);
}

.project-card__screenshot-img {
    display: block;
    width: 100%;
    height: auto;
    will-change: transform;
    transition: transform 2.5s ease-in-out;
}

.project-card__screenshot:hover .project-card__screenshot-img,
.project-card__screenshot:focus-visible .project-card__screenshot-img {
    transform: translateY(calc(-100% + 240px));
}

@media (prefers-reduced-motion: reduce) {
    .project-card__screenshot-img {
        transition: none;
    }
}

/* Technology badges (SPEC-003 section 8). */

.project-card__technologies {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

.project-card__technology {
    background: var(--color-border);
    color: var(--color-text);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
}

/* Card footer actions (SPEC-003-REQ-004, section 8). */

.project-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
}

.project-card__link {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
}

.project-card__link--github {
    background: var(--color-text);
    color: var(--color-bg);
}

.project-card__link--github:hover,
.project-card__link--github:focus-visible {
    background: var(--color-accent-dark);
    color: var(--color-bg);
}

.project-card__link--demo {
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
}

.project-card__link--demo:hover,
.project-card__link--demo:focus-visible {
    background: var(--color-accent);
    color: var(--color-bg);
}

.project-card__link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}
