/* =========================================================
   LM IMPIANTI — HOME STATS
   Reuse of home-projects component
   ========================================================= */

.home-projects.home-stats {
    --stats-ink: #171719;
    --stats-muted: #676c68;
    --stats-soft: #9da39d;
    --stats-line: #dfe2dd;
    --stats-bg: #f4f3ee;
    --stats-accent: #6100fe;
    --stats-ease: cubic-bezier(.22, 1, .36, 1);

    position: relative;

    width: 100%;

    padding:
        clamp(95px, 8vw, 135px)
        clamp(24px, 3.2vw, 58px)
        clamp(105px, 9vw, 150px);

    background: var(--stats-bg);
    color: var(--stats-ink);
}

.home-projects.home-stats,
.home-projects.home-stats * {
    box-sizing: border-box;
}


/* =========================================================
   CONTAINER
   ========================================================= */

.home-projects.home-stats .lm-container {
    width: 100%;
    max-width: 1440px;

    margin-inline: auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.home-stats .projects-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 40px;

    margin-bottom:
        clamp(65px, 6vw, 95px);
}

.home-stats .eyebrow {
    display: flex;
    align-items: center;

    gap: 9px;

    margin: 0 0 18px;

    font-family:
        "IBM Plex Mono",
        "Geist Mono",
        monospace;

    font-size: 10px;
    font-weight: 500;

    line-height: 1.4;

    letter-spacing: .085em;

    text-transform: uppercase;

    color: var(--stats-soft);
}

.home-stats .eyebrow::before {
    content: "";

    width: 5px;
    height: 5px;

    flex: 0 0 auto;

    background: var(--stats-accent);
}


/* =========================================================
   TITLE
   ========================================================= */

.home-stats .section-title {
    max-width: 760px;

    margin: 0;

    font-family:
        "Instrument Sans",
        sans-serif;

    font-size: clamp(
        48px,
        5.4vw,
        82px
    );

    font-weight: 500;

    line-height: .98;

    letter-spacing: -.07em;

    color: var(--stats-ink);

    text-wrap: balance;
}


/* =========================================================
   GRID
   ========================================================= */

.home-stats__grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    width: 100%;

    border-top:
        1px solid var(--stats-line);

    border-bottom:
        1px solid var(--stats-line);
}


/* =========================================================
   STAT ITEM
   ========================================================= */

.home-stats__item {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 350px;

    padding:
        22px
        24px
        27px;

    border-right:
        1px solid var(--stats-line);

    overflow: hidden;

    transition:
        background-color .45s ease;
}

.home-stats__item:first-child {
    padding-left: 0;
}

.home-stats__item:last-child {
    padding-right: 0;
    border-right: 0;
}


/* =========================================================
   INDEX
   ========================================================= */

.home-stats__index {
    display: block;

    margin-bottom:
        clamp(45px, 5vw, 80px);

    font-family:
        "IBM Plex Mono",
        "Geist Mono",
        monospace;

    font-size: 10px;
    font-weight: 400;

    line-height: 1;

    letter-spacing: -.02em;

    color: var(--stats-soft);

    transition:
        color .3s ease;
}


/* =========================================================
   MAIN VALUE
   ========================================================= */

.home-stats__value {
    margin-bottom: 18px;

    font-family:
        "Instrument Sans",
        sans-serif;

    font-size: clamp(
        44px,
        4.8vw,
        72px
    );

    font-weight: 500;

    line-height: .95;

    letter-spacing: -.07em;

    color: var(--stats-ink);

    transition:
        color .35s ease,
        transform .55s var(--stats-ease);
}


/* Sicilia should not feel smaller just because it's text */

.home-stats__item:nth-child(2)
.home-stats__value,

.home-stats__item:nth-child(4)
.home-stats__value {
    font-size: clamp(
        38px,
        4vw,
        62px
    );
}


/* =========================================================
   LABEL
   ========================================================= */

.home-stats__label {
    margin:
        auto
        0
        12px;

    font-family:
        "IBM Plex Mono",
        "Geist Mono",
        monospace;

    font-size: 11px;
    font-weight: 600;

    line-height: 1.3;

    letter-spacing: .025em;

    text-transform: uppercase;

    color: var(--stats-ink);
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.home-stats__text {
    max-width: 30ch;

    margin: 0;

    font-size: 13px;
    font-weight: 400;

    line-height: 1.62;

    letter-spacing: -.01em;

    color: var(--stats-muted);
}


/* =========================================================
   BOTTOM ACCENT
   ========================================================= */

.home-stats__item::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 3px;

    background: var(--stats-accent);

    transform: scaleX(0);

    transform-origin: left center;

    transition:
        transform .65s var(--stats-ease);

    pointer-events: none;
}


/* =========================================================
   HOVER
   ========================================================= */

.home-stats__item:hover {
    background:
        rgba(255, 255, 255, .38);
}

.home-stats__item:hover::after {
    transform: scaleX(1);
}

.home-stats__item:hover
.home-stats__index {
    color: var(--stats-accent);
}

.home-stats__item:hover
.home-stats__value {
    color: var(--stats-accent);

    transform:
        translateY(-4px);
}


/* =========================================================
   DECORATIVE BIG NUMBER
   ========================================================= */

.home-stats__item::before {
    position: absolute;

    right: 15px;
    top: 14px;

    font-family:
        "Instrument Sans",
        sans-serif;

    font-size: clamp(
        90px,
        9vw,
        145px
    );

    font-weight: 500;

    line-height: 1;

    letter-spacing: -.08em;

    color:
        rgba(23, 23, 25, .025);

    pointer-events: none;
}

.home-stats__item:nth-child(1)::before {
    content: "8";
}

.home-stats__item:nth-child(2)::before {
    content: "S";
}

.home-stats__item:nth-child(3)::before {
    content: "8";
}

.home-stats__item:nth-child(4)::before {
    content: "D";
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

    .home-stats__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .home-stats__item {
        min-height: 310px;

        padding:
            22px
            22px
            26px;

        border-bottom:
            1px solid var(--stats-line);
    }

    .home-stats__item:nth-child(2n) {
        border-right: 0;
    }

    .home-stats__item:nth-child(3),
    .home-stats__item:nth-child(4) {
        border-bottom: 0;
    }

    .home-stats__item:first-child,
    .home-stats__item:nth-child(3) {
        padding-left: 0;
    }

    .home-stats__item:nth-child(2),
    .home-stats__item:last-child {
        padding-right: 0;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .home-projects.home-stats {
        padding:
            82px
            22px
            92px;
    }

    .home-stats .projects-heading {
        margin-bottom: 50px;
    }

    .home-stats .section-title {
        font-size: clamp(
            42px,
            11vw,
            58px
        );
    }

    .home-stats__grid {
        display: block;
    }

    .home-stats__item,
    .home-stats__item:first-child,
    .home-stats__item:nth-child(2),
    .home-stats__item:nth-child(3),
    .home-stats__item:nth-child(4),
    .home-stats__item:last-child {
        min-height: 0;

        padding:
            22px
            0
            28px;

        border-right: 0;

        border-bottom:
            1px solid var(--stats-line);
    }

    .home-stats__item:last-child {
        border-bottom: 0;
    }

    .home-stats__index {
        margin-bottom: 40px;
    }

    .home-stats__value {
        margin-bottom: 38px;

        font-size: clamp(
            50px,
            14vw,
            70px
        );
    }

    .home-stats__item:nth-child(2)
    .home-stats__value,

    .home-stats__item:nth-child(4)
    .home-stats__value {
        font-size: clamp(
            44px,
            12vw,
            62px
        );
    }

    .home-stats__label {
        margin-top: 0;
    }

    .home-stats__text {
        max-width: 42ch;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 390px) {

    .home-projects.home-stats {
        padding-inline: 18px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .home-stats__item,
    .home-stats__value,
    .home-stats__index,
    .home-stats__item::after {
        transition: none !important;
    }

}

/* ==========================================
   HOME STATS — COMPACT HEADER OVERRIDE
   ========================================== */

.home-stats .projects-heading {
    margin-bottom: clamp(38px, 4vw, 58px);
}

.home-stats .section-title {
    max-width: 620px;

    font-size: clamp(
        42px,
        4.2vw,
        64px
    );

    line-height: .96;
    letter-spacing: -.065em;
}

.home-projects.home-stats {
    padding-top: clamp(70px, 6vw, 95px);
    padding-bottom: clamp(85px, 7vw, 115px);
}

/* Riduciamo un po' anche l'altezza dei blocchi */
.home-stats__item {
    min-height: 300px;
}

/* Il numero decorativo rimane, ma meno invasivo */
.home-stats__item::before {
    font-size: clamp(
        70px,
        7vw,
        110px
    );

    opacity: .7;
}

/* Desktop medio */
@media (max-width: 1200px) {

    .home-stats .section-title {
        font-size: clamp(
            40px,
            4.5vw,
            58px
        );
    }

    .home-stats__item {
        min-height: 285px;
    }

}