/* ============================
   SECTION 4 – USE CASES: Pinned Scroll
   ============================ */

/* ── Outer wrapper: provides scroll height for GSAP pin ── */
.usecases-wrap {
    position: relative;
    height: 400vh;
    /* Light blue base fallback while images load */
    background: #e8f0fe;
    color: var(--text);
    overflow: clip;
    /* clip sticky elements at section boundary — unlike 'hidden', doesn't break sticky */
}

/* ── Scroll-synced video canvas background ── */
.uc-video-canvas {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin-bottom: -100vh;
    /* collapse — don't push content down */
    z-index: 0;
    display: block;
    pointer-events: none;
}

/* Semi-transparent overlay for text readability */
.uc-bg-overlay {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    margin-bottom: -100vh;
    /* collapse — don't push content down */
    z-index: 1;
    background: rgba(240, 245, 255, 0.65);
    pointer-events: none;
}

/* ── Pinned viewport container (sticky — no GSAP pin needed) ── */
.usecases-pinned {
    position: sticky;
    top: 0;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    /* clip overflowing block content inside the pinned panel */
}

.usecases-inner {
    max-width: 85vw;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    align-items: stretch;
    height: 100%;
}

/* ── LEFT PANEL ── */
.uc-left {
    flex: 0 0 38%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 48px;
    position: relative;
}

/* Entry animation: start hidden in CSS to prevent flash before JS inits */
.uc-left .eyebrow,
.uc-left .section-h2,
.uc-left .section-sub,
.uc-left .uc-progress {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .65s cubic-bezier(.22, 1, .36, 1),
        transform .65s cubic-bezier(.22, 1, .36, 1);
}

.uc-left .eyebrow {
    color: var(--accent);
}

.uc-left .section-h2 {
    color: #0f1118;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin-bottom: 12px;
}

.uc-left .section-sub {
    color: #2a2d3a;
    font-size: .95rem;
    margin-bottom: 48px;
}

/* ── Progress Tracker ── */
.uc-progress {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 24px;
}

.uc-progress-line {
    position: absolute;
    left: 6px;
    /* JS will set top/bottom to exact dot centers */
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(26, 29, 43, .1);
    border-radius: 2px;
    z-index: 0;
}

.uc-progress-fill {
    position: absolute;
    left: 6px;
    top: 0;
    width: 2px;
    height: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: height .6s var(--ease);
    box-shadow: 0 0 12px rgba(79, 110, 247, .25);
    z-index: 1;
}

.uc-progress-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    position: relative;
    cursor: default;
}

.uc-progress-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #c8cfde;
    border: 3px solid #d6e2f8;
    box-sizing: border-box;
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    transition: all .4s var(--ease);
    z-index: 3;
}

.uc-progress-item.active .uc-progress-dot {
    background: var(--accent);
    border-color: #e8eeff;
    box-shadow: 0 0 16px rgba(79, 110, 247, .4);
    transform: translateY(-50%) scale(1.3);
}

.uc-progress-item.done .uc-progress-dot {
    background: var(--accent);
    border-color: #d6e2f8;
    opacity: .5;
}

.uc-progress-label {
    font-size: .85rem;
    font-weight: 500;
    color: #7a8090;
    transition: all .4s var(--ease);
    letter-spacing: .03em;
}

.uc-progress-item.active .uc-progress-label {
    color: #4a5060;
    font-weight: 600;
}

.uc-progress-item.done .uc-progress-label {
    color: #8a8f9a;
}

/* ── RIGHT PANEL ── */
.uc-right {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Start hidden — revealed via .uc-right-entered class */
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    transition: opacity .7s cubic-bezier(.22, 1, .36, 1),
        transform .7s cubic-bezier(.22, 1, .36, 1),
        visibility 0s linear 0s;
}

.uc-right.uc-right-entered {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ── Individual Use Case Block ── */
/* GSAP .set() is the SOLE controller of opacity, visibility, y, pointerEvents. */
.uc-block {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
    /* Initial state — GSAP overrides these immediately */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Block Header ── */
.uc-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px 5px 5px;
    border-radius: var(--radius-full);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 16px;
    width: fit-content;
}

.uc-tag-personal {
    background: rgba(79, 110, 247, .06);
    color: #3b52c4;
    border: 1px solid rgba(79, 110, 247, .1);
}

.uc-tag-business {
    background: rgba(34, 197, 94, .06);
    color: #0f8a3e;
    border: 1px solid rgba(34, 197, 94, .1);
}

.uc-tag-companion {
    background: rgba(244, 114, 182, .06);
    color: #b91c5e;
    border: 1px solid rgba(244, 114, 182, .1);
}

.uc-tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.uc-tag-icon svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

/* Color-specific icon backgrounds with glow */
.uc-tag-personal .uc-tag-icon {
    background: rgba(79, 110, 247, .15);
    box-shadow: 0 0 12px rgba(79, 110, 247, .25),
        0 0 4px rgba(79, 110, 247, .15);
}

.uc-tag-business .uc-tag-icon {
    background: rgba(34, 197, 94, .15);
    box-shadow: 0 0 12px rgba(34, 197, 94, .25),
        0 0 4px rgba(34, 197, 94, .15);
}

.uc-tag-companion .uc-tag-icon {
    background: rgba(244, 114, 182, .2);
    box-shadow: 0 0 12px rgba(244, 114, 182, .3),
        0 0 4px rgba(244, 114, 182, .15);
}

.uc-h3 {
    font-size: clamp(1.4rem, 2.8vw, 2rem);
    font-weight: 700;
    color: #0f1118;
    margin-bottom: 12px;
    line-height: 1.2;
}

.uc-desc {
    font-size: .9rem;
    color: #1e2130;
    line-height: 1.7;
    margin-bottom: 28px;
}

/* ── Feature Pills — left-aligned organic cloud ── */
.uc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    max-width: 520px;
}

.uc-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(26, 29, 43, .08);
    border-radius: var(--radius-full);
    font-size: .78rem;
    line-height: 1;
    color: #1a1d2b;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    white-space: nowrap;
    /* Start hidden — opacity+scale only, NO filter (breaks backdrop-filter) */
    opacity: 0;
    scale: .85;
    transition: opacity .4s cubic-bezier(.22, 1, .36, 1),
        scale .45s cubic-bezier(.34, 1.56, .64, 1),
        background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}

.uc-pill.pill-visible {
    opacity: 1;
    scale: 1;
}

.uc-pill:hover {
    background: rgba(255, 255, 255, .75);
    border-color: rgba(26, 29, 43, .12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.uc-pill-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.uc-pill-icon svg {
    width: 16px;
    height: 16px;
}

.uc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--accent);
    transition: gap .3s var(--ease);
    margin-top: 8px;
}

.uc-link:hover {
    gap: 12px;
}

/* ── Block Layout: Text + Visual side by side ── */
.uc-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.uc-text-side {
    display: flex;
    flex-direction: column;
}

.uc-visual-side {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ════════════════════════════════════
   BLOCK 1: Personal – Phone Mockup
   ════════════════════════════════════ */
.uc-phone {
    width: 220px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(60px) saturate(2);
    -webkit-backdrop-filter: blur(60px) saturate(2);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, .65);
    overflow: hidden;
    box-shadow:
        0 0 0 .5px rgba(255, 255, 255, .6),
        0 20px 60px rgba(0, 0, 0, .08),
        0 4px 16px rgba(0, 0, 0, .04),
        inset 0 1px 0 rgba(255, 255, 255, .8);
    position: relative;
}

.uc-phone-notch {
    width: 80px;
    height: 20px;
    background: #f0f2f8;
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
}

.uc-phone-header {
    padding: 10px 16px;
    font-size: .7rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 1px solid rgba(26, 29, 43, .06);
    display: flex;
    align-items: center;
    gap: 6px;
}

.uc-phone-header::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
}

.uc-phone-msgs {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.uc-phone-msgs .msg {
    font-size: .72rem;
    padding: 8px 12px;
    max-width: 90%;
}

.uc-phone-msgs .msg-bot {
    background: rgba(0, 0, 0, .04);
    color: var(--text);
}

/* ════════════════════════════════════
   BLOCK 2: Business – Dashboard Mockup
   ════════════════════════════════════ */
.uc-dashboard {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(60px) saturate(2);
    -webkit-backdrop-filter: blur(60px) saturate(2);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 0 .5px rgba(255, 255, 255, .6),
        0 20px 60px rgba(0, 0, 0, .08),
        0 4px 16px rgba(0, 0, 0, .04),
        inset 0 1px 0 rgba(255, 255, 255, .8);
}

.uc-dash-topbar {
    padding: 10px 16px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid rgba(26, 29, 43, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.uc-dash-topbar span[style] {
    color: var(--text-muted) !important;
}

.uc-dash-tasks {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uc-dash-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, .02);
    border-radius: var(--radius-sm);
    font-size: .72rem;
    color: var(--text-muted);
    border: 1px solid rgba(26, 29, 43, .06);
}

.uc-task-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.uc-task-dot.urgent {
    background: var(--orange);
}

.uc-task-dot.done {
    background: var(--green);
}

.uc-task-dot.warning {
    background: var(--red);
}

.uc-task-name {
    flex: 1;
    color: var(--text);
}

.uc-task-badge {
    font-size: .62rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.uc-task-badge.badge-awaiting {
    background: rgba(245, 158, 11, .1);
    color: #c07c08;
}

.uc-task-badge.badge-done {
    background: rgba(34, 197, 94, .1);
    color: #0f8a3e;
}

.uc-task-badge.badge-low {
    background: rgba(239, 68, 68, .1);
    color: #c73232;
}

/* Role Switcher */
.uc-role-switch {
    display: flex;
    background: rgba(0, 0, 0, .03);
    border: 1px solid rgba(26, 29, 43, .08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 12px;
}

.uc-role-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: .72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: all .3s var(--ease);
    border: none;
    background: none;
    font-family: var(--ff);
}

.uc-role-btn.active {
    background: rgba(34, 197, 94, .1);
    color: #0f8a3e;
    font-weight: 600;
}

.uc-dash-msg {
    margin: 0 12px 12px;
    padding: 10px 14px;
    background: rgba(34, 197, 94, .06);
    border: 1px solid rgba(34, 197, 94, .12);
    border-radius: var(--radius-md);
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.uc-dash-msg .msg-label {
    font-weight: 600;
    color: #0f8a3e;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    display: block;
    margin-bottom: 4px;
}

/* ════════════════════════════════════
   BLOCK 3: Companion – Warm Chat
   ════════════════════════════════════ */
.uc-companion-chat {
    width: 100%;
    max-width: 340px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(60px) saturate(2);
    -webkit-backdrop-filter: blur(60px) saturate(2);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow:
        0 0 0 .5px rgba(255, 255, 255, .6),
        0 20px 60px rgba(0, 0, 0, .06),
        0 0 60px rgba(244, 114, 182, .04),
        inset 0 1px 0 rgba(255, 255, 255, .8);
    position: relative;
    z-index: 1;
}

.uc-companion-chat::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(244, 114, 182, .12), rgba(79, 110, 247, .12));
    z-index: -1;
    opacity: 0;
    animation: warmGlow 3s ease-in-out infinite;
}

@keyframes warmGlow {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.uc-companion-chat .msg {
    font-size: .78rem;
    max-width: 90%;
}

.uc-companion-chat .msg-bot {
    background: rgba(244, 114, 182, .08);
    color: var(--text);
}

.uc-companion-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 114, 182, .1) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    animation: companionPulse 4s ease-in-out infinite;
}

@keyframes companionPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: .5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: .8;
    }
}

/* ════════════════════════════════════
   MOBILE – Stacked layout (no pin)
   ════════════════════════════════════ */
@media (max-width: 900px) {
    .usecases-wrap {
        height: auto !important;
    }

    .uc-video-canvas,
    .uc-bg-overlay {
        display: none;
    }

    .usecases-pinned {
        height: auto !important;
        position: relative !important;
        /* override GSAP pin */
        flex-direction: column;
    }

    .usecases-inner {
        flex-direction: column;
        padding: var(--section-pad) 24px;
        max-width: 100%;
    }

    .uc-left {
        flex: none;
        padding-right: 0;
        padding-bottom: 40px;
    }

    /* Reset entry animation on mobile — show everything immediately */
    .uc-left .eyebrow,
    .uc-left .section-h2,
    .uc-left .section-sub,
    .uc-left .uc-progress {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .uc-left .section-sub {
        max-width: 100%;
        margin-bottom: 32px;
    }

    .uc-progress {
        flex-direction: row;
        padding-left: 0;
        gap: 24px;
    }

    .uc-progress-line,
    .uc-progress-fill {
        display: none;
    }

    .uc-progress-dot {
        position: static;
    }

    .uc-progress-item {
        padding: 8px 0;
    }

    .uc-right {
        flex: none;
        overflow: visible;
        /* Reset entry animation on mobile */
        clip-path: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none;
    }

    .uc-block {
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        margin-bottom: 60px;
    }

    .uc-block:last-child {
        margin-bottom: 0;
    }

    .uc-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .uc-phone {
        width: 200px;
        margin: 0 auto;
    }

    .uc-dashboard {
        max-width: 100%;
    }

    .uc-companion-chat {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .uc-pills {
        gap: 6px;
    }

    .uc-pill {
        padding: 6px 12px;
        font-size: .72rem;
    }
}