/* =========================================
   WHY REFACTIA (cards escalier + trait)
   Dépend de tes variables : --primary, etc.
   ========================================= */

/* Section */
.why-section{
    padding: 52px 0;
    border-bottom: 1px solid #f3f4f6;
}

.why-wrap{
    text-align: center;
    max-width: 980px;
    margin: 0 auto;
}

/* Texte */
.why-kicker{
    color: var(--text-muted);
    margin: 0 0 10px;
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.why-title{
    margin: 0 0 14px;
    font-size: 1.9rem;
    letter-spacing: -0.02em;
    color: var(--secondary);
}

.why-lead{
    color: var(--text-muted);
    margin: 0 auto 30px;
    max-width: 760px;
}

/* Wrapper: permet de placer le trait derrière */
.why-grid-wrap{
    position: relative;
    margin-top: 18px;
    overflow: visible; /* important: le trait doit dépasser */
}

/* Le trait (SVG) derrière les cartes, plus large que l’écran */
.why-connector{
    position: absolute;
    left: 50%;
    top: 6px;
    width: 100vw;              /* dépasse largement l’écran */
    height: 260px;             /* correspond au viewBox */
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}

/* Style des lignes du trait */
.why-connector__line{
    fill: none;
    stroke: rgba(76,195,189,.35);  /* utilise ton vert, en doux */
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 1;
    filter: drop-shadow(0 10px 18px rgba(15,23,42,.08));
}

/* La grille des cartes (au-dessus du trait) */
.why-grid{
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px;
    text-align: left;
    align-items: start;
}

/* Les cartes */
.why-card{
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #eef2f7;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .22s ease, border-color .22s ease; /* ✅ pas de transform ici */
    will-change: transform, opacity;
}

.features-grid{
    perspective: 1200px;          /* donne la profondeur 3D */
    perspective-origin: 50% 40%;
}

.feature-card{
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
}
/* Titre + texte */
.why-card__t{
    font-weight: 850;
    color: var(--secondary);
}

.why-card__p{
    color: var(--text-muted);
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

/* Hover: premium léger */
.why-card:hover{
    box-shadow: var(--shadow-md);
    border-color: rgba(76,195,189,.22);
}

/* Effet escalier SANS transform => margin-top */
@media (min-width: 900px){
    .why-card:nth-child(2),
    .why-card:nth-child(4){
        margin-top: 18px;
    }
}

/* Effet escalier (colonne droite plus basse) */
@media (min-width: 900px){
    .why-card:nth-child(2),
    .why-card:nth-child(4){
        transform: translateY(18px);
    }

    /* garde aussi l’effet hover sans casser l’escalier */
    .why-card:nth-child(2):hover,
    .why-card:nth-child(4):hover{
        transform: translateY(14px);
    }
}

/* Mobile */
@media (max-width: 899px){
    .why-wrap{ text-align: left; }
    .why-title{ font-size: 1.55rem; }
    .why-grid{
        grid-template-columns: 1fr;
    }
    .why-connector{
        display: none; /* sur mobile on enlève le gros trait */
    }
    .why-card:nth-child(2),
    .why-card:nth-child(4){
        transform: none;
    }
}
