/* View Transitions — same-document only (gallery)
   Cross-document disabled: too many backdrop-filter/blur layers
   cause snapshot artifacts during page rasterization */

/* ============================================================
   COMMON STYLES FOR ALL PAGES
   Portfolio - Kirill Vasilev
   iOS 26 Liquid Glass Optimized
   ============================================================ */

/* ============================================================
   CSS VARIABLES (Base - can be overridden per page)
   ============================================================ */
:root {
    /* Cursor color - updated by JS */
    --cursor-color: #22d3ee;

    /* Colors - Base */
    --c-bg: #0d0d0d;
    --c-surface: #0f0f0f;
    --c-surface-2: #1a1a1a;
    --c-surface-3: #242424;
    --c-text: #ffffff;
    --c-text-muted: #888888;
    
    /* Accent colors - can be overridden */
    --c-accent: #22d3ee;
    --c-accent-glow: rgba(34, 211, 238, 0.25);
    
    /* Spacing & Layout */
    --radius: 32px;
    --radius-sm: 20px;
    --gap: 16px;
    
    /* iOS 26 Safari safe areas - use max variants for stable positioning */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    
    /* iOS 26: Maximum insets when UI fully retracted */
    --safe-max-top: env(safe-area-max-inset-top, env(safe-area-inset-top, 0px));
    --safe-max-bottom: env(safe-area-max-inset-bottom, env(safe-area-inset-bottom, 0px));
    
    /* Animations */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Glass effect variables */
    --glass-bg: linear-gradient(in oklch 135deg, rgba(30, 30, 30, 0.85), rgba(20, 20, 20, 0.7));
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px) saturate(180%);
}

/* ============================================================
   RESET & BASE STYLES - iOS 26 Optimized
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* CRITICAL: Background on html controls Safari iOS 26 tab bar tinting */
html {
    background-color: #0d0d0d; /* This color tints the Liquid Glass tab bar */
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Use svh for stable viewport - iOS 26 changed vh behavior */
    min-height: 100vh;
    min-height: 100svh;
}

body {
    font-family: "Space Grotesk", system-ui, sans-serif;
    color: var(--c-text);
    background: transparent; /* Let html background show through */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent overscroll bounce showing wrong color */
    overscroll-behavior-y: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Squircle corners are handled by squircle.js via clip-path.
   We do NOT use native corner-shape: squircle because overflow: hidden
   clips children using standard border-radius, creating a visible
   mismatch with the squircle-shaped background in the corners. */

/* ============================================================
   iOS 26 LIQUID GLASS MODAL WORKAROUND
   When modals are open, body background extends behind Liquid Glass UI
   ============================================================ */
body.modal-open {
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

body.page-modal-open {
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ============================================================
   FLOATING BACK BUTTON - iOS 26 Safe Positioning
   Positioned above Safari's Liquid Glass tab bar
   ============================================================ */
.back-btn {
    position: fixed !important;
    /* iOS 26: Position higher to avoid Liquid Glass overlap */
    bottom: calc(100px + var(--safe-bottom)) !important;
    left: calc(20px + var(--safe-left)) !important;
    top: auto !important;
    right: auto !important;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 99px;
    /* Glass effect matching iOS 26 aesthetic */
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    transition: all 0.4s var(--ease-out);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin: 0;
    overflow: hidden;
}

/* Inner glass highlight */
.back-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 60%
    );
    pointer-events: none;
}

/* Gradient border effect */
.back-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 99px;
    padding: 1px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
}

.back-btn:hover {
    background: linear-gradient(in oklch 135deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.8));
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.back-btn:hover::after {
    opacity: 1;
}

.back-btn:active {
    transform: translateY(0);
}

.back-btn i,
.back-btn span {
    position: relative;
    z-index: 1;
}

/* ============================================================
   PAGE LOAD ANIMATIONS
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade-up on scroll - DISABLED, elements visible by default */
.fade-up {
    opacity: 1;
    transform: none;
}

.fade-up.visible {
    opacity: 1;
    transform: none;
}

/* Stagger delays */
.stagger-1 { animation-delay: 0.1s; transition-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; transition-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; transition-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; transition-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; transition-delay: 0.5s; }

/* ============================================================
   HERO PARALLAX EFFECT
   ============================================================ */
.hero,
.page-hero {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.hero-bg,
.page-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hero-bg .mesh,
.page-hero-bg .mesh {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hero-content,
.page-hero-content {
    position: relative;
    z-index: 2;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ============================================================
   SCROLL-BASED GRADIENT - DISABLED
   Removed to prevent unwanted background effects
   ============================================================ */
/* 
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse at 50% calc(50% + var(--scroll-progress, 0px)),
        var(--gradient-color-1, rgba(34, 211, 238, 0.15)) 0%,
        var(--gradient-color-2, rgba(139, 92, 246, 0.1)) 50%,
        transparent 100%
    );
    opacity: var(--gradient-opacity, 1);
    transition: opacity 0.3s ease-out, background 0.3s ease-out;
    will-change: background, opacity;
}
*/

/* ============================================================
   GLASS CARD UTILITY - iOS 26 Liquid Glass Style
   ============================================================ */
.glass-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ============================================================
   LANGUAGE CONTENT SWITCHING
   ============================================================ */
[data-lang-content] { display: none; }
html[data-lang="en"] [data-lang-content="en"] { display: inline; }
html[data-lang="de"] [data-lang-content="de"] { display: inline; }

/* Block display variants */
[data-lang-block] { display: none; }
html[data-lang="en"] [data-lang-block="en"] { display: block; }
html[data-lang="de"] [data-lang-block="de"] { display: block; }

/* ============================================================
   COMMON UTILITIES
   ============================================================ */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    padding-left: max(20px, var(--safe-left));
    padding-right: max(20px, var(--safe-right));
}

/* ============================================================
   RESPONSIVE - iOS 26 Safe Areas
   ============================================================ */
@media (max-width: 768px) {
    .back-btn {
        font-size: 13px;
        padding: 10px 18px;
        bottom: calc(110px + var(--safe-bottom)) !important;
        left: calc(16px + var(--safe-left)) !important;
        gap: 8px;
    }
    
    .container {
        padding: 0 16px;
        padding-left: max(16px, var(--safe-left));
        padding-right: max(16px, var(--safe-right));
    }
}

@media (max-width: 480px) {
    .back-btn {
        font-size: 12px;
        padding: 10px 16px;
        gap: 8px;
    }
}

/* ============================================================
   BACKDROP FILTER FALLBACK
   ============================================================ */
@supports not (backdrop-filter: blur(1px)) {
    .back-btn,
    .glass-card {
        background: rgba(20, 20, 20, 0.95);
    }
}

/* ============================================================
   iOS 26 VIEWPORT STABILITY
   Prevent layout shifts from dynamic toolbar
   ============================================================ */
@supports (height: 100svh) {
    .full-height {
        min-height: 100svh;
    }
}

@supports not (height: 100svh) {
    .full-height {
        min-height: 100vh;
    }
}

/* ============================================================
   INFINITE CAROUSEL - Бесконечная карусель
   ============================================================ */
.carousel-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: pointer;
    background: var(--c-surface-2);
    isolation: isolate; /* Изоляция от backdrop-filter элементов */
}

/* Индикатор просмотра */
.carousel-container::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z'/%3E%3Cpath d='M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px;
    z-index: 2;
}

.carousel-container:hover::after {
    opacity: 1;
}

.carousel-track {
    display: flex;
    height: 100%;
    gap: 0;
    position: absolute;
    left: 0;
    top: 0;
    align-items: center;
    /* Анимация будет рассчитана в JS на основе ширины */
    will-change: transform; /* Подсказка браузеру */
    transform: translate3d(0, 0, 0); /* Хак для включения GPU ускорения */
}

.carousel-track.animated {
    animation: carousel-scroll linear infinite;
    will-change: transform;
}

.carousel-item {
    flex-shrink: 0;
    height: 100%;
    /* Для фото 4:5 при высоте 200px ширина будет 160px */
    aspect-ratio: 4/5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    border-radius: 0;
    overflow: hidden;
}

.carousel-item img,
.carousel-item video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* LQIP placeholder - показываем размытым */
.carousel-item img[data-src],
.carousel-item video[data-src] {
    filter: blur(8px);
    transform: scale(1.05);
    opacity: 1;
}

/* После загрузки полного изображения - анимация проявления */
.carousel-item img.loaded,
.carousel-item video.loaded {
    filter: blur(0);
    transform: scale(1);
    opacity: 1;
    transition: filter 0.3s ease-out, transform 0.3s ease-out;
}

/* Fallback для элементов без LQIP */
.carousel-item img:not([data-src]):not(.loaded),
.carousel-item video:not([data-src]):not(.loaded) {
    opacity: 1;
    filter: none;
    transform: none;
}

/* Safari/iOS/Mobile: НЕ показываем LQIP - сразу полная картинка */
/* Класс .simplified-loading добавляется через JS при детекте Safari */
.simplified-loading .carousel-item img[data-src],
.simplified-loading .carousel-item video[data-src] {
    filter: none;
    transform: none;
    opacity: 0;
}

.simplified-loading .carousel-item img.loaded,
.simplified-loading .carousel-item video.loaded {
    filter: none;
    transform: none;
    opacity: 1;
    transition: none;
}

/* Storymaking карусель - изображения в своем размере */
#storymakingCarousel .carousel-item {
    aspect-ratio: auto;
    width: auto;
    height: 100%;
}

#storymakingCarousel .carousel-item img {
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
}

/* AMG Stories карусель - видео плотно друг к другу */
#amgStoriesCarousel .carousel-item {
    aspect-ratio: auto;
    width: auto;
    height: 100%;
    margin-right: 0;
}

#amgStoriesCarousel .carousel-item video {
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

/* Advent Calendar карусель - вертикальные видео 9:16 */
#moeckAdventCarousel .carousel-item {
    aspect-ratio: auto;
    width: auto;
    height: 100%;
    margin-right: 0;
}

#moeckAdventCarousel .carousel-item video {
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

@keyframes carousel-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ============================================================
   FULLSCREEN GALLERY - Полноэкранная галерея
   ============================================================ */
.gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        backdrop-filter 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s 0.5s;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    will-change: opacity, backdrop-filter, background;
}

.gallery-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    transition: 
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        backdrop-filter 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0s 0s;
}

/* View Transition for gallery open/close */
.gallery-overlay.active {
    view-transition-name: gallery;
}

::view-transition-old(gallery) {
    animation: vt-gallery-out 250ms ease-out;
}
::view-transition-new(gallery) {
    animation: vt-gallery-in 250ms ease-out;
}

@keyframes vt-gallery-out {
    to { opacity: 0; transform: scale(1.05); }
}
@keyframes vt-gallery-in {
    from { opacity: 0; transform: scale(0.9); }
}

.gallery-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 100px;
    padding-top: calc(80px + var(--safe-top));
    padding-bottom: calc(100px + var(--safe-bottom));
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    gap: 20px;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
    will-change: opacity, transform;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.gallery-overlay.active .gallery-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.gallery-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.gallery-image,
.gallery-video {
    max-width: 50vw;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
    transition: 
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, filter, transform;
}

.gallery-video {
    outline: none;
}

.gallery-image.changing,
.gallery-video.changing {
    opacity: 0;
    filter: blur(15px);
    transform: scale(0.98);
}

/* На мобильных - по ширине экрана */
@media (max-width: 768px) {
    .gallery-image,
    .gallery-video {
        max-width: 90vw;
    }
}

.gallery-caption {
    width: 100%;
    max-width: 800px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    font-style: italic;
}

/* Текстовый слайд с описанием проекта */
.gallery-description-card {
    width: 100%;
    max-width: 920px;
    padding: 0;
    background: transparent;
    opacity: 1;
    filter: blur(0px);
    transform: scale(1) translateY(0);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    will-change: opacity, filter, transform;
    max-height: 100%;
}

.gallery-description-card.changing {
    opacity: 0;
    filter: blur(15px);
    transform: scale(0.98) translateY(10px);
}

/* Единый блок описания */
.gallery-description-content {
    margin: 0;
    padding: 32px 40px;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.85) 50%,
        rgba(0, 0, 0, 0.75) 100%);
    -webkit-backdrop-filter: blur(80px) saturate(180%);
    backdrop-filter: blur(80px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.gallery-description-content::-webkit-scrollbar {
    width: 6px;
}

.gallery-description-content::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-description-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gallery-description-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.gallery-description-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--c-accent, #22d3ee) 50%,
        transparent 100%);
    opacity: 0.6;
}

/* Заголовки блоков */
.gallery-description-content strong {
    color: var(--c-accent, #22d3ee);
    font-weight: 600;
    display: block;
    margin: 32px 0 0 0;
    font-size: 15px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 1;
    position: relative;
    padding-left: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.gallery-description-content strong::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--c-accent, #22d3ee);
    border-radius: 2px;
    opacity: 0.8;
}

.gallery-description-content strong:first-child {
    margin-top: 0;
}

/* Текст внутри блока */
.gallery-description-content {
    color: rgba(255, 255, 255, 0.95);
    font-size: 17px;
    line-height: 1.7;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Списки */
.gallery-description-content ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-description-content li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    line-height: 1.7;
    transition: color 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.gallery-description-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--c-accent, #22d3ee);
    opacity: 0.8;
    font-weight: 600;
    font-size: 14px;
    transform: translateX(2px);
}

.gallery-description-content li:hover {
    color: rgba(255, 255, 255, 1);
}

/* Разделители */
.gallery-description-content br + br {
    display: block;
    height: 1px;
    margin: 20px 0;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%);
}

@media (max-width: 768px) {
    .gallery-description-content {
        padding: 22px 24px;
        border-radius: 18px;
        font-size: 15px;
        line-height: 1.6;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    /* Webkit scrollbar styling */
    .gallery-description-content::-webkit-scrollbar {
        width: 6px;
    }

    .gallery-description-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .gallery-description-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .gallery-description-content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }

    .gallery-description-content strong {
        font-size: 13px;
        margin: 28px 0 0 0;
    }

    .gallery-description-content strong:first-child {
        margin-top: 0;
    }

    .gallery-description-content li {
        font-size: 14px;
        padding: 5px 0 5px 20px;
    }
}

@media (max-width: 480px) {
    .gallery-description-content {
        padding: 18px 20px;
        border-radius: 14px;
        font-size: 14px;
        line-height: 1.55;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    /* Webkit scrollbar styling */
    .gallery-description-content::-webkit-scrollbar {
        width: 4px;
    }

    .gallery-description-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .gallery-description-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }

    .gallery-description-content strong {
        font-size: 12px;
        margin: 24px 0 0 0;
        padding-left: 12px;
    }

    .gallery-description-content strong:first-child {
        margin-top: 0;
    }

    .gallery-description-content strong::before {
        width: 3px;
        height: 12px;
    }

    .gallery-description-content li {
        font-size: 13px;
        padding: 4px 0 4px 18px;
        line-height: 1.5;
    }

    .gallery-description-content ul {
        gap: 6px;
        margin: 12px 0 0 0;
    }
}

.gallery-close {
    position: fixed;
    top: calc(20px + var(--safe-top));
    right: calc(20px + var(--safe-right));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        all 0.2s var(--ease-out),
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
    will-change: opacity, transform;
}

.gallery-overlay.active .gallery-close {
    opacity: 1;
    transform: scale(1);
}

.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 
        all 0.2s var(--ease-out),
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    z-index: 10;
    opacity: 0;
    will-change: opacity, transform;
}

.gallery-overlay.active .gallery-nav {
    opacity: 1;
}

.gallery-overlay.active .gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: calc(20px + var(--safe-left));
}

.gallery-nav.next {
    right: calc(20px + var(--safe-right));
}

.gallery-counter {
    position: fixed;
    top: calc(20px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: 
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s,
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
    opacity: 0;
    will-change: opacity, transform;
}

.gallery-overlay.active .gallery-counter {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
    z-index: 10;
}

@media (max-width: 768px) {
    .gallery-nav {
        width: 48px;
        height: 48px;
        font-size: 20px;
        top: auto;
        bottom: calc(20px + var(--safe-bottom));
        transform: none;
        background: rgba(0, 0, 0, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 50%;
        transition: none;
        position: fixed;
    }

    /* Buttons next to each other at bottom center */
    .gallery-nav.prev {
        left: calc(50% - 60px);
        right: auto;
    }

    .gallery-nav.next {
        left: calc(50% + 12px);
        right: auto;
    }

    /* Disable hover animations on mobile */
    .gallery-overlay.active .gallery-nav:hover,
    .gallery-overlay.active .gallery-nav:active {
        transform: none;
        background: rgba(0, 0, 0, 0.7);
    }

    .gallery-close {
        width: 40px;
        height: 40px;
        font-size: 18px;
        top: calc(16px + var(--safe-top));
        bottom: auto;
        right: calc(16px + var(--safe-right));
        left: auto;
        transform: none;
        transition: none;
    }

    .gallery-overlay.active .gallery-close {
        transform: none;
    }

    .gallery-close:hover,
    .gallery-close:active {
        transform: none;
        background: rgba(255, 255, 255, 0.15);
    }

    .gallery-counter {
        font-size: 12px;
        padding: 6px 12px;
        top: calc(16px + var(--safe-top));
    }

    .gallery-caption {
        font-size: 13px;
        padding: 16px 20px;
    }

    .gallery-content {
        padding: 70px 16px 90px;
        padding-top: calc(70px + var(--safe-top));
        padding-bottom: calc(90px + var(--safe-bottom));
        padding-left: calc(16px + var(--safe-left));
        padding-right: calc(16px + var(--safe-right));
        justify-content: flex-start;
    }
}

/* ============================================================
   MAGNETIC BUTTONS
   ============================================================ */
.magnetic {
    transition: transform 0.2s var(--ease-out);
}

.magnetic.magnet-active {
    transition: transform 0.1s ease-out;
}

/* ============================================================
   HERO PHOTO PARALLAX
   ============================================================ */
.hero-photo img {
    transition: transform 0.3s var(--ease-out);
}

/* ============================================================
   FOCUS STYLES (WCAG 2.2 SC 2.4.13)
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--c-accent-light, #00a67d);
    outline-offset: 2px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

:target {
    scroll-margin-top: 100px;
}
