/* ==========================================================================
   1. CSS Custom Properties (Design System)
   ========================================================================== */

:root {
    /* Force dark colors */
    color-scheme: dark;
    
    /* Colors */
    --bg-primary: #000000;
    --bg-secondary: #1b0c2d;
    --bg-surface: rgba(255, 255, 255, 0.05);
    --bg-surface-hover: rgba(255, 255, 255, 0.08);
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-base: clamp(1rem, 2.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 3vw, 1.25rem);
    --text-xl: clamp(1.25rem, 4vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 5vw, 2rem);
    --text-3xl: clamp(1.875rem, 6vw, 3rem);
    --text-4xl: clamp(2.25rem, 8vw, 4rem);

    /* Spacing */
    --space-xs: clamp(0.25rem, 1vw, 0.5rem);
    --space-sm: clamp(0.5rem, 2vw, 1rem);
    --space-md: clamp(1rem, 3vw, 1.5rem);
    --space-lg: clamp(1.5rem, 5vw, 3rem);
    --space-xl: clamp(2rem, 8vw, 4rem);
    --space-xxl: clamp(3rem, 10vw, 6rem);
    --section-gap: clamp(3rem, 7vw, 5rem); /* Увеличенные отступы для дышащего дизайна */
    --section-gap-small: clamp(2.5rem, 6vw, 4rem); /* Для менее важных секций */
    --section-gap-mobile: clamp(3rem, 8vw, 4rem); /* Специально для мобильных */
    --card-padding: clamp(1.25rem, 3vw, 2rem);
    --card-gap: clamp(1rem, 3vw, 2rem);
    --container-padding: clamp(1rem, 4vw, 2rem);
    
    /* Radius */
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transitions */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Safe Area Insets for iOS */
    --safe-area-top: env(safe-area-inset-top, 0);
    --safe-area-bottom: env(safe-area-inset-bottom, 0);
    --safe-area-left: env(safe-area-inset-left, 0);
    --safe-area-right: env(safe-area-inset-right, 0);

    /* Glow Effects */
    --glow-blur-md: 100px;
    --glow-blur-lg: 200px;
    
    /* Gradient Text Accent */
    --text-gradient: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    --text-gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}


/* ==========================================================================
   1.5. Preloader
   ========================================================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader__logo {
    width: 64px;
    height: 64px;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.6;
        transform: scale(0.96);
    }
}


/* ==========================================================================
   2. Modern CSS Reset & Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: -webkit-fill-available;
    height: 100%;
    background: #000000;
    color-scheme: dark;
}

body {
    background: linear-gradient(180deg, #000000 0%, #1b0c2d 100%);
    background-attachment: fixed;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    position: relative;
}

main {
    flex-grow: 1;
    /* display: flex;
    flex-direction: column;
    gap: var(--section-gap); */ /* This approach is causing issues, reverting to padding */
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

section {
    padding-block: var(--section-gap);
    position: relative;
}

/* Улучшенные отступы для мобильных */
@media (max-width: 768px) {
    section {
        padding-block: var(--section-gap-mobile);
    }
    
    .section-title {
        margin-bottom: clamp(1rem, 3vw, 1.5rem);
    }
    
    .section-subtitle {
        margin-bottom: clamp(2rem, 5vw, 3rem);
        font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    }
}

.section-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: var(--space-sm);
    text-wrap: balance;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    text-align: center;
    max-width: 50ch;
    margin-inline: auto;
    margin-bottom: var(--space-lg);
    text-wrap: pretty;
    line-height: 1.6;
}


/* ==========================================================================
   3. Header
   ========================================================================== */

.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(12, 5, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding-top: var(--safe-area-top);
    transform: translateZ(0);
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-sm) var(--container-padding);
    min-height: 64px;
    gap: var(--space-md);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.header__logo img {
    height: 32px;
    width: auto;
}

.header__logo span {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

@media (max-width: 375px) {
    .header__logo span {
        display: none;
    }
}

/* Mobile Menu Button */
.header__menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

.header__menu-icon {
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.header__menu-icon::before,
.header__menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

.header__menu-icon::before {
    top: -8px;
}

.header__menu-icon::after {
    bottom: -8px;
}

/* Menu Open State */
.header__menu-toggle[aria-expanded="true"] .header__menu-icon {
    background: transparent;
}

.header__menu-toggle[aria-expanded="true"] .header__menu-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.header__menu-toggle[aria-expanded="true"] .header__menu-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Mobile Navigation */
.header__nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(12, 5, 20, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md);
    padding-top: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 999;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

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

.header__nav.is-open {
    display: flex;
}

.header__nav a {
    padding: var(--space-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-align: center;
    border-radius: var(--radius-md);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.header__nav a:hover,
.header__nav a:focus {
    color: var(--text-primary);
    background: var(--bg-surface);
}

.header__nav a:active {
    transform: scale(0.98);
}

.header__cta {
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    display: none;
    flex-shrink: 0;
}

.header__cta--mobile {
    display: flex;
    width: 100%;
    margin-top: var(--space-sm);
    justify-content: center;
}

/* Desktop Styles */
@media (min-width: 768px) {
    .header__menu-toggle {
        display: none;
    }
    
    .header__nav {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        border: none;
        gap: var(--space-lg);
        max-height: none;
        overflow: visible;
        align-items: center;
        justify-content: center;
        flex: 1;
        margin: 0 auto;
    }
    
    .header__nav a:not(.cta-button) {
        padding: 0;
        color: var(--text-secondary);
        text-align: center;
        border-radius: 0;
        transition: color var(--transition-fast);
    }
    
    .header__nav a:not(.cta-button):hover {
        color: var(--text-primary);
        background: transparent;
    }
    
    .header__cta {
        display: inline-flex;
    }
    
    .header__cta--mobile {
        display: none !important;
    }
}

/* ==========================================================================
   4. CTA Button
   ========================================================================== */

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.25rem, 3vw, 1.75rem);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem);
    min-height: 48px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    text-align: center;
    letter-spacing: 0.02em;
}

.cta-button--primary {
    background: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

@media (hover: hover) {
    .cta-button--primary:hover {
        background: var(--accent-secondary);
        transform: translateY(-2px);
        box-shadow: 0 8px 30px rgba(167, 139, 250, 0.4);
    }
}

.cta-button--secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

@media (hover: hover) {
    .cta-button--secondary:hover {
        background: var(--bg-surface-hover);
        border-color: var(--accent-secondary);
    }
}

.cta-button:active {
    transform: translateY(0) scale(0.98);
}

.header__cta {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}


/* ==========================================================================
   5. Hero Section
   ========================================================================== */

.hero-section {
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh; /* Small viewport height */
    min-height: 100dvh; /* Dynamic viewport height */
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: clamp(3rem, 8vw, 6rem);
    overflow: hidden;
    margin-top: 0;
    position: relative;
}

/* Fallback for browsers without dvh support */
@supports not (height: 100svh) {
    .hero-section {
        min-height: calc(100vh - 64px);
    }
}

/* Улучшенный скролл-индикатор - теперь работает на ВСЕХ устройствах */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 3rem;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    animation: scrollPulse 2s infinite ease-in-out;
    opacity: 0.9;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

@keyframes scrollPulse {
    0%, 100% { 
        transform: translateX(-50%) translateY(0);
        opacity: 0.4;
    }
    50% { 
        transform: translateX(-50%) translateY(0.75rem);
        opacity: 1;
    }
}

/* Скрыть индикатор после начала прокрутки */
.hero-section.scrolled::after,
.hero-section.scrolled .scroll-hint-arrow {
    opacity: 0 !important;
    visibility: hidden;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .hero-section::after {
        height: 2.5rem;
        bottom: 1.5rem;
        opacity: 1;
        z-index: 10;
    }
}

@media (max-height: 600px) {
    .hero-section::after {
        height: 2rem;
        bottom: 1rem;
    }
}

/* Анимированная стрелка-подсказка для мобильных */
.scroll-hint-arrow {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    opacity: 0;
    visibility: hidden;
    animation: bounceArrow 2s infinite ease-in-out;
    z-index: 10;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.scroll-hint-arrow::before {
    content: '↓';
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: block;
}

@keyframes bounceArrow {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.85;
    }
    50% {
        transform: translateX(-50%) translateY(0.75rem);
        opacity: 1;
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
    }
}

.scroll-hint-arrow:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.7);
}

.scroll-hint-arrow:active {
    transform: translateX(-50%) scale(0.95);
}

/* Показываем стрелку только на мобильных */
@media (max-width: 768px) {
    .scroll-hint-arrow {
        opacity: 0.9;
        visibility: visible;
        width: 44px;
        height: 44px;
        bottom: 1.5rem;
    }
    
    .scroll-hint-arrow::before {
        font-size: 20px;
    }
}

@media (max-height: 600px) {
    .scroll-hint-arrow {
        width: 36px;
        height: 36px;
        bottom: 1rem;
    }
    
    .scroll-hint-arrow::before {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: auto;
        padding-top: clamp(2rem, 6vw, 3rem);
        padding-bottom: clamp(4rem, 10vw, 5rem);
    }
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    align-items: center;
    width: 100%;
}

@media (min-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-xl);
    }
}

@media (max-width: 768px) {
    .hero-container {
        gap: var(--space-sm);
    }
}

.hero-content {
    text-align: left;
    position: relative;
    z-index: 2;
}

@media (max-width: 991px) {
    .hero-content {
        text-align: center;
        order: 2;
    }
    .hero-cta-group {
        justify-content: center;
        gap: var(--space-sm);
    }
}

.hero-video-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 768px) {
    .hero-video-container {
        filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.3));
    }
}

.hero-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateZ(0);
    box-shadow: 
        0 0 60px rgba(139, 92, 246, 0.4),
        0 0 120px rgba(167, 139, 250, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.5);
    transition: all var(--transition-normal);
    margin: 0 auto;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(0, 0, 0, 0.3));
}

/* Loading indicator */
.hero-video-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hero-video-wrapper[data-loading="true"]::before {
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .hero-video-wrapper {
        max-width: 100%;
        box-shadow: 
            0 0 40px rgba(139, 92, 246, 0.3),
            0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

/* Enhanced fallback for older browsers */
@supports not (aspect-ratio: 16 / 9) {
    .hero-video-wrapper {
        padding-top: 56.25%; /* 16:9 fallback */
        height: 0;
        position: relative;
    }
    
    .hero-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .hero-video-wrapper::before {
        top: calc(50% - 20px);
        left: calc(50% - 20px);
        margin: 0;
    }
}

@media (hover: hover) {
    .hero-video-wrapper:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 
            0 0 80px rgba(139, 92, 246, 0.5),
            0 0 140px rgba(167, 139, 250, 0.3),
            0 20px 60px rgba(0, 0, 0, 0.6);
    }
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: opacity 0.3s ease;
}

/* Loading states */
.hero-video[data-loading="true"] {
    opacity: 0.7;
}

.hero-video[data-quality="hd"] {
    /* Enhanced quality for HD version */
    image-rendering: auto;
}

/* Optimize video rendering */
.hero-video {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, opacity;
    image-rendering: optimizeSpeed;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Fullscreen video button */
.video-fullscreen-trigger {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast), background var(--transition-fast);
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.video-fullscreen-trigger:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-fullscreen-trigger:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Fullscreen mode styles */
.hero-video-wrapper:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.hero-video-wrapper:-webkit-full-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.hero-video-wrapper:-moz-full-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.hero-video-wrapper:-ms-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.hero-video-wrapper:fullscreen .hero-video,
.hero-video-wrapper:-webkit-full-screen .hero-video,
.hero-video-wrapper:-moz-full-screen .hero-video,
.hero-video-wrapper:-ms-fullscreen .hero-video {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.fullscreen-active .video-fullscreen-trigger {
    opacity: 1;
}

.fullscreen-active .video-fullscreen-trigger svg {
    transform: rotate(180deg);
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    filter: blur(80px);
    opacity: 0.35;
    z-index: -1;
    pointer-events: none;
    animation: breathingGlow 8s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes breathingGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.1);
    }
}



.hero-title {
    font-size: clamp(2rem, 7vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    text-wrap: balance;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 45ch;
    text-wrap: pretty;
    overflow-wrap: break-word;
}

@media (max-width: 991px) {
    .hero-subtitle {
        margin-inline: auto;
        margin-bottom: var(--space-md);
    }
}

.hero-cta-group {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
}

@media (max-width: 640px) {
    .hero-cta-group {
        flex-direction: column;
        gap: var(--space-sm);
    }
    .hero-cta-group .cta-button {
        width: 100%;
        justify-content: center;
    }
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
    .hero-cta-group .cta-button--primary {
        animation: subtlePulse 3s infinite;
    }
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(139, 92, 246, 0.5);
    }
}

.telegram-handle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 1.5rem;
    background: rgba(23, 16, 34, 0.75);
    border: 1px solid rgba(115, 86, 186, 0.35);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(30, 22, 54, 0.35);
    max-width: 360px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.telegram-handle--hidden {
    display: none !important;
}

.telegram-handle--center {
    justify-content: center;
    margin-inline: auto;
}

.telegram-handle__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(55, 174, 226, 0.18);
    box-shadow: inset 0 0 0 1px rgba(55, 174, 226, 0.35);
}

.telegram-handle__icon svg {
    width: 24px;
    height: 24px;
}

.telegram-handle__content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.telegram-handle__label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.telegram-handle__value {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.telegram-handle__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    background: rgba(12, 8, 21, 0.65);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    min-width: 110px;
}

.telegram-handle__copy-text,
.telegram-handle__copy-success {
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.telegram-handle__copy-success {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}

.telegram-handle.is-copied .telegram-handle__copy-text {
    opacity: 0;
    transform: translateY(-6px);
}

.telegram-handle.is-copied .telegram-handle__copy-success {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: hover) {
    .telegram-handle:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 28px rgba(30, 22, 54, 0.4);
        border-color: rgba(167, 139, 250, 0.5);
    }

    .telegram-handle__copy:hover {
        background: rgba(32, 22, 55, 0.8);
        border-color: rgba(167, 139, 250, 0.6);
    }
}

.telegram-inline-note {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--text-secondary);
    line-height: 1.6;
    text-wrap: pretty;
}

.telegram-inline-note--center {
    margin-inline: auto;
    margin-top: 1.5rem;
    justify-content: center;
}

.telegram-inline-note__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.telegram-inline-note__icon svg {
    width: 100%;
    height: 100%;
}

.telegram-inline-note__text {
    display: inline;
}

.telegram-inline-note__handle {
    font-weight: 600;
    color: var(--text-primary);
}

.telegram-inline-note--hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .telegram-inline-note {
        display: none !important;
    }
}


/* ==========================================================================
   6. Features Section
   ========================================================================== */
.features-section {
    position: relative;
    z-index: 5;
    padding-block: var(--section-gap);
    background: linear-gradient(180deg, transparent, rgba(27, 12, 45, 0.2));
    
    /* "Peek" эффект - показываем часть секции на мобильных */
    margin-top: -20px;
    padding-top: calc(var(--section-gap) + 20px);
    
    /* Добавляем тонкую верхнюю границу для визуального разделения */
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

@media (max-width: 768px) {
    .features-section {
        margin-top: -30px;
        padding-top: calc(var(--section-gap-mobile) + 30px);
        border-top-width: 2px;
    }
}

@media (max-height: 600px) {
    .features-section {
        margin-top: -25px;
        padding-top: calc(var(--section-gap) + 25px);
    }
}

/* УТП бейджи */
.utp-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-sm);
}

.utp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: clamp(0.8125rem, 1.8vw, 0.9375rem);
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

@media (hover: hover) {
    .utp-badge:hover {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.5);
        transform: translateY(-2px);
    }
}

@media (max-width: 640px) {
    .utp-badges {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .utp-badge {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Ensure features section is immediately visible on mobile */
@media (max-width: 768px) {
    .features-section {
        padding-top: var(--space-lg);
    }
    
    .features-section .section-title,
    .features-section .section-subtitle {
        opacity: 1 !important;
        transform: none !important;
    }
}
   
.features-grid {
    display: grid;
    gap: var(--card-gap);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
    .feature-card {
        min-height: 280px;
    }
}

.feature-card::before {
    content: '';
    position: absolute;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

.feature-card .skeleton-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.feature-card.is-visible .skeleton-placeholder {
    opacity: 0;
    pointer-events: none;
}


.feature-card__icon {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-md);
}

.feature-card__title {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.feature-card__description {
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-grow: 1;
    line-height: 1.6;
}


/* ==========================================================================
   7. How It Works Section
   ========================================================================== */
.how-it-works-section {
    background: linear-gradient(180deg, rgba(0,0,0,0.1), transparent);
    padding-block: var(--section-gap);
    position: relative;
    z-index: 5;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--card-gap);
    margin-top: var(--space-lg);
}

@media (max-width: 640px) {
    .steps-container {
        grid-template-columns: 1fr;
    }
}

.step-card {
    position: relative;
    padding: var(--card-padding);
    padding-top: 3.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--bg-surface);
    min-height: 240px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

@media (hover: hover) {
    .step-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    }
}

@media (max-width: 640px) {
    .step-card {
        min-height: 200px;
    }
}

.step-card__number {
    position: absolute;
    top: -1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: var(--text-primary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    border: 3px solid var(--bg-primary);
    z-index: 1;
}

.step-card__title {
    font-size: clamp(1.125rem, 2.5vw, 1.375rem);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.step-card__description {
    color: var(--text-secondary);
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}


/* ==========================================================================
   8. Pricing Section
   ========================================================================== */

.final-cta-card {
    max-width: 700px;
    margin-inline: auto;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(27, 12, 45, 0.2));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 6vw, 3.5rem);
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.final-cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.final-cta-card__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
}

.final-cta-card__description {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    margin-bottom: var(--space-lg);
    max-width: 45ch;
    margin-inline: auto;
    line-height: 1.6;
}

.final-cta-card__features {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    flex-wrap: wrap;
}

.final-cta-card__features li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.final-cta-card .cta-button--large {
    padding: 1rem 2rem;
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    width: 100%;
    max-width: 400px;
}


/* ==========================================================================
   9. Final CTA Section
   ========================================================================== */
.final-cta-section {
    padding-block: var(--section-gap);
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(139, 92, 246, 0.05));
}



.final-cta__title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    margin-bottom: var(--space-md);
    text-wrap: balance;
    overflow-wrap: break-word;
    line-height: 1.2;
}

.final-cta__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 50ch;
    margin-inline: auto;
    text-wrap: pretty;
    line-height: 1.6;
}


/* ==========================================================================
   9.5. Modern Comparison Gallery Section (img-comparison-slider)
   ========================================================================== */
.comparison-gallery-section {
    padding-block: var(--section-gap);
    background: linear-gradient(180deg, transparent, rgba(27, 12, 45, 0.3), transparent);
    position: relative;
    z-index: 5;
}

/* Галерея превью - теперь СВЕРХУ слайдера */
.comparison-thumbnails {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    max-width: 900px;
    margin-inline: auto;
}

/* Адаптация под планшеты */
@media (max-width: 991px) {
    .comparison-thumbnails {
        grid-template-columns: repeat(8, 1fr);
        gap: var(--space-sm);
    }
}

/* На мобильных превью СВЕРХУ (как и на десктопе) */
@media (max-width: 768px) {
    .comparison-thumbnails {
        grid-template-columns: repeat(4, 1fr);
        gap: clamp(0.5rem, 2vw, 0.75rem);
        max-width: 100%;
        padding-inline: clamp(0.5rem, 2vw, 1rem);
        margin-bottom: var(--space-lg);
    }
}

.thumbnail-btn {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 0;
    min-width: 0;
}

@media (max-width: 768px) {
    .thumbnail-btn {
        border-width: 1px;
        width: 100%;
        height: auto;
    }
    
    .thumbnail-btn img {
        object-fit: cover;
    }
    
    .thumbnail-overlay {
        display: none;
    }
}

@media (max-width: 480px) {
    .comparison-thumbnails {
        gap: clamp(0.375rem, 1.5vw, 0.5rem);
    }
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
    color: var(--text-primary);
}

.thumbnail-btn:hover .thumbnail-overlay {
    opacity: 1;
}

.thumbnail-btn:hover img {
    transform: scale(1.1);
}

.thumbnail-btn.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary), 0 4px 20px rgba(139, 92, 246, 0.4);
}

.thumbnail-btn.active .thumbnail-overlay {
    opacity: 0;
}

/* Основной контейнер */
.comparison-container {
    max-width: 900px;
    margin: 0 auto;
}

.comparison-wrapper {
    position: relative;
    background: rgba(20, 20, 25, 0.8); /* Чуть светлее фона для видимых полос */
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 
        0 10px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.2);
    transform: translateZ(0);
}

/* Новый универсальный слайдер - стилизация компонента */
.comparison-slider-modern {
    width: 100%;
    max-height: 70vh;
    display: block;
    /* aspect-ratio устанавливается динамически через JavaScript */
    
    /* Кастомные CSS переменные для компонента - адаптированы под дизайн */
    --divider-width: 3px;
    --divider-color: var(--accent-primary);
    --divider-shadow: 0 0 20px rgba(139, 92, 246, 0.8), inset 0 0 2px rgba(255, 255, 255, 0.3);
    --default-handle-width: 44px;
    --default-handle-color: var(--accent-secondary);
    --default-handle-opacity: 1;
    --default-handle-shadow: 0 3px 12px rgba(139, 92, 246, 0.5), 0 0 0 2px var(--text-primary);
    
    /* Оптимизация производительности */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    
    /* iOS Safari: Критические исправления для Shadow DOM + object-fit */
    position: relative;
    overflow: hidden;
    
    /* WebKit: Принудительная обработка высоты для aspect-ratio */
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    
    /* Исправление для iOS Safari: предотвращение коллапса высоты */
    min-height: 400px;
    
    /* Улучшенная производительность рендеринга на мобильных */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: auto;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .comparison-slider-modern {
        max-height: 60vh;
        --default-handle-width: 50px;
    }
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 480px) {
    .comparison-slider-modern {
        max-height: 55vh;
    }
}

/* Изображения внутри слайдера - CONTAIN чтобы фото были видны целиком */
.comparison-slider-modern .comparison-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain !important; /* Фото видны целиком, полосы по краям если разные пропорции */
    object-position: center !important; /* Центрируем оба изображения */
    user-select: none;
    pointer-events: none;
    transition: opacity 0.3s ease;
    
    /* iOS Safari/WebKit: Принудительное применение object-fit */
    -webkit-user-select: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    
    /* Исправление для Safari: явное указание max-размеров */
    max-width: 100%;
    max-height: 100%;
}

/* 🍎 SAFARI CRITICAL OVERRIDE: Direct img targeting */
.comparison-slider-modern img[slot="first"],
.comparison-slider-modern img[slot="second"] {
    /* 🔧 CORE: Sizing with object-fit */
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    
    /* 🍎 WebKit-specific */
    -webkit-object-fit: contain !important;
    -webkit-object-position: center center !important;
    
    /* 🚀 CRITICAL: Composite layer activation */
    transform: translateZ(0) scale(1.0001) !important;
    -webkit-transform: translateZ(0) scale(1.0001) !important;
    will-change: transform !important;
    
    /* 🍎 Safari: Box model constraints */
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    
    /* 🎯 Display properties */
    display: block !important;
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    
    /* 🍎 Safari: Image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    
    /* 🔄 Performance */
    contain: layout style paint !important;
    
    /* Исправление для WebKit: предотвращение растяжения */
    align-self: center;
    justify-self: center;
}

/* ==========================================================================
   Система подсказок для слайдера (улучшенная версия)
   ========================================================================== */
.comparison-tutorial-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

.comparison-tutorial-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Контейнер для руки - чуть ниже центра, следует за слайдером, смещена правее */
.tutorial-hand {
    position: absolute;
    left: calc(var(--hand-position, 50%) + 80px); /* Смещение на 80px правее от центра */
    top: 60%; /* Чуть ниже центра */
    transform: translate(-50%, -50%);
    width: 150px; /* Увеличено в 2.5 раза (было 60px) */
    height: 150px;
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 16;
}

/* SVG иконка руки - непрозрачная, без свечения */
.tutorial-hand svg {
    width: 100%;
    height: 100%;
    color: var(--accent-primary); /* Яркий фиолетовый */
    opacity: 1; /* Полностью непрозрачная */
    filter: none; /* БЕЗ свечения */
}

/* Старые анимации удалены - не нужны */

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .tutorial-hand {
        width: 120px; /* Пропорционально увеличено */
        height: 120px;
        left: calc(var(--hand-position, 50%) + 60px); /* Меньшее смещение на мобильных */
    }
}

@media (max-width: 480px) {
    .tutorial-hand {
        width: 100px;
        height: 100px;
        left: calc(var(--hand-position, 50%) + 50px);
    }
}

/* Индикатор загрузки */
.comparison-loader {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    border-radius: var(--radius-lg);
}

.comparison-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 92, 246, 0.3);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tutorial-hand {
        animation: none;
        opacity: 0.5;
    }
}

/* Акцентные стили для ключевых слов */
.text-accent {
    background: var(--text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.text-accent-primary {
    background: var(--text-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* ==========================================================================
   10. Footer
   ========================================================================== */
.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding-block: clamp(2rem, 4vw, 3rem);
    padding-bottom: calc(clamp(2rem, 4vw, 3rem) + var(--safe-area-bottom));
    margin-top: auto;
}

.footer__container {
    max-width: min(1200px, 100% - 2rem);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

/* Оптимизированная Grid-система футера */
.footer__grid {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2rem);
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
}

/* Tablet layout: 2 колонки */
@media (min-width: 48em) {
    .footer__grid {
        grid-template-columns: 2fr 1fr;
        grid-template-areas: 
            "links contact";
        align-items: center;
    }

    .footer__section--contact {
        grid-area: contact;
        justify-self: end;
    }

    .footer__section--links {
        grid-area: links;
        justify-self: start;
    }
}

/* Desktop layout: 2 колонки по центру */
@media (min-width: 64em) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        max-width: 800px;
        margin: 0 auto;
        grid-template-areas: "links contact";
    }

    .footer__section--links {
        justify-self: start;
    }

    .footer__section--contact {
        justify-self: end;
    }
}

/* Стили секций */
.footer__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Логотип и бренд */
.footer__logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity var(--transition-fast);
}

.footer__logo:hover {
    opacity: 0.8;
}

.footer__logo:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

.footer__logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.footer__description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: var(--space-xs);
    max-width: 25ch;
}

/* Заголовки секций */
.footer__heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin: 0;
}

/* Навигация документов */
.footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

@media (min-width: 48em) {
    .footer__links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs) var(--space-sm);
    }
}

.footer__links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: color var(--transition-fast);
    display: inline-block;
}

.footer__links a:hover,
.footer__links a:focus-visible {
    color: var(--accent-secondary);
}

.footer__links a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* CTA кнопка с иконкой */
.footer__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    white-space: nowrap;
}

.footer__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45);
}

.footer__cta:active {
    transform: translateY(0);
}

.footer__cta:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

.footer__cta-icon {
    flex-shrink: 0;
}

/* Дисклеймер с inline-ссылками */
.footer__disclaimer {
    margin-top: clamp(1.5rem, 3vw, 2rem);
    padding-top: clamp(1rem, 2vw, 1.5rem);
    border-top: 1px solid var(--border-color);
}

.footer__disclaimer p {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.6;
    text-align: center;
    max-width: 60ch;
    margin: 0 auto;
}

.footer__disclaimer a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer__disclaimer a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.footer__disclaimer a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Копирайт */
.footer__bottom {
    margin-top: clamp(1rem, 2vw, 1.5rem);
    padding-top: clamp(0.75rem, 1.5vw, 1rem);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer__copyright {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin: 0;
}

/* Mobile оптимизации */
@media (max-width: 640px) {
    .footer__description {
        text-align: center;
        max-width: 100%;
    }

    .footer__links {
        text-align: center;
    }

    .footer__cta {
        width: 100%;
        justify-content: center;
    }

    .footer__disclaimer p {
        font-size: 0.75rem;
    }

    .footer__copyright {
        font-size: 0.75rem;
    }
}

/* Accessibility и motion preferences */
@media (prefers-reduced-motion: reduce) {
    .footer__cta,
    .footer__logo,
    .footer__links a,
    .footer__disclaimer a {
        transition: none;
    }
}

/* High DPI оптимизация */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .footer__logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}


/* ==========================================================================
   11. Adaptive Scroll Animations & Performance
   ========================================================================== */

/* Базовые CSS переменные для динамических анимаций */
.animate-on-scroll {
    --animation-duration: 0.6s;
    --animation-delay: 0ms;
    --animation-distance: 30px;
    --animation-scale: 0.97;
    
    opacity: 0;
    transform: translateY(var(--animation-distance)) scale(var(--animation-scale));
    transition: 
        opacity var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1) var(--animation-delay),
        transform var(--animation-duration) cubic-bezier(0.4, 0, 0.2, 1) var(--animation-delay);
    will-change: transform, opacity;
}

/* Состояние готовности для предзагрузки (аппаратное ускорение) */
.animate-on-scroll.animation-ready {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateY(var(--animation-distance)) scale(var(--animation-scale)) translateZ(0);
}

/* Появившиеся элементы */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Без анимации для пользователей с prefers-reduced-motion */
.animate-on-scroll.is-visible-no-animation {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: none;
}

/* Мобильные оптимизации */
@media (max-width: 768px) {
    .animate-on-scroll {
        --animation-distance: 20px;
        --animation-scale: 0.98;
        --animation-duration: 0.5s;
    }
    
    /* Show features immediately on small screens */
    .features-section .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {
    .animate-on-scroll {
        --animation-distance: 15px;
        --animation-scale: 0.99;
        --animation-duration: 0.4s;
    }
}

/* iOS Safari специфичные оптимизации с принудительным аппаратным ускорением */
@supports (-webkit-touch-callout: none) {
    .animate-on-scroll {
        transform: translateY(var(--animation-distance)) scale(var(--animation-scale)) translateZ(0);
        -webkit-transform: translateY(var(--animation-distance)) scale(var(--animation-scale)) translateZ(0);
    }
    
    .animate-on-scroll.animation-ready {
        transform: translateY(var(--animation-distance)) scale(var(--animation-scale)) translateZ(0);
        -webkit-transform: translateY(var(--animation-distance)) scale(var(--animation-scale)) translateZ(0);
    }
    
    .animate-on-scroll.is-visible {
        transform: translateY(0) scale(1) translateZ(0);
        -webkit-transform: translateY(0) scale(1) translateZ(0);
    }
}

/* Legacy support */
body.is-loading .animate-on-scroll .feature-card__icon,
body.is-loading .animate-on-scroll .feature-card__title,
body.is-loading .animate-on-scroll .feature-card__description {
    visibility: hidden;
}

body.is-loading .animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
}

.skeleton-placeholder {
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.1) 8%, rgba(255, 255, 255, 0.2) 18%, rgba(255, 255, 255, 0.1) 33%);
    background-size: 200% 100%;
    animation: 1.5s skeleton-loading-shimmer infinite linear;
}

@keyframes skeleton-loading-shimmer {
    to {
        background-position-x: -200%;
    }
}


/* ==========================================================================
   12. Media Queries for Better Responsiveness
   ========================================================================== */

/* Tablet Landscape */
@media (max-width: 1024px) {
    :root {
        --glow-blur-md: 60px;
        --glow-blur-lg: 120px;
    }
    
    .container {
        max-width: 960px;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .header__content {
        padding: var(--space-sm) var(--container-padding);
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 6vw, 2.75rem);
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: clamp(0.95rem, 2.5vw, 1.15rem);
        line-height: 1.7;
    }
    
    .features-grid,
    .steps-container {
        gap: clamp(1.25rem, 4vw, 2rem);
    }
    
    .header__nav a:not(.cta-button) {
        font-weight: 500;
    }
    
    .utp-badges {
        margin-top: clamp(1.5rem, 4vw, 2rem);
        margin-bottom: clamp(2.5rem, 6vw, 3rem);
    }
}

/* Large Mobile */
@media (max-width: 640px) {
    :root {
        --section-gap: clamp(2rem, 6vw, 3rem);
        --card-padding: clamp(1.5rem, 4vw, 2rem);
        --card-gap: clamp(1.25rem, 3.5vw, 2rem);
    }
    
    .hero-section {
        min-height: calc(100vh - 120px);
    }
    
    .final-cta-card__features {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
        max-width: 280px;
        margin-inline: auto;
    }
    
    .final-cta-card__features li {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Small Mobile */
@media (max-width: 375px) {
    :root {
        --container-padding: 0.75rem;
        --card-padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-video-wrapper {
        border-radius: 12px;
        max-width: calc(100vw - 2rem);
    }
    
    .feature-card,
    .step-card {
        min-height: auto;
    }
}

/* Ultra Small Mobile (iPhone SE) */
@media (max-width: 320px) {
    .hero-cta-group .cta-button {
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
    }
    
    .features-grid,
    .steps-container {
        gap: clamp(1rem, 4vw, 1.5rem);
    }
    
    .comparison-thumbnails {
        gap: 0.25rem;
    }
}

/* Hover Effects Only for Desktop */
@media (hover: none) and (pointer: coarse) {
    .cta-button:active {
        transform: scale(0.98);
    }
    
    .feature-card:active {
        transform: scale(0.98);
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .header {
        border-bottom-width: 0.5px;
    }
    
    .feature-card,
    .step-card,
    .comparison-wrapper,
    .final-cta-card {
        border-width: 0.5px;
    }
    
    .text-accent,
    .text-accent-primary {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding-block: clamp(1rem, 3vw, 2rem);
    }
    
    .hero-video-wrapper {
        max-width: 450px;
        max-height: 70vh;
    }
    
    .comparison-slider {
        max-height: 50vh;
    }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-surface: rgba(255, 255, 255, 0.04);
        --bg-surface-hover: rgba(255, 255, 255, 0.07);
    }
}

/* Accessibility: Reduced Motion - Full WCAG Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-on-scroll {
        --animation-duration: 0.01s;
        --animation-distance: 0px;
        --animation-scale: 1;
        opacity: 1;
        transform: none;
        transition: opacity 0.01s ease;
    }
    
    .animate-on-scroll.animation-ready {
        transform: none;
    }
    
    .glow-effect {
        animation: none;
        opacity: 0.2;
    }
    
    video {
        display: none;
    }
    
    .hero-video-wrapper::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        opacity: 0.3;
    }
}

/* Force dark theme regardless of system preferences */
@media (prefers-color-scheme: light) {
    body {
        background: linear-gradient(180deg, #000000 0%, #1b0c2d 100%) !important;
        color: #ffffff !important;
    }
    
    .header {
        background: rgba(12, 5, 20, 0.85) !important;
    }
}
/* ==========================================================================
   🍎 SAFARI BROWSER-SPECIFIC: Progressive enhancement
   ========================================================================== */

/* Safari-specific fixes using feature detection */
@supports (-webkit-appearance: none) and (not (appearance: none)) {
    /* This targets Safari specifically */
    .comparison-slider-modern img[slot="first"],
    .comparison-slider-modern img[slot="second"] {
        /* 🍎 Safari: Enhanced transform for stability */
        transform: translateZ(0) scale(1.0001) translate3d(0, 0, 0) !important;
        -webkit-transform: translateZ(0) scale(1.0001) translate3d(0, 0, 0) !important;
    }
}

/* 🍎 iOS SAFARI SPECIFIC: Touch device optimizations */
@supports (-webkit-touch-callout: none) {
    .comparison-slider-modern {
        /* 🍎 iOS: Enhanced containment */
        contain: size layout style;
        isolation: isolate;
    }
    
    .comparison-slider-modern img[slot="first"],
    .comparison-slider-modern img[slot="second"] {
        /* 🍎 iOS: Force hardware acceleration */
        -webkit-transform: translateZ(0) scale(1.0001) !important;
        transform: translateZ(0) scale(1.0001) !important;
        
        /* 🍎 iOS: Additional object-fit support */
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cta-button,
    video,
    .glow-effect {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-section {
        min-height: auto;
    }
}

