/* Erwin van Zijl — direction A "Galerie": quiet, the work first; dark grey or white. */

@font-face {
    font-family: 'Hanken Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/hanken-grotesk-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
}

/* Theme. Dark grey is the default; white comes from the visitor's toggle (data-theme on
   <html>, set by the inline script in <head>) or, without a choice, from a browser that
   reports prefers-color-scheme: light. The light block appears twice on purpose: once for
   the explicit choice, once for the no-choice / no-JavaScript case. */

:root {
    color-scheme: dark;
    --bg: #2e2e2e;
    --ink: #f2f2f2;
    --ink-soft: #d0d0d0;
    --muted: #ababab;
    --panel: #383838;
    --line: #4a4a4a;
    --button-hover: #d6d6d6;
    --overlay: rgba(46, 46, 46, 0.98);
    --backdrop: rgba(46, 46, 46, 0.9);
    --sold: #f97066;
}

:root[data-theme='light'] {
    color-scheme: light;
    --bg: #ffffff;
    --ink: #161616;
    --ink-soft: #4a4a4a;
    --muted: #5f5f5f;
    --panel: #f3f3f3;
    --line: #e4e4e4;
    --button-hover: #3a3a3a;
    --overlay: rgba(255, 255, 255, 0.98);
    --backdrop: rgba(255, 255, 255, 0.9);
    --sold: #b42318;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        color-scheme: light;
        --bg: #ffffff;
        --ink: #161616;
        --ink-soft: #4a4a4a;
        --muted: #5f5f5f;
        --panel: #f3f3f3;
        --line: #e4e4e4;
        --button-hover: #3a3a3a;
        --overlay: rgba(255, 255, 255, 0.98);
        --backdrop: rgba(255, 255, 255, 0.9);
        --sold: #b42318;
    }
}

:root {
    --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
    --gutter: clamp(16px, 4vw, 48px);
    --section: clamp(64px, 10vw, 120px);
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--muted);
}

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

h1,
h2,
h3 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

p {
    margin: 0;
}

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

.skip {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 20;
    padding: 12px 16px;
    background: var(--ink);
    color: var(--bg);
}

.skip:focus {
    top: 16px;
    color: var(--bg);
}

.label {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.more {
    align-self: flex-start;
    display: inline-block;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--ink);
}

/* Header */

/* Wide: name, menu, theme button on one row. Narrow: the button next to the name, the menu
   on its own row below. */
.site-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'brand nav toggle';
    align-items: center;
    gap: 4px clamp(18px, 3vw, 32px);
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.site-header > .brand {
    grid-area: brand;
}

.site-header > .site-nav {
    grid-area: nav;
    justify-self: end;
}

.site-header > .theme-toggle {
    grid-area: toggle;
}

@media (max-width: 640px) {
    .site-header {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            'brand toggle'
            'nav nav';
    }

    .site-header > .site-nav {
        justify-self: start;
    }
}

.brand {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 10px 0;
}

/* Hidden until the inline script has set data-theme: without JavaScript it cannot work. */
.theme-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

:root[data-theme] .theme-toggle {
    display: inline-flex;
}

.theme-toggle:hover {
    border-color: var(--ink);
}

.theme-toggle__icon {
    width: 18px;
    height: 18px;
}

:root[data-theme='dark'] .theme-toggle__icon--moon,
:root[data-theme='light'] .theme-toggle__icon--sun {
    display: none;
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 clamp(18px, 3vw, 32px);
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav a {
    display: inline-block;
    padding: 12px 0;
    border-bottom: 1px solid transparent;
}

.site-nav a[aria-current] {
    border-bottom-color: var(--ink);
}

/* Home */

.intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 32px 48px;
    align-items: end;
    padding: clamp(56px, 9vw, 96px) 0 clamp(40px, 6vw, 80px);
}

.intro h1 {
    font-size: clamp(30px, 4.2vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.intro__text {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 460px;
    color: var(--ink-soft);
}

.hero {
    margin: 0 0 var(--section);
}

.hero a {
    display: block;
}

.hero img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
    background: var(--panel);
}

.caption {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding-top: 14px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

.lines {
    display: flex;
    flex-direction: column;
    gap: var(--section);
    padding-bottom: var(--section);
}

.line {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.line__head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 16px 48px;
    border-top: 1px solid var(--ink);
    padding-top: 20px;
}

.line__title {
    display: flex;
    gap: 20px;
    align-items: baseline;
}

.line__title h2 {
    font-size: clamp(26px, 3vw, 32px);
}

.line__head p {
    color: var(--ink-soft);
    max-width: 560px;
}

.quote {
    padding: clamp(56px, 8vw, 80px) 0 var(--section);
    border-top: 1px solid var(--line);
}

.quote blockquote {
    margin: 0 auto;
    max-width: 900px;
    font-size: clamp(26px, 3.4vw, 44px);
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-align: center;
}

.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 40px 80px;
    align-items: start;
    padding-bottom: var(--section);
}

.split > img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stack h2 {
    font-size: clamp(26px, 3vw, 32px);
}

.stack p {
    color: var(--ink-soft);
}

.timeline {
    margin: 8px 0 0;
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px 24px;
    font-size: 15px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.timeline dt {
    font-family: var(--mono);
    color: var(--muted);
}

.timeline dd {
    margin: 0;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 24px;
    padding-bottom: var(--section);
}

.card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(24px, 4vw, 40px);
    background: var(--panel);
}

.card h3 {
    font-size: clamp(22px, 2.4vw, 26px);
}

.card p {
    color: var(--ink-soft);
}

/* Section pages */

.page-head {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 16px 64px;
    align-items: end;
    padding: clamp(48px, 8vw, 96px) 0 32px;
}

.page-head h1 {
    font-size: clamp(44px, 7vw, 96px);
    line-height: 0.98;
    letter-spacing: -0.02em;
}

.page-head__text {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
    color: var(--ink-soft);
}

.filters ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 8px 0 40px;
    list-style: none;
}

.filters a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 15px;
}

.filters a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.filters a[aria-current] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.filters span {
    font-family: var(--mono);
    font-size: 12px;
    opacity: 0.7;
}

.prose {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 720px;
    color: var(--ink-soft);
}

.prose h2 {
    color: var(--ink);
    font-size: clamp(24px, 2.6vw, 30px);
    margin-top: 16px;
}

.prose ul {
    margin: 0;
    padding-left: 20px;
}

.prose li + li {
    margin-top: 6px;
}

.prose a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lead {
    font-size: clamp(22px, 2.6vw, 28px);
    line-height: 1.3;
    color: var(--ink);
}

.columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 48px 80px;
    padding-bottom: var(--section);
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.list li {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.list span {
    color: var(--muted);
}

.list a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.section-title {
    font-size: clamp(26px, 3vw, 32px);
    border-top: 1px solid var(--ink);
    padding-top: 20px;
    margin-bottom: 32px;
}

/* Gallery */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(136px, 38vw, 320px), 1fr));
    gap: clamp(28px, 4vw, 40px) clamp(12px, 2vw, 24px);
    margin: 0;
    padding: 0 0 var(--section);
    list-style: none;
}

.gallery--home {
    padding-bottom: 0;
}

.work {
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-margin-top: 24px;
}

/* Each work sits bottom-left in its cell, so the caption lines up with the image's left edge. */
.work__link {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.work__link img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
    transform-origin: left bottom;
    transition: transform 0.3s ease;
}

.work__link:hover img {
    transform: scale(1.02);
}

.work__caption {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 15px;
    line-height: 1.4;
}

.work__title {
    font-weight: 500;
}

.work__meta {
    color: var(--muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.tag {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.4;
    padding: 2px 8px;
    border: 1px solid var(--line);
    color: var(--ink-soft);
}

.tag--price {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.tag--sold {
    color: var(--muted);
}

.tag--sold::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--sold);
    vertical-align: 1px;
}

/* Lightbox */

.lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--overlay);
    color: var(--ink);
}

.lightbox::backdrop {
    background: var(--backdrop);
}

.lightbox__inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.lightbox__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px var(--gutter);
}

.lightbox__buttons {
    display: flex;
    gap: 8px;
}

.lightbox__buttons button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
}

.lightbox__buttons button:hover {
    border-color: var(--ink);
}

.lightbox__body {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: 24px 32px;
    padding: 8px var(--gutter) 40px;
}

.lightbox__image {
    flex: 999 1 480px;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.lightbox__image img {
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    width: auto;
    object-fit: contain;
}

.lightbox__info {
    flex: 1 1 260px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lightbox__info h2 {
    font-size: clamp(26px, 3vw, 36px);
}

.lightbox__info p {
    color: var(--muted);
}

.button {
    align-self: flex-start;
    display: inline-block;
    margin-top: 8px;
    padding: 12px 20px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
}

.button:hover {
    color: var(--bg);
    background: var(--button-hover);
}

/* Footer */

.site-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 32px;
    padding: 48px 0 64px;
    border-top: 1px solid var(--ink);
    font-size: 15px;
}

.site-footer address {
    font-style: normal;
    color: var(--ink-soft);
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer li a {
    display: inline-block;
    padding: 4px 0;
}

.site-footer .brand {
    padding: 0;
}

.site-footer small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

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