/* Square Collage — 3×2 grid with parallax on occupied boxes */
.sq-collage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-items: center;
}

.sq-item {
    width: 140px;    
    height: 140px;
    background: var(--m8crc-surface-overlay);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .4s ease-out, background .3s; /* Smooth transitions */
    overflow: hidden;
    will-change: transform; /* Hint for GPU acceleration */
}
    .sq-item.active {
        cursor: pointer;
    }

/* Offset columns 2 & 5 (0-indexed: 1 & 4) down by 24px on desktop */
@media (min-width: 769px) {
    .sq-item:nth-child(3n+2) {
        transform: translateY(24px);
    }
}

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

@media (min-width: 769px) {
    #sq-3 {
        margin-top: -25px;
    }
    .sq-item:nth-child(3n+2):hover {
        transform: translateY(24px) scale(1.05);
    }
}

.sq-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Accent boxes - these get parallax effect */
.sq-item.accent {
    background: var(--m8crc-primary);
}

.sq-item.accent svg {
    width: 44px;
    height: 44px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.5px;
}

/* Teal accent tile */
.sq-item.accent-teal {
    background: var(--m8crc-secondary);
}

.sq-item.accent-teal svg {
    width: 44px;
    height: 44px;
    stroke: #fff;
    fill: none;
    stroke-width: 1.5px;
}

.sq-item.accent-neutral {
    background: var(--m8crc-surface-overlay);
    border: 1px solid var(--m8crc-text-muted);
}

.sq-item.accent-neutral svg {
    width: 44px;
    height: 44px;
    stroke: var(--m8crc-text-base);
    fill: none;
    stroke-width: 1.5px;
}

/* Responsive */
@media (max-width: 1024px) {
    .trifecta-inner {
        grid-template-columns: 1fr;
        gap: 60px;
    }
}

@media (max-width: 768px) {
    .trifecta {
        padding: 80px 24px;
    }

    .trifecta-stats {
        flex-direction: column;
        gap: 32px;
    }

    /* Mobile: 2x3 grid */
    .sq-collage {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .sq-item {
        width: 120px;
        height: 120px;
    }

    /* Remove desktop offset on mobile */
    .sq-item:nth-child(3n+2) {
        transform: none;
    }

    .sq-item:nth-child(3n+2):hover {
        transform: scale(1.05);
    }
    
    /* Disable parallax on mobile for better performance */
    .sq-item.accent,
    .sq-item.accent-neutral,
    .sq-item.accent-teal {
        will-change: auto;
    }
}
