/* ====== БАЗОВЫЕ СТИЛИ (ДНК главной) ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --dark-bg: #0f0f23;
    --dark-card: #1a1a2e;
    --cyan: #00ffff;
    --purple: #ff00ff;
    --blue: #0066ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --border: #2a2a4a
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px
}

.gradient-text {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

/* ====== Навигация ====== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 15, 35, .8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border)
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.nav-links {
    display: flex;
    gap: 32px
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .3s ease
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--cyan)
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer
}

/* ====== Хедер страницы ====== */
header.page-hero {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, rgba(0, 255, 255, .08), rgba(255, 0, 255, .08) 50%, rgba(0, 102, 255, .08));
    border-bottom: 1px solid var(--border)
}

.page-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px
}

.page-hero p {
    color: var(--text-secondary)
}

/* ====== Кнопки/фильтры ====== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 10px
}

.btn {
    padding: 12px 18px;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: all .3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary)
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, .15)
}

.btn.active {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 255, 255, .15) inset
}

.btn-primary {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    color: var(--dark-bg);
    border: none
}

/* ====== Сетка работ ====== */
section {
    padding: 40px 0 100px
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 22px
}

.work-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(26, 26, 46, .5);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    transition: all .3s ease
}

.work-card:hover {
    transform: translateY(-6px);
    border-color: var(--cyan);
    box-shadow: 0 20px 40px rgba(0, 255, 255, .08)
}

.work-card .work-cover {
    aspect-ratio: 16/10;
    width: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(70%) brightness(0.8) hue-rotate(180deg) saturate(120%);
    transition: filter .4s ease;
}

.work-card:hover .work-cover {
    filter: grayscale(0%) brightness(1) hue-rotate(0deg) saturate(100%);
}

.work-cover {
    aspect-ratio: 16/10;
    width: 100%;
    object-fit: cover;
    display: block
}

.work-meta {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(15, 15, 35, .55);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(42, 42, 74, .7);
    border-radius: 12px;
    padding: 10px 12px
}

.work-title {
    font-weight: 700;
    font-size: 1rem
}

.work-chip {
    font-size: .75rem;
    color: var(--cyan);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 20px;
    white-space: nowrap
}

/* ====== Лайтбокс с поддержкой длинных вертикальных скринов ====== */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 15, .75);
    backdrop-filter: blur(6px);
    z-index: 2000
}

.lightbox.open {
    display: flex
}

.lightbox-inner {
    width: min(100%, 1080px);
    max-height: 86vh;
    background: rgba(26, 26, 46, .9);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border)
}

.lb-title {
    font-weight: 700
}

.lb-sub {
    font-size: .875rem;
    color: var(--text-secondary)
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer
}

.icon-btn:hover {
    border-color: var(--cyan)
}

/* Сцена прокручиваемая: вертикальные скрины идут "по ширине" */
.lightbox-stage {
    position: relative;
    background: #070713;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 72vh;
    overflow: auto;
    padding: 16px
}

.slide {
    display: block;
    max-width: 100%;
    height: auto
}

.slide.landscape {
    max-height: calc(72vh - 32px);
    width: auto
}

.slide.portrait {
    width: min(1000px, 92vw);
    max-height: none
}

.slide.fit-screen {
    max-height: calc(72vh - 32px) !important;
    width: auto !important
}

/* Вертикальные полупрозрачные панели-навигации поверх изображения */
/* Фиксированная навигация: панели всегда поверх видимой части сцены */
.lb-nav {
    position: fixed;
    /* было: absolute/relative — не важно, теперь fixed */
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    pointer-events: none;
    /* клики проходят только на кнопки */
    z-index: 3000;
    /* поверх содержимого сцены */
    /* координаты задаём из JS под реальную область .lightbox-stage */
}

.lb-arrow {
    pointer-events: auto;
    width: 56px;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, opacity .2s ease, transform .08s ease;
    opacity: .9;
    margin: 0 12px;
}

.lb-arrow:hover {
    background: rgba(255, 255, 255, 0.07);
    opacity: 1;
}

.lb-arrow:active {
    transform: scale(0.995);
}

.lb-arrow i {
    font-size: 1.1rem;
    color: #fff;
    opacity: .95;
}

@media (max-width:768px) {
    .lb-arrow {
        width: 44px;
        margin: 0 8px;
        border-radius: 10px;
    }
}

.lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid var(--border)
}

.thumbs {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding-bottom: 2px
}

.thumbs img {
    width: 64px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    opacity: .7;
    border: 1px solid var(--border);
    cursor: pointer
}

.thumbs img.active,
.thumbs img:hover {
    opacity: 1;
    border-color: var(--cyan)
}

.lb-info,
.lb-count {
    font-size: .875rem;
    color: var(--text-secondary);
    min-width: 50px;
}

.lb-link {
    display: inline-block;
    text-decoration: none;       /* убираем подчёркивание */
    color: var(--cyan);              /* зелёный текст */
    font-weight: 700;            /* жирный */
    border: 2px solid var(--cyan);   /* зелёная рамка */
    border-radius: 6px;          /* скругление */
    padding: 6px 14px;           /* отступы */
    transition: all 0.3s ease;   /* плавный ховер */
    min-width: 120px;
}

.lb-link:hover {
    background: var(--cyan);         /* заливка при наведении */
    color: #0f0f23;              /* контрастный тёмный текст */
}

/* ====== Респонсив ====== */
@media (max-width:768px) {
    .nav-links {
        display: none
    }

    .mobile-menu-btn {
        display: block
    }

    .page-hero h1 {
        font-size: 2.2rem
    }

    .lightbox-stage {
        height: 66vh
    }

    .slide.portrait {
        width: 94vw
    }

    .lb-arrow {
        width: 44px;
        margin: 8px;
        height: calc(100% - 16px);
        border-radius: 10px
    }
}

/* ===== Кастомный скролл для .lightbox-stage ===== */
.lightbox-stage {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: var(--cyan) transparent;
}

/* Chrome, Safari, Edge */
.lightbox-stage::-webkit-scrollbar {
    width: 10px;
    /* толщина вертикального скролла */
    height: 10px;
    /* толщина горизонтального */
}

.lightbox-stage::-webkit-scrollbar-track {
    background: transparent;
    /* фон трека */
}

.lightbox-stage::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--cyan), var(--purple));
    border-radius: 8px;
    min-height: 40px;
}

.lightbox-stage::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--purple), var(--cyan));
}

.lightbox-stage::-webkit-scrollbar-corner {
    background: transparent;
}