/*
 * Framed by AJ: public site.
 * Quiet and white, the work is the point. The only "decoration" is the thin
 * frame around the wordmark.
 */
:root {
    --ink: #111;
    --muted: #8a8a8a;
    --paper: #fff;
    --placeholder: #f2f2f0;
    --gutter: 1.25rem;
    --menu-width: 12rem;
    --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 0.875rem/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

:focus-visible {
    outline: 1px solid var(--ink);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Menu --------------------------------------------------------------- */

.menu {
    position: fixed;
    top: var(--gutter);
    left: var(--gutter);
    width: var(--menu-width);
    z-index: 10;
}

.wordmark {
    display: inline-block;
    padding: 0.35em 0.6em;
    border: 1px solid currentColor;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
    white-space: nowrap;
}

.wordmark:hover,
.wordmark:focus-visible {
    text-decoration: none;
    background: var(--ink);
    color: var(--paper);
}

.menu__list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    font-weight: 700;
}

.menu__list li + li {
    margin-top: 0.15rem;
}

.menu__list a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

/* --- Content & grid ----------------------------------------------------- */

.content {
    margin-left: calc(var(--menu-width) + 2 * var(--gutter));
    padding: var(--gutter) var(--gutter) 5rem;
}

.grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gutter);
    align-items: start;
}

.tile a {
    position: relative;
    display: block;
}

.tile img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--placeholder);
    transition: opacity 0.2s ease;
}

.tile a:hover img {
    opacity: 0.88;
}

/* Small play mark on video tiles: a triangle in a thin circle. */
.tile__play {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid #fff;
    border-radius: 50%;
    background: rgb(0 0 0 / 0.25);
}

.tile__play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.4rem 0 0.4rem 0.65rem;
    border-color: transparent transparent transparent #fff;
}

.empty,
.error-page {
    color: var(--muted);
}

.error-page h1 {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ink);
}

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

@media (min-width: 100em) {
    .grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Phones and small tablets: menu on top instead of a fixed column. */
@media (max-width: 47.99em) {
    .menu {
        position: static;
        width: auto;
        padding: var(--gutter) var(--gutter) 0;
    }

    .menu__list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
        margin-top: 1rem;
    }

    .menu__list li + li {
        margin-top: 0;
    }

    .content {
        margin-left: 0;
    }

    .grid {
        gap: 0.75rem;
    }
}

/* --- Viewer (lightbox, built by viewer.js) ------------------------------ */

.viewer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--paper);
    color: var(--ink);
}

.viewer::backdrop {
    background: var(--paper);
}

.viewer__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 100%;
    margin: 0;
    padding: 3.5rem 4rem 1.5rem;
}

.viewer__stage {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer__stage img,
.viewer__stage video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer__caption {
    max-width: 40rem;
    min-height: 1.5em;
    text-align: center;
    color: var(--muted);
}

.viewer__caption strong {
    color: var(--ink);
}

.viewer button {
    position: absolute;
    padding: 0.5rem 0.75rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.viewer__close {
    top: var(--gutter);
    right: var(--gutter);
}

.viewer__prev,
.viewer__next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.viewer__prev {
    left: 0.5rem;
}

.viewer__next {
    right: 0.5rem;
}

@media (max-width: 47.99em) {
    .viewer__figure {
        padding: 3.5rem 0.5rem 1rem;
    }

    /* Swiping replaces the arrows on small screens. */
    .viewer__prev,
    .viewer__next {
        display: none;
    }
}

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