/* ============================================
   Welcome Video — cursor-following landscape bubble
   Click-to-start · click-through (scrollable) · fades
   Prefixed .wv-  ·  uses cardboard.css tokens
   ============================================ */

/* CTA button next to "get started" */
.lp-welcome-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lp-welcome-video-btn svg {
    flex-shrink: 0;
}

/* Root layer — non-blocking so the page stays scrollable while watching */
.wv-root {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.wv-root[data-state="visible"] {
    opacity: 1;
}

/* Small landscape bubble that follows the cursor (click-through) */
.wv-bubble {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--cb-border-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    will-change: transform;
}
/* mobile only (class added by JS on coarse pointers): smooth the docked bubble's
   slide when it lifts to make room for the email pill */
.wv-bubble.wv-anim {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.wv-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.wv-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
}
.wv-progress-bar {
    height: 100%;
    width: 0;
    background: var(--cb-accent-yield);
    transition: width 0.15s linear;
}

/* Fixed control puck — the only interactive part (bubble stays click-through) */
.wv-puck {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 100px;
    background: var(--cb-bg-elevated);
    border: 1px solid var(--cb-border-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
.wv-root[data-state="visible"] .wv-puck {
    pointer-events: auto;
}
.wv-puck-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--cb-text-secondary);
    cursor: pointer;
    transition: color var(--cb-duration-fast) ease, background var(--cb-duration-fast) ease;
}
.wv-puck-btn:hover {
    color: var(--cb-text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.wv-puck-btn svg {
    width: 18px;
    height: 18px;
}
/* icon toggle: main by default, alt when .is-alt */
.wv-puck-btn .wv-ic-alt { display: none; }
.wv-puck-btn.is-alt .wv-ic-main { display: none; }
.wv-puck-btn.is-alt .wv-ic-alt { display: block; }

/* Email CTA — revealed in the puck when the VO says "email us at the link below".
   Collapsed (zero width, faded) until .is-shown is added by welcome-video.js.
   Reveal: smooth spring expand + scale pop, then a gentle attention glow. */
.wv-puck-email {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    padding: 0;
    margin: 0;
    height: 36px;
    border-radius: 100px;
    background: var(--cb-accent-yield);
    color: #000;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1px;
    text-decoration: none;
    pointer-events: none;
    transform: scale(0.82);
    transform-origin: right center;
    transition:
        max-width 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        margin 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease,
        transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); /* slight overshoot = pop */
}
.wv-puck-email svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}
.wv-puck-email.is-shown {
    max-width: 300px;
    opacity: 1;
    padding: 0 16px;
    margin-right: 4px;
    transform: scale(1);
    pointer-events: auto;
    /* gentle pulsing glow so it draws the eye without being noisy */
    animation: wvEmailGlow 2.6s ease-in-out 0.55s infinite;
}
.wv-puck-email:hover {
    filter: brightness(1.08);
    transform: scale(1.04);
}

@keyframes wvEmailGlow {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(79, 195, 247, 0);
    }
    50% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 0 0 5px rgba(79, 195, 247, 0.22);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wv-puck-email { transition: opacity 0.3s ease; transform: none; }
    .wv-puck-email.is-shown { transform: none; animation: none; }
}

@media (max-width: 768px) {
    .wv-bubble {
        width: 180px;
    }
    .wv-puck {
        right: 14px;
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wv-root {
        transition: none;
    }
}
