.brands-section {
    padding: 4rem 2rem 12rem;
    background: #1a1a1a;
    position: relative;
}

[data-theme="light"] .brands-section {
    background: var(--background-color);
}

.brands-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: #1a1a1a;
    clip-path: polygon(0 30%, 100% 100%, 0 100%);
    z-index: 1;
}

[data-theme="light"] .brands-section::after {
    background: var(--background-color);
}

.brands-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.brands-header {
    flex: 0 0 30%;
    position: relative;
}

.brands-header::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 140%;
    background: radial-gradient(circle at left, 
        rgba(255,255,255,0.1) 0%,
        rgba(255,255,255,0.05) 35%,
        transparent 70%
    );
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
}

[data-theme="light"] .brands-header::before {
    background: radial-gradient(circle at left,
        rgba(200,200,200,0.3) 0%,
        rgba(200,200,200,0.15) 35%,
        transparent 70%
    );
}

.brands-header-content {
    position: relative;
    height: 180px; /* Match the height of the logo containers */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.brands-header h2 {
    font-family: 'Teko', sans-serif;
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Style for the heading spans */
.brands-header h2 .heading-first,
.brands-header h2 .heading-second {
    position: relative;
    display: inline-block;
    white-space: nowrap;
}

.brands-header h2 .heading-first {
    margin-right: 0.5ch;
}

.brands-header h2 .heading-second {
    margin-left: 0;
}

/* First triangle positioned relative to the first span */
.brands-header h2 .heading-first::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 12px 0 0;
    border-color: var(--text-color) transparent transparent transparent;
    opacity: 0.8;
}

/* Second triangle positioned relative to the second span */
.brands-header h2 .heading-second::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: -12px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 12px 12px;
    border-color: transparent transparent var(--text-color) transparent;
    opacity: 0.8;
}

/* Add left triangle for single-word brand names */
.brands-header h2 .heading-first:empty + .heading-second::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -15px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 12px 0 0;
    border-color: var(--text-color) transparent transparent transparent;
    opacity: 0.8;
}

/* Handle empty spans */
.brands-header h2 .heading-first:empty {
    display: none;
}

.brands-header h2 .heading-second:empty::after {
    display: none;
}

/* Remove the original triangles */
.brands-header h2::before,
.brands-header h2::after {
    display: none;
}

.brands-header .heading-first {
    color: var(--text-color);
}

.brands-header .heading-second {
    color: var(--accent-color);
}

.brands-header-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.brands-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 0;
    position: relative;
    max-width: 100%;
}

/* Scramble animation styles */
.scramble-char {
    display: inline-block;
    color: var(--accent-color);
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(255, 140, 0, 0.5);
    animation: pulse 0.3s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.6;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1.02);
    }
}

.brands-logos {
    flex: 0 0 65%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

.brand-logo-container {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.brand-logo-container::after {
    content: 'View Brand';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-color);
    font-size: 0.85rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 3;
}

.brand-logo-container:hover::after {
    transform: translateY(0);
}

.brands-logos:hover .brand-logo-container {
    opacity: 0.35;
    transform: scale(0.95);
}

.brands-logos .brand-logo-container:hover {
    transform: scale(1.15);
    z-index: 10;
    opacity: 1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.brands-logos .brand-logo-container:active {
    transform: scale(1.05);
    transition: transform 0.1s ease;
}

/* Focus styles for keyboard navigation */
.brand-logo-container:focus {
    outline: none;
    transform: scale(1.15) !important;
    z-index: 10;
    opacity: 1 !important;
    box-shadow: 0 0 0 3px var(--accent-color), 0 8px 20px rgba(0, 0, 0, 0.2) !important;
}

.brand-logo-container:focus::after {
    transform: translateY(0);
}

.brand-logo-container:focus .brand-logo {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.brand-logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-color) 0%, rgba(255, 140, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.brand-logo-container:hover::before {
    opacity: 0.15;
}

.brand-logo {
    width: 80%;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.brand-logo-container:hover .brand-logo {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Responsive styles */
@media (max-width: 1200px) {
    .brands-section {
        padding: 4rem 2rem 12rem;
    }
    
    .brands-container {
        padding: 0 1rem;
    }
}

@media (max-width: 1024px) {
    .brands-section {
        padding: 4rem 1.5rem 14rem;
        min-height: auto;
    }
    
    .brands-container {
        padding: 0;
        max-width: 800px;
    }
    
    .brands-container {
        flex-direction: column;
        text-align: center;
    }
    
    .brands-header, .brands-logos {
        flex: 0 0 100%;
    }
    
    .brands-header::before {
        left: 50%;
        transform: translate(-50%, -50%);
        background: radial-gradient(circle at center, 
            rgba(255,255,255,0.1) 0%,
            rgba(255,255,255,0.05) 35%,
            transparent 70%
        );
    }
    
    [data-theme="light"] .brands-header::before {
        background: radial-gradient(circle at center,
            rgba(200,200,200,0.3) 0%,
            rgba(200,200,200,0.15) 35%,
            transparent 70%
        );
    }
    
    .brands-header-content {
        height: auto;
        margin-bottom: 40px;
        position: relative;
    }
    
    .brands-header-content-wrapper {
        position: relative;
    }
    
    .brands-header h2 {
        margin-bottom: 15px;
    }
    
    .brands-header p {
        margin: 0 auto;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .brands-section {
        padding: 3rem 1rem 10rem;
    }
    
    .brands-section::after {
        height: 120px;
        clip-path: polygon(0 40%, 100% 100%, 0 100%);
    }
    
    .brands-logos {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .brand-logo-container {
        width: 150px;
        height: 150px;
    }
    
    .brands-logos .brand-logo-container:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .brands-section {
        padding: 2rem 1rem 8rem;
    }
    
    .brands-section::after {
        height: 80px;
        clip-path: polygon(0 50%, 100% 100%, 0 100%);
    }
    
    .brands-header h2 {
        font-size: 2.8rem;
    }
    
    .brand-logo-container {
        width: 120px;
        height: 120px;
    }
} 