/*!
 |------------------------------------------------------------------
 | problem.css — "You Don't Need Another SaaS Subscription." section.
 |------------------------------------------------------------------
 |
 | Owns .raas-problem__* (head, three problem cards, transition) and the
 | shared .raas-problem-flow chip track used for AD -> REVENUE.
 |
 | journey.js adds .is-armed to [data-raas-flow] and .is-lit to the
 | children marked [data-raas-step] as they scroll into view, so chips
 | highlight in order.  Nothing is dimmed or animated unless that script
 | runs and the user allows motion — a static render shows every chip.
 */

/* ---------- Header block ---------- */
.raas-problem__head {
    max-width: 46rem;
    margin-bottom: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
}

/* ---------- Three problem cards ---------- */
.raas-problem__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0 0 clamp(2.5rem, 1.9rem + 2.5vw, 4rem);
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .raas-problem__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

.raas-problem__item {
    position: relative;
    padding: 1.5rem 1.375rem 1.375rem;
    background: var(--z-white);
    border: 1px solid var(--z-line);
    border-radius: var(--z-radius);
    box-shadow: var(--z-shadow-card);
}

/* Thin accent keyline that extends on hover — the reveal/transition
   shorthand on the card itself stays untouched, so this never delays
   the scroll reveal. */
.raas-problem__item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.375rem;
    width: 36px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--z-blue);
    transition: width .3s ease, background-color .3s ease;
}

.raas-problem__item:hover::before {
    width: 64px;
    background: var(--z-green);
}

.raas-problem__num {
    display: block;
    margin-bottom: .625rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--z-blue);
}

.raas-problem__item h3 {
    margin: 0 0 .5rem;
    font-size: clamp(1.0625rem, 1rem + .35vw, 1.1875rem);
    letter-spacing: -.01em;
}

.raas-problem__item p {
    margin: 0;
    font-size: .9375rem;
    color: var(--z-muted);
}

/* Stagger the scroll reveal across the three cards. */
.raas-js .raas-problem__item:nth-child(2) { transition-delay: .1s; }
.raas-js .raas-problem__item:nth-child(3) { transition-delay: .2s; }

/* ---------- Transition + flow ---------- */
.raas-problem__turn {
    padding-top: clamp(1rem, .5rem + 2vw, 2.5rem);
    text-align: center;
}

.raas-problem__turn-title {
    margin: 0 0 clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
    font-size: clamp(1.5rem, 1.25rem + 1.3vw, 2.125rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--z-ink);
}

.raas-problem-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.raas-problem-flow__item {
    display: inline-flex;
    align-items: center;
}

.raas-problem-flow__label {
    display: inline-flex;
    align-items: center;
    padding: .5rem .875rem;
    background: var(--z-white);
    border: 1px solid var(--z-line);
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--z-ink);
    white-space: nowrap;
    transition: color .3s ease, border-color .3s ease;
}

.raas-problem-flow__arrow {
    margin-inline: .5rem;
    color: var(--z-muted);
    font-weight: 600;
    transition: color .3s ease;
}

.raas-problem-flow__item.is-lit .raas-problem-flow__label {
    border-color: var(--z-blue);
    color: var(--z-blue);
}

/* Armed state: not-yet-reached chips recede until they light up. */
.raas-problem-flow.is-armed .raas-problem-flow__item:not(.is-lit) .raas-problem-flow__label {
    border-color: #EDF1F9;
    color: rgba(15, 23, 42, .38);
}

.raas-problem-flow.is-armed .raas-problem-flow__item:not(.is-lit) .raas-problem-flow__arrow {
    color: rgba(91, 107, 133, .35);
}

/* Mobile: the flow stacks vertically (AD -> LEAD -> ... as in the spec). */
@media (max-width: 639px) {
    .raas-problem-flow {
        flex-direction: column;
        gap: .3rem;
    }

    .raas-problem-flow__item {
        flex-direction: column;
    }

    .raas-problem-flow__arrow {
        margin: .1rem 0;
        transform: rotate(90deg);
    }
}

.raas-problem__cta {
    margin: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem) 0 0;
}

@media (prefers-reduced-motion: reduce) {
    .raas-problem-flow__label,
    .raas-problem-flow__arrow,
    .raas-problem__item::before {
        transition: none;
    }
}
