/* ============================================================
   VTI App Dev — module base.
   Builds on vti-home's stylesheet (loaded as a dependency): every section root
   carries `vti-home` for its tokens (--vh-*), theme resets and shared atoms
   (__wrap, __head, __title, __eyebrow, __lead). Only what vti-home lacks lives here.
   ============================================================ */

/* ---------- reused sections (via their `class` option) ----------
   The page template tags every reused section `vti-app-dev vti-app-dev-<section>`.
   Doubled classes beat the owning module's rules regardless of file order;
   vti-home.css and vti-service-pillar.css stay untouched. */

/* Tech stack: insights below has no top padding, so tech pads its bottom. */
.vti-home.vsp-tech.vti-app-dev-tech {
    padding-bottom: var(--vh-pad);
}

/* Mobile frame 2968:49509 (375 wide): 20px gutters, 24px eyebrow, -1px titles. */
@media (max-width: 699px) {
    .vti-home.vti-app-dev .vti-home__wrap {
        width: calc(100% - 40px);
    }

    .vti-home.vti-app-dev .vti-home__eyebrow {
        padding: 3px 12px;
        line-height: 16px;
        letter-spacing: 0;
    }

    /* vti-home's mobile lead is zinc; this frame keeps the desktop grey (the hero
       lead keeps its own translucent black). */
    .vti-home.vti-app-dev:not(.vsp-hero) .vti-home__lead {
        color: var(--vh-muted);
    }

    .vti-home.vti-app-dev .vti-home__title {
        letter-spacing: -1px;
    }

    /* Hero: 500px tall, art raised 14px, H4-sized title. */
    .vsp-hero.vti-app-dev-hero {
        min-height: 500px;
    }

    .vsp-hero.vti-app-dev-hero .vsp-hero__bg {
        top: -14px;
    }

    .vsp-hero.vti-app-dev-hero .vsp-hero__title {
        font-size: 24px;
        line-height: 32px;
    }

    .vsp-services.vti-app-dev-services .vsp-services__group {
        background: linear-gradient(96.37deg, #fcfdff 0%, #f1f7ff 67.791%);
    }

    .vti-app-dev-services .vsp-services__grid {
        background: #fff;
    }

    /* Industries: the cases section above pads its bottom, so no top gap; no lead,
       taller crop, 20px between every panel part. */
    .vti-home-industries.vti-app-dev-industries {
        padding-top: 0;
    }

    .vti-home-industries.vti-app-dev-industries .vti-home__lead {
        display: none;
    }

    .vti-app-dev-industries .vti-home-industries__panel {
        gap: 20px;
    }

    .vti-app-dev-industries .vti-home-industries__media {
        height: 129px;
        aspect-ratio: auto;
        margin-bottom: -4px;
        border-radius: 8px;
    }

    .vti-app-dev-industries .vti-home-industries__heading,
    .vti-app-dev-industries .vti-home-industries__list,
    .vti-app-dev-industries .vti-home-industries__cta {
        margin: 0;
    }

    .vti-app-dev-industries .vti-home-industries__list {
        gap: 8px;
    }

    .vsp-tech.vti-app-dev-tech .vsp-tech__body {
        padding: 4px;
    }

    /* Cases (mobile_layout="stack"): small header button, 24px between cards,
       borderless 218px media. */
    .vti-app-dev-cases .vti-home__head-aside .vti-home__btn {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 14px;
        line-height: 20px;
    }

    .vti-app-dev-cases .vti-home__head-aside .vti-home__btn img {
        width: 16px;
        height: 16px;
    }

    .vti-home-cases.vti-app-dev-cases .vti-home-cases__row {
        gap: 24px;
    }

    .vti-app-dev-cases .vti-home-cases__media,
    .vti-app-dev-cases .vti-home-cases__card.is-open .vti-home-cases__media {
        border-radius: 8px;
    }

    .vti-app-dev-cases .vti-home-cases__title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 20px;
        line-height: 28px;
        letter-spacing: 0;
    }

    .vti-app-dev-cases .vti-home-cases__desc {
        letter-spacing: 0;
    }

    /* Insights: the mobile cards drop the post-type badge. */
    .vti-app-dev-insights .vti-home__post-badge {
        display: none;
    }

    .vti-app-dev-insights .vti-home__post-media {
        height: 160px;
    }

    .vti-app-dev-insights .vti-home__post-title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    /* CTA: box inside the gutters, roomier form card, H2-sized title. */
    .vti-app-dev-cta .vti-home-cta__box {
        margin-inline: 0;
        padding: 40px 20px;
    }

    .vti-app-dev-cta .vti-home-cta__copy {
        gap: 16px;
    }

    .vti-home-cta.vti-app-dev-cta .vti-home-cta__title {
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -1px;
        color: var(--vh-ink);
    }

    .vti-home-cta.vti-app-dev-cta .vti-home-cta__text {
        color: var(--vh-muted);
    }

    .vti-app-dev-cta .vti-home-cta__formcard {
        gap: 20px;
        padding: 40px 16px;
    }
}

/* Section: engineering */
.vti-app-dev-engineering {
    overflow: hidden; /* clips the glow and the track bleeding to the viewport edge */
    padding-block: 0 var(--vh-pad);
}

/* Preview `.stage`: blurred ellipse, drawn with a gradient instead of an SVG blur filter. */
.vti-app-dev-engineering__glow {
    position: absolute;
    top: 143px;
    left: calc(50% - 645px);
    width: 1326px;
    height: 1213px;
    background: radial-gradient(closest-side, rgba(194, 218, 255, .9), rgba(194, 218, 255, 0));
    pointer-events: none;
}

.vti-app-dev-engineering__inner {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

/* Head (Section head or the one printed from the options): left-aligned, lead
   across the full width. */
.vti-app-dev-engineering__inner > .vti-home__head .vti-home__title {
    max-width: none;
}

.vti-app-dev-engineering__inner > .vti-home__head > div,
.vti-app-dev-engineering__inner > .vti-home__head .vti-home__lead {
    align-self: stretch;
}

.vti-app-dev-engineering__slider {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Bleeds past the wrap to the viewport's right edge, like the preview. */
.vti-app-dev-engineering__viewport {
    overflow: hidden;
    margin-right: calc((100% - 100vw) / 2);
}

.vti-app-dev-engineering__track {
    display: flex;
    gap: 24px;
    /* Step = inactive card 440 + gap 24. */
    transform: translateX(calc(var(--vad-index, 0) * -464px));
    transition: transform .3s ease-in-out;
}

.vti-app-dev-engineering__slide {
    flex-shrink: 0;
    display: flex;
    gap: 20px;
    width: 440px;
    height: 540px;
    padding: 20px;
    border: 1px solid var(--vh-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
    opacity: .3;
    transition: opacity .3s ease-in-out;
}

.vti-app-dev-engineering__slide.is-active {
    width: 1074px;
    opacity: 1;
}

.vti-app-dev-engineering__media {
    position: relative;
    flex-shrink: 0;
    width: 400px;
    height: 500px;
    overflow: hidden;
    border-radius: 24px;
}

.vti-app-dev-engineering__slide.is-active .vti-app-dev-engineering__media {
    border-radius: 8px;
}

.vti-app-dev-engineering__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vti-app-dev-engineering__content {
    flex: 1;
    min-width: 0;
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
}

.vti-app-dev-engineering__slide.is-active .vti-app-dev-engineering__content {
    display: flex;
    animation: vti-app-dev-fade .3s ease-in-out;
}

@keyframes vti-app-dev-fade {
    from {
        opacity: 0;
    }
}

.vti-app-dev-engineering__slide-title {
    font-size: var(--vad-title-size, 30px);
    font-weight: 500;
    line-height: calc(36 / 30); /* unitless: keeps the Figma ratio when the editor sets a size */
    letter-spacing: -.25px;
    color: var(--vh-ink);
}

.vti-app-dev-engineering__slide-text {
    font-size: var(--vad-text-size, 20px);
    line-height: calc(28 / 20);
    color: var(--vh-muted);
}

.vti-app-dev-engineering__pagination {
    display: flex;
    align-items: center;
    gap: 64px;
}

.vti-app-dev-engineering__count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    color: var(--vh-muted);
    white-space: nowrap;
}

/* Own weight: the mobile label drops to 400, the number stays 500. */
.vti-app-dev-engineering__count-num {
    min-width: 25px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--vh-text);
}

.vti-app-dev-engineering__progress {
    flex: 1;
    height: 4px;
    overflow: hidden;
    border-radius: 24px;
    background: var(--vh-gray);
}

.vti-app-dev-engineering__progress-bar {
    display: block;
    height: 100%;
    background: #4984ed;
    transform: scaleX(var(--vad-progress, 0));
    transform-origin: left;
    transition: transform .3s ease-in-out;
}

.vti-app-dev-engineering__nav {
    display: flex;
    gap: 8px;
}

.vti-app-dev-engineering .vti-app-dev-engineering__nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--vh-gray);
    padding: 1px 6px;
    border-radius: 9999px;
    background: #fff;
    color: var(--vh-text);
    transition: border-color .1s linear;
}

.vti-app-dev-engineering .vti-app-dev-engineering__nav-btn:disabled {
    opacity: .5;
    background: #f9fafb;
    cursor: default;
}

@media (hover: hover) {
    .vti-app-dev-engineering .vti-app-dev-engineering__nav-btn:not(:disabled):hover {
        border-color: var(--vh-line-soft);
    }
}

.vti-app-dev-engineering__nav-icon {
    width: 20px;
    height: 20px;
    color: var(--vh-muted);
}

@media (prefers-reduced-motion: reduce) {
    .vti-app-dev-engineering__track,
    .vti-app-dev-engineering__slide,
    .vti-app-dev-engineering__progress-bar {
        transition: none;
    }

    .vti-app-dev-engineering__slide.is-active .vti-app-dev-engineering__content {
        animation: none;
    }
}

@media (max-width: 1099px) {
    .vti-app-dev-engineering__slide.is-active {
        width: min(1074px, 90vw);
    }

    .vti-app-dev-engineering__media {
        width: 40vw;
    }

    .vti-app-dev-engineering__content {
        padding: 16px;
    }

    .vti-app-dev-engineering__slide-title {
        font-size: var(--vad-title-size-md, 24px);
        line-height: calc(32 / 24);
    }

    .vti-app-dev-engineering__slide-text {
        font-size: var(--vad-text-size-md, 16px);
        line-height: calc(24 / 16);
    }
}

/* Mobile frame 2968:49509: left-aligned head, one full-width card per step, no glow
   and no progress bar. */
@media (max-width: 699px) {
    .vti-app-dev-engineering__glow,
    .vti-app-dev-engineering__progress {
        display: none;
    }

    .vti-app-dev-engineering__inner {
        gap: 40px;
    }

    /* Title → lead is 20px: the head's 16px gap + 4. */
    .vti-app-dev-engineering__inner > .vti-home__head .vti-home__lead {
        margin-top: 4px;
    }

    .vti-app-dev-engineering__slider {
        gap: 20px;
    }

    .vti-app-dev-engineering__viewport {
        margin-right: 0;
    }

    /* One full-width card per step: -100% is the track (= viewport) width. */
    .vti-app-dev-engineering__track {
        transform: translateX(calc(var(--vad-index, 0) * (-100% - 24px)));
    }

    /* 15px padding + 1px border = Figma's 16px inset. The preview's backdrop blur is
       dropped: the card moves with the track (see CODE-RULES, Hiệu suất). */
    .vti-app-dev-engineering__slide,
    .vti-app-dev-engineering__slide.is-active {
        flex-direction: column;
        gap: 24px;
        width: 100%;
        height: auto;
        padding: 15px;
        opacity: 1;
    }

    /* Photo-only cards are a desktop backdrop; the script skips hidden slides. */
    .vti-app-dev-engineering__slide--media-only {
        display: none;
    }

    .vti-app-dev-engineering__media,
    .vti-app-dev-engineering__slide.is-active .vti-app-dev-engineering__media {
        width: calc(100% - 8px);
        height: auto;
        aspect-ratio: 400 / 500;
        border-radius: 5.9px;
    }

    .vti-app-dev-engineering__content,
    .vti-app-dev-engineering__slide.is-active .vti-app-dev-engineering__content {
        display: flex;
        gap: 8px;
        padding: 0;
    }

    .vti-app-dev-engineering__slide-title {
        font-size: var(--vad-title-size-sm, 16px);
        line-height: calc(24 / 16);
        letter-spacing: 0;
    }

    .vti-app-dev-engineering__slide-text {
        font-size: var(--vad-text-size-sm, 14px);
        line-height: calc(20 / 14);
    }

    .vti-app-dev-engineering__pagination {
        justify-content: space-between;
        gap: 12px;
    }

    .vti-app-dev-engineering__count {
        font-weight: 400;
    }

    .vti-app-dev-engineering__count-num {
        font-size: 14px;
        line-height: 20px;
    }

    .vti-app-dev-engineering .vti-app-dev-engineering__nav-btn {
        width: 44px;
        height: 44px;
    }
}
