:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-light: #757575;
    --accent-color: #000000;
    --font-main: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 32px;
    --spacing-lg: 64px;
    --spacing-xl: 120px;
    /* Shared side padding for alignment */
    --side-padding: 60px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

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

a:hover {
    opacity: 0.6;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 32px var(--side-padding);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

header>* {
    pointer-events: auto;
}

.brand {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.02em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

nav li {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main Layout */
main {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    padding-left: var(--side-padding);
    padding-right: var(--side-padding);
}

/* Gallery Grid */
.gallery {
    display: grid;
    /* Strict 3 columns as requested */
    grid-template-columns: repeat(3, 1fr);
    /* Landscape images align to center of portrait ones */
    align-items: center;
    /* Increased gap for pleasing ratio and smaller images */
    gap: 8vh 4vw;
    /* Remove max-width to ensure alignment with full-width header */
    max-width: none;
    margin: 0 auto;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --side-padding: 20px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    header {
        padding: 20px;
    }
}

.gallery-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gallery-item picture {
    display: block;
    width: 100%;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

/* Image Info Overlay (on hover) */
.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    transition: opacity 0.3s ease;
}

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

.item-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-color);
}

.item-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* Shared Close/Nav Buttons */
.close-btn,
.prev-btn,
.next-btn,
.contact-close-x {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 48px;
    color: var(--text-color);
    padding: 20px;
    z-index: 201;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.close-btn:hover,
.prev-btn:hover,
.next-btn:hover,
.contact-close-x:hover {
    opacity: 1;
}

.close-btn,
.contact-close-x {
    top: 20px;
    right: 20px;
}

.prev-btn {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.next-btn {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

/* Contact Section */
.contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.contact-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.contact-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    padding: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--text-color);
}

.contact-form button {
    padding: 15px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.3s;
}

.contact-form button:hover {
    background: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lightbox Caption */
.lightbox-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.lightbox-content:hover .lightbox-caption {
    opacity: 1;
}

.lightbox-title {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-color);
    font-size: 16px;
}

.lightbox-meta {
    font-size: 14px;
    color: var(--text-light);
}