@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --background: #f8f8f7;
    --surface: #ffffff;
    --text: #111210;
    --muted: #676963;
    --line: #d2d3cf;
    --accent: #5e675f;
    --header-height: 74px;
    --page-pad: 38px;
    --content-max: 1760px;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-optical-sizing: auto;
    font-synthesis: none;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #111210;
    --surface: #161715;
    --text: #f1f1ed;
    --muted: #9b9d96;
    --line: #353733;
    --accent: #aab2aa;
}

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

html {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    background: var(--background);
    scroll-behavior: smooth;
}

body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    min-width: 320px;
    background: var(--background);
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
    font-weight: 430;
    transition: background-color 180ms ease, color 180ms ease;
}

body.viewer-open {
    overflow: hidden;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
    background: var(--line);
}

::selection {
    background: var(--accent);
    color: var(--background);
}

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

.skip-link {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 1000;
    transform: translateY(-160%);
    background: var(--text);
    color: var(--background);
    padding: 9px 12px;
}

.skip-link:focus {
    transform: none;
}

.site-header {
    position: relative;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(230px, 0.8fr) minmax(360px, 1fr) minmax(190px, 0.6fr);
    align-items: center;
    min-height: var(--header-height);
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--page-pad);
}

.brand {
    justify-self: start;
    font-size: 14px;
    font-weight: 720;
    text-transform: uppercase;
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 32px;
    font-size: 9px;
    font-weight: 560;
    text-transform: uppercase;
}

.primary-nav a,
.language-switch,
.filter-button,
.text-link,
.back-link,
.project-pager a {
    position: relative;
}

.primary-nav a::after,
.language-switch::after,
.text-link::after,
.back-link::after,
.project-pager a::after {
    position: absolute;
    right: 0;
    bottom: -5px;
    left: 0;
    height: 1px;
    background: currentColor;
    content: "";
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 160ms ease;
}

.primary-nav a:hover::after,
.primary-nav a.is-active::after,
.language-switch:hover::after,
.text-link:hover::after,
.back-link:hover::after,
.project-pager a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-tools {
    display: flex;
    justify-self: end;
    align-items: center;
    gap: 16px;
    font-size: 9px;
    font-weight: 560;
}

.language-switch {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.language-switch .is-active {
    border-bottom: 1px solid currentColor;
}

.theme-toggle,
.menu-toggle,
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.theme-toggle {
    font-size: 18px;
}

.theme-toggle__light,
:root[data-theme="light"] .theme-toggle__light {
    display: inline;
}

.theme-toggle__dark,
:root[data-theme="light"] .theme-toggle__dark {
    display: none;
}

:root[data-theme="dark"] .theme-toggle__light {
    display: none;
}

:root[data-theme="dark"] .theme-toggle__dark {
    display: inline;
}

.menu-toggle {
    display: none;
}

#main-content,
.site-footer {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

.project-index {
    padding: 8px var(--page-pad) 86px;
}

.index-tools {
    margin-bottom: 30px;
}

.index-tools h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
}

.filter-button {
    padding: 5px 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    font-size: 9px;
    font-weight: 540;
    text-transform: uppercase;
    cursor: pointer;
}

.filter-button:hover,
.filter-button.is-active {
    border-bottom-color: currentColor;
}

.project-index__body {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.filter-rail {
    display: grid;
    gap: 8px;
    padding-top: 48vh;
    font-size: 8px;
    font-weight: 560;
    text-transform: uppercase;
}

.filter-rail b {
    font-size: 14px;
    font-weight: 400;
}

.project-list {
    display: grid;
    gap: 72px;
}

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

.project-entry__mosaic {
    display: grid;
    grid-template-columns: 2.15fr 0.95fr 0.95fr;
    grid-template-rows: 1.05fr 0.8fr;
    gap: 7px;
    height: min(55vw, 760px);
}

.project-tile {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--line);
}

.project-tile--1 {
    grid-column: 1;
    grid-row: 1;
}

.project-tile--2 {
    grid-column: 2;
    grid-row: 1;
}

.project-tile--3 {
    grid-column: 3;
    grid-row: 1;
}

.project-tile--4 {
    grid-column: 1 / 4;
    grid-row: 2;
}

.project-entry__mosaic--2 {
    grid-template-columns: 1fr 1.85fr 0.82fr;
}

.project-entry__mosaic--2 .project-tile--1 {
    grid-column: 2;
}

.project-entry__mosaic--2 .project-tile--2 {
    grid-column: 1;
}

.project-entry__mosaic--2 .project-tile--3 {
    grid-column: 3;
}

.project-entry__mosaic--3 {
    grid-template-columns: 0.82fr 1fr 1.85fr;
}

.project-entry__mosaic--3 .project-tile--1 {
    grid-column: 3;
}

.project-entry__mosaic--3 .project-tile--2 {
    grid-column: 1;
}

.project-entry__mosaic--3 .project-tile--3 {
    grid-column: 2;
}

.project-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 420ms ease, opacity 180ms ease;
}

.project-tile:hover img {
    opacity: 0.92;
    transform: scale(1.012);
}

.project-entry__label {
    display: none;
    justify-content: space-between;
    gap: 20px;
    padding-top: 12px;
    font-size: 11px;
    text-transform: uppercase;
}

.project-entry__label span:last-child {
    color: var(--muted);
    text-align: right;
    text-transform: none;
}

.empty-state {
    margin: 20vh 0;
    color: var(--muted);
    text-align: center;
}

.project-detail,
.gallery-view {
    padding: 6px var(--page-pad) 82px;
}

.project-detail__topline,
.gallery-view__topline {
    display: flex;
    min-height: 46px;
    justify-content: space-between;
    align-items: start;
    font-size: 8px;
    font-weight: 560;
    text-transform: uppercase;
}

.project-pager {
    display: flex;
    gap: 24px;
}

.project-intro {
    display: grid;
    grid-template-columns: minmax(310px, 34%) 1fr;
    gap: 30px;
    align-items: stretch;
    min-height: calc(100vh - var(--header-height) - 88px);
}

.project-intro__info {
    display: flex;
    flex-direction: column;
    align-items: start;
    padding: 8px 0 20px;
}

.project-intro h1,
.gallery-view__header h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 430;
    line-height: 1.05;
    text-transform: uppercase;
}

.project-intro__place {
    margin: 12px 0 38px;
    color: var(--muted);
    font-size: 9px;
}

.project-facts {
    display: grid;
    width: 100%;
    gap: 8px;
    margin: 0 0 38px;
}

.project-facts div {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
}

.project-facts dt {
    color: var(--muted);
    font-size: 8px;
    font-weight: 530;
    text-transform: uppercase;
}

.project-facts dd {
    margin: 0;
    font-size: 10px;
}

.project-copy {
    max-width: 42ch;
    margin-top: auto;
    font-size: 11px;
    line-height: 1.7;
}

.project-copy p:last-child {
    margin-bottom: 0;
}

.text-link {
    margin-top: 22px;
    font-size: 8px;
    font-weight: 560;
    text-transform: uppercase;
}

.project-intro__cover {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    background: var(--line);
}

.project-intro__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-monograph {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin-top: 16px;
}

.monograph-image {
    grid-column: auto;
    margin: 0;
}

.monograph-image--wide,
.monograph-image--full,
.monograph-image--portrait,
.monograph-image--pair-left,
.monograph-image--pair-right {
    grid-column: auto;
}

.monograph-image img {
    width: 100%;
    height: 138px;
    object-fit: cover;
}

.monograph-image figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
}

.gallery-view__header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 10px 0 22px;
}

.gallery-view__header span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.gallery-view__tabs {
    display: flex;
    min-height: 34px;
    align-items: start;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
    font-size: 8px;
    font-weight: 560;
    text-transform: uppercase;
}

.gallery-view__tabs span {
    padding-bottom: 9px;
    border-bottom: 1px solid currentColor;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
}

.gallery-grid__item {
    grid-column: span 6;
    min-width: 0;
    padding: 0;
    border: 0;
    aspect-ratio: 4 / 3;
    background: var(--line);
    cursor: zoom-in;
    overflow: hidden;
}

.gallery-grid__item--portrait {
    grid-column: span 6;
}

.gallery-grid__item--full,
.gallery-grid__item--wide {
    grid-column: span 6;
}

.gallery-grid__item img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    transition: opacity 180ms ease;
}

.gallery-grid__item:hover img {
    opacity: 0.9;
}

.viewer {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    grid-template-rows: 58px 1fr;
    background: var(--background);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.viewer.is-open {
    opacity: 1;
    pointer-events: auto;
}

.viewer__bar {
    grid-column: 1 / 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
}

.viewer__stage {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 18px;
}

.viewer__stage img {
    max-width: 100%;
    max-height: calc(100vh - 94px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.viewer__nav {
    grid-row: 2;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.viewer__nav--previous {
    grid-column: 1;
}

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

.text-page {
    display: grid;
    grid-template-columns: minmax(220px, 34%) minmax(300px, 760px);
    gap: 8vw;
    min-height: calc(100vh - var(--header-height) - 80px);
    padding: 90px var(--page-pad) 130px;
}

.text-page header {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-content: start;
    gap: 18px;
}

.text-page__index {
    padding-top: 9px;
    color: var(--muted);
    font-size: 9px;
}

.text-page h1 {
    margin: 0;
    font-size: 40px;
    font-weight: 400;
    line-height: 1.1;
    text-transform: uppercase;
}

.text-page__body {
    max-width: 62ch;
    font-size: 15px;
    line-height: 1.7;
}

.text-page__lead {
    margin-top: 0;
    font-size: 23px;
    line-height: 1.45;
}

.contact-block {
    display: grid;
    gap: 10px;
    margin-top: 70px;
    font-style: normal;
}

.contact-block a {
    width: fit-content;
    border-bottom: 1px solid var(--line);
}

.not-found {
    display: grid;
    place-content: center;
    min-height: calc(100vh - var(--header-height));
    text-align: center;
}

.not-found span {
    color: var(--muted);
    font-size: 10px;
}

.not-found h1 {
    margin: 10px 0 25px;
    font-size: 26px;
    font-weight: 400;
    text-transform: uppercase;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px var(--page-pad) 34px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    :root {
        --page-pad: 18px;
        --header-height: 70px;
    }

    .site-header {
        display: block;
        width: 100vw;
        max-width: 100vw;
    }

    .brand {
        display: inline-flex;
        min-height: var(--header-height);
        align-items: center;
        font-size: 13px;
    }

    .menu-toggle {
        position: absolute;
        top: 50%;
        right: var(--page-pad);
        display: inline-grid;
        width: 32px;
        gap: 4px;
        padding: 8px;
        transform: translateY(-50%);
    }

    .menu-toggle span {
        display: block;
        width: 18px;
        height: 1px;
        background: currentColor;
    }

    .header-tools {
        position: absolute;
        top: 50%;
        right: 62px;
        transform: translateY(-50%);
    }

    .theme-toggle {
        display: none;
    }

    .primary-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        padding: 12px var(--page-pad) 20px;
        border-bottom: 1px solid var(--line);
        background: var(--background);
        font-size: 14px;
    }

    .primary-nav.is-open {
        display: grid;
    }

    .primary-nav a {
        padding: 10px 0;
    }

    .index-tools {
        display: block;
        min-width: 0;
        max-width: 100%;
        margin-bottom: 20px;
    }

    .index-tools h1 {
        margin-bottom: 12px;
    }

    .filters {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex-wrap: nowrap;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .project-index__body {
        display: block;
        min-width: 0;
        max-width: 100%;
    }

    .filter-rail {
        display: none;
    }

    .filter-button {
        flex: 0 0 auto;
    }

    .project-list {
        gap: 52px;
    }

    .project-entry__mosaic,
    .project-entry__mosaic--2,
    .project-entry__mosaic--3 {
        display: block;
        height: auto;
    }

    .project-tile {
        display: none;
        aspect-ratio: 4 / 3;
    }

    .project-tile:first-child {
        display: block;
    }

    .project-entry__label {
        display: grid;
        gap: 3px;
    }

    .project-entry__label span:last-child {
        text-align: left;
    }

    .project-detail,
    .gallery-view {
        padding-top: 14px;
    }

    .project-pager a:not(:nth-child(2)) {
        display: none;
    }

    .project-intro {
        display: flex;
        min-height: 0;
        flex-direction: column-reverse;
        gap: 26px;
    }

    .project-intro__cover {
        aspect-ratio: 4 / 3;
    }

    .project-intro__info {
        padding-top: 0;
    }

    .project-intro h1,
    .gallery-view__header h1 {
        font-size: 24px;
    }

    .project-intro__place,
    .project-facts {
        margin-bottom: 28px;
    }

    .project-copy {
        margin-top: 4px;
    }

    .project-monograph {
        display: block;
        margin-top: 58px;
    }

    .monograph-image {
        margin: 0 0 8px;
    }

    .monograph-image img {
        height: auto;
    }

    .gallery-view__header {
        align-items: start;
        margin: 16px 0 24px;
    }

    .gallery-grid {
        display: block;
    }

    .gallery-grid__item {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    .viewer {
        grid-template-columns: 44px 1fr 44px;
    }

    .viewer__stage {
        padding: 6px;
    }

    .text-page {
        display: block;
        min-height: calc(100vh - var(--header-height));
        padding-top: 56px;
    }

    .text-page header {
        margin-bottom: 55px;
    }

    .text-page h1 {
        font-size: 31px;
    }

    .text-page__lead {
        font-size: 20px;
    }
}

@media (max-width: 520px) {
    .project-index {
        padding-top: 18px;
    }

    .project-detail__topline,
    .gallery-view__topline {
        min-height: 42px;
    }

    .project-facts div {
        grid-template-columns: 88px 1fr;
    }

    .gallery-view__header span {
        display: none;
    }

    .site-footer {
        display: grid;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
