/* ==============================================
   Gufi Marketplace Teaser - The Hidden Architecture
   "A new system is being assembled behind the veil"
   Premium white aesthetic - Apple Vision Pro meets Gufi
   ============================================== */

/* Modal overlay container */
.marketplace-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.marketplace-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.marketplace-modal-close {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 10000;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.marketplace-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.marketplace-modal-close:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .marketplace-modal-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* Main container - The assembly chamber */
.marketplace-teaser {
    position: relative;
    min-height: 25vh;
    width: 100%;
    overflow: hidden;
    scroll-margin-top: 72px;

    /* Pure, luminous background */
    background: linear-gradient(180deg,
        #FAFAFA 0%,
        #F8F8F8 50%,
        #FAFAFA 100%
    );

    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    opacity: 1;
}

/* Animated video background - beneath all blur layers */
.marketplace-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: -1;
    opacity: 0.15;
    filter: blur(80px);
}

/* Background container */
.teaser-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ==============================================
   Hidden Module Grid - The architecture behind
   ============================================== */

.module-layer {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 20px;
    padding: 30px;
    opacity: 0.12;
    filter: blur(25px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Individual modules - like Gufi blocks being assembled */
.floating-module {
    position: relative;
    background: linear-gradient(135deg,
        rgba(124, 58, 237, 0.2) 0%,
        rgba(139, 92, 246, 0.15) 50%,
        rgba(167, 139, 250, 0.1) 100%
    );
    border: 2px solid rgba(124, 58, 237, 0.2);
    border-radius: 20px;
    box-shadow:
        0 12px 32px rgba(124, 58, 237, 0.18),
        0 0 40px rgba(124, 58, 237, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.6);

    /* Subtle breathing animation - like modules settling into place */
    animation: moduleSettle 20s ease-in-out infinite;
    will-change: transform, opacity;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Different grid positions for modules */
.module-1 { grid-column: 1 / 3; grid-row: 1 / 2; animation-delay: 0s; }
.module-2 { grid-column: 3 / 5; grid-row: 1 / 2; animation-delay: -3s; }
.module-3 { grid-column: 5 / 7; grid-row: 1 / 2; animation-delay: -6s; }
.module-4 { grid-column: 1 / 2; grid-row: 2 / 4; animation-delay: -9s; }
.module-5 { grid-column: 2 / 4; grid-row: 2 / 3; animation-delay: -12s; }
.module-6 { grid-column: 4 / 6; grid-row: 2 / 4; animation-delay: -15s; }
.module-7 { grid-column: 6 / 7; grid-row: 2 / 4; animation-delay: -18s; }
.module-8 { grid-column: 1 / 4; grid-row: 4 / 5; animation-delay: -21s; }

@keyframes moduleSettle {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.15;
    }
    25% {
        transform: translate(1px, -2px);
        opacity: 0.18;
    }
    50% {
        transform: translate(-1px, 1px);
        opacity: 0.12;
    }
    75% {
        transform: translate(2px, 1px);
        opacity: 0.16;
    }
}

/* ==============================================
   Connection Lines - Neural grid
   ============================================== */

.connection-layer {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    filter: blur(1px);
}

.connection-svg {
    width: 100%;
    height: 100%;
}

.connection-line {
    stroke: rgba(124, 58, 237, 0.2);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 8, 12;
    animation: connectionFlow 12s ease-in-out infinite;
}

.connection-line:nth-child(2) { animation-delay: -3s; }
.connection-line:nth-child(3) { animation-delay: -6s; }
.connection-line:nth-child(4) { animation-delay: -9s; }

@keyframes connectionFlow {
    0%, 100% {
        opacity: 0.3;
        stroke-dashoffset: 0;
    }
    50% {
        opacity: 0.6;
        stroke-dashoffset: 20;
    }
}

/* ==============================================
   Energy Waves - Gentle breathing
   ============================================== */

.energy-waves {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.03) 0%, transparent 60%);
    animation: breathe 10s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.8;
    }
}

/* ==============================================
   Premium White Glassmorphism - The veil
   ============================================== */

.glass-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(100px) saturate(150%);
    -webkit-backdrop-filter: blur(100px) saturate(150%);
    z-index: 0;
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);

    /* Remove visible backgrounds and shadows to eliminate rectangle */
    background-image: none;
    box-shadow: none;
}

/* ==============================================
   Content Layer - The message
   ============================================== */

.teaser-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.teaser-text {
    opacity: 0;
    animation: contentEmerge 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.8s;
    position: relative;
}

/* Premium backdrop blur directly behind text */
.teaser-text::before {
    content: '';
    position: absolute;
    inset: -60px -80px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(80px) saturate(140%);
    -webkit-backdrop-filter: blur(80px) saturate(140%);
    border-radius: 40px;
    z-index: -1;
    opacity: 0.8;
    box-shadow:
        0 20px 60px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@keyframes contentEmerge {
    from {
        opacity: 0;
        transform: scale(0.96);
        filter: blur(20px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
}

/* ==============================================
   Main Title - Premium keynote style
   ============================================== */

.teaser-title {
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 8px;
    color: #1a1a1a;
    letter-spacing: -0.04em;

    /* Subtle white glow */
    text-shadow:
        0 0 40px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(124, 58, 237, 0.06);

    /* Breathing glow effect */
    animation: whiteGlow 8s ease-in-out infinite;
}

/* Gufi highlight in marketplace title - same style as hero */
.teaser-title .gufi-highlight {
    position: relative;
    display: inline-block;
    font-weight: 700;
    color: #5e18ea;
    background: linear-gradient(135deg, #5e18ea 0%, #7C3AED 50%, #A78BFA 100%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: shimmerText 3s ease-in-out infinite;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(94, 24, 234, 0.3));
}

.teaser-title .gufi-highlight:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 20px rgba(94, 24, 234, 0.6));
}

/* Elegant animated underline for Gufi */
.teaser-title .gufi-highlight::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #5e18ea, #7C3AED, #5e18ea);
    background-size: 200% 100%;
    border-radius: 2px;
    opacity: 0;
    box-shadow: none;
    animation: elegantUnderline 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.5s,
               underlineShimmer 2s ease-in-out infinite 2.7s,
               underlineGlow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.5s;
    pointer-events: none;
}

@keyframes shimmerText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes elegantUnderline {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

@keyframes underlineShimmer {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 200% 0%;
    }
}

@keyframes underlineGlow {
    from {
        box-shadow: none;
    }
    to {
        box-shadow: 0 2px 12px rgba(94, 24, 234, 0.5), 0 0 20px rgba(94, 24, 234, 0.3);
    }
}

@keyframes whiteGlow {
    0%, 100% {
        text-shadow:
            0 0 40px rgba(255, 255, 255, 0.8),
            0 2px 8px rgba(0, 0, 0, 0.08),
            0 8px 24px rgba(124, 58, 237, 0.06);
    }
    50% {
        text-shadow:
            0 0 60px rgba(255, 255, 255, 1),
            0 2px 8px rgba(0, 0, 0, 0.08),
            0 8px 32px rgba(124, 58, 237, 0.1);
    }
}

/* ==============================================
   Subtitle - Fine and elegant
   ============================================== */

.teaser-subtitle {
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 400;
    color: #666666;
    letter-spacing: 0.02em;
    line-height: 1.6;
    opacity: 0;
    animation: subtitleFade 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.5s;

    /* Subtle shadow for depth */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@keyframes subtitleFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   Ambient Glow - Soft light presence
   ============================================== */

.ambient-glow {
    position: absolute;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 400px;
    background: radial-gradient(ellipse at center,
        rgba(167, 139, 250, 0.12) 0%,
        rgba(124, 58, 237, 0.08) 40%,
        transparent 70%
    );
    z-index: 0;
    filter: blur(100px);
    animation: ambientBreath 12s ease-in-out infinite;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ambientBreath {
    0%, 100% {
        opacity: 0.4;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1.05);
    }
}

/* ==============================================
   Mouse Interaction - Premium Interactive Blur
   ============================================== */

.marketplace-teaser:hover .glass-overlay {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(120px) saturate(160%);
    -webkit-backdrop-filter: blur(120px) saturate(160%);
}

.marketplace-teaser:hover .module-layer {
    opacity: 0.35;
    filter: blur(12px);
}

/* Modules light up on hover - mysterious glow */
.floating-module:hover {
    background: linear-gradient(135deg,
        rgba(124, 58, 237, 0.45) 0%,
        rgba(139, 92, 246, 0.35) 50%,
        rgba(167, 139, 250, 0.25) 100%
    );
    border: 2px solid rgba(124, 58, 237, 0.5);
    box-shadow:
        0 20px 60px rgba(124, 58, 237, 0.4),
        0 0 100px rgba(124, 58, 237, 0.35),
        0 0 150px rgba(124, 58, 237, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
    filter: blur(3px);
    z-index: 10;
}

/* Energy waves intensify on hover */
.marketplace-teaser:hover .energy-waves {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
}

/* Ambient glow pulses on hover */
.marketplace-teaser:hover .ambient-glow {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
    filter: blur(100px);
}

/* ==============================================
   Responsive Design
   ============================================== */

@media (max-width: 1024px) {
    .module-layer {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 40px;
    }

    .module-4 { grid-column: 1 / 3; grid-row: 2 / 3; }
    .module-6 { grid-column: 3 / 5; grid-row: 2 / 3; }
    .module-7 { grid-column: 1 / 3; grid-row: 3 / 4; }
    .module-8 { grid-column: 3 / 5; grid-row: 3 / 4; }
}

@media (max-width: 768px) {
    .marketplace-teaser {
        min-height: 50vh;
    }

    .module-layer {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 30px;
        opacity: 0.12;
        filter: blur(10px);
    }

    .teaser-content {
        display: block !important;
        visibility: visible !important;
    }

    .teaser-text {
        opacity: 1 !important;
        animation: none !important;
        display: block !important;
        visibility: visible !important;
    }

    .teaser-text::before {
        display: block !important;
        opacity: 0.9 !important;
        inset: -40px -40px !important;
        border-radius: 32px !important;
    }

    .teaser-title {
        font-size: clamp(32px, 8vw, 56px);
        margin-bottom: 24px;
        opacity: 1 !important;
    }

    .teaser-subtitle {
        font-size: clamp(14px, 3.5vw, 20px);
        opacity: 1 !important;
        animation: none !important;
    }

    .ambient-glow {
        width: 90%;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .module-layer {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 20px;
    }

    .connection-layer {
        display: none;
    }

    .teaser-title {
        font-size: clamp(28px, 9vw, 42px);
    }

    .teaser-content {
        padding: 40px 24px;
    }
}

/* ==============================================
   Premium details - Micro interactions
   ============================================== */

/* Subtle shimmer on title */
@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* Shimmer effect removed to eliminate visible rectangle */
