/* ===== Grid View =====
   Bento button, grid overlay, grid items
*/

/* Bento grid button */
.bento-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: grid;
    grid-template-columns: repeat(3, 7px);
    grid-template-rows: repeat(3, 7px);
    gap: 2.5px;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.bento-btn:hover {
    transform: scale(1.15);
}

.bento-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    transform: scale(1.15);
}

.bento-btn .dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--text-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-btn:hover .dot {
    background: var(--accent);
}

/* Scroll-back mode: morph dots into horizontal bars */
.bento-btn.scroll-mode .dot {
    border-radius: 1px;
}

.bento-btn.scroll-mode .dot:nth-child(1),
.bento-btn.scroll-mode .dot:nth-child(2),
.bento-btn.scroll-mode .dot:nth-child(3) {
    transform: scaleX(1);
}

.bento-btn.scroll-mode .dot:nth-child(1) { grid-column: 1 / 4; width: 100%; }
.bento-btn.scroll-mode .dot:nth-child(2) { display: none; }
.bento-btn.scroll-mode .dot:nth-child(3) { display: none; }
.bento-btn.scroll-mode .dot:nth-child(4) { grid-column: 1 / 4; width: 75%; }
.bento-btn.scroll-mode .dot:nth-child(5) { display: none; }
.bento-btn.scroll-mode .dot:nth-child(6) { display: none; }
.bento-btn.scroll-mode .dot:nth-child(7) { grid-column: 1 / 4; width: 50%; }
.bento-btn.scroll-mode .dot:nth-child(8) { display: none; }
.bento-btn.scroll-mode .dot:nth-child(9) { display: none; }

/* Grid overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.grid-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.grid-item:nth-child(1),
.grid-item:nth-child(2) {
    grid-column: span 3;
}

.grid-item:nth-child(3),
.grid-item:nth-child(4),
.grid-item:nth-child(5) {
    grid-column: span 2;
}

.grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.35s ease;
}

.grid-item:hover {
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3),
                inset 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}

.grid-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3),
                inset 0 0 0 1px rgba(var(--accent-rgb), 0.25);
}

.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-item .grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3rem 2rem 1.5rem;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.79) 12%,
        rgba(0, 0, 0, 0.64) 25%,
        rgba(0, 0, 0, 0.46) 38%,
        rgba(0, 0, 0, 0.28) 52%,
        rgba(0, 0, 0, 0.12) 66%,
        rgba(0, 0, 0, 0.03) 80%,
        transparent 100%
    );
    pointer-events: none;
}

.grid-item .grid-item-number {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-family: 'NB International Pro', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent);
    opacity: 0.2;
    line-height: 1;
}

.grid-item .grid-item-title {
    font-family: 'NB International Pro', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.grid-item .grid-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
}
