/* Запрет браузеру применять автоматическую тёмную тему */
:root {
    color-scheme: only light;
}

html,
body {
    overflow-x: hidden;
}

/* Контейнер для графика */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    height: 350px;
    max-height: 400px;
}
@media (max-width : 843px ){
    .chart-container {
        height: 300px;
    }
}

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 10px ; /* Ширина вертикального скроллбара */
    height: 8px; /* Высота горизонтального (на всякий случай) */
}

::-webkit-scrollbar-track {
    background: #f3efff; /* Цвет дорожки (твоя переменная brand-light) */
    border-radius: 5px ;
}

::-webkit-scrollbar-thumb {
    background: #f3efff; /* Цвет самого ползунка (твой основной brand) */
    border-radius: 10px;
    border: 2px solid #f3efff; /* Отступ вокруг ползунка, чтобы он казался тоньше */
}

::-webkit-scrollbar-thumb:hover {
    background: #6e6581; /* Цвет при наведении (brand-dark) */
}

/* Для Firefox */
* {
    scrollbar-width: auto;
    scrollbar-color: #8a70d6 #f3efff;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(138, 112, 214, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.hero-background-text {
    position: fixed;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(6rem, 12vw, 15rem);
    font-weight: 800;
    color: rgba(51, 45, 65, 0.12);
    letter-spacing: 0.08em;
    white-space: nowrap;
    z-index: 1;
    mix-blend-mode: normal;
    pointer-events: none;
}

#main-shell {
    position: relative;
    z-index: 2;
}

.dashboard-nav-hint {
    position: absolute;
    top: 6.1rem;
    left: 4.3rem;
    z-index: 25;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: none;
}

.dashboard-nav-hint-card {
    max-width: 15rem;
    padding: 1rem 1.05rem;
    background: rgba(255, 255, 255, 0.74);
    border: 2px solid rgba(51, 45, 65, 0.22);
    border-radius: 1.35rem;
    box-shadow: 0 10px 30px rgba(51, 45, 65, 0.08);
    transform: rotate(-3deg);
    position: relative;
}

.dashboard-nav-hint-kicker {
    display: block;
    margin-bottom: 0.35rem;
    font-family: 'Marker Felt', 'Chalkboard SE', 'Bradley Hand', 'Segoe UI', sans-serif;
    font-size: 1.02rem;
    line-height: 1;
    color: #8a70d6;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.dashboard-nav-hint-card p {
    margin: 0;
    font-family: 'Marker Felt', 'Chalkboard SE', 'Bradley Hand', 'Segoe UI', sans-serif;
    font-size: 1.02rem;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: #332d41;
}

.dashboard-nav-hint-mobile {
    position: relative;
    z-index: 25;
    margin: 0 0 1rem;
    padding: 0.55rem 0.9rem;
    border: 2px solid rgba(51, 45, 65, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    font-family: 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
    font-size: 0.95rem;
    color: #332d41;
    text-align: center;
}

/* Анимации */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* ОПТИМИЗАЦИЯ: Поддержка prefers-reduced-motion для пользователей с чувствительностью к анимациям */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .skill-category,
    .skill-list,
    .arrow,
    .lightbox-thumb,
    * {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-hero-gradient {
    background: linear-gradient(135deg, #8a70d6 0%, #a594f9 100%);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    /* ОПТИМИЗАЦИЯ: Используем contain для улучшения производительности */
    contain: layout style paint;
}

.lightbox-stage {
    width: min(92vw, 1200px);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-x pan-y pinch-zoom;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-drag: none;
    /* ОПТИМИЗАЦИЯ: Предотвращаем перерисовку при масштабировании */
    image-rendering: crisp-edges;
}

.lightbox-thumbs {
    width: min(92vw, 900px);
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.lightbox-thumbs::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.lightbox-thumb {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    opacity: 0.65;
    cursor: pointer;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lightbox-thumb.is-active {
    opacity: 1;
    border-color: #8a70d6;
}

@media (max-width: 767px) {
    #lottie-bg {
        display: none !important;
    }

    * {
        scrollbar-width: none;
    }

    *::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .gallery-grid {
        display: flex;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.35rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-grid .gallery-thumb {
        flex: 0 0 62vw;
        max-width: 62vw;
        scroll-snap-align: center;
        aspect-ratio: 3 / 4 !important;
        grid-column: auto !important;
    }

    .lightbox-stage {
        width: 94vw;
        max-height: 75vh;
    }

    .lightbox-img {
        max-width: 94vw;
        max-height: 68vh;
    }

    .lightbox-thumb {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .dashboard-nav-hint,
    .dashboard-nav-hint-card {
        display: none !important;
    }
}

/* Стили для аккордеона навыков */
.skill-category {
    cursor: pointer;
    transition: all 0.3s;
}
.skill-category:hover {
    background-color: #f3efff;
}
.skill-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.skill-category.active .skill-list {
    max-height: 500px; /* Достаточно большое значение */
    transition: max-height 0.5s ease-in;
}
.arrow {
    transition: transform 0.3s;
}
.skill-category.active .arrow {
    transform: rotate(180deg);
}
