/*
 * Blocks and the parts they use: the poster, heroes, statements, covers,
 * the roster, cards, marquees and stacks. One loud thing per screen; the
 * work is never covered.
 */

/* The home poster ------------------------------------------------------- */
.poster {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template:
        "stack . ." auto
        "logo logo logo" 1fr
        "line line line" auto / 1fr 1fr auto;
    gap: var(--space-5);
    min-height: var(--vitrine-screen, 100svh);
    /* The header sits over it (header.css), so the shapes are cropped by
       the screen's edges, never by a line across the page. */
    padding: calc(var(--space-6) + 4.5rem) var(--gutter) var(--space-7);
}

.poster-stack {
    grid-area: stack;
    font-size: clamp(.95rem, 1.4vw, 1.25rem);
}

.poster-title {
    grid-area: logo;
    align-self: center;
    justify-self: center;
    width: min(100%, 68rem);
    margin: 0;
}

.poster-line {
    grid-area: line;
    max-width: 30rem;
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-strong);
    text-transform: uppercase;
    line-height: 1.15;
}

/* The brand's stacked list ---------------------------------------------- */
.stack-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: var(--weight-strong);
    text-transform: uppercase;
    line-height: var(--leading-stack);
    letter-spacing: var(--tracking-caps);
}

/* Marquee ----------------------------------------------------------------- */
.flow > .marquee {
    grid-column: full;
}

/* A Marquee block with the row to itself runs across the whole window, as
   the poster's does (Vitrine writes a cell's span as --span:N). */
.grid-cell[style*="--span:12"] > .block-marquee {
    margin-inline: calc(50% - 50vw);
}

.marquee {
    position: relative;
    overflow: hidden;
    padding-block: var(--space-4);
    border-block: 2px solid var(--ink);
    font-size: clamp(1.6rem, 4.5vw, 3.6rem);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    text-transform: uppercase;
    line-height: 1;
}

.marquee-track {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0 var(--gutter);
    list-style: none;
}

/* Running (marquee.js, motion on): one row, as long as its copies. Without
   script, or with motion off, the row wraps inside the page and the copies
   made for the loop are put away. */
.marquee-track.is-looping {
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
}

.marquee-track:not(.is-looping) > [data-marquee-copy] {
    display: none;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.marquee-item::after {
    content: "";
    width: .7em;
    aspect-ratio: 1;
    margin-inline: .45em;
    background: var(--brand-gradient);
    mask: url("logo-star.svg") center / contain no-repeat;
}

.marquee-pause {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    translate: 0 -50%;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 0 2px var(--ink);
}

/* A paragraph block reads at a size that holds its own next to the rest. */
.block-paragraph {
    max-width: var(--width-text);
    font-size: var(--text-lg);
    line-height: 1.45;
}

/* Cards: the work. A gradient line grows under the title; the frame tilts
   a little towards the pointer (motion/cards.js). ------------------------ */
/* The rule for this theme: a piece of work takes the full width or half
   of it, never a third. Grids are two across (one on a phone), and every
   few items one runs the full width. */
.card-grid,
.records-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8) var(--space-6);
}

.card-link {
    gap: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);
}

.card-media {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.card-link:hover .card-media {
    box-shadow: 0 30px 50px -24px rgb(17 17 17 / .45);
}

.card-title {
    justify-self: start;
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    line-height: 1;
    text-transform: uppercase;
    background: var(--brand-gradient) left bottom / 0 3px no-repeat;
    padding-bottom: .15em;
    transition: background-size var(--duration) var(--ease);
}

.card-link:hover .card-title {
    text-decoration: none;
    background-size: 100% 3px;
}

.card-meta {
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

/* The first of every five runs the full width. */
.card-grid > .card:nth-child(5n + 1 of :not([data-filter-hidden])) {
    grid-column: 1 / -1;
    --card-ratio: 21 / 9;
}

.card-grid > .card:nth-child(5n + 1 of :not([data-filter-hidden])) .card-title {
    font-size: var(--text-2xl);
}

/* Records (Artists & projects) ------------------------------------------ */
.block-records .record-text {
    display: grid;
    gap: var(--space-2);
}

/* Counted among what is shown, so a filtered list keeps the rhythm. */
.records-grid > .record:nth-child(5n + 1 of :not([data-filter-hidden])) {
    grid-column: 1 / -1;
}

.records-grid > .record:nth-child(5n + 1 of :not([data-filter-hidden])) .record-media {
    aspect-ratio: 21 / 9;
}

.records-grid > .record:nth-child(5n + 1 of :not([data-filter-hidden])) .record-title {
    font-size: var(--text-2xl);
}

.records-grid .record-media {
    aspect-ratio: 4 / 3;
}

/* Media grids: two across at most, the first of every three full width;
   masonry in two columns; justified rows tall enough for two. */
.media-grid.is-natural,
.media-grid.is-uniform,
.project-grid .media-grid.is-natural {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-grid.is-natural > li:nth-child(3n + 1),
.media-grid.is-uniform > li:nth-child(3n + 1) {
    grid-column: 1 / -1;
}

.media-grid.is-masonry {
    columns: 2;
}

.media-grid.is-justified {
    --row-height: clamp(16rem, 34vw, 34rem);
}
.record-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    line-height: 1;
    text-transform: uppercase;
}

.block-records .record-title {
    justify-self: start;
    padding-bottom: .15em;
    background: var(--brand-gradient) left bottom / 0 3px no-repeat;
    transition: background-size var(--duration) var(--ease);
}

.block-records a:hover .record-title,
.block-records a:focus-visible .record-title {
    color: var(--ink);
    background-size: 100% 3px;
}

.record-media {
    overflow: hidden;
}

.record-media img {
    transition: transform var(--duration-slow) var(--ease);
}

.block-records a:hover .record-media img {
    transform: scale(1.05);
}

.record-media {
    border-radius: 0;
    background: var(--media-bg);
}

.record-meta {
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

/* List: one project a row, the picture half the width, the words the other
   half (the full-or-half rule). */
.records-list .record-link {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
    align-items: center;
    padding-block: var(--space-5);
}

.records-list li {
    border-color: var(--ink);
}

.records-list .record-media {
    aspect-ratio: 16 / 9;
    max-width: none;
}

.records-list .record-title {
    font-size: var(--text-2xl);
}

.record-excerpt {
    color: var(--ink);
    font-size: var(--text-base);
}

/* Index of projects: the roster's big capitals, the year at the right. */
.records-index {
    border-top: 2px solid var(--ink);
}

.records-index li {
    border-bottom: 2px solid var(--ink);
}

.records-index .record-link {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-5);
    padding-block: var(--space-3);
    color: var(--ink);
    text-decoration: none;
}

.records-index-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: clamp(1.6rem, 4.5vw, 3.6rem);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-display);
    line-height: 1;
    text-transform: uppercase;
}

.records-index a:hover .records-index-title,
.records-index a:focus-visible .records-index-title {
    color: transparent;
    background: var(--brand-gradient-on-paper);
    background-clip: text;
}

.records-index-meta,
.records-index-tags {
    flex: none;
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-caps);
    text-transform: uppercase;
}

/* The roster -------------------------------------------------------------- */
.roster {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 2px solid var(--ink);
}

.roster-item {
    border-bottom: 2px solid var(--ink);
}

.roster-link {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
    padding-block: var(--space-3);
    color: var(--ink);
    text-decoration: none;
}

.roster-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
    hyphens: auto;
    font-size: clamp(2.2rem, 8vw, 7rem);
    font-weight: var(--weight-black);
    letter-spacing: var(--tracking-monster);
    line-height: .9;
    text-transform: uppercase;
    transition: color var(--duration-fast);
}

.roster-link:hover .roster-name,
.roster-link:focus-visible .roster-name {
    color: transparent;
    background: var(--brand-gradient-on-paper);
    background-clip: text;
}

/* Names only: the face is the source of the picture that floats beside
   the pointer (motion/roster.js), never shown in the list itself. */
.roster-face {
    display: none;
}

/* The picture beside the pointer (js/hover-picture.js): a face in the
   roster, the next project in the pager. */
.hover-picture {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-overlay);
    width: clamp(12rem, 20vw, 18rem);
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 58% 42% 50% 50% / 48% 56% 44% 52%;
    pointer-events: none;
    opacity: 0;
    scale: .6;
    background: var(--media-bg);
}

.hover-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Media grids: room between the files, so each reads as a piece of its
   own; less on a phone, where they are one column. Every arrangement
   (natural, uniform, rows, two up, masonry, justified) takes its gap from
   here. */
.media-grid {
    --grid-gap: clamp(var(--space-5), 3vw, var(--space-6));
}

/* Stickers (motion/stickers.js): stars dropped onto a section. */
.sticker {
    position: absolute;
    z-index: 2;
    width: var(--sticker-size, 5rem);
    aspect-ratio: 1;
    background: var(--brand-gradient);
    mask: url("logo-star.svg") center / contain no-repeat;
    touch-action: none;
    cursor: grab;
}

.sticker:active {
    cursor: grabbing;
}

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

    .card-grid,
    .records-grid,
    .media-grid.is-natural,
    .media-grid.is-uniform,
    .project-grid .media-grid.is-natural {
        grid-template-columns: minmax(0, 1fr);
    }

    .media-grid.is-masonry {
        columns: 1;
    }

    .poster {
        grid-template:
            "stack" auto
            "logo" 1fr
            "line" auto / 1fr;
        min-height: 0;
        gap: var(--space-7);
        /* Under the header, which sits over it, as on a computer. */
        padding-block: calc(var(--space-5) + 4.5rem) var(--space-8);
    }

    .marquee-pause {
        right: var(--space-1);
    }
}

/* A moving gradient's canvas (motion/mesh.js) draws over the element's CSS
   gradient, behind its content, and fades in once it has a frame. The
   element keeps its own position (the footer's sky is absolute). */
[data-mesh] {
    isolation: isolate;
}

[data-mesh] > .mesh-canvas {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: block;
    width: 100%;
    height: 100%;
    contain: strict;
    opacity: 0;
    transition: opacity 1.2s var(--ease);
}

[data-mesh] > .mesh-canvas.is-in {
    opacity: 1;
}
