/* ==========================================================
   STORIES — Section heading with angular accent shapes
   ========================================================== */

.stories-head-row{
    display:grid;
    grid-template-columns:minmax(320px, 560px) 1fr;
    align-items:center;
    gap:48px;

    margin-bottom:56px;
}

.section-head.stories-head{
    position:relative;
    display:block;

    padding:40px 44px 40px 32px;

    background:var(--gray-100);
    border-radius:var(--radius-md);

    overflow:visible;
    isolation:isolate;
}

/* right-side highlight — key trust stat filling the row */
.stories-head-highlight{
    display:flex;
    flex-direction:column;
    gap:6px;

    padding-left:48px;
    border-left:2px solid var(--gray-150);
}

.stories-head-highlight {
    font-size:clamp(40px,4vw,56px);
    font-weight:800;
    color:var(--crimson);
    line-height:1;
} 

.big-stat{
    font-size: 25pt;
    font-weight:800;
    color:var(--crimson);
    line-height:1;
} 

.stories-head-highlight .big-stat-label{
    font-size:14px;
    color:var(--gray-500);
}

/* top-left angled ribbon */
.section-head.stories-head::before{
    content:"";
    position:absolute;
    top:-28px;
    left:-16px;

    width:90px;
    height:90px;

    background:var(--crimson);
    clip-path:polygon(0 0, 100% 0, 0 100%);

    z-index:-1;
}

/* bottom-left angled ribbon */
.section-head.stories-head::after{
    content:"";
    position:absolute;
    bottom:-28px;
    left:-16px;

    width:90px;
    height:90px;

    background:var(--crimson);
    clip-path:polygon(0 0, 100% 100%, 0 100%);

    z-index:-1;
}

.stories-head h2{
    font-size:clamp(30px,3.4vw,42px);
    font-weight:800;
    line-height:1.15;

    color:var(--crimson);
}

.stories-head p.lead{
    max-width:460px;

    margin-top:16px;

    font-size:15px;
    line-height:1.7;

    color:var(--gray-700);
}

/* Tablet — collapse to single column, highlight moves below */
@media (max-width:900px){
    .stories-head-row{
        grid-template-columns:1fr;
        gap:24px;
    }

    .stories-head-highlight{
        padding-left:0;
        border-left:none;
        padding-top:20px;
        border-top:1px solid var(--gray-150);
    }
}

/* Mobile */
@media (max-width:640px){
    .stories-head-row{
        margin-bottom:36px;
    }

    .section-head.stories-head{
        padding:32px 28px 32px 24px;
    }

    .section-head.stories-head::before,
    .section-head.stories-head::after{
        width:60px;
        height:60px;
    }
    .big-stat {
        font-size: 13.5pt;
    }
}


/* ==========================================================
   TYPEWRITER HEADLINE — words appear one at a time
   ========================================================== */

.typewriter-heading span{
    display:inline-block;
    opacity:0;

    animation:wordAppear .4s ease forwards;
}

/* stagger — one word every 0.25s */
.typewriter-heading span:nth-child(1){ animation-delay:0.1s; }
.typewriter-heading span:nth-child(2){ animation-delay:0.35s; }
.typewriter-heading span:nth-child(3){ animation-delay:0.6s; }
.typewriter-heading span:nth-child(4){ animation-delay:0.85s; }
.typewriter-heading span:nth-child(5){ animation-delay:1.1s; }
.typewriter-heading span:nth-child(6){ animation-delay:1.35s; }

@keyframes wordAppear{
    from{
        opacity:0;
        transform:translateY(6px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* blinking cursor after the last word */
.typewriter-heading .cursor{
    display:inline-block;
    width:3px;
    height:0.85em;

    margin-left:4px;
    margin-bottom:-4px;

    background:var(--crimson);

    opacity:0;
    animation:
        wordAppear .4s ease forwards 1.35s,
        blink 1s steps(1) infinite 1.75s;
}

@keyframes blink{
    50%{ opacity:0; }
}

@media (prefers-reduced-motion: reduce){
    .typewriter-heading span,
    .typewriter-heading .cursor{
        animation:none;
        opacity:1;
    }
}


/* ==========================================================
   STORIES — Customer testimonial cards
   ========================================================== */

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

.story-card{
    display:flex;
    flex-direction:column;
    gap:20px;

    padding:38px;
    min-height:340px;

    background:var(--white);

    border:1px solid var(--gray-150);
    border-radius:var(--radius-lg);

    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.story-card:hover{
    transform:translateY(-6px);
    border-color:var(--crimson);
    box-shadow:
        0 18px 36px rgba(15,23,42,.08),
        0 28px 60px rgba(15,23,42,.06);
}

.story-card .metric{
    font-size:clamp(34px,3.6vw,46px);
    font-weight:800;
    letter-spacing:-.02em;
    color:var(--crimson);
}

.story-card .metric-label{
    margin-top:-12px;
    font-size:13.5px;
    color:var(--gray-500);
}

.story-card p.quote{
    position:relative;
    flex:1;

    font-size:15px;
    line-height:1.8;

    color:var(--gray-700);
}

.story-card p.quote::before{
    content:"\201C";
    position:absolute;
    left:-10px;
    top:-12px;

    font-size:42px;
    line-height:1;

    color:var(--crimson-tint);
}

.story-card .who{
    display:flex;
    align-items:center;
    gap:12px;

    padding-top:14px;

    border-top:1px solid var(--gray-150);
}

.story-card .avatar{
    display:flex;
    align-items:center;
    justify-content:center;

    width:40px;
    height:40px;

    border-radius:50%;

    background:var(--crimson-tint);
    color:var(--crimson-dark);

    font-size:13px;
    font-weight:800;

    flex-shrink:0;

    transition:transform .3s ease;
}

.story-card:hover .avatar{
    transform:scale(1.08);
}

.story-card .who b{
    display:block;
    font-size:13.5px;
}

.story-card .who span{
    font-size:12px;
    color:var(--gray-500);
}

/* Tablet */
@media (max-width:860px){
    .stories-grid{
        grid-template-columns:1fr;
    }
}

/* Mobile */
@media (max-width:640px){
    .story-card{
        padding:26px;
        min-height:auto;
    }
    .story-card .metric{
        font-size:30px;
    }
}