/* «Webivan» v2 cases: a horizontal gallery driven by the scroll (sticky) on
   wide screens, a swipe strip with scroll-snap on phones. */
.wi-cases { --wi-edge: max(var(--gutter), calc((100vw - var(--wi-container)) / 2)); position: relative; }

.wi-cases__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; margin-bottom: 40px; }
.wi-cases__titles { display: grid; gap: 16px; max-width: 760px; }
.wi-cases__titles .wi-head__lead { margin: 0; }
.wi-cases__nav { display: flex; align-items: center; gap: 20px 28px; flex-wrap: wrap; }
.wi-cases__counter { font-family: var(--webivan-font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: #fff; white-space: nowrap; }
.wi-cases__bar { position: relative; display: block; width: 120px; height: 2px; overflow: hidden; border-radius: 2px; background: var(--wi-line-2); }
.wi-cases__bar i { position: absolute; inset: 0; background: var(--webivan-cobalt-2); transform: scaleX(0); transform-origin: left; }
.wi-cases__chips { margin: -16px 0 32px; }

/* The strip (phones, no script): native sideways scroll with snap. */
.wi-cases__view {
    margin-inline: calc(50% - 50vw);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--wi-edge);
    scrollbar-width: none;
}
.wi-cases__view::-webkit-scrollbar { display: none; }
.wi-cases__track {
    display: flex;
    gap: clamp(16px, 2vw, 32px);
    width: max-content;
    margin: 0;
    padding: 4px var(--wi-edge) 8px;
    list-style: none;
    will-change: transform;
}
.wi-case { flex: 0 0 auto; width: min(84vw, 860px, calc((100svh - 480px) * 1.6)); min-width: min(84vw, 480px); scroll-snap-align: start; }
.wi-case[hidden] { display: none; }

.wi-case__frame { box-shadow: 0 0 0 1px var(--webivan-line), 0 40px 80px -40px rgba(0, 0, 0, 0.8); transition: var(--wi-hover-tr); }
/* The long screenshot scrolls on hover by transform only (no object-position). */
.wi-case__screen { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--webivan-raise); container-type: inline-size; }
.wi-case__screen img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    object-position: 50% 0%;
    transition: transform 1.2s var(--wi-ease-io);
}

.wi-case__body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px 20px; padding: 22px 4px 0; }
.wi-case__num { padding-top: 6px; font-family: var(--webivan-font-display); font-size: 14px; color: var(--webivan-cobalt-2); }
.wi-body .wi-case__title { margin: 0; font-size: clamp(20px, 0.7vw + 15px, 26px); }
.wi-body .wi-case__title a { color: #fff; text-decoration: none; }
.wi-case__kind { margin: 6px 0 0; color: var(--webivan-mute); font-size: 15px; }
.wi-case__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.wi-case__chips li { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--webivan-line); color: var(--webivan-text); font-size: 13px; line-height: 1.3; }
.wi-case__go {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--wi-line-2);
    color: #fff !important;
    transition: var(--wi-hover-tr);
}
.wi-case__go:active { scale: var(--wi-hover-press); }
.wi-case__go svg { width: 20px; height: 20px; transition: transform var(--wi-hover-dur) var(--wi-hover-ease); }
.wi-body .wi-case__title a { transition: color var(--wi-hover-dur) var(--wi-hover-ease); }

.wi-case:has(:focus-visible) .wi-case__frame { translate: 0 var(--wi-hover-lift); box-shadow: 0 0 0 1px var(--webivan-cobalt-2), var(--wi-hover-shadow); }
.wi-case:has(:focus-visible) .wi-case__go { background: var(--webivan-cobalt-2); color: var(--webivan-night) !important; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
    .wi-case:hover .wi-case__frame { translate: 0 var(--wi-hover-lift); box-shadow: 0 0 0 1px var(--wi-hover-border), var(--wi-hover-shadow); }
    .wi-case:hover .wi-case__screen img { transform: translateY(calc(-100% + 62.5cqw)); transition-duration: 8s; }
    .wi-case:hover .wi-case__go { background: var(--webivan-cobalt-2); color: var(--webivan-night) !important; box-shadow: none; }
    .wi-case:hover .wi-case__go svg { transform: translate(var(--wi-hover-nudge-d), calc(-1 * var(--wi-hover-nudge-d))); }
    .wi-body .wi-case:hover .wi-case__title a { color: var(--webivan-cobalt-2); }
}
@media (prefers-reduced-motion: reduce) { .wi-case .wi-case__screen img { transform: none !important; } }

/* Pinned: the section stays, the page scroll moves the track (webivan.js). */
.wi-cases.is-pinned { height: var(--wi-hs-h, auto); }
.wi-cases.is-pinned .wi-cases__pin {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100svh;
    padding-top: calc(var(--wi-hdr-h) + 8px);
}
.wi-cases.is-pinned .wi-cases__head { margin-bottom: 28px; }
.wi-cases.is-pinned .wi-cases__view { overflow: hidden; scroll-snap-type: none; }

@media (max-width: 47.99rem) {
    .wi-cases__head { margin-bottom: 28px; }
    .wi-cases__bar { width: 72px; }
    .wi-case { width: 86vw; min-width: 0; }
    .wi-case__body { grid-template-columns: minmax(0, 1fr) auto; padding-top: 16px; }
    .wi-case__num { display: none; }
    .wi-case__go { width: 44px; height: 44px; }
}
