/* =========================================
   Block: Stats
   ========================================= */

.stats {
    padding: 88px 0;
    background: var(--color-bg);
}

.stats__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* --- Base --- */
.stats__cell {
    border-radius: 20px;
    overflow: hidden;
    min-height: 240px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .stats__cell:hover { transform: translateY(-4px); }
}

/* =========================================
   Stat cell — engineering blueprint style
   ========================================= */

.stats__cell--stat {
    position: relative;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    padding: 36px 32px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Точечная сетка — чертёжная бумага */
    background-image:
        radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    background-color: var(--color-bg-light);
}

@media (hover: hover) {
    .stats__cell--stat:hover {
        border-color: rgba(84,187,144,0.3);
        box-shadow: 0 12px 40px rgba(84,187,144,0.07);
    }
}

/* Угловые скобки — технический чертёж */
.stats__cell--stat::before,
.stats__cell--stat::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.stats__cell--stat::before {
    top: 16px;
    left: 16px;
    border-top: 1.5px solid var(--color-primary);
    border-left: 1.5px solid var(--color-primary);
    border-radius: 3px 0 0 0;
}

.stats__cell--stat::after {
    bottom: 16px;
    right: 16px;
    border-bottom: 1.5px solid var(--color-primary);
    border-right: 1.5px solid var(--color-primary);
    border-radius: 0 0 3px 0;
}

@media (hover: hover) {
    .stats__cell--stat:hover::before,
    .stats__cell--stat:hover::after {
        opacity: 0.7;
    }
}

/* Контент */
.stats__cell-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Число + суффикс */
.stats__number-wrap {
    display: flex;
    align-items: baseline;
    gap: 1px;
    line-height: 1;
}

/* Более мягкая типографика — Raleway 700, не 800 */
.stats__number {
    font-family: var(--font-primary);
    font-size: clamp(44px, 5.5vw, 72px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1;
}

/* Суффикс зелёный — чуть меньше */
.stats__suffix {
    font-family: var(--font-primary);
    font-size: clamp(26px, 3vw, 44px);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-primary);
    line-height: 1;
}

.stats__desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-top: 4px;
    max-width: 240px;
}

/* =========================================
   Image cell
   ========================================= */

.stats__cell--image {
    position: relative;
    min-height: 240px;
}

.stats__cell--image img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

@media (hover: hover) {
    .stats__cell--image:hover img { transform: scale(1.04); }
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 900px) {
    .stats__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats { padding: 56px 0 64px; }

    /* Одна колонка — всё на всю ширину */
    .stats__grid {
        gap: 10px;
        grid-template-columns: 1fr;
    }

    .stats__cell--stat {
        min-height: 160px;
        padding: 24px 20px 22px;
        background-size: 18px 18px;
    }

    .stats__cell--image { min-height: 220px; }

    .stats__cell--stat::before { top: 10px; left: 10px; width: 12px; height: 12px; }
    .stats__cell--stat::after  { bottom: 10px; right: 10px; width: 12px; height: 12px; }

    .stats__bg-num { display: none; }

    .stats__number { font-size: clamp(40px, 13vw, 56px); }
    .stats__suffix { font-size: clamp(24px, 8vw, 36px); }
    .stats__desc   { font-size: 13px; max-width: 100%; }
}
