body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 2rem;
    text-align: left;
    background-color: #fff;
    color: #1a1a1a;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 350;
    letter-spacing: 0.02rem;
    margin-bottom: 0.5rem;
    text-transform: lowercase;
}

nav {
    margin-bottom: 4rem;
}

.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.instagram-link:hover {
    color: #666;
    transform: translateY(-1px);
}

/* Photo Gallery */
.gallery-wrapper {
    container-type: inline-size;
    width: 100%;
}

.gallery {
    --columns: 5;
    --gap: 5px;
    --landscape-aspect: 0.66667;
    /* Height is 2/3 of Width */

    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gap);
    margin: 4rem auto;

    /* Calculate exact row height based on dynamic column width in container */
    --column-width: calc((100cqw - ((var(--columns) - 1) * var(--gap))) / var(--columns));
    grid-auto-rows: calc(var(--column-width) * var(--landscape-aspect));
}

.gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
    transition: transform 0.3s ease;
}

.gallery img.portrait {
    grid-column: span 1;
    grid-row: span 2;
}

.gallery img.landscape {
    grid-column: span 1;
    grid-row: span 1;
}

.gallery img:hover {
    transform: scale(1.02);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .gallery {
        --columns: 3;
    }
}

@media (max-width: 600px) {
    .gallery {
        --columns: 2;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #999;
}