/* =========================================
   5. БЛОК КЕЙСОВ
   ========================================= */
.engineering-cases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 350px);
    gap: 15px;
}

.case-item-wide { grid-column: span 2; }
.case-item-tall { grid-row: span 2; }

.case-item {
    position: relative;
    overflow: hidden;
    background-color: #111;
    border-radius: 4px;
}

.case-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-item:hover img { transform: scale(1.05); }

.case-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

@media (max-width: 959px) {
    .engineering-cases-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .case-item-wide, .case-item-tall, .case-item {
        grid-column: span 1;
        grid-row: span 1;
        height: 300px;
    }
}

/* =========================================
   6. БЛОК УСЛУГ (СФЕРЫ И ДЕКОР)
   ========================================= */
.decorated-text-wrapper {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.decor-handdrawn-line {
    position: absolute;
    width: 100%;
    bottom: -15px;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.services-header__title {
    position: relative;
    z-index: 2;
}

.service-sphere {
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    text-align: center;
    padding: 20px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    border-radius: 50%;
}

.service-sphere::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    z-index: -1;
    filter: blur(5px);
    transition: filter 0.4s ease, transform 0.4s ease;
/* --- ЖЕЛЕЗОБЕТОННЫЙ ФИКС ДЛЯ SAFARI --- */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Заставляем браузер сразу выделить отдельный графический слой */
    -webkit-transform: translateZ(0) scale(1);
    transform: translateZ(0) scale(1);
}

.service-sphere:hover { transform: translateY(-8px); }
.service-sphere:hover::before {
    filter: blur(20px);
    -webkit-transform: translateZ(0) scale(1.05);
    transform: translateZ(0) scale(1.05);
}

.service-sphere-dark { color: #fff; }
.service-sphere-dark::before { background: rgba(17, 17, 17, 0.85); }

.service-sphere-light { color: #111; }
.service-sphere-light::before { 
    background: #ffffff; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.03); 
}

.service-sphere-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

.service-strict-list li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #444;
}

.service-strict-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #111;
    font-weight: bold;
}

/* =========================================
   7. В ЦИФРАХ (ТУРБИНА И РОТОР)
   ========================================= */
#home-numbers { overflow: hidden !important; }

.numbers-grid .uk-heading-medium {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 300;
    line-height: 1;
    margin-bottom: 5px;
    letter-spacing: -0.02em;
}

.numbers-label {
    font-size: 1rem;
    color: #444;
    line-height: 1.3;
}

.decor-strikethrough {
    position: absolute;
    top: 50%; left: -5%;
    width: 110%; height: 100%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: -1;
    stroke: #111;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
}

@keyframes spin-turbine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotating-turbine {
    animation: spin-turbine 10s linear infinite;
    transform-origin: center center;
    width: 100%; height: 100%;
}

.turbine-wrapper {
    position: absolute;
    top: 50%; right: -25%;
    transform: translateY(-50%);
    width: 80vw; max-width: 800px;
    height: 80vw; max-height: 800px;
    pointer-events: none;
    opacity: 0.9;
}

@media (max-width: 959px) {
    .turbine-wrapper { right: -40%; opacity: 0.15; }
}

/* Экспериментальный ротор */
.stats-rotor-wrap { flex-shrink: 0; margin-right: clamp(-6rem, -10vw, -3rem); }
.stats-rotor { display: block; width: clamp(280px, 38vw, 540px); height: clamp(280px, 38vw, 540px); fill: #111111; overflow: visible; }
.stats-rotor--sun { display: block; }

@keyframes stats-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.stats-rotor-spin { transform-origin: 0 0; animation: stats-spin 18s linear infinite; will-change: transform; }

/*@media (prefers-reduced-motion: reduce) { .stats-rotor-spin { animation: none; } }*/
@media (max-width: 639px) {
    .stats-rotor-wrap { position: absolute; right: clamp(-6rem, -20vw, -2rem); top: 50%; transform: translateY(-50%); margin-right: 0; opacity: 0.08; z-index: 0; }
    .stats-rotor { width: clamp(240px, 70vw, 360px); height: clamp(240px, 70vw, 360px); }
}

/* =========================================
   8. ПРОТОКОЛ РАБОТЫ (ШАГИ)
   ========================================= */
.process-step-card {
    position: relative;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease;
}

.process-step-card:hover { border-top-color: #111; }

.process-step-number {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    color: #ccc;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.process-step-card:hover .process-step-number { color: #111; }

.process-step-title {
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.process-step-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}



/* =========================================
   4. HERO БЛОК И ИНЖЕНЕРНЫЙ КОЛЛАЖ
   ========================================= */

/* --- Монументальная типографика --- 
.hero-title-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

.hero-title-massive {
    font-family: var(--font-primary);
    font-weight: 500 !important;
    font-size: clamp(5rem, 12vw, 12rem);
    letter-spacing: -0.05em;
    line-height: 0.8;
    color: #111;
    white-space: nowrap;
    margin: 0 !important;
}

.hero-subtitle-aligned {
    letter-spacing: 0.15em;
    font-weight: 500;
    font-size: clamp(0.8rem, 1.2vw, 1.3rem);
    color: #999;
    text-transform: uppercase;
    margin-top: 0.2rem;
    text-align: right;
    width: 100%;
}

/* --- Интерактивный коллаж --- 
.hero-collage-wrapper {
    position: relative;
    height: 600px;
    width: 100%;
}

/* Плавный ход слоев за мышкой 
.parallax-layer {
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

/* 1. Точечная сетка (Самый глубокий фон) 
.hero-collage-dots {
    position: absolute;
    width: 180px; height: 180px;
    left: 0%; top: 15%;
    background-image: radial-gradient(rgba(17, 17, 17, 0.25) 15%, transparent 16%);
    background-size: 12px 12px;
    border-radius: 50%;
    z-index: 5;
}

/* 2. Лист (Задний план) 
.hero-collage-leaf {
    position: absolute;
    width: 65%;
    aspect-ratio: 4/3; /* Жестко держим пропорции картинки 
    right: 0; top: 0;
    z-index: 2;
    background-position: center;
    background-size: cover;
    clip-path: polygon(5% 0%, 100% 0%, 95% 100%, 0% 100%);
    filter: grayscale(20%) contrast(1.1);
}

/* 3. Рука (Передний план) 
.hero-collage-hand {
    position: absolute;
    width: 70%;
    aspect-ratio: 4/3;
    left: 5%; bottom: 5%;
    z-index: 3;
    background-position: center;
    background-size: cover;
    clip-path: polygon(0% 0%, 95% 5%, 100% 100%, 5% 95%);
    filter: contrast(1.15) brightness(0.95);
}

/* 4. Металлическая сфера (Акцент) 
.hero-collage-sphere {
    position: absolute;
    width: 80px; height: 80px;
    left: 55%; top: 40%;
    border-radius: 50%;
    z-index: 4;
    background: radial-gradient(circle at 30% 30%, #ffebb3 0%, #d8ae47 30%, #8c6a1c 80%, #3a2b06 100%);
    box-shadow: 10px 20px 30px rgba(0, 0, 0, 0.2), inset -5px -5px 15px rgba(0,0,0,0.5);
}
*/
/* =========================================
   7. ИНЖЕНЕРНЫЙ КОЛЛАЖ (ПЕРВЫЙ ЭКРАН)
   ========================================= */
.hero-title-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

.hero-title-massive {
    font-family: var(--font-primary);
    font-weight: 400 !important;
    font-size: clamp(5rem, 12vw, 12rem);
    letter-spacing: -0.05em;
    line-height: 0.8;
    color: #111;
    white-space: nowrap;
    margin: 0 !important;
}

.hero-subtitle-aligned {
    letter-spacing: 0.15em;
    font-weight: 500;
    font-size: clamp(0.8rem, 1.2vw, 1.3rem);
    color: #999;
    text-transform: uppercase;
    margin-top: 0.2rem;
    text-align: right;
    width: 100%;
}

.hero-collage-wrapper {
    position: relative;
    height: 600px;
    width: 100%;
}

.parallax-layer {
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

.hero-collage-dots {
    position: absolute;
    width: 180px; height: 180px;
    left: 0%; top: 15%;
    background-image: radial-gradient(rgba(17, 17, 17, 0.25) 15%, transparent 16%);
    background-size: 12px 12px;
    border-radius: 50%;
    z-index: 1;
}

.hero-collage-leaf {
    position: absolute;
    width: 65%;
    aspect-ratio: 4/3;
    right: 0; top: 0;
    z-index: 2;
    background-position: center;
    background-size: cover;
    clip-path: polygon(5% 0%, 100% 0%, 95% 100%, 0% 100%);
    filter: grayscale(20%) contrast(1.1);
}

.hero-collage-hand {
    position: absolute;
    width: 70%;
    aspect-ratio: 4/3;
    left: 5%; bottom: 5%;
    z-index: 3;
    background-position: center;
    background-size: cover;
    clip-path: polygon(0% 0%, 95% 5%, 100% 100%, 5% 95%);
    filter: contrast(1.15) brightness(0.95);
}

.hero-collage-sphere {
    position: absolute;
    width: 80px; height: 80px;
    left: 55%; top: 40%;
    border-radius: 50%;
    z-index: 4;
    background: radial-gradient(circle at 30% 30%, #ffebb3 0%, #d8ae47 30%, #8c6a1c 80%, #3a2b06 100%);
    box-shadow: 10px 20px 30px rgba(0, 0, 0, 0.2), inset -5px -5px 15px rgba(0,0,0,0.5);
}

/* catalog/view/theme/default/stylesheet/home.css */

.hero-interactive-zone {
    min-height: 70vh; /* Сразу резервируем высоту под первый экран */
    box-sizing: border-box;
}

.hero-collage-wrapper {
    position: relative;
    height: 600px;
    width: 100%;
    /* Фиксируем контейнер, чтобы он не схлопывался до загрузки картинок */
    contain: layout size; 
}

/* На мобильных экранах полностью отключаем тяжелую анимацию и параллакс */
@media (max-width: 959px) {
    .hero-interactive-zone {
        min-height: auto;
        padding-top: 2rem !important;
    }
    
    /* Скрываем сложную графику на мобилках для экономии ресурсов, 
       оставляя чистый, читаемый текст, либо фиксируем её без параллакса */
    .hero-collage-wrapper {
        height: 300px;
        margin-top: 2rem;
    }
    
    .parallax-layer {
        transform: none !important;
        transition: none !important;
    }
}

.hero-interactive-zone {
    min-height: calc(100vh - 80px);
    contain: layout paint;
    box-sizing: border-box;
}

.hero-title-massive {
    line-height: 0.85;
    contain: layout;
}