:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #666666;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition-slow: 1.2s cubic-bezier(0.2, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* Let clicks pass through to gallery unless on interactive elements */
}

.logo {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    pointer-events: auto;
}

nav {
    pointer-events: auto;
}

#contact-trigger {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#contact-trigger:hover {
    opacity: 1;
}

/* Gallery Wall */
#gallery-wall {
    width: 100%;
    min-height: 250vh;
    padding: 8rem 2vw; /* Tightened horizontal padding */
    position: relative;
    overflow-y: visible;
}

.gallery-item {
    position: absolute;
    cursor: grab;
    user-select: none; /* Prevent text selection during drag */
    -webkit-user-drag: none; /* Prevent ghost image drag */
    touch-action: none;
    opacity: 0;
    transform: translateY(60px) scale(0.98);
    transition: 
        opacity var(--transition-slow), 
        transform var(--transition-slow), 
        box-shadow 0.4s ease;
    z-index: 1;
    will-change: transform, opacity; /* Performance boost for Brave/Chrome */
}

.gallery-item:active {
    cursor: grabbing;
    z-index: 999 !important;
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-item.is-dragging {
    transition: transform 0.1s ease, box-shadow 0.3s ease; /* Snappier during drag */
    box-shadow: 0 40px 100px rgba(0,0,0,0.2);
    transform: scale(1.04) rotate(1deg); /* Slight lift and tilt */
    z-index: 1000 !important;
}

.photo-container {
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.2, 0, 0.2, 1);
}

.gallery-item:hover .photo-container {
    transform: scale(1.01);
}

.photo-container img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: saturate(0.95);
    transition: filter 0.6s ease;
}

.gallery-item:hover img {
    filter: saturate(1.1);
}

/* Contact Overlay */
#contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#contact-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.close-btn {
    position: absolute;
    top: -4rem;
    right: 0;
    background: none;
    border: none;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    color: var(--accent-color);
}

.contact-details h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem; /* Smaller as requested */
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-transform: lowercase;
}

.email-link {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    margin: 1.5rem 0;
    font-weight: 400;
    border-bottom: 1px solid var(--text-color); /* Underline word-length */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding-bottom: 2px;
}

.email-link span {
    display: inline-block;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Envelope Morph */
.email-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -120%) scale(0.5);
    width: 24px;
    height: 18px;
    /* Inlined SVG for absolute reliability across all deployments */
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='18' viewBox='0 0 24 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V14C22 15.1046 21.1046 16 20 16H4C2.89543 16 2 15.1046 2 14V4Z' stroke='%231A1A1A' stroke-width='1.5'/%3E%3Cpath d='M2.5 4.5L12 11L21.5 4.5' stroke='%231A1A1A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.email-link:hover span {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
}

.email-link:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.email-link:hover {
    border-bottom-color: transparent;
}

.socials {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.socials a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Lightbox Overlay */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.2, 0, 0.2, 1), visibility 0.5s;
}

#lightbox-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    box-shadow: 0 40px 100px rgba(0,0,0,0.1);
    object-fit: contain;
    background: #fff;
}

.lightbox-close {
    position: fixed;
    top: 2.5rem;
    right: 3rem;
    background: none;
    border: none;
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    color: var(--text-color);
    z-index: 2100;
    line-height: 1;
}

/* Hide gallery items when lightbox or contact is open to save on performance if needed */
body.modal-open #gallery-wall {
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1.5rem;
    }
    .contact-details h2 {
        font-size: 2rem;
    }
    .email-link {
        font-size: 1.2rem;
    }
.lightbox-close {
        top: 1.2rem;
        right: 1.5rem;
        font-size: 2.2rem;
    }
    .gallery-item {
        cursor: default;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 92% !important;
        margin: 0 auto 1.5rem auto;
        transform: translateY(30px);
        touch-action: auto !important; /* Restore browser scrolling */
    }
    .gallery-item.visible {
        transform: translateY(0);
    }
    #gallery-wall {
        padding: 6rem 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: auto !important; /* Allow natural flow */
    }
}
