/**
 * ux-styles.css
 * Core design system additions for advanced UX/UI enhancements including:
 * Glassmorphism, F-Pattern, Asymmetrical Layouts, and Hardware-Accelerated Animations
 */

/* ==========================================================================
   1. GLASSMORPHISM 
   ========================================================================== */
.glass-panel {
    background: rgba(255, 255, 255, 0.05); /* very light base */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

.theme-light .glass-panel,
.section-light .glass-panel {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

.glass-nav-active {
    background: rgba(5, 5, 5, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   2. REVEAL TEXT ON SCROLL 
   ========================================================================== */
.animate-headline {
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    transform: translateY(20px);
    transition: clip-path 0.85s cubic-bezier(0.22, 1, 0.36, 1), 
                opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: clip-path, opacity, transform;
}

.animate-headline.is-revealed {
    clip-path: inset(0 0 0% 0);
    opacity: 1;
    transform: translateY(0);
}

/* Specific delay combinations for line-by-line staggered headlines */
.animate-headline.delay-1 { transition-delay: 0.1s; }
.animate-headline.delay-2 { transition-delay: 0.2s; }
.animate-headline.delay-3 { transition-delay: 0.3s; }

/* ==========================================================================
   3. SCROLL-TRIGGERED ANIMATIONS (CARDS & ELEMENTS)
   ========================================================================== */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.animate-fade-up.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Counter Text Styling */
.stat-counter {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* ==========================================================================
   4. F-PATTERN LAYOUT 
   ========================================================================== */
.layout-f-pattern {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
    align-items: flex-start;
}

.layout-f-pattern .f-primary-header {
    grid-column: 1 / -1; /* Top scanning bar */
    text-align: left;
    margin-bottom: 20px;
}

.layout-f-pattern .f-heavy-left {
    grid-column: 1 / 8; /* Left dominant spine */
    text-align: left;
}

.layout-f-pattern .f-light-right {
    grid-column: 9 / 13; /* Right supplementary details */
}

@media (max-width: 991px) {
    .layout-f-pattern .f-heavy-left,
    .layout-f-pattern .f-light-right {
        grid-column: 1 / -1;
    }
}

/* ==========================================================================
   5. ASYMMETRIC LAYOUT
   ========================================================================== */
.layout-asymmetric {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* 60/40 ratio Split */
    gap: 40px;
    align-items: center;
}

.layout-asymmetric.ratio-reverse {
    grid-template-columns: 1fr 1.5fr; /* 40/60 reversed ratio */
}

/* Overlapping effect elements */
.layout-asymmetric .overlap-image {
    position: relative;
    z-index: 1;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.layout-asymmetric .overlap-text-box {
    position: relative;
    z-index: 2;
    padding: 40px;
    margin-left: -60px; /* Force overlap into the previous column */
    border-radius: 12px;
}

.layout-asymmetric.ratio-reverse .overlap-text-box {
    margin-left: 0;
    margin-right: -60px; /* Reverse overlap */
}

@media (max-width: 991px) {
    .layout-asymmetric,
    .layout-asymmetric.ratio-reverse {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .layout-asymmetric .overlap-text-box,
    .layout-asymmetric.ratio-reverse .overlap-text-box {
        margin-left: 0;
        margin-right: 0;
        padding: 30px 20px;
        margin-top: -30px; /* Keep slight vertical overlap on mobile */
    }
}

/* ==========================================================================
   6. PARALLAX WRAPPER & ACCESSIBILITY OVERRIDES
   ========================================================================== */
.parallax-wrapper {
    position: relative;
    overflow: hidden; /* Prevent vertical shift breaking sections */
}

.parallax-layer {
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .parallax-layer {
        transform: none !important;
        transition: none !important;
    }
    
    .animate-headline,
    .animate-fade-up {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        transition: none !important;
    }
}
