/* ========================================================
   VISION-2027 CSS
   Spatial UI, Bento Grids, and Next-Gen Fluidity
   ======================================================== */

:root {
    /* Spatial UI Colors mapped from existing theme variables */
    --spatial-glass-light: rgba(255, 255, 255, 0.6);
    --spatial-glass-dark: rgba(20, 20, 20, 0.65);
    
    --spatial-border-light: rgba(255, 255, 255, 0.3);
    --spatial-border-dark: rgba(255, 255, 255, 0.05);

    --spatial-shadow-deep: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 25px 50px -12px rgba(var(--bs-primary-rgb), 0.15);
}

/* --------------------------------------------------------
   SPATIAL GLASSMORPHISM
-------------------------------------------------------- */
.spatial-glass {
    position: relative;
    background: var(--spatial-glass-light);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--spatial-border-light);
    box-shadow: var(--spatial-shadow-deep);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

/* Apply SVG Noise Overlay */
.spatial-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url('#spatial-noise');
    opacity: 0.15;
    mix-blend-mode: overlay;
}

/* Dark Mode Adaptation */
[theme="dark"] .spatial-glass {
    background: var(--spatial-glass-dark);
    border-color: var(--spatial-border-dark);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.3), 
        0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.spatial-glass:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 
        0 10px 15px -3px rgba(var(--bs-primary-rgb), 0.2), 
        0 35px 60px -15px rgba(var(--bs-primary-rgb), 0.15);
}

/* --------------------------------------------------------
   BENTO GRID SYSTEM
-------------------------------------------------------- */
.bento-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
}

.bento-item {
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    background: var(--spatial-glass-light);
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-item:hover img {
    transform: scale(1.05);
}

/* Spans */
.bento-col-12 { grid-column: span 12; }
.bento-col-8 { grid-column: span 8; }
.bento-col-6 { grid-column: span 6; }
.bento-col-4 { grid-column: span 4; }
.bento-row-2 { grid-row: span 2; }

@media (max-width: 991px) {
    .bento-col-8, .bento-col-4 {
        grid-column: span 12;
    }
}
@media (min-width: 992px) {
    .bento-tall {
        grid-row: span 2;
    }
}

/* --------------------------------------------------------
   LIQUID BUTTONS
-------------------------------------------------------- */
.btn-liquid {
    position: relative;
    overflow: hidden;
    border: none;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 3rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-liquid::after {
    content: "";
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 40%;
    z-index: -1;
    transition: all 0.6s ease;
    transform: translateY(0) rotate(0deg);
}

.btn-liquid:hover::after {
    transform: translateY(-50%) rotate(180deg);
}

.btn-liquid:hover {
    box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.4);
    transform: translateY(-2px);
    color: #fff;
}

/* --------------------------------------------------------
   SCROLL DRIVEN ANIMATIONS
-------------------------------------------------------- */
@supports (animation-timeline: view()) {
    .scroll-reveal {
        animation: reveal-on-scroll linear both;
        animation-timeline: view();
        animation-range: entry 10% cover 30%;
    }

    @keyframes reveal-on-scroll {
        from {
            opacity: 0;
            transform: translateY(50px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}
