@font-face {
    font-family: "P22 Typewriter";
    src: url("/fonts/p22-typewriter-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --line: rgba(17, 17, 17, 0.1);
    --text: #121212;
    --muted: #626262;
    --shadow-soft: 0 16px 40px rgba(15, 15, 15, 0.05);
    --menu-surface: rgba(255, 255, 255, 0.96);
    --card-surface: #f5f5f3;
    --button-surface: #ffffff;
    --hover-surface: rgba(17, 17, 17, 0.035);
}

body.dark-mode {
    --bg: #0c0c0d;
    --surface: #121214;
    --line: rgba(255, 255, 255, 0.12);
    --text: #f3f3f1;
    --muted: #a8a8a1;
    --shadow-soft: 0 22px 54px rgba(0, 0, 0, 0.42);
    --menu-surface: rgba(18, 18, 20, 0.96);
    --card-surface: #171719;
    --button-surface: #151517;
    --hover-surface: rgba(255, 255, 255, 0.045);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "P22 Typewriter", monospace;
    scroll-behavior: smooth;
    background: #ffffff;
    color: var(--text);
}

body {
    overflow-x: hidden;
    background: var(--bg);
    transition: background-color 180ms ease, color 180ms ease;
}

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

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

.page-shell {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 96px 0 24px;
}

.page-nav {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1200;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-toggle {
    display: none;
}

.theme-toggle,
.menu-icon {
    border: 1px solid var(--line);
    background: var(--menu-surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.theme-toggle {
    min-width: 64px;
    padding: 11px 14px;
    cursor: pointer;
}

.menu-icon {
    width: 46px;
    height: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    cursor: pointer;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(2) {
    opacity: 0;
}

#menu-toggle:checked + .nav-actions .menu-icon span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

.menu {
    margin: 12px 0 0;
    padding: 12px;
    list-style: none;
    border: 1px solid var(--line);
    background: var(--menu-surface);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 8px;
    min-width: 180px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.menu a {
    display: block;
    padding: 8px 10px;
    color: var(--text);
    text-decoration: none;
}

.theme-toggle:hover,
.menu-icon:hover,
.menu a:hover,
.lightbox-close:hover,
.lightbox-nav:hover,
.scroll-top:hover,
.filter-chip:hover,
.work-link:hover {
    background: var(--hover-surface);
}

#menu-toggle:checked ~ .menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.hero {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: clamp(28px, 5vw, 56px);
}

.eyebrow,
.lightbox-eyebrow,
.work-category {
    margin: 0 0 16px;
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-copy {
    max-width: 880px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.6rem, 8vw, 6.2rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hero-description {
    margin: 20px 0 0;
    max-width: 66ch;
    font-size: clamp(1rem, 1.8vw, 1.18rem);
    line-height: 1.7;
    color: var(--muted);
    text-wrap: pretty;
}

.filters {
    margin-top: 22px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.filter-chip.is-active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.works-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.work-card {
    border: 1px solid var(--line);
    background: transparent;
    display: grid;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease;
}

.work-card:hover {
    transform: translateY(-2px);
    background: var(--hover-surface);
}

.work-media {
    min-height: 280px;
    background: var(--card-surface);
    border-bottom: 1px solid var(--line);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.work-media img,
.work-media video {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    background: var(--card-surface);
}

.work-copy {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.work-title {
    margin: 0;
    font-size: 1.04rem;
    font-weight: 400;
}

.work-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    text-wrap: pretty;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;

    line-clamp: 4;

    overflow: hidden;
}

.work-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.work-meta span,
.lightbox-meta li {
    border: 1px solid var(--line);
    padding: 6px 8px;
    color: var(--muted);
}

.work-link {
    width: fit-content;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--line);
    padding: 8px 12px;
}

.page-footer {
    margin-top: 48px;
    padding: 20px 0 0;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.page-footer p,
.lightbox-caption h2 {
    margin: 0;
}

.work-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: var(--bg);
    overflow-y: auto;
}

.work-lightbox.is-open {
    display: grid;
}

.lightbox-stage {
    min-width: 0;
    display: grid;
    gap: 18px;
    justify-items: center;
    align-self: start;
    padding: 32px 0;
}

.lightbox-media {
    width: auto;
    height: auto;
    max-width: min(100%, 1100px);
    max-height: min(70vh, 820px);
    display: grid;
    place-items: center;
    cursor: zoom-in;
}

.lightbox-asset {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: min(100%, 1100px) !important;
    max-height: min(70vh, 820px) !important;
    object-fit: contain !important;
}

.lightbox-caption {
    width: min(100%, 900px);
    display: grid;
    gap: 10px;
    padding-bottom: 24px;
}

.lightbox-media-controls {
    width: min(100%, 900px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lightbox-subnav {
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    cursor: pointer;
    width: 42px;
    height: 42px;
    font-size: 1.6rem;
    line-height: 1;
}

.lightbox-subnav:hover {
    background: var(--hover-surface);
}

.lightbox-subnav:disabled {
    opacity: 0.35;
    cursor: default;
}

.lightbox-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 12px;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.lightbox-dot.is-active {
    background: var(--text);
    border-color: var(--text);
}

.lightbox-caption h2 {
    font-size: 1.2rem;
    font-weight: 400;
}

.lightbox-description {
    display: grid;
    gap: 14px;
    max-width: 72ch;
}

.lightbox-description p {
    margin: 0;
    color: var(--muted);
    line-height: 1.85;
    text-wrap: pretty;
    text-align: justify;
    text-justify: inter-word;
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
    widows: 3;
    orphans: 3;
}

.lightbox-meta {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lightbox-close,
.lightbox-nav,
.scroll-top {
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 10px 14px;
}

.lightbox-nav {
    width: 52px;
    height: 52px;
    font-size: 2rem;
    line-height: 1;
}

.lightbox-nav:disabled {
    opacity: 0.35;
}

.scroll-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
}

.scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

body.lightbox-open .page-nav,
body.lightbox-open .scroll-top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.asset-viewer {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg);
}

.asset-viewer.is-open {
    display: grid;
}

.asset-viewer-stage {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.asset-viewer-stage img,
.asset-viewer-stage video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, 1280px);
    max-height: 88vh;
    object-fit: contain;
}

.asset-viewer-close,
.asset-viewer-nav {
    border: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    cursor: pointer;
}

.asset-viewer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 10px 14px;
}

.asset-viewer-nav {
    width: 54px;
    height: 54px;
    font-size: 2rem;
    line-height: 1;
}

.asset-viewer-nav:disabled {
    opacity: 0.35;
}

body.asset-viewer-open .work-lightbox {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 900px) {
    .works-grid {
        grid-template-columns: 1fr;
    }

    .work-lightbox {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 72px 16px 20px;
    }

    .asset-viewer {
        grid-template-columns: 1fr;
        padding: 72px 16px 20px;
    }

    .lightbox-stage {
        width: 100%;
    }

    .lightbox-media-controls {
        flex-wrap: wrap;
    }

    .lightbox-media,
    .lightbox-asset {
        max-height: min(62vh, 640px) !important;
    }

    .lightbox-nav {
        position: absolute;
        bottom: 18px;
    }

    .lightbox-nav-prev {
        left: 16px;
    }

    .lightbox-nav-next {
        right: 16px;
    }

    .asset-viewer-nav {
        position: absolute;
        bottom: 18px;
    }

    .asset-viewer-nav-prev {
        left: 16px;
    }

    .asset-viewer-nav-next {
        right: 16px;
    }
}

@media (max-width: 640px) {
    .page-nav {
        top: 12px;
        right: 12px;
        left: auto;
        width: max-content;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .nav-actions {
        gap: 8px;
        justify-content: flex-end;
        width: max-content;
    }

    .theme-toggle {
        min-width: 58px;
        padding: 10px 12px;
    }

    .page-shell {
        width: min(100vw - 20px, 100%);
        padding-top: 84px;
    }

    .hero {
        padding: 22px;
    }

    .filter-row {
        gap: 8px;
    }

    .filter-chip {
        padding: 9px 12px;
    }

    .work-media {
        min-height: 220px;
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
    }

    .asset-viewer-close {
        top: 14px;
        right: 14px;
    }

    .scroll-top {
        right: 14px;
        bottom: 14px;
    }
}
