/*--------------------------------------------------------------
# Companies Section
--------------------------------------------------------------*/

.companies-section {
    background-color: var(--ink);
    padding: 100px 0;
    width: 100%;
}

.companies-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Header ── */
.companies-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.companies-heading {
    font-family: var(--font-primary);
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 300;
    color: #111111;
    line-height: 1.2;
    margin: 0;
    max-width: 600px;
    letter-spacing: -0.02em;
}

.companies-cta {
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    color: #111111;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}

.companies-cta:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

/* ── Divider ── */
.companies-divider {
    border: 0;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.08);
    margin: 40px 0;
}

/* ── Marquee System ── */
.companies-marquee-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px 0;
}

/* Edge Masking */
.companies-fade-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    max-width: 150px;
    z-index: 10;
    pointer-events: none;
}

.left-mask {
    left: 0;
    background: linear-gradient(to right, var(--ink) 0%, rgba(255, 255, 255, 0) 100%);
}

.right-mask {
    right: 0;
    background: linear-gradient(to left, var(--ink) 0%, rgba(255, 255, 255, 0) 100%);
}

/* Tracks */
.companies-track {
    display: flex;
    gap: 80px;
    width: fit-content;
}

/* Animations */
@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 40px)); } /* -50% minus half gap */
}

@keyframes scrollRight {
    0% { transform: translateX(calc(-50% - 40px)); }
    100% { transform: translateX(0); }
}

.track-left {
    animation: scrollLeft 35s linear infinite;
}

.track-right {
    animation: scrollRight 40s linear infinite;
}

.track-slow {
    animation-duration: 45s;
}

/* Pause on hover section */
.companies-marquee-wrapper:hover .companies-track {
    animation-play-state: paused;
}

/* ── Logo Items ── */
.company-logo-item {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* Simulate logo appearance for text placeholders */
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
    cursor: default;
}

/* Text acting as logo for placeholder */
.logo-text {
    font-size: 24px;
    letter-spacing: -0.03em;
    color: #111;
    white-space: nowrap;
}

/* Highlight hover interaction */
.companies-marquee-wrapper:hover .company-logo-item {
    filter: grayscale(100%) opacity(0.3); /* dim others */
}

.companies-marquee-wrapper .company-logo-item:hover {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.05);
}

.companies-marquee-wrapper .company-logo-item:hover .logo-text {
    color: var(--brand-color, #111111);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .companies-section { padding: 60px 0; }
    .companies-container { padding: 0 20px; }
    .companies-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .companies-heading {
        font-size: clamp(24px, 6vw, 32px);
    }
    .companies-track {
        gap: 40px;
    }
    .companies-marquee-wrapper {
        gap: 28px;
    }
    .logo-text { font-size: 20px; }
    .companies-divider { margin: 28px 0; }
    /* Mobile single row or 2 rows */
    .track-left.track-slow {
        display: none; /* Hide 3rd row on mobile */
    }
}
