/* ======================================================
   DESIGN — la galleria dei progetti
   Ogni scheda apre la pagina del progetto (project-….html, stile in project.css).
   Struttura comune (hero, particelle, fine pagina) in page.css,
   navbar, pannello HUD e HUD di scroll in common.css
   ====================================================== */

.design-projects {
    --panel-bg: rgba(5, 5, 5, 0.82);         /* le particelle si intravedono dietro */
    --panel-scanline: transparent;           /* niente righe da monitor sopra le anteprime */

    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10rem var(--side-safe) 12rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5rem 1.5rem;
    width: 100%;
    max-width: 92rem;
}


/* ---------- Scheda ---------- */
.project-card {
    display: flex;
    flex-direction: column;
    color: var(--text);
    text-decoration: none;
}

.project-card:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 8px;
}

/* anteprima 4:5: la copertina e, dove c'è, il reel che parte al passaggio del mouse */
.project-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card__media img,
.project-card__media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card__media img {
    filter: grayscale(25%) contrast(105%);
    transform: scale(1.02);
    transition: filter 0.8s ease, transform 1.2s var(--ease-out);
}

.project-card__media video {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card.is-playing .project-card__media video {
    opacity: 1;
}

.project-card:hover .project-card__media img,
.project-card:focus-visible .project-card__media img {
    filter: none;
    transform: scale(1.06);
}

/* il mirino si chiude sull'anteprima anche passando sul nome */
.project-card:hover .frame-corners i,
.project-card:focus-visible .frame-corners i {
    opacity: 1;
    transform: none;
}

.project-card:hover .frame-scan {
    animation: frame-scan 0.9s var(--ease-out) forwards;
}

/* "■ ANIMATION": il progetto ha un reel */
.project-card__badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 4px 7px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.project-card__badge::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--accent);
}


/* ---------- Testi: [01] CATEGORIA / NOME / 16 FILES — OPEN PROJECT → ---------- */
.project-card__head {
    display: flex;
    gap: 1rem;
    margin-top: 1.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--muted);
}

.project-card__index {
    color: var(--accent);
}

.project-card__title {
    display: block;
    margin-top: 0.7rem;
    font-family: var(--font-helvetica);
    font-size: clamp(2rem, 3.2vw, 3.25rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.project-card:hover .project-card__title {
    color: var(--accent);
}

.project-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.project-card__open {
    color: var(--text);
    transition: color 0.3s ease;
}

.project-card__open span {
    display: inline-block;
    transition: transform 0.4s var(--ease-out);
}

.project-card:hover .project-card__open {
    color: var(--accent);
}

.project-card:hover .project-card__open span {
    transform: translateX(6px);
}


/* ---------- Schermi piccoli ---------- */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .design-projects {
        padding-top: 6rem;
        padding-bottom: 8rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-card:hover .frame-scan {
        animation: none;
    }
}
