:root { 
    --bg: #FFFFFF; 
    --bg-alt: #F3F5F7; 
    --text: #1A1A1A; 
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --glass: rgba(255,255,255,0.92);
    --logo-filter: brightness(1) invert(0);
    --shadow: rgba(0,0,0,0.08);
}

body.dark { 
    --bg: #1E1F21; 
    --bg-alt: #2C2E30; 
    --text: #F0F0F0;
    --glass: rgba(30,31,33,0.92);
    --logo-filter: brightness(0) invert(1);
    --shadow: rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
html { scroll-behavior: smooth; }

body { 
    font-family: 'Montserrat', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    transition: background 0.4s ease, color 0.4s ease; 
    overflow-x: hidden; 
    line-height: 1.6;
}

.container { max-width: 1240px; margin: 0 auto; padding: 0 30px; }
a { color: inherit; text-decoration: none; transition: 0.3s; }

.header { 
    position: fixed; top: 0; width: 100%; height: 65px; 
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000; display: flex; align-items: center; 
    border-bottom: 1px solid rgba(128,128,128,0.1); 
    transition: background 0.4s ease;
}
.header-flex { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.logo-img { height: 48px; filter: var(--logo-filter); transition: filter 0.4s ease; display: block; }
.footer-logo { height: 38px; filter: var(--logo-filter); transition: filter 0.4s ease; }

.nav-links a { 
    font-weight: 700; font-size: 0.7rem; text-transform: uppercase; 
    margin: 0 15px; letter-spacing: 0.5px; opacity: 0.75;
    position: relative; padding-bottom: 3px;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 1.5px; background: var(--accent);
    transition: width 0.3s ease;
}
.nav-links a:hover { opacity: 1; color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.header-right { display: flex; align-items: center; gap: 20px; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.clean-btn { background: transparent; border: none; cursor: pointer; color: var(--text); padding: 5px; transition: opacity 0.3s, color 0.3s; }
.clean-btn:hover { opacity: 0.65; }
.lang-btn { font-size: 0.75rem; font-weight: 800; opacity: 0.85; letter-spacing: 0.5px; }
.theme-btn { font-size: 1.2rem; display: flex; align-items: center; }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.burger span { width: 24px; height: 2px; background: var(--text); transition: 0.3s; }
.close-menu { display: none; font-size: 2.5rem; position: absolute; top: 15px; right: 25px; cursor: pointer; color: var(--text); line-height: 1; }

.hero { 
    height: 100vh; min-height: 500px;
    position: relative; display: flex; align-items: center; 
    justify-content: center; color: #fff; text-align: center; 
}
.hero-video { 
    position: absolute; inset: 0; width: 100%; height: 100%; 
    object-fit: cover;
}
.hero-overlay { 
    position: absolute; inset: 0; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.25)); 
    z-index: 1;
}
.hero-content { 
    position: relative; z-index: 2;  /* ИСПРАВЛЕНО: z-index > overlay */
    padding: 0 20px;
}
.hero-content h1 { 
    font-size: 2.8rem; font-weight: 800; margin-bottom: 20px; 
    line-height: 1.15; letter-spacing: -0.5px; 
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero-content p { 
    font-size: 1.1rem; opacity: 0.9; max-width: 700px; 
    margin: 0 auto 32px; font-weight: 400; 
}
.hero-cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 36px;
    border-radius: 3px;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 20px rgba(37,99,235,0.35);
}
.hero-cta:hover { 
    background: var(--accent-hover); 
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37,99,235,0.45);
    color: #fff;
}

.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { 
    text-align: center; margin-bottom: 48px; 
    font-size: 1.8rem; font-weight: 800; 
    text-transform: uppercase; letter-spacing: 1.5px; 
}

.about-text-block { text-align: center; max-width: 850px; margin: 0 auto 56px; }
.section-intro { margin-bottom: 20px; font-weight: 700; font-size: 1.2rem; line-height: 1.5; }
.section-desc { font-weight: 400; font-size: 1rem; opacity: 0.75; line-height: 1.9; }

.img-box { 
    width: 100%;
    background: rgba(128,128,128,0.08); 
    overflow: hidden;
    border-radius: 8px; 
    position: relative;                      
    transition: transform 0.35s ease, box-shadow 0.35s ease; 
}
.img-box img { 
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.55s ease;
}
.img-box:hover { transform: translateY(-4px); box-shadow: 0 12px 30px var(--shadow); }
.img-box:hover img { transform: scale(1.04); }

.pillars-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.pillar-card { text-align: center; }
.pillar-card .img-box { 
    aspect-ratio: 4 / 3;    
    margin-bottom: 16px; 
}
.pillar-card h4 { font-size: 0.78rem; margin-bottom: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.pillar-card p { font-size: 0.74rem; opacity: 0.7; line-height: 1.6; }

.grid-services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.card { 
    background: var(--bg); border-radius: 12px; overflow: hidden; 
    border: 1px solid rgba(128,128,128,0.1); 
    transition: border-color 0.3s, box-shadow 0.3s; 
}
.card:hover { border-color: rgba(128,128,128,0.25); box-shadow: 0 8px 32px var(--shadow); }
.card .img-box { 
    aspect-ratio: 16 / 9;   
    border-radius: 0; 
}
.card-body { padding: 32px; text-align: center; }
.card-body h4 { margin-bottom: 12px; font-size: 1rem; font-weight: 700; }
.card-body p { font-size: 0.88rem; opacity: 0.7; line-height: 1.7; }

.grid-portfolio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.port-card .img-box { 
    aspect-ratio: 4 / 3;    
    margin-bottom: 10px; 
}
.port-card p { font-size: 0.78rem; font-weight: 600; text-align: center; opacity: 0.85; }

.rtl.marquee { overflow: visible; white-space: normal; padding: 0 0 20px; }
.rtl .marquee-track { 
    animation: none; 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    width: 100%;
    padding: 0 30px;
    gap: 24px; 
}
.product-item { width: 100%; text-align: center; }
.product-item .img-box { 
    aspect-ratio: 4 / 3;    
    border-radius: 8px;
}
.product-item p { margin-top: 14px; font-weight: 700; font-size: 0.85rem; line-height: 1.4; white-space: normal; }

.marquee { overflow: hidden; white-space: nowrap; padding: 20px 0; }
.marquee-track { display: flex; gap: 50px; width: max-content; }

.partner-item { width: 140px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.partner-item img { max-width: 100%; max-height: 52px; object-fit: contain; filter: grayscale(1); opacity: 0.45; transition: filter 0.3s, opacity 0.3s; }
.partner-item:hover img { filter: grayscale(0); opacity: 1; }

.ltr .marquee-track { animation: scrollLTR 35s linear infinite; }
@keyframes scrollLTR { 
    from { transform: translateX(0); } 
    to   { transform: translateX(-50%); } 
}

.footer { padding: 60px 0 30px; border-top: 1px solid rgba(128,128,128,0.12); }
.footer-flex { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 20px; }
.footer-slogan { font-weight: 600; font-size: 0.88rem; border-left: 1px solid rgba(128,128,128,0.4); padding-left: 20px; opacity: 0.75; }
.footer-info p { font-size: 0.88rem; text-align: right; margin-bottom: 8px; font-weight: 500; }
.footer-info a:hover { color: var(--accent); }

.footer-social { display: flex; gap: 14px; align-items: center; }
.social-link { 
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(128,128,128,0.2);
    opacity: 0.6; transition: opacity 0.3s, border-color 0.3s, color 0.3s;
}
.social-link:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }

.footer-bottom { text-align: center; margin-top: 40px; opacity: 0.35; font-size: 0.74rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 1100px) {
    .pillars-grid { grid-template-columns: repeat(3, 1fr); }
    .grid-portfolio { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .section { padding: 60px 0; }
    .section-title { font-size: 1.4rem; margin-bottom: 36px; }

    .pillars-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .grid-services { grid-template-columns: 1fr; }
    .grid-portfolio { grid-template-columns: repeat(2, 1fr); }
    .rtl .marquee-track { grid-template-columns: repeat(2, 1fr); padding: 0 20px; }

    .footer-brand { flex-direction: column; text-align: center; }
    .footer-slogan { border-left: none; border-top: 1px solid rgba(128,128,128,0.3); padding: 15px 0 0; }
    .footer-info p { text-align: center; }
    .footer-social { justify-content: center; }
}

@media (max-width: 992px) {
    .nav-center { 
        position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; 
        background: var(--bg); transition: right 0.4s cubic-bezier(0.4,0,0.2,1); 
        z-index: 2000; display: flex; flex-direction: column; justify-content: center; 
    }
    .nav-center.active { right: 0; }
    .nav-links { display: flex; flex-direction: column; align-items: center; gap: 32px; }
    .nav-links a { font-size: 1rem; }
    .nav-links a::after { display: none; }

    .header-right { display: flex; flex-direction: row; align-items: center; gap: 15px; }
    .burger { display: flex; margin-left: 10px; }
    .close-menu { display: block; }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
    .hero-content h1 { font-size: 1.65rem; }
    .pillars-grid { grid-template-columns: 1fr; }
    .grid-portfolio { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .rtl .marquee-track { grid-template-columns: 1fr; }
    .footer-flex { flex-direction: column; align-items: center; }
}
