/* Chroma Grid Styles */
.chroma-grid {
    position: relative;
    width: 100%;
    /* height: 100%; Removed fixed height for auto flow */
    min-height: 600px;
    display: grid;
    grid-template-columns: repeat(var(--cols, 3), 320px);
    grid-auto-rows: auto;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    background-color: #00000050;
    backdrop-filter: blur(2px);

    --x: 50%;
    --y: 50%;
    --r: 300px;
    /* Radius */
}

@media (max-width: 1124px) {
    .chroma-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
        --cols: 2;
    }
}

@media (max-width: 640px) {
    .chroma-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        --cols: 1;
    }
}

.chroma-card {
    position: relative;
    display: flex;
    flex-direction: column;
    /* width: 320px; Removed fixed width for responsiveness */
    width: 100%;
    height: 300px;
    /* Reduced from 400px for less crowding on mobile initially */
    border-radius: 12px;
    /* Smoother, less space taken */
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease, transform 0.3s ease;
    background: var(--card-gradient, #111);

    --mouse-x: 50%;
    --mouse-y: 50%;
    --spotlight-color: rgba(255, 255, 255, 0.2);
}

.chroma-card:hover {
    border-color: var(--card-border);
    transform: translateY(-5px);
}

.chroma-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--spotlight-color), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.chroma-card:hover::before {
    opacity: 1;
}

.chroma-img-wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 0;
    /* Full bleed image */
    box-sizing: border-box;
    background: transparent;
    transition: background 0.3s ease;
    overflow: hidden;
}

.chroma-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.chroma-card:hover .chroma-img-wrapper img {
    transform: scale(1.05);
}

.chroma-info {
    position: relative;
    z-index: 1;
    padding: 0.5rem;
    /* Reduced from 0.75rem for mobile */
    color: #fff;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    /* Tighter gap */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chroma-info .name {
    font-weight: 700;
    font-size: 0.95rem;
    /* Reduced */
    color: #fff;
    line-height: 1.1;
}

.chroma-info .role {
    color: #aaa;
    font-size: 0.8rem;
    /* Reduced */
    line-height: 1.1;
}

/* Desktop-specific overrides for spacing */
@media (min-width: 641px) {
    .chroma-card {
        height: 400px;
        border-radius: 20px;
    }

    .chroma-info {
        padding: 0.75rem;
        gap: 0.25rem;
    }

    .chroma-info .name {
        font-size: 1.1rem;
        line-height: normal;
    }

    .chroma-info .role {
        font-size: 0.9rem;
        line-height: normal;
    }
}

.chroma-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    /* backdrop-filter: grayscale(1) brightness(0.78); Removed crazy filter */
    background: transparent;

    mask-image: radial-gradient(circle var(--r) at var(--x) var(--y),
            transparent 0%,
            transparent 20%,
            rgba(0, 0, 0, 0.5) 40%,
            black 100%);
    -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y),
            transparent 0%,
            transparent 20%,
            rgba(0, 0, 0, 0.5) 40%,
            black 100%);
}

.chroma-fade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: grayscale(80%);
    /* Fade out non-hovered areas */

    mask-image: radial-gradient(circle var(--r) at var(--x) var(--y),
            transparent 0%,
            transparent 30%,
            black 100%);
    -webkit-mask-image: radial-gradient(circle var(--r) at var(--x) var(--y),
            transparent 0%,
            transparent 30%,
            black 100%);

    opacity: 1;
    transition: opacity 0.25s ease;
}

/* Filter Buttons */
.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: rgba(34, 211, 238, 0.1);
    border-color: #22d3ee;
    color: #22d3ee;
    transform: translateY(-1px);
}