/* Projects: a two-up wall of screenshots, with the words underneath
   (the same arrangement as Moments, at a larger size). */

.pgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3.5vw, 3rem);
    border-top: 1px solid var(--border);
    padding-top: clamp(2rem, 5vw, 3rem);
}

.ptile {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ptile-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 1rem;
    background: var(--card);
}

/* A hairline over the image, so dark screenshots keep their edges. */
.ptile-img::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    border-radius: inherit;
    pointer-events: none;
    transition: border-color var(--dur) var(--ease);
}

.ptile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    filter: saturate(0.75) brightness(0.88);
    transition: filter 300ms var(--ease), transform 500ms var(--ease);
}

/* No screenshot (most of the older work): the description stands in for one. */
.ptile-blank {
    display: flex;
    align-items: flex-end;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.ptile-words {
    max-width: 16em;
    font-size: clamp(1.35rem, 2.6vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--fg-muted);
    transition: color var(--dur) var(--ease);
}

.ptile-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.ptile-title {
    font-size: 1.3rem;
    letter-spacing: -0.015em;
    color: var(--fg-bright);
    transition: color var(--dur) var(--ease);
}

.ptile-year {
    font-family: var(--sans);
    font-size: 0.8125rem;
    color: var(--fg-dim);
    font-variant-numeric: tabular-nums;
}

.ptile-desc {
    display: block;
    margin-top: 0.25rem;
    max-width: 34em;
    color: var(--fg-muted);
}

.ptile:focus-visible { outline: none; }
.ptile:focus-visible .ptile-img { outline: 2px solid rgb(var(--hue-projects)); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
    .ptile:hover .ptile-img img { filter: saturate(1) brightness(1); transform: scale(1.02); }
    .ptile:hover .ptile-img::after { border-color: var(--ghost); }
    .ptile:hover .ptile-title { color: rgb(var(--hue-projects)); }
    .ptile:hover .ptile-words { color: var(--fg-bright); }
}

@media (max-width: 760px) {
    .pgrid { grid-template-columns: minmax(0, 1fr); }
}
