/* Global Styles */
:root {
    --bg-color: #FAFAFA;
    --text-color: #111;
    --text-light: #777;
    --accent-color: #000;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --spacing-unit: 8px;
    --container-width: 1600px;
}

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

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

/* Grain Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.hero-eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-light);
    margin-bottom: 20px;
    display: block;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.2s forwards;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease 0.4s forwards;
}

/* ============================================
   BIG IMAGE GALLERY - MUSEUM STYLE
   ============================================ */
.gallery-section {
    padding-bottom: 100px;
}

/* Flexbox grid for better control over image sizes */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding-top: 40px;
}

/* Gallery Rows */
.gallery-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

/* Row 1: 2 images - both large landscape */
.row-2-landscape .gallery-item {
    flex: 1 1 calc(50% - 15px);
    min-width: 300px;
}

/* Row 2: 3 images - square + tall + square */
.row-3-mixed .gallery-item:nth-child(1),
.row-3-mixed .gallery-item:nth-child(3) {
    flex: 1 1 calc(25% - 20px);
    min-width: 200px;
}

.row-3-mixed .gallery-item:nth-child(2) {
    flex: 1 1 calc(50% - 20px);
    min-width: 250px;
}

/* Ensure row-3-mixed items (Nexa, Balazs, Aethel) are equal height */
.row-3-mixed {
    align-items: stretch;
}

.row-3-mixed .gallery-item {
    display: flex;
}

.row-3-mixed .project-link {
    display: flex;
    flex: 1;
}

.row-3-mixed .image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-3-mixed .image-wrapper img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Row 3: 2 images - extra large feature + large square */
.row-2-feature .gallery-item:nth-child(1) {
    flex: 2 1 calc(66.666% - 15px);
    min-width: 350px;
}

.row-2-feature .gallery-item:nth-child(2) {
    flex: 1 1 calc(33.333% - 15px);
    min-width: 250px;
}

/* Ensure row-2-feature items (Florida Paintur, Hoop Earrings) are equal height */
.row-2-feature {
    align-items: stretch;
}

.row-2-feature .gallery-item {
    display: flex;
}

.row-2-feature .project-link {
    display: flex;
    flex: 1;
}

.row-2-feature .image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-2-feature .image-wrapper img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Row 4: 3 images - landscape + square + landscape */
.row-3-horizontal .gallery-item:nth-child(1),
.row-3-horizontal .gallery-item:nth-child(3) {
    flex: 1 1 calc(37.5% - 20px);
    min-width: 250px;
}

.row-3-horizontal .gallery-item:nth-child(2) {
    flex: 1 1 calc(25% - 20px);
    min-width: 200px;
}

/* Ensure row-3-horizontal items (Cinemax, Kroma, Social Pulse) are equal height */
.row-3-horizontal {
    align-items: stretch;
}

.row-3-horizontal .gallery-item {
    display: flex;
}

.row-3-horizontal .project-link {
    display: flex;
    flex: 1;
}

.row-3-horizontal .image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-3-horizontal .image-wrapper img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Row 5: 2 images - both tall portrait */
.row-2-portrait .gallery-item {
    flex: 1 1 calc(50% - 15px);
    min-width: 280px;
}

/* Row 6: 3 images - square + landscape + square */
.row-3-balanced .gallery-item:nth-child(1),
.row-3-balanced .gallery-item:nth-child(3) {
    flex: 1 1 calc(30% - 20px);
    min-width: 220px;
}

.row-3-balanced .gallery-item:nth-child(2) {
    flex: 1 1 calc(40% - 20px);
    min-width: 280px;
}

/* Ensure row-3-balanced items (Mode, Sonic, Muse) are equal height */
.row-3-balanced {
    align-items: stretch;
}

.row-3-balanced .gallery-item {
    display: flex;
}

.row-3-balanced .project-link {
    display: flex;
    flex: 1;
}

.row-3-balanced .image-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.row-3-balanced .image-wrapper img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* Image Wrapper - Museum matte style */
.image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    padding: 16px;
    /* Larger padding for museum matte effect */
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1),
        box-shadow 0.4s ease,
        padding 0.3s ease;
}

.image-wrapper:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 40px -15px rgba(0, 0, 0, 0.15);
    padding: 14px;
    /* Slightly smaller padding on hover for subtle effect */
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    /* Slight corner on image inside matte */
    transition: transform 0.6s ease;
}

.image-wrapper:hover img {
    transform: scale(1.02);
}

/* Gallery Label Overlay */
.gallery-label {
    position: absolute;
    inset: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.4) 30%,
            transparent 80%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
    border-radius: 16px;
}

.gallery-item:hover .gallery-label {
    opacity: 1;
}

.label-project {
    transform: translateY(10px);
    transition: transform 0.4s ease 0.05s;
    color: #fff;
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.label-category {
    transform: translateY(10px);
    transition: transform 0.4s ease 0.1s;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.gallery-item:hover .label-project,
.gallery-item:hover .label-category {
    transform: translateY(0);
}

/* ============================================
   FOOTER
   ============================================ */
.minimal-footer {
    padding: 80px 0 60px;
    text-align: center;
}

.footer-text {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 20px;
}

.footer-email {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.footer-email:hover {
    border-bottom: 1px solid var(--text-color);
}

/* ============================================
   PROJECT DETAIL PAGES (Keep existing)
   ============================================ */
.project-nav {
    padding: 40px 0 20px;
}

.back-link {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-color);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.back-link:hover {
    border-bottom-color: var(--text-color);
}

.project-hero {
    padding: 60px 0 40px;
    text-align: center;
}

.project-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 15px;
    font-weight: 400;
}

.project-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-light);
}

.project-info {
    padding: 40px 0 60px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.info-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1000px) {
    .gallery-row {
        gap: 20px;
    }

    .image-wrapper {
        padding: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* Stack everything on mobile */
    .gallery-row {
        flex-direction: column;
        gap: 20px;
    }

    .gallery-row .gallery-item {
        flex: 1 1 100% !important;
        min-width: 100% !important;
    }

    .image-wrapper {
        padding: 10px;
        border-radius: 12px;
    }

    .gallery-label {
        opacity: 1;
        padding: 20px;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.5),
                transparent 60%);
    }

    .label-project,
    .label-category {
        transform: translateY(0);
    }

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

    .hero {
        min-height: 25vh;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
}

/* ============================================
   LIGHTBOX GALLERY STYLES
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.4s;
}

@keyframes zoom {
    from {transform:scale(0.95); opacity: 0}
    to {transform:scale(1); opacity: 1}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    z-index: 10001;
}

.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lightbox-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

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

@media only screen and (max-width: 700px) {
    .lightbox-content {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
}