/* =================================================================
   HOMEPAGE HERO SECTION - FINAL ARTISTIC VERSION
   - Creates a dense, multi-colored, 3D animated starfield.
   - Correctly sized for partial screen view.
   - Fully responsive typography and layout.
   - No "!important" used.
   ================================================================= */

/* --- 1. HERO SECTION LAYOUT --- */
.homepage-hero-section {
    position: relative;
    height: 70vh; /* FIX: Height is now 70% of the viewport height */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: #000; /* The base black color of space */
}

.hero-content-container {
    position: relative;
    z-index: 10;
    color: #fff;
    padding: 20px;
}

.hero-title {
    font-family: var(--font-secondary);
    font-size: clamp(1.7rem, 7vw, 4.0rem);
    font-weight: 900;
    margin: 0 0 15px 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    animation: fadeInDown 1.5s ease-out;
    color: #fff; /* Simple white for better readability against the busy background */
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem); /* FIX: Reduced font size range */
    font-weight: 400;
    opacity: 0.8;
    max-width: 550px;
    margin: 0 auto;
    animation: fadeInUp 1.5s ease-out 0.5s;
    animation-fill-mode: both;
}

.scroll-down-arrow {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: #fff;
    animation: bounce 2s infinite 2s; /* Start animation after 2s */
}

/* --- 2. GALAXY BACKGROUND & 3D ANIMATION --- */
.galaxy-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* This creates the 3D space for our stars */
    perspective: 800px; 
    /* Subtle nebula/dust effect */
    background: radial-gradient(ellipse at 50% 50%, rgba(4, 23, 55, 0.4) 0%, rgba(0,0,0,0) 60%);
}

/* The star layers will be transformed in 3D space */
#stars-small, #stars-medium, #stars-large, #stars-colors-1, #stars-colors-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    animation-name: flyThrough;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* The core animation: flying through space */
@keyframes flyThrough {
    from { transform: translateZ(-800px); } /* Start far away */
    to   { transform: translateZ(800px); }  /* Fly past the viewer */
}

/* --- 3. CREATING THE DENSE & COLORFUL STARFIELD --- */
/* We use box-shadow to create thousands of stars from a single div */

/* Layer 1: Tiny, dense white stars (Cosmic Dust) */
#stars-small {
    background-image: radial-gradient(1px 1px at 20px 30px, #eee, transparent),
                      radial-gradient(1px 1px at 90% 10%, #fff, transparent),
                      radial-gradient(1px 1px at 50% 50%, #eee, transparent),
                      radial-gradient(1px 1px at 20% 80%, #fff, transparent);
    background-size: 200px 200px;
    animation-duration: 75s; /* Slowest, as they are farthest */
}

/* Layer 2: Medium white stars */
#stars-medium {
    background-image: radial-gradient(2px 2px at 10% 90%, #fff, transparent),
                      radial-gradient(2px 2px at 80% 30%, #ddd, transparent);
    background-size: 250px 250px;
    animation-duration: 50s;
}

/* Layer 3: Large, bright white stars */
#stars-large {
    background-image: radial-gradient(3px 3px at 5% 25%, #fff, transparent),
                      radial-gradient(3px 3px at 95% 75%, #fff, transparent);
    background-size: 300px 300px;
    animation-duration: 25s; /* Fastest, as they are closest */
}

/* Layer 4: Red and Yellow stars */
#stars-colors-1 {
    background-image: radial-gradient(2px 2px at 15% 60%, #ff5733, transparent), /* Red */
                      radial-gradient(1px 1px at 85% 40%, #f1c40f, transparent); /* Yellow */
    background-size: 220px 220px;
    animation-duration: 40s;
}

/* Layer 5: Blue and Green stars */
#stars-colors-2 {
    background-image: radial-gradient(2px 2px at 30% 20%, #3498db, transparent), /* Blue */
                      radial-gradient(2px 2px at 70% 85%, #2ecc71, transparent); /* Green */
    background-size: 180px 180px;
    animation-duration: 33s;
}

/* --- 4. TEXT & ARROW ANIMATIONS --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

/* --- 5. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .homepage-hero-section {
        height: 60vh; /* FIX: Further reduced height on mobile */
    }
    .hero-subtitle {
        font-size: 0.7rem; 
    }
}