#cases {
    padding: 60px 0 80px 0;
    border-top: 1px solid var(--border-color);
}

#cases h2 {
    font-size: 1.8rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    grid-auto-rows: 420px; 
    gap: 16px;
    min-height: 856px; 
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #111;
    overflow: hidden;
}

.card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    z-index: 2;
}

.card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    font-weight: 800;
    font-size: 1.4rem;
    text-transform: uppercase;
    z-index: 1;
}

.card-metric {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.card .category {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card h3 {
    font-size: 1.25rem;
    color: #fff;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    flex-grow: 1;
}

.more-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 8px;
}

@media (max-width: 767px) {
    #cases-grid {
        display: flex !important;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        min-height: 0 !important;
        grid-auto-rows: unset;
        gap: 12px;
        padding-top: 8px;
        padding-bottom: 8px;
        margin-top: -8px;
    }
    #cases-grid::-webkit-scrollbar { display: none; }
    #cases-grid .card {
        flex-shrink: 0;
        width: calc(100vw - 72px);
        height: auto;
        scroll-snap-align: start;
    }
}

@media (min-width: 768px) {
    #cases h2 {
        font-size: 2.5rem;
    }
    .grid {
        gap: 24px;
    }
    .card:hover {
        transform: translateY(-6px);
        /* ДОБАВЛЕНО: Мягкое бирюзовое неоновое свечение и рамка */
        border-color: rgba(0, 229, 255, 0.4);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 
                    0 0 15px rgba(0, 229, 255, 0.2);
    }
    .card:hover .card-image-wrapper img {
        transform: scale(1.04);
    }
    .card:hover .more-link {
        color: var(--mm-cyan);
    }
}

/* ==========================================================================
   VIDEO REVEAL
   Видео выезжает снизу в нормальном скролле.
   border-radius + scale схлопываются пока первые 50% видео входят в экран.
   ========================================================================== */
.video-reveal-section {
    overflow: hidden;
    padding: 40px 0;
}

.video-reveal-wrapper {
    position: relative;
    border-radius: 44px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.64);
    will-change: transform, border-radius, opacity;
}

.video-reveal-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

.video-sound-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, transform 0.15s;
    z-index: 10;
}

.video-sound-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.08);
}

.video-sound-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.video-sound-btn .icon-sound {
    display: none;
}

.video-sound-btn.is-unmuted .icon-muted {
    display: none;
}

.video-sound-btn.is-unmuted .icon-sound {
    display: block;
}
