/* * Rumsoft Premium Style Engine - Optimized Performance
 * Version: 2.5 (Senior UX/UI Audit)
 * ----------------------------------------------------
 */

/* --- Core Brand Variables --- */
:root {
    --mts-red: #ff0000;
    --mts-red-dark: #d90000;
    --mts-dark: #1d2023;
    --mts-dark-bg: #121212;
    --mts-gray: #f2f3f7;
    --mts-text-gray: #626c77;
    --marquee-bg: #ffffff;
    
    /* Оптимизированные тени */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

.dark {
    --marquee-bg: #121212;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

/* --- Global Base Styles --- */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--mts-dark);
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Button Components --- */
.btn-primary {
    background-color: var(--mts-red);
    transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), 
                background-color 0.3s ease, 
                box-shadow 0.4s ease;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.25);
    backface-visibility: hidden; /* GPU fix */
}

.btn-primary:hover {
    background-color: var(--mts-red-dark);
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 12px 30px -5px rgba(255, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* --- Layout Elements & Shadows --- */
.card-shadow {
    box-shadow: var(--shadow-sm);
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1), 
                box-shadow 0.5s ease,
                border-color 0.3s ease;
    will-change: transform, box-shadow;
}

.card-shadow:hover {
    transform: translateY(-6px) translateZ(0);
    box-shadow: var(--shadow-lg);
}

.rounded-mts {
    border-radius: 24px;
}

/* --- Promo Slider Logic --- */
.slider-progress-bar {
    width: 0%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 99px;
    transform: translate3d(0,0,0);
}

.progress-active .slider-progress-bar {
    animation: fillProgress 6s linear forwards;
}

@keyframes fillProgress {
    from { width: 0%; }
    to { width: 100%; }
}

.slide-item {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                visibility 0.8s;
    pointer-events: none;
}

.slide-item.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-mask {
    mask-image: linear-gradient(to right, transparent, black 35%);
    -webkit-mask-image: linear-gradient(to right, transparent, black 35%);
}

/* --- Cinematic Reveal Effects --- */
@keyframes cinematic-word-reveal {
    0% {
        opacity: 0;
        filter: blur(15px);
        transform: scale(1.3) translate3d(0, 20px, 0);
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        transform: scale(1) translate3d(0, 0, 0);
    }
}

.cinematic-word {
    opacity: 0; 
    animation: cinematic-word-reveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity, filter;
}

/* --- Scroll Entrance Animations --- */
.reveal {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 1s cubic-bezier(0.2, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

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

/* --- UI Motion & Floating (GPU Accelerated) --- */
@keyframes float {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

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

.animate-float-delayed {
    animation: float 6s ease-in-out infinite;
    animation-delay: 3s;
}

/* --- Marquee Component --- */
.marquee-container {
    overflow: hidden;
    display: flex;
    white-space: nowrap;
    position: relative;
    contain: paint; /* Optimization */
}

.marquee-container::before, .marquee-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 10%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--marquee-bg), transparent);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--marquee-bg), transparent);
}

.marquee-content {
    display: flex;
    animation: marquee 40s linear infinite;
    min-width: max-content; 
    will-change: transform;
}

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

/* --- Mobile Specific Optimizations --- */
@media (max-width: 768px) {
    .reveal {
        transition-duration: 0.8s; /* Быстрее на мобилках */
    }
    
    /* Уменьшаем количество тяжелых блюров на мобильных */
    .image-mask {
        mask-image: none;
        -webkit-mask-image: none;
        background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    }
}
