/* Story Cards – Frontend */

.sc-section,
.sc-section * {
    box-sizing: border-box;
}

.sc-section {
    width: 100%;
    padding: 0;
}

/* ── Flex wrapper ── */
.sc-wrapper {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: 80px;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

/* ── Card ── */
.sc-card {
    position: relative;
    width: var(--sc-card-w, calc(25% - 15px));
    min-width: 0;
    height: 240px;
    border-radius: 24px;
    overflow: hidden;
    padding: 24px 22px;
    background-position: right top;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, .04),
        0 4px 18px rgba(0, 0, 0, .07);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.sc-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, .04),
        0 12px 32px rgba(0, 0, 0, .11);
}

/* ── Icon circle ── */
.sc-icon-wrap {
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #EEF2FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.sc-icon-img {
    width: 85px;
    height: 85px;
    object-fit: contain;
    display: block;
}

.sc-icon-svg {
    width: 85px;
    height: 85px;
    color: #6366f1;
    display: block;
}

/* ── Title ── */
.sc-title {
    position: relative;
    z-index: 1;
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.1px;
    color: #191919;
    font-family: "Google Sans", sans-serif !important;
}

/* ── Description ── */
.sc-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
    color: #778AA9;
}

/* ── Tablet / laptop (≤1240px) ──
   2-up, auto-height cards. Above 1200px the fixed-height 4-up cards clipped
   and overflowed their text in the 1201–1240 band. */
@media (max-width: 1240px) {
    .sc-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
    .sc-card {
        width: calc(50% - 10px) !important;
        min-width: 260px;
    }
}

/* ── Mobile ── */
@media (max-width: 767px) {
    .sc-section {
        padding: 0 15px;
    }
    .sc-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .sc-card {
        width: 100% !important;
        max-width: 100%;
        height: auto;
        min-height: 200px;
        padding: 22px 18px;
    }
    .sc-title {
        font-size: 16px;
    }
    .sc-desc {
        font-size: 13px;
    }
}

/* =====================================================
   MVV Layout
===================================================== */

.sc-mvv-section,
.sc-mvv-section * {
    box-sizing: border-box;
}

.sc-mvv-section {
    width: 100%;
    padding: 0;
}

.sc-mvv-wrapper {
    width: 100%;
    max-width: 1600px;
    margin-left: auto;
    margin-right: 80px;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.sc-mvv-card {
    width: var(--mvv-card-w, calc(33.333% - 13.333px));
    min-width: 0;
    height: 179px;
    border: 1px solid #DDDDDD;
    border-radius: 34px;
    padding: 28px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all .3s ease;
}

.sc-mvv-card:hover {
    transform: translateY(-4px);
}

.sc-mvv-icon {
    flex-shrink: 0;
}

.sc-mvv-icon img,
.sc-mvv-icon svg {
    width: 106px;
    height: 106px;
    object-fit: contain;
    display: block;
}

.sc-mvv-content {
    flex: 1;
    min-width: 0;
}

.sc-mvv-title {
    margin: 0 0 12px;
    font-family: "Google Sans", sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    color: #1E1E1E;
}

.sc-mvv-desc {
    margin: 0;
    font-family: "Google Sans", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    color: #7283A7;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 1240px) {
    .sc-mvv-wrapper {
        width: 100%;
        margin: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .sc-mvv-card {
        width: calc(50% - 8px) !important;
        max-width: 100%;
        height: auto;
        min-height: 120px;
        padding: 22px 20px;
        gap: 18px;
    }
    .sc-mvv-icon img,
    .sc-mvv-icon svg {
        width: 80px;
        height: 80px;
    }
    .sc-mvv-title {
        font-size: 18px;
        font-weight: 700;
        margin: 0 0 10px;
        color: #191919 !important;
        font-family: "Google Sans", sans-serif !important;
        line-height: 1.2 !important;
    }
    .sc-mvv-desc {
        font-size: 16px;
        color: #778AA9 !important;
        font-family: "Google Sans", sans-serif !important;
        line-height: 1.2 !important;
    }
}

@media (max-width: 767px) {
    .sc-mvv-section {
        padding: 0 16px;
    }
    .sc-mvv-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: 100%;
        margin: 0;
    }
    .sc-mvv-card {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        border-radius: 24px;
        padding: 20px;
        gap: 16px;
    }
    .sc-mvv-icon img,
    .sc-mvv-icon svg {
        width: 72px;
        height: 72px;
    }
    .sc-mvv-title {
        font-size: 19px;
        margin: 0 0 8px;
    }
    .sc-mvv-desc {
        font-size: 14.5px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .sc-mvv-card {
        border-radius: 20px;
        padding: 18px;
        gap: 14px;
    }
    .sc-mvv-icon img,
    .sc-mvv-icon svg {
        width: 64px;
        height: 64px;
    }
    .sc-mvv-title {
        font-size: 18px;
    }
    .sc-mvv-desc {
        font-size: 14px;
    }
}

/* =====================================================
   Scroll-reveal entrance — 3D flip-in (premium, slow)
   opacity + transform only; no layout shift.
   Hidden state armed by JS via .sc-reveal on the wrapper,
   revealed via .sc-in. perspective() lives in the transform
   list so start/end interpolate on the same function list.
===================================================== */

/* ── Hidden (pre-reveal) — Story layout ── */
.sc-wrapper.sc-reveal .sc-card {
    opacity: 0;
    transform: perspective(1200px) rotateY(-14deg) translateY(28px) scale(0.96);
    transform-origin: left center;
    transition:
        opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Staggered, card-by-card */
.sc-wrapper.sc-reveal .sc-card:nth-child(1) { transition-delay: 0s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(2) { transition-delay: .11s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(3) { transition-delay: .22s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(4) { transition-delay: .33s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(5) { transition-delay: .44s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(6) { transition-delay: .55s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(7) { transition-delay: .66s; }
.sc-wrapper.sc-reveal .sc-card:nth-child(n+8) { transition-delay: .77s; }

/* ── Revealed — Story layout (identity of same function list) ── */
.sc-wrapper.sc-in .sc-card {
    opacity: 1;
    transform: perspective(1200px) rotateY(0deg) translateY(0) scale(1);
}

/* Keep the existing hover lift alive while reveal classes linger */
.sc-wrapper.sc-in .sc-card:hover {
    transform: translateY(-4px);
}

/* ── Hidden (pre-reveal) — MVV layout ── */
.sc-mvv-wrapper.sc-reveal .sc-mvv-card {
    opacity: 0;
    transform: perspective(1200px) rotateY(-14deg) translateY(28px) scale(0.96);
    transform-origin: left center;
    transition:
        opacity 1.25s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.25s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.sc-mvv-wrapper.sc-reveal .sc-mvv-card:nth-child(1) { transition-delay: 0s; }
.sc-mvv-wrapper.sc-reveal .sc-mvv-card:nth-child(2) { transition-delay: .13s; }
.sc-mvv-wrapper.sc-reveal .sc-mvv-card:nth-child(3) { transition-delay: .26s; }
.sc-mvv-wrapper.sc-reveal .sc-mvv-card:nth-child(4) { transition-delay: .39s; }
.sc-mvv-wrapper.sc-reveal .sc-mvv-card:nth-child(n+5) { transition-delay: .52s; }

/* ── Revealed — MVV layout ── */
.sc-mvv-wrapper.sc-in .sc-mvv-card {
    opacity: 1;
    transform: perspective(1200px) rotateY(0deg) translateY(0) scale(1);
}

.sc-mvv-wrapper.sc-in .sc-mvv-card:hover {
    transform: translateY(-4px);
}

/* ── Reduced motion: no animation, always visible ── */
@media (prefers-reduced-motion: reduce) {
    .sc-wrapper.sc-reveal .sc-card,
    .sc-wrapper.sc-in .sc-card,
    .sc-mvv-wrapper.sc-reveal .sc-mvv-card,
    .sc-mvv-wrapper.sc-in .sc-mvv-card {
        opacity: 1;
        transform: none;
        transition: none;
        will-change: auto;
    }
}
