@font-face {
    font-family: 'Necto Mono';
    src: url('fonts/NectoMono-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-color: #f7f6f4;
    --text-color: #000;
    --font-size: 12.5pt;
    --line-height: 1.4;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Necto Mono', monospace;
    font-size: var(--font-size);
    line-height: var(--line-height);
    letter-spacing: -0.05em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    padding: 3vw 4vw;
    gap: 4vw;
    max-width: 100%;
}

.sidebar {
    width: 440px; /* Enough width for the longest text */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 3vw;
    height: calc(100vh - 6vw);
    overflow-y: auto;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.works-section {
    padding-left: 20px; /* Space for hanging dots */
}

.works-title {
    font-size: var(--font-size);
    font-weight: normal;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.category {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: var(--font-size);
    font-weight: normal;
    display: flex;
    align-items: center;
    margin-left: -20px; /* Pull left so text aligns with WORKS, dot hangs outside */
    margin-bottom: 0.75rem;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Match colors from screenshot */
.dot.blue { background-color: #2e3eff; }
.dot.light-blue { background-color: #92bcf7; }
.dot.gray { background-color: #a3a3a3; }

.work-list {
    list-style: none;
    margin-left: 0;
}

.work-list li {
    margin-bottom: 0.75rem;
    padding-left: 20px;
}

.sidebar-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sidebar-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.sidebar-link.active, .works-title.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.about-section {
    margin-top: 4rem;
    padding-left: 20px;
}

.about-section p {
    margin-bottom: 1rem;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.email {
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.email:hover {
    opacity: 0.6;
}

.feed {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 3vw 2vw;
    align-items: start;
}

.feed-item {
    display: flex;
    flex-direction: column;
}

.feed-item img,
.feed-item video {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 1rem;
    object-fit: contain; /* ensures images aren't distorted */
}

.caption {
    font-size: var(--font-size);
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.caption::before {
    content: '';
    display: block;
    width: 0;
    height: 10px;
    border-radius: 50%;
    margin-right: 0;
    opacity: 0;
    transition: width 0.3s, margin-right 0.3s, opacity 0.3s;
}

.feed-link:hover .caption {
    /* Optional: any transform on the text itself */
}

.feed-link:hover .caption::before {
    width: 10px;
    margin-right: 10px;
    opacity: 1;
}

.feed-link.videography .caption::before { background-color: #2e3eff; }
.feed-link.photography .caption::before { background-color: #92bcf7; }
.feed-link.booklets .caption::before { background-color: #a3a3a3; }

.mobile-header {
    display: none;
}

/* Secondary Page Styles */
.project-content {
    flex-grow: 1;
    min-width: 0;
}

.project-details {
    display: flex;
    flex-direction: column;
}

/* Title inside project pages — same weight/size as body */
.project-details h2 {
    font-size: var(--font-size);
    font-weight: normal;
    font-family: 'Necto Mono', monospace;
    line-height: var(--line-height);
    margin: 0 0 0 0;
}

.project-details p {
    margin-bottom: 0;
    line-height: var(--line-height);
}

.project-details .year {
    margin-bottom: 0;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
}

.project-description {
    white-space: pre-wrap;
    font-family: 'Necto Mono', monospace;
    font-size: var(--font-size);
}

/* Two-column credits layout */
.credits-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 2em;
    row-gap: 0;
    line-height: var(--line-height);
    margin-top: 0;
}

.credits-grid .credit-role {
    white-space: nowrap;
}

.credits-grid .credit-name {
    /* left column sets width, name flows naturally */
}

/* Breathing room between text block and first still image */
.project-stills {
    margin-top: 3rem;
}

.video-btn {
    background-color: #a3a3a3;
    color: #fff;
    padding: 6px 12px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.video-btn:hover {
    background-color: #2e3eff;
}

.project-feed {
    display: flex;
    flex-direction: column;
    gap: 3vw;
}

.project-feed img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s;
}

.project-feed img:hover {
    opacity: 0.9;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox.active {
    display: flex;
}

/* Close button — top-right of viewport */
.lightbox-close {
    position: fixed;
    top: 24px;
    right: 28px;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Necto Mono', monospace;
    z-index: 1020;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

/* Nav arrows — fixed on left/right of viewport */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 16px;
    z-index: 1020;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.lightbox-nav:hover { opacity: 1; }

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* Image/iframe container */
.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: calc(100vw - 120px);
    max-height: 92vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.lightbox-content iframe {
    width: 80vw;
    height: 45vw;
    max-width: 1280px;
    max-height: 720px;
    border: none;
}

/* Reset links in feed items */
a.feed-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        padding-top: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        height: 70px;
        background-color: var(--bg-color);
        padding: 0 4vw;
        z-index: 100;
    }

    .mobile-title {
        font-family: 'Necto Mono', monospace;
        font-size: var(--font-size);
        text-decoration: none;
        color: var(--text-color);
    }

    .hamburger {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 5px;
    }

    .hamburger span {
        display: block;
        width: 30px;
        height: 2px;
        background-color: var(--text-color);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .hamburger.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.open span:nth-child(2) {
        transform: scaleX(0);
        opacity: 0;
    }

    .hamburger.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 70px;
        left: 0;
        height: 0;
        overflow: hidden;
        background-color: var(--bg-color);
        margin-bottom: 0;
        padding: 0 4vw;
        transition: height 0.4s ease;
        z-index: 99;
    }

    .sidebar.open {
        height: calc(100dvh - 70px);
        border-bottom: 1px solid #ddd;
        overflow-y: auto;
        /* Shrink type + spacing on short viewports so the whole menu
           tends to fit without scrolling; overflow-y above still
           covers any screen it doesn't fit on. Setting font-size (not
           just the custom property) here makes every descendant that
           doesn't declare its own font-size inherit the scaled value,
           instead of the fixed size already resolved at <body>. */
        --font-size: clamp(9pt, 2.3dvh, 14pt);
        font-size: var(--font-size);
    }

    .sidebar.open .works-title {
        margin-bottom: clamp(0.6rem, 1.8dvh, 1.5rem);
    }

    .sidebar.open .category {
        margin-bottom: clamp(0.5rem, 1.8dvh, 1.5rem);
    }

    .sidebar.open .category-title {
        margin-bottom: clamp(0.3rem, 1dvh, 0.75rem);
    }

    .sidebar.open .work-list li {
        margin-bottom: clamp(0.25rem, 1dvh, 0.75rem);
    }

    .sidebar.open .about-section {
        margin-top: clamp(1rem, 4dvh, 4rem);
    }

    .sidebar.open .about-section p {
        margin-bottom: clamp(0.35rem, 1dvh, 1rem);
    }

    body.menu-open {
        overflow: hidden;
    }

    body.menu-open .feed,
    body.menu-open .project-header,
    body.menu-open .project-feed,
    body.menu-open .project-content {
        display: none;
    }

    .feed {
        grid-template-columns: 1fr;
        padding: 0 4vw;
    }

    .project-header {
        padding: 0 4vw;
        flex-direction: column;
        gap: 2rem;
    }

    .project-content {
        padding: 0 4vw;
    }

    .project-details {
        padding-bottom: 4vw;
    }

    .credits-grid {
        grid-template-columns: 1fr;
        row-gap: 0;
    }

    .credits-grid .credit-role {
        margin-bottom: 0.2rem;
    }

    .credits-grid .credit-name {
        margin-bottom: 1.5rem;
    }
}
