/**
 * Intro Scroll Sequence Styles
 *
 * Styles for the pinned scroll-driven text section that appears
 * between .intro-top and the dots/sphere composition.
 *
 * ============================================================================
 * QUICK CUSTOMIZATION GUIDE
 * ============================================================================
 *
 * CHANGE SCROLL DISTANCE (line ~20):
 *   min-height: 300vh;  → Increase for slower progression (e.g., 400vh)
 *                       → Decrease for faster (e.g., 200vh)
 *
 * CHANGE TEXT SIZE (line ~73):
 *   font-size: clamp(2.5rem, 5vw, 6rem);
 *   - First value: minimum size (mobile)
 *   - Middle value: responsive scaling
 *   - Last value: maximum size (desktop)
 *
 * CHANGE TEXT COLOR (line ~77):
 *   color: #eaf0ff;  → Use any color (e.g., #6ea8fe for blue)
 *
 * CHANGE ANIMATION SPEED (line ~84):
 *   transition: opacity 0.6s ...
 *   - Increase for slower fades (e.g., 1s)
 *   - Decrease for snappier (e.g., 0.4s)
 *
 * ============================================================================
 */

/* ============================================================================
   SCROLL SEQUENCE CONTAINER
   ============================================================================ */

.intro-scroll-sequence {
    position: relative;
    width: 100%;
    /* Height determines scroll distance - adjust for longer/shorter sequence */
    min-height: 300vh; /* 3x viewport height for smooth progression */
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 2;
}

/* Reduced motion: shorter, no pinning */
@media (prefers-reduced-motion: reduce) {
    .intro-scroll-sequence {
        min-height: auto;
        padding: 8rem 0;
    }
}

/* Mobile: reduce scroll distance */
@media (max-width: 768px) {
    .intro-scroll-sequence {
        min-height: 200vh; /* 2x viewport height on mobile */
    }
}

/* ============================================================================
   INNER WRAPPER (PINNED)
   ============================================================================ */

.intro-scroll-sequence__inner {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    pointer-events: none;
}

/* Reduced motion: no sticky positioning */
@media (prefers-reduced-motion: reduce) {
    .intro-scroll-sequence__inner {
        position: relative;
        top: auto;
        transform: none;
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }
}

/* ============================================================================
   STEPS (TEXT MESSAGES)
   ============================================================================ */

.intro-step {
    /* Positioning: all steps stacked on top of each other */
    position: absolute;
    inset: 0;

    /* Layout: center the text */
    display: grid;
    place-items: center;

    /* Typography: responsive, fluid sizing */
    font-size: clamp(1.25rem, 3vw, 2.25rem);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    color: #eaf0ff;

    /* Padding for mobile */
    padding: clamp(16px, 3vw, 48px);

    /* Initial state: hidden */
    opacity: 0;
    transform: translateY(10px);

    /* Performance optimization */
    will-change: opacity, transform;

    /* Prevent text selection during scroll */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;

    /* Ensure text is visible */
    z-index: 10;
    pointer-events: none;
}

/* Reduced motion: simpler layout */
@media (prefers-reduced-motion: reduce) {
    .intro-step {
        position: static;
        opacity: 1 !important;
        transform: none !important;
        margin-bottom: 3rem;
    }

    .intro-scroll-sequence__inner {
        position: static;
        transform: none;
        display: flex;
        flex-direction: column;
        gap: 3rem;
    }
}

/* ============================================================================
   RESPONSIVE TYPOGRAPHY
   ============================================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .intro-step {
        font-size: clamp(1.125rem, 2.8vw, 2rem);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .intro-step {
        font-size: clamp(1rem, 4vw, 1.5rem);
        padding: 1rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .intro-step {
        font-size: clamp(0.9rem, 5vw, 1.25rem);
    }
}

/* ============================================================================
   ENHANCED PARALLAX SUPPORT
   ============================================================================ */

/* Ensure intro-top elements are positioned for parallax */
.intro-top .intro-canvas {
    transition: transform 0.1s linear;
    will-change: transform;
}

.intro-top h1,
.intro-top .content-animation {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* Disable parallax transforms on reduced motion */
@media (prefers-reduced-motion: reduce) {
    .intro-top .intro-canvas,
    .intro-top h1,
    .intro-top .content-animation {
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .intro-scroll-sequence__item {
        color: #ffffff;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    }
}

/* Focus styles for keyboard navigation */
.intro-scroll-sequence:focus-visible {
    outline: 2px solid #6ea8fe;
    outline-offset: 4px;
}

/* ============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================ */

/* GPU acceleration for smooth scrolling */
.intro-scroll-sequence__inner,
.intro-scroll-sequence__item {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Prevent layout shift */
.intro-scroll-sequence {
    contain: layout style paint;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

/* Hide sequence until JavaScript initializes */
.intro-scroll-sequence:not([data-intro-sequence]) {
    display: none;
}

/* Fallback for no-JS */
.no-js .intro-scroll-sequence {
    min-height: auto;
    padding: 4rem 0;
}

.no-js .intro-scroll-sequence__inner {
    position: relative;
    top: auto;
    transform: none;
}

.no-js .intro-scroll-sequence__item {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    margin-bottom: 2rem;
}

/* ============================================================================
   DARK MODE SUPPORT (if needed)
   ============================================================================ */

@media (prefers-color-scheme: light) {
    .intro-scroll-sequence__item {
        color: #04040E;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    .intro-scroll-sequence {
        min-height: auto;
        page-break-inside: avoid;
    }
    
    .intro-scroll-sequence__inner {
        position: relative;
        top: auto;
        transform: none;
    }
    
    .intro-scroll-sequence__item {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        opacity: 1 !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ============================================================================
   INTRO CONTENT FADE OUT
   ============================================================================ */

.intro-top__content {
    /* Smooth fade transition */
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Performance optimization */
    will-change: opacity, transform;
}

/* Reduced motion: simpler transition */
@media (prefers-reduced-motion: reduce) {
    .intro-top__content {
        transition: opacity 0.3s ease;
    }
}
