:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #555555;
    --accent: #000000;
    --max-width: 2000px;
    --gap: 48px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* libre-bodoni-regular - latin */
@font-face {
    font-display: swap;

    font-family: 'Libre Bodoni';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/libre-bodoni-v9-latin-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* eb-garamond-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/eb-garamond-v32-latin-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* eb-garamond-600 - latin */
@font-face {
    font-display: swap;
    font-family: 'EB Garamond';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/eb-garamond-v32-latin-600.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 100;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: opacity 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    opacity: 1;
}

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

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

/* Header Styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 32px;
    padding: 12px;
    position: relative;
}

.brand {
    margin-bottom: 16px;
}

.brand .title {
    font-family: 'Libre Bodoni', serif;
    font-weight: 200;
    font-size: 28px;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.brand .role {
    font-size: 14px;
    color: var(--muted);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Navigation */
nav {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

nav a {
    font-size: 12px;
    color: var(--muted);
    position: relative;
    padding-bottom: 4px;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #333;
    border: none;
}

nav a.active {
    color: var(--accent);
    font-weight: 400;
}

nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    opacity: 0.3;
}

/* Close Button */
.close-button {
    position: fixed;
    top: 155px;
    border: none;
    outline: none;
    color: rgb(0, 0, 0);
    font-size: 26px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #00000000;
    padding: 10px;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: absolute;
    right: 20px;
    top: 20px;
}

.burger-line {
    width: 100%;
    height: 1px;
    background: var(--text);
    transition: var(--transition);
    transform-origin: center;
}

.burger-menu.open .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.open .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.open .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 1000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    display: flex;
    opacity: 1;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 32px;
    text-align: center;
}

.mobile-nav a {
    font-size: 16px;
    color: var(--text);
    padding: 10px;
    font-weight: 100;
    text-transform: none;
    font-style: thin;
}

.mobile-nav a.active {
    color: var(--accent);
}

/* Hero Section */
.hero {
    margin-bottom: 40px;
    text-align: center;
}

h1 {
    font-family: 'EB Garamond', serif;
    font-size: 52px;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

p.lead {
    color: var(--muted);
    max-width: 62ch;
    font-size: 18px;
    margin: 0 auto;
}

.meta {
    text-align: right;
    font-size: 15px;
    color: var(--muted);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    row-gap: 0px;
    margin-bottom: 0px;
}

.card {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    cursor: pointer;
    transition: var(--transition);
}

.card a {
    display: block;
    width: 100%;
    height: 100%;
}

.card .imgwrap {
    position: absolute;
    inset: 0;
}

.card img,
.card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card video {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.card:hover video {
    opacity: 1;
}



.card .label {
    position: absolute;
    left: 20px;
    bottom: 18px;
    font-family: 'EB Garamond', serif;
    font-size: 14px;
    color: #ffffff;
    padding: 1px 10px;
    border-radius: 6px;
    z-index: 10;
    background: rgba(29, 29, 29, 0.2);
    backdrop-filter: blur(5px);
}

/* Project Pages */
.category-detail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    row-gap: 0px;
}

.category-project {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr 320px;
    gap: 48px;
}

.category-project .gallery {
    display: grid;
    flex-direction: row;
    gap: 24px;
}

.category-project .gallery .main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.category-project .gallery .main img,
.category-project .gallery .main video {
    display: flex;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.category-project .gallery .main video {
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.category-project .meta-box {
    font-size: 16px;
    color: var(--muted);
    position: sticky;
    top: 100px;
    align-self: center;
    text-align: center;
    margin-bottom: 60px;
}

.category-project .meta-box h3 {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 18px;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.3;
}

.category-project .meta-box div {
    margin-bottom: 12px;
    line-height: 1.5;
}

.category-project .meta-box .category-year {
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    font-size: small;
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.category-project .meta-box .category-year div {
    margin-bottom: 0;
}

.category-credits {
    font-size: small;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

.project-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    position: relative;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery .main {
    position: relative;
    display: flex;
}

.gallery .main img,
.gallery .main video {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.gallery .main video {
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

/* Video Controls */
.custom-video-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
}

.gallery .main:hover .custom-video-controls {
    opacity: 1;
}

.custom-video-controls button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 4px;
}

.custom-video-controls button:hover {
    opacity: 1;
}

.video-progress {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    overflow: hidden;
    cursor: pointer;
}

.video-progress-filled {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.1s ease;
}

.video-time {
    color: white;
    font-size: 11px;
    min-width: 70px;
    opacity: 0.7;
    font-family: monospace;
}

.thumbs {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.thumb-item {
    cursor: pointer;
    transition: var(--transition);
    border-radius: 3px;
    overflow: hidden;
}

.thumb-item:hover {
    opacity: 1;
}

.thumb-item.active {
    opacity: 1;
    border: 2px solid var(--accent);
}

.thumbs img,
.thumbs video {
    width: 100px;
    height: 72px;
    object-fit: cover;
}

.meta-box {
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    color: var(--muted);
    position: sticky;
    top: 100px;
    align-self: start;
}

.meta-box h3 {
    font-family: 'EB Garamond', serif;
    font-size: 26px;
    color: var(--text);
    margin-bottom: 14px;
    line-height: 1.3;
}

.meta-box div {
    margin-bottom: 12px;
    line-height: 1.5;
}

.meta-box .category-year {
    justify-content: center;
    font-size: small;
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.meta-box .category-year div {
    margin-bottom: 0;
}

section {
    margin-bottom: 80px;
}

h2 {
    font-family: 'EB Garamond', serif;
    font-size: 30px;
    margin-bottom: 16px;
}

p {
    margin-bottom: 18px;
    line-height: 1.6;
}

/* Footer */
footer {
    position: relative;
    left: 0;
    bottom: 0;
    width: 100%;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    padding: 20px 12px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Contact Section */
.contact-card {
    display: grid;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 48px;
    min-height: 55vh;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    width: 100%;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #333;
    font-size: 18;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-icon:hover {
    background-color: #333;
    color: white;
    transform: scale(1.1);
}

.vimeo:hover {
    background-color: #1ab7ea;
}

.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}

/* Mobile Styles */
@media (max-width: 640px) {
    footer {
        position: relative;
        padding: 15px 12px;
        margin-top: 40px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    nav {
        display: none;
    }

    .close-button {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        background-color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .burger-menu {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-100%);
        margin: 0;
    }

    header {
        position: relative;
        padding: 30px 20px;
        margin-bottom: 30px;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        min-height: 80px;
    }

    .brand {
        text-align: center;
        margin-bottom: 0;
        padding: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .brand .title {
        font-size: 24px;
        line-height: 1.2;
    }

    .brand .role {
        font-size: 13px;
        margin-top: 2px;
    }
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

@media (max-width: 980px) {

    .hero,
    .project-page,
    .category-project {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .meta-box {
        position: static;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 0 20px;
        margin: 50px auto;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 38px;
    }

    header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 50px;
    }

    .close-button {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* Accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #333;
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}