/* ============================================
   NEBULA SECTIONS - Cosmic Background Theme
   v2.1 - Seamless Star Transition + Vibrant Nebula
   ============================================ */

/* --- NEBULA SECTION BASE --- */
.nebula-section {
    position: relative;
    overflow: hidden;
    padding: 0;
    /* Match hero background exactly */
    background-color: #050508;
    /* Allow hero canvas to show through */
    z-index: 0;
}

/* Nebula Background - Static, Vibrant, High Quality Feel */
.nebula-bg {
    position: absolute;
    inset: 0;
    z-index: 0;

    background-image:
        /* Top Fade to Black */
        linear-gradient(to bottom,
            #050508 0%,
            rgba(5, 5, 8, 0.8) 15%,
            transparent 100%),
        /* Bottom Fade - Match products section start */
        linear-gradient(to top,
            #0a0a12 0%,
            rgba(10, 10, 18, 0.95) 8%,
            rgba(10, 10, 18, 0.7) 20%,
            transparent 50%),
        /* The Nebula Image */
        url('../images/Nebula/pillarsof-creation-4k.webp');

    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #050508;
}

.nebula-section .container {
    position: relative;
    z-index: 5;
}

/* ============================================
   SERVICES SECTION (Combined with Future Header)
   ============================================ */

.services-section {
    padding: var(--spacing-xxl) 0;
    padding-top: 100px;
    padding-bottom: 250px;
    /* Extended bottom padding */
}

/* Services Intro - Simple Header */
.services-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
}

.section-tag-cosmic {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    margin-bottom: var(--spacing-md);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.services-intro h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #fff;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
    font-weight: 700;
}

.text-glow {
    background: linear-gradient(135deg, #a78bfa 0%, #2dd4bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.services-intro p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* ============================================
   COMPACT SERVICE CARDS
   ============================================ */

/* ============================================
   HOLOGRAPHIC CONSTELLATION CARDS (Refined)
   ============================================ */

.services-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: var(--spacing-xl);
}

.service-card-compact {
    /* -- Default Card Color (Deep Teal/Cyan) -- */
    --card-color: 45, 212, 191;
    /* RGB values for rgba usage */
    --card-hex: #2dd4bf;
    /* Hex for solid usage */

    /* Transparent Background - HUD Style */
    background: rgba(5, 5, 8, 0.05);
    /* Transparency for holographic feel */
    border: none;
    padding: var(--spacing-lg);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    border-left: 1px solid rgba(var(--card-color), 0.1);

    /* Performance Optimization - GPU Layer */
    will-change: transform;
    transform: translateZ(0);
    backdrop-filter: blur(4px);
    /* Light blur for HUD feel */
}

/* --- Color Variations (Matching Constellations) --- */
/* Web -> #3b82f6 (Bright Blue) */
.service-card-compact.color-web {
    --card-color: 59, 130, 246;
    --card-hex: #3b82f6;
}

/* Mobile -> #d946ef (Magenta) */
.service-card-compact.color-mobile {
    --card-color: 217, 70, 239;
    --card-hex: #d946ef;
}

/* Ecom -> #f472b6 (Pink) */
.service-card-compact.color-ecom {
    --card-color: 244, 114, 182;
    --card-hex: #f472b6;
}

/* AI -> #10b981 (Emerald) */
.service-card-compact.color-ai {
    --card-color: 16, 185, 129;
    --card-hex: #10b981;
}

/* Cloud -> #06b6d4 (Cyan) */
.service-card-compact.color-cloud {
    --card-color: 6, 182, 212;
    --card-hex: #06b6d4;
}

/* IoT -> #f59e0b (Amber/Orange) */
.service-card-compact.color-iot {
    --card-color: 245, 158, 11;
    --card-hex: #f59e0b;
}


/* Tech/HUD Corners using pseudo-elements (OPTIMIZED) */
.service-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Full width but scaled down */
    height: 1px;
    background: var(--card-hex);
    opacity: 0.3;

    /* Animation Setup */
    transform-origin: left;
    transform: scaleX(0.05);
    /* Start at 5% width */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.service-card-compact::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 1px;
    height: 100%;
    /* Full height but scaled down */
    background: var(--card-hex);
    opacity: 0.3;

    /* Animation Setup */
    transform-origin: bottom;
    transform: scaleY(0.05);
    /* Start at 5% height */
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

/* Hover Effects: Lines extend smoothly */
.service-card-compact:hover::before {
    transform: scaleX(0.25);
    /* Expand to 25% */
    opacity: 1;
    box-shadow: 0 0 15px rgba(var(--card-color), 0.8);
}

.service-card-compact:hover::after {
    transform: scaleY(1);
    /* Expand to full height */
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(var(--card-color), 0.8);
}

.service-card-compact:hover {
    background: linear-gradient(90deg,
            rgba(var(--card-color), 0.05) 0%,
            transparent 100%);
    transform: translateX(5px);
    border-left-color: rgba(var(--card-color), 0.5);
}

/* Icon Container */
.card-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-hex);

    background: rgba(5, 5, 8, 0.6);
    border: 1px solid rgba(var(--card-color), 0.3);

    clip-path: polygon(10% 0, 100% 0,
            100% 90%, 90% 100%,
            0 100%, 0 10%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

/* Scanline effect inside the icon (Slightly slower for less 'laggy' feel) */
.card-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            transparent,
            rgba(var(--card-color), 0.2),
            transparent);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.service-card-compact:hover .card-icon {
    border-color: var(--card-hex);
    box-shadow: 0 0 25px rgba(var(--card-color), 0.4);
    transform: scale(1.1);
    color: #fff;
    background: rgba(var(--card-color), 0.1);
}

.service-card-compact:hover .card-icon::after {
    transform: rotate(45deg) translateY(100%);
}

.card-info {
    flex: 1;
}

.card-info h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Small tech accent next to title */
.card-info h3::before {
    content: '>>';
    font-size: 0.8rem;
    color: var(--card-hex);
    opacity: 0;
    transform: translateX(-10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.service-card-compact:hover .card-info h3::before {
    opacity: 1;
    transform: translateX(0);
}

.card-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin: 0;
    font-family: 'Inter', sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    width: 100%;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.service-card-compact:hover .card-info p {
    color: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(var(--card-color), 0.4);
}

/* ============================================
   PRODUCTS SECTION - HOLOGRAPHIC GLASS CARDS
   ============================================ */

.products-section {
    position: relative;
    padding-bottom: 150px;
    z-index: 2;
    /* 
       Dynamic gradient: Purple-black → Deep blue
       Matches nebula end and flows to terminal
    */
    background: linear-gradient(180deg,
            #0a0a12 0%,
            #0b0b14 15%,
            #0c0d18 30%,
            #0d0f1c 50%,
            #0e1020 70%,
            #0f1224 85%,
            #101428 100%);
}

/* Ambient purple glow for products */
.products-section::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at center,
            rgba(168, 85, 247, 0.08) 0%,
            rgba(139, 92, 246, 0.04) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Hide the extension - using main section gradient instead */
.products-background-extension {
    display: none;
}


.product-glass-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 80px;
}

.product-card-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card-wrapper:hover {
    transform: translateY(-8px);
    z-index: 10;
}


.product-card {
    position: relative;
    width: 340px;
    min-height: 420px;
    height: 100%;
    /* Enforces equal height in flex container */
    border-radius: 4px;
    padding: 2px;
    /* For border gradient */
    isolation: isolate;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    /* Spotlight position variables */
    --mouse-x: 50%;
    --mouse-y: 50%;
    /* Default color (teal) - override per card */
    --card-color: 45, 212, 191;
    --card-hex: #2dd4bf;
    /* GPU acceleration */
    will-change: transform;
    transform: translateZ(0);
}

/* --- Product Card Color Variations --- */
/* CRM -> Cosmic Purple */
.product-card.color-crm {
    --card-color: 139, 92, 246;
    --card-hex: #8b5cf6;
}

/* Mobile -> Nebula Pink */
.product-card.color-mobile {
    --card-color: 236, 72, 153;
    --card-hex: #ec4899;
}

/* Tourism -> Aurora Cyan */
.product-card.color-tourism {
    --card-color: 6, 182, 212;
    --card-hex: #06b6d4;
}

/* Spotlight Effect Overlay - Uses card color */
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(var(--card-color), 0.15),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.product-card:hover::before {
    opacity: 1;
}


.product-card:hover {
    /* Transform handled by wrapper */
    transform: none;
    z-index: 10;
}


/* Angular Glass Background */
.product-card .glass-bg {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    z-index: -1;
    transition: all 0.4s ease;
}

/* Left accent border - card color */
.product-card .glass-bg::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
            rgba(var(--card-color), 0.6) 0%,
            rgba(var(--card-color), 0.2) 100%);
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.product-card:hover .glass-bg::before {
    opacity: 1;
}

/* Highlight Card (Center) */
.product-card.highlight .glass-bg {
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Hover state - uses card color */
.product-card:hover .glass-bg {
    border-color: rgba(var(--card-color), 0.35);
    box-shadow: 0 20px 50px rgba(var(--card-color), 0.15);
    background: linear-gradient(145deg,
            rgba(var(--card-color), 0.06) 0%,
            rgba(255, 255, 255, 0.01) 100%);
}


/* Content Layout */
.product-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 30px;
    height: 100%;
}

/* Badge */
.product-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 20px;
    background: rgba(45, 212, 191, 0.1);
    color: #2dd4bf;
    border: 1px solid rgba(45, 212, 191, 0.2);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.1);
    margin-bottom: 12px;
}

.product-badge.beta {
    background: rgba(217, 70, 239, 0.1);
    color: #d946ef;
    border-color: rgba(217, 70, 239, 0.2);
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.1);
}

.product-badge.live {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}


/* Icon Wrapper */
.icon-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(45, 212, 191, 0.4), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover .icon-glow {
    opacity: 1;
}

.product-icon {
    font-size: 2.5rem;
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}


/* Typography */
.product-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 16px;
    font-weight: 600;
}

.product-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: auto;
    /* Pushes link to bottom */
    padding-bottom: 30px;
}


/* Link Button */
.product-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.product-link .arrow {
    transition: transform 0.3s ease;
}

.product-link:hover {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.4);
    color: #2dd4bf;
}

.product-link:hover .arrow {
    transform: translateX(4px);
}


/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .product-glass-grid {
        flex-direction: column;
        align-items: center;
    }

    .product-card {
        width: 100%;
        max-width: 360px;
    }
}

/* --- SERVICE CARDS MOBILE RESPONSIVE --- */
@media (max-width: 768px) {
    .services-cards-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .service-card-compact {
        padding: 32px 24px;
        /* Keep column layout - flex-direction: column is already default */
    }

    .card-icon {
        width: 80px;
        height: 80px;
        font-size: 2.25rem;
    }

    .card-info h3 {
        font-size: 1.35rem;
    }

    .card-info p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* Keep hover effects subtle on mobile */
    .service-card-compact:hover {
        transform: translateX(3px);
    }
}