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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    background: #fff;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 20%;
    min-width: 220px;
    max-width: 300px;
    height: 100vh;
    background: #fafafa;
    z-index: 100;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 3.5rem 2.5rem;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

.name {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 3.5rem;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
}

.name:hover {
    color: #1a1a1a;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
    text-decoration: none;
    transition: color 0.25s ease;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: #1a1a1a;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: #aaa;
    letter-spacing: 0.02em;
}

.social-link {
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    transition: color 0.25s ease;
}

.social-link:hover {
    color: #1a1a1a;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fafafa;
    z-index: 200;
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .name {
    font-size: 1rem;
    margin-bottom: 0;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: #1a1a1a;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active span:last-child {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #fafafa;
    padding: 2rem 1.5rem;
    z-index: 150;
    flex-direction: column;
    gap: 1.25rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Gallery (Work page) - Justified row layout */
.gallery {
    margin-left: 20%;
    min-height: 100vh;
    padding: 1.5rem 2rem;
    width: calc(100% - 20%);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.gallery img {
    height: 280px;
    width: auto;
    flex-grow: 1;
    object-fit: cover;
    display: block;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 150px;
    max-width: 600px;
}

.gallery img.visible {
    opacity: 1;
    transform: scale(1);
}

.gallery img:hover {
    opacity: 0.85;
}

@media (min-width: 1600px) {
    .gallery img {
        height: 320px;
    }
}

@media (min-width: 2000px) {
    .gallery img {
        height: 360px;
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 85%;
    max-height: 85vh;
    object-fit: contain;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    cursor: default;
}

.lightbox.active img {
    transform: scale(1);
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.25s ease;
    line-height: 1;
    font-weight: 300;
}

.lightbox-close:hover {
    color: #fff;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.25s ease;
    padding: 1rem;
    line-height: 1;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Page Content */
.page-content {
    margin-left: 20%;
    min-height: 100vh;
    padding: 3.5rem 4rem;
    max-width: 900px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
    color: #1a1a1a;
}

.page-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    max-width: 600px;
}

.page-text p {
    margin-bottom: 1.5rem;
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-link {
    font-size: 1.1rem;
    color: #666;
    text-decoration: none;
    transition: color 0.25s ease;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.project-link:hover {
    color: #1a1a1a;
}

/* Project/Collection Page - Editorial Vertical Layout */
.project-gallery {
    margin-left: 20%;
    min-height: 100vh;
    padding: 4rem 5%;
    width: calc(100% - 20%);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-header {
    margin-bottom: 4rem;
    text-align: center;
    width: 100%;
}

.project-title {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #1a1a1a;
    text-transform: uppercase;
}

.project-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem;
    width: 100%;
    max-width: 1400px;
}

.project-images img {
    width: auto;
    height: auto;
    max-height: 85vh;
    display: block;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Landscape images - nearly full width */
.project-images img.landscape {
    max-width: 90%;
    width: 90%;
    height: auto;
    object-fit: contain;
}

/* Portrait images - centered, taller display */
.project-images img.portrait {
    max-width: 55%;
    width: auto;
    max-height: 90vh;
    object-fit: contain;
}

/* Default before orientation detected */
.project-images img:not(.portrait):not(.landscape) {
    max-width: 80%;
}

.project-images img.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* Large screens */
@media (min-width: 1800px) {
    .project-gallery {
        padding: 5rem 8%;
    }
    
    .project-images {
        gap: 6rem;
    }
    
    .project-images img.portrait {
        max-width: 50%;
    }
}

/* Contact */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    font-size: 1rem;
    color: #666;
    text-decoration: none;
    transition: color 0.25s ease;
}

.contact-link:hover {
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery {
        margin-left: max(220px, 20%);
        width: calc(100% - max(220px, 20%));
        padding: 1rem 1.5rem;
    }
    
    .gallery img {
        height: 240px;
    }
    
    .page-content {
        margin-left: max(220px, 20%);
    }
    
    .project-gallery {
        margin-left: max(220px, 20%);
        width: calc(100% - max(220px, 20%));
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    .gallery {
        margin-left: 0;
        margin-top: 60px;
        width: 100%;
        padding: 0.5rem;
        gap: 6px;
    }
    
    .gallery img {
        height: 180px;
        min-width: 120px;
        max-width: 100%;
    }
    
    .page-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 2rem 1.5rem;
    }
    
    .project-gallery {
        margin-left: 0;
        margin-top: 60px;
        padding: 2rem 1rem;
        width: 100%;
    }
    
    .project-header {
        margin-bottom: 2.5rem;
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    .project-images {
        gap: 3rem;
    }
    
    .project-images img.landscape,
    .project-images img.portrait,
    .project-images img:not(.portrait):not(.landscape) {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .gallery {
        padding: 0.25rem;
        gap: 4px;
    }
    
    .gallery img {
        height: 140px;
        min-width: 100px;
    }
    
    .page-content {
        padding: 1.5rem 1rem;
    }
    
    .project-gallery {
        padding: 1.5rem 0.75rem;
    }
    
    .project-images {
        gap: 2.5rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .project-title {
        font-size: 1.1rem;
        letter-spacing: 0.03em;
    }
}

/* Selection */
::selection {
    background: rgba(0, 0, 0, 0.08);
}
