/* ============================================
   SCROLL-SYNCED TECH STACK VIDEO
   Homepage component — smooth drop-in icons
   ============================================ */

/*
 * FIX: overflow-x: hidden on html/body breaks position: sticky.
 * Using overflow-x: clip instead — same visual effect but doesn't
 * create a new scroll container, so sticky still works.
 */
html,
body {
    overflow-x: clip !important;
}

/* --- Main Section Container --- */
.ts-scroll-video {
    position: relative;
    height: 500vh;
    background: #000 !important;
    color-scheme: dark;
    color: #fff !important;
}

/* Lock all children to dark-mode colors regardless of site theme */
.ts-scroll-video,
.ts-scroll-video *,
.ts-scroll-video *::before,
.ts-scroll-video *::after {
    color-scheme: dark;
}

.ts-scroll-video .ts-sticky {
    background: #000 !important;
}

.ts-scroll-video .ts-header-title,
.ts-scroll-video .ts-header h2,
.ts-scroll-video h2.ts-header-title,
.ts-scroll-video .ts-header-title * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: none !important;
}

.ts-scroll-video .ts-header-title .gradient-text {
    background: linear-gradient(90deg, #cf5b2e, #22d3ee) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.ts-scroll-video .ts-header-label {
    color: #cf5b2e !important;
    background: rgba(207, 91, 46, 0.15) !important;
}

@media (max-width: 768px) {
    .ts-scroll-video {
        height: 350vh;
    }
}

/* --- Sticky Video Container --- */
.ts-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* --- Video Element --- */
.ts-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Gradient Edges (cinematic framing) --- */
.ts-sticky::before,
.ts-sticky::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 2;
    pointer-events: none;
}

.ts-sticky::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}

.ts-sticky::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

/* --- Section Header Overlay --- */
.ts-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.ts-header.visible {
    opacity: 1;
}

.ts-header-label {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: rgba(207, 91, 46, 0.15);
    border: 1px solid rgba(207, 91, 46, 0.3);
    border-radius: 100px;
    color: #cf5b2e;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.ts-header-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.ts-header-subtitle {
    margin-top: 0.75rem;
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.ts-header-title .gradient-text {
    background: linear-gradient(90deg, #cf5b2e, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Icon Overlay Layer --- */
.ts-overlay {
    position: absolute;
    top: 10%;
    bottom: 18%;
    left: 8%;
    right: 8%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

/* ============================================
   SMOOTH DROP-IN ICON ANIMATION
   Only uses opacity + transform (GPU-composited).
   No filter, no perspective, no blur.
   ============================================ */
.ts-icon {
    position: absolute;
    width: 68px;
    height: 68px;
    padding: 13px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 16px rgba(34, 211, 238, 0.15),
        0 0 32px rgba(207, 91, 46, 0.08);
    pointer-events: none;
    object-fit: contain;

    /* START STATE: above and scaled up, fully transparent */
    opacity: 0;
    transform: scale(1.8) translateY(-60px);
    transition:
        opacity 0.55s ease-out,
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* END STATE: settled in place */
.ts-icon.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Staggered drop-in delays for cascade effect */
.ts-icon:nth-child(1)  { transition-delay: 0s; }
.ts-icon:nth-child(2)  { transition-delay: 0.06s; }
.ts-icon:nth-child(3)  { transition-delay: 0.12s; }
.ts-icon:nth-child(4)  { transition-delay: 0.18s; }
.ts-icon:nth-child(5)  { transition-delay: 0.24s; }
.ts-icon:nth-child(6)  { transition-delay: 0.30s; }
.ts-icon:nth-child(7)  { transition-delay: 0.36s; }
.ts-icon:nth-child(8)  { transition-delay: 0.10s; }
.ts-icon:nth-child(9)  { transition-delay: 0.16s; }
.ts-icon:nth-child(10) { transition-delay: 0.22s; }

/* Offset float phases for variety */
.ts-icon:nth-child(2n) { animation-delay: -1.2s; }
.ts-icon:nth-child(3n) { animation-delay: -2.5s; }
.ts-icon:nth-child(5n) { animation-delay: -0.7s; }

/* OpenAI logo is white-on-transparent */
.ts-icon[alt="OpenAI"] {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.4);
}


/* Gentle float once settled */
@keyframes tsIconFloat {
    0%, 100% { transform: scale(1) translateY(0); }
    50%      { transform: scale(1) translateY(-6px); }
}

/* ============================================
   DESCRIPTION CARDS (glassmorphism)
   ============================================ */
.ts-desc {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    text-align: center;
    pointer-events: none;
    width: 90%;
    max-width: 520px;
}

.ts-desc-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    padding: 1.2rem 1.8rem;
    background: rgba(8, 8, 14, 0.6);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    visibility: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
}

.ts-desc-card.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    border-color: rgba(207, 91, 46, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(207, 91, 46, 0.06),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
}

.ts-desc-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #cf5b2e, #e8874a, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ts-desc-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 400;
}

/* Legacy label support (kept for fallback) */
.ts-label {
    display: none;
}

/* --- Scroll Progress Bar --- */
.ts-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #cf5b2e, #e8874a, #22d3ee);
    z-index: 5;
    transition: width 0.05s linear;
    border-radius: 2px;
    box-shadow:
        0 0 10px rgba(207, 91, 46, 0.4),
        0 0 20px rgba(34, 211, 238, 0.2);
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .ts-icon {
        width: 44px;
        height: 44px;
        padding: 8px;
    }

    .ts-header-title {
        font-size: 1.5rem;
    }

    .ts-header-subtitle {
        font-size: 0.8rem;
    }

    .ts-overlay {
        top: 12%;
        bottom: 25%;
        left: 5%;
        right: 5%;
    }

    /* Hide secondary icons on mobile to prevent stacking */
    .ts-icon[alt="Photoshop"],
    .ts-icon[alt="Squarespace"],
    .ts-icon[alt="Magento"],
    .ts-icon[alt="Google Ads"],
    .ts-icon[alt="Salesforce"],
    .ts-icon[alt="GitHub Copilot"] {
        display: none !important;
    }

    .ts-desc {
        bottom: 80px;
        max-width: 92%;
    }

    .ts-desc-card {
        padding: 0.75rem 1rem;
        border-radius: 14px;
    }

    .ts-desc-title {
        font-size: 0.65rem;
    }

    .ts-desc-body {
        font-size: 0.78rem;
    }

    .ts-sticky::before,
    .ts-sticky::after {
        height: 60px;
    }
}