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

body{
    font-family: "Space Grotesk", sans-serif;
    color:white;

    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;

    background:
        radial-gradient(circle at 20% 20%, #2a2a2a 0%, transparent 40%),
        radial-gradient(circle at 80% 60%, #1f1f1f 0%, transparent 45%),
        linear-gradient(180deg, #0e0e0e, #0a0a0a);
}

/* мягкое свечение и динамический фон */
.bg{
    position:fixed;
    inset:0;
    pointer-events:none;
    z-index: -1;
    background-size: cover;
    background-position: center;
    opacity: 0.15; /* Оптимальная прозрачность для читаемости контента */
    transition: background-image 1s ease-in-out; /* Плавное затухание при смене картинок */
}

/* контейнер */
.container{
    width:min(1200px,92vw);
}

/* HEADER */
header{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;

    margin-bottom:40px;
    gap:20px;
}

/* имя */
.name{
    font-size:clamp(2rem,4vw,3.5rem);
    letter-spacing:.35em;
    font-weight:600;
}

/* подзаголовок */
.subtitle{
    opacity:.5;
    font-size:.9rem;
}

/* ссылка vgen */
.link{
    display:inline-block;

    color:rgba(255,255,255,0.75);
    text-decoration:none;

    font-size:.95rem;
    letter-spacing:.08em;

    border-bottom:1px solid rgba(255,255,255,0.25);

    padding-bottom:2px;

    transition:.25s ease;
}

.link:hover{
    color:white;
    border-bottom:1px solid rgba(255,255,255,0.6);
    transform:translateY(-1px);
}

/* GALLERY */
.gallery{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:22px;
}

/* карточка */
.card{
    display:block;
    position:relative;

    border-radius:16px;
    overflow:hidden;

    aspect-ratio:16/9;

    background:rgba(255,255,255,0.03);
    border:1px solid rgba(255,255,255,0.08);

    cursor:pointer;
    transition:.25s ease;
}

/* лёгкий световой слой */
.card::after{
    content:"";
    position:absolute;
    inset:0;

    background:linear-gradient(
        135deg,
        rgba(255,255,255,0.08),
        transparent 60%
    );

    opacity:.25;
    pointer-events:none;
}

.card:hover{
    transform:translateY(-6px);
    border-color:rgba(255,255,255,0.2);
}

/* изображение */
.card img{
    width:100%;
    height:100%;
    object-fit:contain;

    background:#0f0f0f;

    transition:.35s ease;
}

.card:hover img{
    transform:scale(1.02);
}

/* СТИЛИ ДЛЯ ВСПЛЫВАЮЩЕГО ОКНА (LIGHTBOX) */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px); /* Эффект размытия заднего плана */
    -webkit-backdrop-filter: blur(12px); /* Поддержка Safari */
    justify-content: center;
    align-items: center;
}

/* Класс активации */
.lightbox.active {
    display: flex;
}

/* Изображение по центру экрана */
.lightbox-img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    animation: zoomIn 0.25s ease-out; /* Плавное увеличение */
}

/* Кнопка закрытия (крестик) */
.close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.2s ease;
    user-select: none;
}

.close-btn:hover {
    color: white;
}

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

/* адаптив */
@media(max-width:900px){
    header{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

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

    .close-btn {
        top: 15px;
        right: 25px;
        font-size: 40px;
    }
}
