/* ===== CSS Reset & Variables ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a0a;
    --bg-secondary: #151515;
    --text-light: #f5f5f5;
    --text-muted: #a0a0a0;
    --accent: #ffffff;
    --transition-smooth: cubic-bezier(0.65, 0.05, 0, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-light);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text-light);
}

/* ===== Hero Section ===== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-secondary) 100%);
}

.hero-content {
    padding: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 200;
    letter-spacing: 8px;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-muted);
    letter-spacing: 2px;
    font-weight: 300;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* ===== Gallery Section ===== */
.gallery-container {
    min-height: 100vh;
    padding: 6rem 0 4rem;
    position: relative;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 15vh;
    padding: 0;
}

/* Gallery Item - Base Styles */
.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: visible;
    width: fit-content;
    margin: 0 auto;
    /* Initial state for animations */
    opacity: 0;
    will-change: transform;
    perspective: 1000px;
    transform: translate3d(0, 0, 0); /* Force GPU acceleration */
    backface-visibility: hidden; /* Improve rendering performance */
    background: none;
}

/* Alternate positioning for visual interest */
.gallery-item:nth-child(odd) {
    margin-left: 5vw;
}

.gallery-item:nth-child(even) {
    margin-right: 5vw;
}

/* Portrait and landscape dimensions now set dynamically by JavaScript */
.gallery-item.portrait,
.gallery-item.landscape {
    /* Dimensions set via JavaScript based on image aspect ratio */
}

/* Animation States - Dramatic entrance from far off-screen */
.gallery-item.slide-left {
    transform: translateX(-150vw) rotateY(-25deg) rotateZ(-8deg) scale(0.8);
}

.gallery-item.slide-right {
    transform: translateX(150vw) rotateY(25deg) rotateZ(8deg) scale(0.8);
}

/* Alternative animation: flip in */
.gallery-item.flip-left {
    transform: translateX(-120vw) rotateY(-90deg) scale(0.4);
}

.gallery-item.flip-right {
    transform: translateX(120vw) rotateY(90deg) scale(0.4);
}

/* Animated in state */
.gallery-item.animate-in {
    opacity: 1;
    transform: translateX(0) rotateY(0) rotateZ(0) scale(1);
    transition: transform 0.8s var(--transition-smooth),
                opacity 0.6s ease;
}

/* Add a slight bounce effect on entry */
@keyframes bounceIn {
    0% {
        transform: translateX(0) scale(1);
    }
    60% {
        transform: translateX(0) scale(1.02);
    }
    100% {
        transform: translateX(0) scale(1);
    }
}

.gallery-item.animate-in {
    animation: bounceIn 0.6s ease 1.2s;
}

/* Gallery Image */
.gallery-item img {
    display: block;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0); /* Force GPU acceleration */
}

/* Landscape images - constrain by width */
.gallery-item.landscape img {
    max-width: 72vw;
    height: auto;
}

/* Portrait images - constrain by height, 20% larger than base */
.gallery-item.portrait img {
    max-height: 90vh;
    width: auto;
}

/* Hover effect - subtle inflate */
.gallery-item:hover {
    z-index: 10;
}

.gallery-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

/* ===== About Section ===== */
.about-section {
    padding: 8rem 2rem;
    background-color: var(--bg-secondary);
    text-align: center;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 2rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

/* ===== Contact Section ===== */
.contact-section {
    padding: 8rem 2rem;
    text-align: center;
}

.contact-content h2 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 2rem;
}

.contact-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-caption {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2.5rem;
    cursor: pointer;
    padding: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2001;
    line-height: 1;
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 0.7;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-close:hover {
    transform: scale(1.1);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .gallery-item.landscape img {
        max-width: 80vw;
    }

    .gallery-item:nth-child(odd) {
        margin-left: 4vw;
    }

    .gallery-item:nth-child(even) {
        margin-right: 4vw;
    }

    .hero-title {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .gallery-container {
        padding: 5rem 0 3rem;
    }

    .gallery-grid {
        gap: 10vh;
    }

    .gallery-item {
        margin: 0 auto !important;
    }

    .gallery-item.landscape img {
        max-width: 95vw;
    }

    .gallery-item.portrait img {
        max-height: 75vh;
    }

    /* Reduce rotation on mobile for better visibility */
    .gallery-item.slide-left {
        transform: translateX(-120vw) rotateZ(-5deg);
    }

    .gallery-item.slide-right {
        transform: translateX(120vw) rotateZ(5deg);
    }

    .gallery-item.flip-left,
    .gallery-item.flip-right {
        transform: translateX(-120vw) scale(0.5);
    }

    .hero-title {
        font-size: 3rem;
        letter-spacing: 4px;
    }

    .about-section,
    .contact-section {
        padding: 4rem 1.5rem;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}

/* ===== Loading State ===== */
.gallery-item.loading {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ===== Utility Classes ===== */
.no-scroll {
    overflow: hidden;
}
