html { scroll-padding-top: 7rem; }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f9ff; }
::-webkit-scrollbar-thumb { background: #bae6fd; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #38bdf8; }
/* Firefox scrollbar */
html { scrollbar-width: thin; scrollbar-color: #bae6fd #f0f9ff; }

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.hero-gradient .reveal {
    opacity: 1;
    transform: none;
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* Градиенты и стекло */
.glass-card {
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(24px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.hero-gradient {
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.9) 0%, rgba(3, 105, 161, 0.64) 100%), url('../images/themes/hero-interior-window.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@media (max-width: 768px) {
    .hero-gradient {
        background-attachment: scroll;
    }
}

.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(135deg, #38bdf8, #818cf8, #34d399, #38bdf8);
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
}

.text-gradient-dark {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: linear-gradient(to right, #0284c7, #2563eb);
}

/* Optimized Header */
.glass-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    transition: width 0.3s ease;
    border-radius: 2px;
}
.nav-link:hover::after {
    width: 100%;
}

.header-scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1023px) {
    .hero-gradient {
        background-attachment: scroll;
    }
}

/* Анимации плавающих световых пятен (blobs) */
@keyframes float {
    0% { transform: translate(0px, 0px) scale(1); }
    50% { transform: translate(15px, -25px) scale(1.08); }
    100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes float-delayed {
    0% { transform: translate(0px, 0px) scale(1.08); }
    50% { transform: translate(-20px, 20px) scale(1); }
    100% { transform: translate(0px, 0px) scale(1.08); }
}

.animate-float {
    animation: float 12s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-delayed 15s ease-in-out infinite;
}

/* Переливающийся градиентный текст */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Плавные переходы для интерактивных элементов */
.price-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.portfolio-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
