:root {
    --bg: #141414;
    --surface: #1c1c1c;
    --reel-bg: #404040; /* background colour of media/reel.mp4, so the video blends into the hero */
    --text: #f3f1ed;
    --text-soft: #d6d2cb;
    --muted: #aaa69f;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #ff9a3c;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --max: 80rem;
    --header-h: 4rem;
    --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 30;
    padding: 0.5rem 0.875rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 4px;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.75rem;
}

.eyebrow {
    margin-bottom: 1rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.wrap {
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* Header */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
    padding-inline: var(--gutter);
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.site-header.is-scrolled {
    background: rgba(20, 20, 20, 0.82);
    border-bottom-color: var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-header__name {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
}

.site-nav a {
    padding-block: 0.5rem;
    color: var(--text-soft);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--text);
}

/* Buttons */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.375rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button:hover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.button--primary {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.button--primary:hover {
    border-color: #fff;
    background: #fff;
}

.button[hidden] {
    display: none;
}

/* A second primary button only appears when the reel button is switched on; demote the one after it. */
.button--primary:not([hidden]) ~ .button--primary {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
    color: var(--text);
}

/* Hero */

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(1rem, 4vh, 2.5rem);
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 1rem) var(--gutter) clamp(4rem, 10vh, 6rem);
    background: var(--reel-bg);
    overflow: hidden;
}

/* Fades the hero into the page below. */
.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    z-index: -1;
    height: 16%;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0), var(--bg));
    pointer-events: none;
}

.reel {
    flex: none;
    align-self: center;
    width: min(80vw, 44vh);
    width: min(80vw, 44svh);
    height: min(80vw, 44vh);
    height: min(80vw, 44svh);
    object-fit: contain;
    /* Feathers the frame edge in case a browser renders the video's background a shade off --reel-bg. */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
    mask-composite: intersect;
}

.hero__content {
    width: 100%;
    max-width: 34rem;
    transition: opacity 0.3s ease;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}

.hero h1 span {
    display: block;
}

.hero__lead {
    margin-block: 1.5rem 2rem;
    color: var(--text-soft);
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

.hero__close {
    position: absolute;
    top: 1rem;
    right: var(--gutter);
    z-index: 3;
    display: none;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    color: var(--text);
    cursor: pointer;
}

.hero__close:hover {
    border-color: var(--text);
}

@media (min-width: 56rem) {
    .hero {
        padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
    }

    .hero__content {
        max-width: min(30rem, 40vw);
    }

    .reel {
        position: absolute;
        top: 50%;
        right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
        z-index: -2;
        width: min(44vw, 78vh, 40rem);
        height: min(44vw, 78vh, 40rem);
        transform: translateY(-50%);
    }
}

/* Full-bleed footage: the video fills the hero and the text sits over it, bottom left. */

.hero[data-reel-fit="cover"] {
    justify-content: flex-end;
    background: #000;
}

.hero[data-reel-fit="cover"] .reel {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.hero[data-reel-fit="cover"]::after {
    height: 100%;
    background:
        linear-gradient(to top, var(--bg) 0%, rgba(20, 20, 20, 0.7) 28%, rgba(20, 20, 20, 0) 65%),
        linear-gradient(to right, rgba(20, 20, 20, 0.55), rgba(20, 20, 20, 0) 60%);
}

/* Watching the reel: the video takes over the hero with sound and controls. */

.is-watching .site-header {
    transform: translateY(-100%);
}

.hero.is-watching {
    background: #000;
}

.hero.is-watching .reel {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.hero.is-watching .hero__content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.hero.is-watching::after {
    display: none;
}

.hero.is-watching .hero__close {
    display: grid;
}

/* Sections */

.section {
    padding-block: clamp(4rem, 10vw, 8rem);
}

.section--alt {
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.section__head {
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

/* Work */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
    gap: 1.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

a.card:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-3px);
}

.card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
}

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

.card__media--cover img {
    object-fit: cover;
}

a.card__media {
    display: block;
}

/* Diagrams drawn on transparent or white backgrounds. */
.card__media--light {
    background: #f3f1ed;
}

.card__media--light img {
    padding: 1.25rem;
}

/* Cards with more than one link (try it, source) highlight as a whole when any link is hovered. */
.card:has(a:hover) {
    border-color: rgba(255, 255, 255, 0.35);
}

.card h3 a {
    color: inherit;
    text-decoration: none;
}

.card h3 a:hover {
    color: var(--accent);
}

.card__body p.card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.card__links a {
    color: var(--text-soft);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

.card__links a:hover {
    color: var(--accent);
}

.card__links a[href^="http"]::after {
    content: " \2197";
}

.attribution {
    margin-top: 2.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

.attribution a {
    color: var(--text-soft);
}

.pdf-frame {
    display: block;
    width: 100%;
    height: min(85vh, 70rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pdf-frame__fallback {
    padding: 2rem;
    color: var(--bg);
}

.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 1.375rem;
}

.card__tag {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card h3 {
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
}

.card__body p:not(.card__tag) {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.card__link {
    margin-top: auto;
    padding-top: 0.5rem;
    color: var(--text-soft);
    font-size: 0.875rem;
    font-weight: 600;
}

.card__link::after {
    content: " \2197";
}

a.card:hover .card__link {
    color: var(--accent);
}

/* About */

.about {
    display: grid;
    gap: clamp(2.5rem, 6vw, 5rem);
}

.about__text h2 {
    margin-bottom: 1.5rem;
    max-width: 18ch;
}

.about__text p:not(.eyebrow) {
    max-width: 36rem;
    color: var(--text-soft);
}

.about__text p + p {
    margin-top: 1rem;
}

.facets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 2rem 1.5rem;
    align-content: start;
    margin: 0;
}

.facets dt {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.facets dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9375rem;
    line-height: 1.9;
}

@media (min-width: 56rem) {
    .about {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: end;
    }
}

/* Contact and footer */

.contact h2 {
    font-size: clamp(2.25rem, 6vw, 4rem);
    letter-spacing: -0.03em;
}

.contact__lead {
    margin-block: 1rem 2rem;
    color: var(--text-soft);
}

.site-footer {
    padding: 1.5rem var(--gutter);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}

/* Experience */

.experience {
    display: grid;
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

.experience__text h2 {
    margin-bottom: 1.25rem;
}

.experience__text p:not(.eyebrow) {
    max-width: 36rem;
    margin-bottom: 1rem;
    color: var(--text-soft);
}

.experience__text p.experience__role {
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.experience__text .actions {
    margin-top: 2rem;
}

.employer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-height: 14rem;
    padding: 2.5rem 2rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.employer:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.employer img {
    width: auto;
    max-width: min(100%, 13rem);
    height: auto;
}

.employer__url {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
}

.employer__url::after {
    content: " \2197";
}

.employer:hover .employer__url {
    color: var(--accent);
}

.experience__peek {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.5rem, 1.5vw, 1rem);
}

.experience__peek a {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.experience__peek a:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.experience__peek img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

@media (min-width: 56rem) {
    .experience {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    }

    .experience__peek {
        grid-column: 1 / -1;
    }
}

/* Gallery page */

.site-nav a[aria-current="page"] {
    color: var(--text);
}

.page-head {
    padding-block: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem)) clamp(2.5rem, 6vw, 4rem);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.page-head__logo {
    display: inline-block;
    margin-bottom: 2rem;
}

.page-head__logo img {
    width: auto;
    height: clamp(3.5rem, 8vw, 5rem);
}

.page-head h1 {
    margin-bottom: 1.25rem;
    font-size: clamp(2.25rem, 6vw, 4rem);
    letter-spacing: -0.03em;
}

.page-head__lead {
    max-width: 40rem;
    margin-bottom: 2rem;
    color: var(--text-soft);
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

.gallery-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* The note about missing pictures only shows where pictures would be: an empty grid, or a page with no years at all. */
.wrap:not(:has(.year)) .gallery-bar,
.wrap:not(:has(.shot)) .gallery-count,
.gallery:has(.shot) ~ .gallery-empty,
.gallery[data-view="timeline"]:has(.year) ~ .gallery-empty {
    display: none;
}

.gallery-empty {
    color: var(--muted);
}

.gallery-count {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Without scripting there is only the grid, so the switch stays hidden. */
.view-toggle {
    display: none;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.js .view-toggle {
    display: inline-flex;
}

.view-toggle button {
    min-height: 2.25rem;
    padding: 0 1.125rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.view-toggle button:hover {
    color: var(--text);
}

.view-toggle button[aria-pressed="true"] {
    background: var(--text);
    color: var(--bg);
}

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.shot {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.shot:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.shot__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

.shot__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Placeholders for footage still to capture: only in draft view (tsc.html?draft). */
.shot--placeholder,
.draft-note {
    display: none;
}

.is-draft .shot--placeholder {
    display: flex;
    border: 1px dashed rgba(255, 154, 60, 0.5);
    background: transparent;
}

.is-draft .shot--placeholder:hover {
    transform: none;
}

.shot--placeholder .shot__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 12px, transparent 12px 24px);
    text-align: center;
}

.slot__label {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.slot__id {
    color: var(--text-soft);
    font-family: var(--mono);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.is-draft .draft-note {
    display: block;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px dashed rgba(255, 154, 60, 0.5);
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 0.9375rem;
}

/* Outside draft view, a group holding only placeholders takes no space on the timeline. */
html:not(.is-draft) .shots:not(:has(> a.shot)) {
    display: none;
}

/* Play badge on video thumbnails. */
.shot[data-video] .shot__media::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 3.5v9l7-4.5z' fill='%23f3f1ed'/%3E%3C/svg%3E") center / 1.25rem no-repeat;
    transform: translate(-50%, -50%);
}

.shot__caption {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem 1rem;
}

.shot__meta {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.shot__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.shot__text {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

/* What Nathan did on the piece, kept apart from the description of the product. */
.shot__credit,
.lightbox__credit {
    color: var(--text-soft);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.shot__credit {
    margin-top: 0.375rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.shot__credit-label {
    margin-right: 0.375rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lightbox__credit {
    margin-top: 0.5rem;
}

.lightbox__credit:empty {
    display: none;
}

/* Grid view: the year groups dissolve and every piece sits in one grid. */

.gallery[data-view="grid"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: 1rem;
}

.gallery[data-view="grid"] .year,
.gallery[data-view="grid"] .shots {
    display: contents;
}

/* Each group's --rank orders the grid by Nathan's share of the work; the timeline keeps the page's year order. */
.gallery[data-view="grid"] .shot {
    order: var(--rank, 50);
}

.gallery[data-view="grid"] .year__label,
.gallery[data-view="grid"] .year__note {
    display: none;
}

/* Pieces without a confirmed year stay in the grid only. */
.gallery[data-view="timeline"] .year.year--undated {
    display: none;
}

/* Timeline view: a year column, a rail, and that year's pieces. */

.gallery[data-view="timeline"] {
    --year-col: 3.25rem;
    --rail-gap: 1.75rem;
    position: relative;
    display: grid;
    gap: clamp(2rem, 5vw, 3.5rem);
}

.gallery[data-view="timeline"]::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    bottom: 0;
    left: calc(var(--year-col) + var(--rail-gap) / 2);
    width: 1px;
    background: var(--line);
}

.gallery[data-view="timeline"] .year {
    position: relative;
    display: grid;
    grid-template-columns: var(--year-col) minmax(0, 1fr);
    column-gap: var(--rail-gap);
    row-gap: 1rem;
    align-items: start;
}

.gallery[data-view="timeline"] .year::before {
    content: "";
    position: absolute;
    top: 0.4375rem;
    left: calc(var(--year-col) + var(--rail-gap) / 2 - 0.25rem);
    width: calc(0.5rem + 1px);
    height: calc(0.5rem + 1px);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
}

.year__label {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    grid-column: 1;
    grid-row: 1 / span 2;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.6;
    text-align: right;
}

.year__note,
.gallery[data-view="timeline"] .shots {
    grid-column: 2;
}

.year__note {
    max-width: 40rem;
    color: var(--text-soft);
    line-height: 1.6;
}

@media (min-width: 48rem) {
    .gallery[data-view="timeline"] {
        --year-col: 5rem;
        --rail-gap: 3rem;
    }

    .year__label {
        font-size: 1.125rem;
        line-height: 1.35;
    }
}

/* Lightbox */

html:has(.lightbox[open]) {
    overflow: hidden;
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(12, 12, 12, 0.97);
    color: var(--text);
}

.lightbox[open] {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
}

.lightbox__figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    height: 100%;
    margin: 0;
    padding: 4rem 0 1.5rem;
}

.lightbox__stage {
    display: grid;
    min-height: 0;
    place-items: center;
}

.lightbox__stage img,
.lightbox__stage video {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: scale-down;
}

.lightbox__caption {
    max-width: 44rem;
    margin-inline: auto;
    text-align: center;
}

.lightbox__meta,
.lightbox__count {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lightbox__meta {
    color: var(--accent);
}

.lightbox__title {
    margin-block: 0.375rem 0.25rem;
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
}

.lightbox__text {
    color: var(--text-soft);
    font-size: 0.9375rem;
}

.lightbox__text:empty,
.lightbox__meta:empty {
    display: none;
}

.lightbox__count {
    margin-top: 0.625rem;
}

.lightbox__button {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.6);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lightbox__button:hover {
    border-color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.lightbox__close {
    position: absolute;
    top: 0.75rem;
    right: 0;
    z-index: 1;
}

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

    .lightbox__figure {
        grid-column: 1;
        grid-row: 1;
        padding: 4rem 1rem 1.25rem;
    }

    .lightbox__caption {
        padding-inline: 3.25rem;
    }

    .lightbox__prev,
    .lightbox__next {
        position: absolute;
        bottom: 1.25rem;
        z-index: 1;
        margin: 0;
    }

    .lightbox__prev {
        left: 1rem;
    }

    .lightbox__next {
        right: 1rem;
    }
}

.site-header__short {
    display: none;
}

/* Four nav links and the full name don't fit on a phone, so the name shrinks to initials. */
@media (max-width: 30rem) {
    .site-header__full {
        display: none;
    }

    .site-header__short {
        display: inline;
    }

    .site-nav {
        gap: 1rem;
    }
}

/* Scroll reveal (only when scripting is available and motion is welcome) */

@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translateY(1.25rem);
        transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.2s ease;
    }

    .js .reveal.is-visible {
        opacity: 1;
        transform: none;
    }

    .js a.card.reveal.is-visible:hover {
        transform: translateY(-3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
