/* ============================================================
   PEXUM Galaxy Scrollytelling — CSS
   Mario Galaxy-style cosmic animation section
   ============================================================ */

/* --- Wrapper: Creates the scroll space --- */
#galaxy-wrapper {
    position: relative;
    width: 100%;
    height: 500vh; /* 5 screens of scroll travel */
    z-index: 2;
}

/* --- Sticky Canvas Container --- */
.galaxy-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
    /* Three.js renderer owns the background now — no CSS bg needed */
    background: transparent;
}

#galaxy-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* --- Text Overlay Layer --- 
   Positioned absolutely within the wrapper, covering the full 500vh.
   The sticky canvas stays pinned while this scrolls naturally. */
.galaxy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Fills the full 500vh wrapper */
    z-index: 10;
    pointer-events: none;
}

/* --- Individual Scroll Sections --- */
.galaxy-section {
    height: 100vh;  /* Each section = 1 screen within the 500vh wrapper */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5vw;
    position: relative;
}

@media (min-width: 768px) {
    .galaxy-section {
        padding: 0 8vw;
    }
}

/* Alignment variants */
.galaxy-section.align-right {
    align-items: flex-end;
}
.galaxy-section.align-center {
    align-items: center;
    text-align: center;
}
.galaxy-section.align-left {
    align-items: flex-start;
}

/* --- Content Boxes (Glassmorphism) --- */
.galaxy-box {
    background: rgba(10, 5, 21, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 480px;
    pointer-events: auto;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 240, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* JS drives opacity + transform; CSS only smooths the change */
    opacity: 0;
    transform: translateY(50px) scale(0.92);
    will-change: opacity, transform;
    transition: none; /* JS handles frame-by-frame */
}

.galaxy-box.visible {
    pointer-events: auto;
}

/* Box typography */
.galaxy-box .galaxy-eyebrow {
    display: inline-block;
    font-family: var(--font-mono, 'Fira Code', monospace);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary-cyan, #00F0FF);
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 100px;
    background: rgba(0, 240, 255, 0.08);
}

.galaxy-box h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: #fff;
}

.galaxy-box h2 .text-gradient-galaxy {
    background: linear-gradient(135deg, #00F0FF 0%, #7000FF 50%, #FF00FF 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.galaxy-box p {
    font-size: 1.05rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

.galaxy-box .galaxy-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.9rem 2.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-primary-cyan, #00F0FF);
    color: #000;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.galaxy-box .galaxy-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.55);
}

/* --- Scroll Progress Indicator --- */
.galaxy-progress {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.galaxy-progress.active {
    opacity: 1;
}

.galaxy-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.galaxy-progress-dot.active {
    background: var(--color-primary-cyan, #00F0FF);
    border-color: var(--color-primary-cyan, #00F0FF);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    transform: scale(1.4);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .galaxy-box {
        max-width: 100%;
        padding: 1.8rem;
        border-radius: 16px;
    }

    .galaxy-progress {
        right: 1rem;
    }

    .galaxy-progress-dot {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 480px) {
    .galaxy-box h2 {
        font-size: 1.6rem;
    }

    .galaxy-box p {
        font-size: 0.95rem;
    }
}
