/* 3D Hero Section Styling */
#home-section.hero-3d-scene {
    position: relative;
    height: 100vh;
    min-height: 700px;
    width: 100%;
    overflow: hidden;
    background: #0a0a0a; /* Deep dark background for professional look */
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hero-3d-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease-out; /* Smooth tilt */
}

/* Base layer height and positioning */
.hero-3d-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Background gradient layer */
.layer-bg {
    z-index: 1;
    transform: translateZ(-200px);
    background: radial-gradient(circle at 50% 50%, rgba(30, 30, 40, 0.8) 0%, rgba(10, 10, 10, 1) 100%);
}

/* Floating smartphones and gadgets */
.floating-item {
    position: absolute;
    max-width: 300px;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
    transition: transform 0.1s ease-out;
}

/* Positioning for different products */
.item-1 { /* Main iPhone */
    top: 20%;
    left: 10%;
    z-index: 5;
    transform: translateZ(100px) rotateY(15deg) rotateX(5deg);
    max-width: 280px;
}

.item-2 { /* Samsung / Android */
    bottom: 10%;
    right: 5%;
    z-index: 4;
    transform: translateZ(-50px) rotateY(-20deg) rotateX(-10deg);
    max-width: 250px;
}

.item-3 { /* Earbuds / Accessories */
    top: 15%;
    right: 15%;
    z-index: 3;
    transform: translateZ(150px) rotateY(-10deg);
    max-width: 150px;
}

.item-4 { /* Watch */
    bottom: 25%;
    left: 15%;
    z-index: 2;
    transform: translateZ(50px) rotateY(10deg);
    max-width: 120px;
}

/* Hero Content - Glassmorphism Card */
.hero-content-3d {
    z-index: 10;
    transform: translateZ(200px);
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 40px 100px rgba(0,0,0,0.4);
    pointer-events: auto;
    max-width: 800px;
    margin: 0 20px;
}

.hero-content-3d h1 {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: #fff;
    letter-spacing: -2px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: linear-gradient(to bottom, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content-3d p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Scroll indicator */
.scroll-hint-3d {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateZ(50px);
    color: #fff;
    opacity: 0.6;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.scroll-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, #fff, transparent);
    animation: scrollSlide 2s infinite ease-in-out;
}

@keyframes scrollSlide {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .hero-content-3d h1 {
        font-size: 3.5rem;
    }
    .hero-content-3d p {
        font-size: 1.1rem;
    }
    .item-1, .item-2, .item-3, .item-4 {
        max-width: 150px;
        opacity: 0.4; /* Fade out products on tablet to keep text readable */
    }
}

@media (max-width: 767.98px) {
    .hero-content-3d h1 {
        font-size: 2rem;
    }
    .hero-content-3d p {
        font-size: 0.95rem;
    }
    .floating-item {
        display: block !important;
        opacity: 0.12; /* Subtle background presence */
        pointer-events: none;
        transform: scale(0.65); /* Slightly larger for better detail */
        filter: blur(2px); /* Soften edges for background feel */
        z-index: 1 !important;
    }
    .hero-content-3d {
        z-index: 10;
        position: relative;
    }
    /* Only show the first two items on mobile to keep it clean */
    .floating-item:nth-child(n+3) {
        display: none !important;
    }
    .hero-content-3d {
        background: transparent;
        backdrop-filter: none;
        border: none;
        padding-top: 50px; /* Space from header */
        padding-bottom: 50px;
    }
    .scroll-hint-3d {
        display: none !important; /* Hide scroll hint on mobile to avoid overlap with long text */
    }
    #home-section.hero-3d-scene {
        min-height: 500px;
        height: auto;
        padding: 100px 0;
    }
}
