.gallery {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            max-width: 1200px;
            margin:100px auto 0;
        }
        .gallery-item {
            flex: 1 1 calc(20% - 15px);
            min-width: 150px;
            max-width: 200px;
            cursor: pointer;
            transition: transform 0.3s;
            text-align:center;
            margin-bottom:100px;
            color: #3968a6;
            font-size:20px;
            font-family: "Philosopher-Italic";
            -webkit-transition: all 360ms ease-in-out;
            -moz-transition: all 360ms ease-in-out;
            -o-transition: all 360ms ease-in-out;
            -ms-transition: all 360ms ease-in-out;
            transition: all 360ms ease-in-out;
        }
        .gallery-item:nth-child(even) {
            color: #e74560;
        }
        .gallery-item:hover {
            color:#333;
            -webkit-transition: all 360ms ease-in-out;
            -moz-transition: all 360ms ease-in-out;
            -o-transition: all 360ms ease-in-out;
            -ms-transition: all 360ms ease-in-out;
            transition: all 360ms ease-in-out;
        }
        .gallery-item img {
            margin:0 auto 20px;
            display:block;
            opacity:0.8;
        }
        .gallery-item:hover img {
            opacity:1;
            animation: modalopen 1.9s;
        }
        
        /* Модальное окно */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            overflow: auto;
            opacity: 0;
            transition: opacity 0.3s;
        }
        
        .modal-content {
            margin: 5% auto;
            padding: 50px 40px 100px;
            border-radius: 8px;
            width: 90%;
            max-width: 800px;
            position: relative;
            animation: modalopen 0.3s;
            background:url('/bg.jpg') 50% 0% no-repeat;
            background-size:cover;
            color:#333;
            font-size:20px;
            line-height:130%;
        }
        .modal-content h2 {
            color:#e74560;
            margin:20px 0 50px;
        }
        
        @keyframes modalopen {
            from {opacity: 0; transform: translateY(-50px);}
            to {opacity: 1; transform: translateY(0);}
        }
        
        .close {
            position: absolute;
            top: 10px;
            right: 20px;
            font-size: 28px;
            font-weight: bold;
            color: #aaa;
            cursor: pointer;
        }
        
        .close:hover {
            color: #000;
        }
        
        .modal-body {
            padding: 20px 0;
        }
        
        .modal-body img {
            width: 100%;
            max-height: 400px;
            object-fit: contain;
            margin-bottom: 20px;
            border-radius: 4px;
        }
        
        /* Адаптивность */
        @media (max-width: 768px) {
            .gallery-item {
                flex: 1 1 calc(33.33% - 15px);
            }
            
            .modal-content {
                margin: 10% auto;
                width: 95%;
            }
        }
        
        @media (max-width: 480px) {
            .gallery-item {
                flex: 1 1 calc(50% - 15px);
            }
            
            .modal-content {
                margin: 15% auto;
                padding: 15px;
            }
        }