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

body {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 400;
}

header {
    padding: 30px 8px 5px 8px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.contact {
    font-size: 12px;
    margin-top: auto;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.contact.visible {
    opacity: 1;
}

.contact a {
    color: #fff;
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

.title {
    text-align: right;
    line-height: 1;
}

.title h1 {
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 2px;
}

.title p {
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 0;
}

.copyright {
    font-size: 12px;
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 0 8px 8px 8px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gallery.visible {
    opacity: 1;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 3/4;
    transition: opacity 0.6s ease;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 3/4;
    transition: opacity 0.6s ease;
}

.gallery-item.fade-out img {
    animation: fadeOut 0.6s ease forwards;
}

.gallery-item.fade-out video {
    animation: fadeOut 0.6s ease forwards;
}

.gallery-item.fade-out .caption-right {
    animation: fadeOut 0.6s ease forwards;
}

.gallery-item.fade-in img {
    animation: fadeIn 0.6s ease forwards;
}

.gallery-item.fade-in video {
    animation: fadeIn 0.6s ease forwards;
}

.gallery-item.fade-in .caption-right {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.caption {
    position: absolute;
    bottom: 0;
    left: 2px;
    font-size: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.caption-right {
    position: absolute;
    bottom: 0;
    right: 2px;
    font-size: 6px;
    text-align: right;
    line-height: 1.4;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.caption-right div {
    margin-bottom: 1px;
}

.caption-right.hidden {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.caption-right.animating {
    position: fixed;
    z-index: 1000;
    transition: all 0.6s ease;
}

.back-button {
    background-color: #000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    aspect-ratio: 3/4;
    padding: 8px;
}

.back-text {
    font-family: Arial, sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
}

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

.lightbox.active {
    display: flex;
}

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

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10000;
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    background-color: #fff;
    top: 50%;
    left: 0;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* Desktop/Web version */
@media screen and (min-width: 429px) {
    .caption {
        font-size: 10px;
    }
    
    .caption-right {
        font-size: 10px;
    }
}

/* Tablet version */
@media screen and (min-width: 429px) and (max-width: 1024px) {
    .gallery {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* iPhone Pro Max dimensions */
@media screen and (max-width: 428px) {
    header {
        padding: 25px 8px 5px 8px;
    }
    
    .gallery {
        grid-template-columns: 1fr 1fr;
    }
    
    .contact {
        font-size: 12px;
    }
    
    .title h1 {
        font-size: 12px;
    }
    
    .title p {
        font-size: 12px;
    }
    
    .copyright {
        font-size: 12px;
    }
}
