.project-preview {
    max-width: 960px;
    margin: 3rem 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.project-preview.is-visible {
    opacity: 1;
    transform: none;
}

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

.project-card {
    --thumb-gap: 0.75rem;
    --thumb-size: min(180px, 42vw);

    color: black;
    font-family: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: 400;
}

.project-card__head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.project-card__number {
    font-size: 0.8rem;
}

.project-card__title {
    margin: 0;
    color: black;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.2;
}

.project-card__description {
    max-width: 68ch;
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.55;
}

.project-card__credit {
    margin: 0.75rem 0 0;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-line;
}

.project-card__youtube {
    display: inline-block;
    margin-top: 1rem;
    color: red;
    text-decoration: none;
    text-underline-offset: 0.15em;
}

.project-card__youtube[href]:hover {
    text-decoration: underline;
}

.project-card__youtube.is-pending {
    color: #666;
}

.project-card__media {
    margin-top: 1.5rem;
}

.project-card__thumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--thumb-gap);
}

.project-scroller__track {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.project-scroller__track::-webkit-scrollbar {
    display: none;
}

.project-scroller__track .project-card__thumb {
    scroll-snap-align: start;
}

.project-scroller__controls {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-top: 0.75rem;
}

.project-scroller__controls[hidden] {
    display: none;
}

.project-scroller__button {
    padding: 0;
    border: 0;
    background: none;
    color: red;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.project-scroller__button:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.project-scroller__button:focus-visible {
    outline: 2px solid black;
    outline-offset: 4px;
}

.project-scroller__count {
    font-size: 0.8rem;
}

.project-card__thumb {
    display: block;
    flex: 0 0 var(--thumb-size);
    width: var(--thumb-size);
    padding: 0;
    border: 0;
    background: #eee;
    cursor: zoom-in;
}

.project-card__thumb[hidden] {
    display: none;
}

.project-card__thumb:hover {
    opacity: 0.8;
}

.project-card__thumb:focus-visible {
    outline: 2px solid black;
    outline-offset: 2px;
}

.project-card__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.project-card__video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: black;
    cursor: pointer;
}

.project-preview__continue {
    margin-top: 1.5rem;
}

.project-preview__continue .choice-text {
    font-size: 1.25em;
}

.lightbox-open {
    overflow: hidden;
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.92);
    color: white;
    font-family: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.lightbox[open] {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) 3.5rem;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 1rem;
}

.lightbox::backdrop {
    background: black;
}

.lightbox__bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.lightbox__caption {
    margin: 0;
    font-size: 0.85rem;
}

.lightbox__button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.lightbox__button:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.lightbox__button:focus-visible {
    outline: 2px solid white;
    outline-offset: 4px;
}

.lightbox__nav {
    grid-row: 2;
    align-self: center;
    font-size: 2rem;
    line-height: 1;
}

.lightbox__nav--prev {
    grid-column: 1;
}

.lightbox__nav--next {
    grid-column: 3;
}

.lightbox__image {
    grid-column: 2;
    grid-row: 2;
    place-self: center;
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 600px) {
    .lightbox[open] {
        grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    }

    .project-card {
        --thumb-size: calc((100% - var(--thumb-gap)) / 2);
    }

    .project-card__title {
        font-size: 1.25rem;
    }

    .project-card__description {
        font-size: 0.9rem;
    }

    .project-card__credit {
        font-size: 0.78rem;
    }
}
