/* ============================================
   COMPANIES PAGE
   ============================================ */

/* ---------- PAGE BODY ---------- */
.companies-body {
    background: var(--navy-deep);
}

.companies-main {
    min-height: 100vh;
    background: #f4f5f5;
    --container-max: 1260px;
    --container-pad: clamp(20px, 3.5vw, 64px);
}

/* ---------- BANNER ---------- */
.companies-banner {
    position: relative;
    width: 100%;
    height: 36vh;
    min-height: 220px;
    background: var(--navy-deep);
    overflow: hidden;
    flex-shrink: 0;
}

/* Dot texture — same as landing page */
.companies-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.18)'/%3E%3C/svg%3E");
    background-size: 28px 28px;
    opacity: 0.12;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 100%);
}

/* Subtle blue glow — same as landing page */
.companies-banner::after {
    content: '';
    position: absolute;
    top: -10%; right: -5%;
    width: 70%; height: 80%;
    background: radial-gradient(ellipse at 70% 30%, rgba(74, 144, 217, 0.06) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.companies-banner-text {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    padding-top: 80px; /* offset for transparent nav */
    width: 100%;
    max-width: var(--container-max);
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
    pointer-events: none;
}

.companies-banner-headline-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.companies-banner-headline {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--white);
    margin: 0;
}

.companies-banner-comma {
    font-style: italic;
    color: var(--accent-blue);
}

.companies-banner-tagline {
    font-size: clamp(0.95rem, 1.6vw, 1.25rem);
    font-weight: 300;
    letter-spacing: -0.01em;
    color: var(--white);
    margin: 0;
}

.companies-banner-sub {
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
}

/* ---------- FILTER BAR ---------- */
.companies-filters {
    background: #f4f5f5;
    padding: clamp(28px, 4vw, 48px) 0 0;
}

.companies-filters-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.companies-filter-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.companies-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
}

/* Push view toggle to far right on the status row */
.companies-filter-row .view-toggle {
    margin-left: auto;
}

/* ---------- GRID / LIST TOGGLE ---------- */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #cad2d1;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: transparent;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9aa5a4;
    transition: color 0.2s ease, background 0.2s ease;
}

.view-toggle-btn:hover {
    background: #06c4a2;
    color: #fff;
}

.view-toggle-btn--active {
    background: #06c4a2;
    color: #fff;
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.companies-filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(1, 12, 51, 0.4);
    margin-right: 2px;
    white-space: nowrap;
}

/* Filter pill buttons */
.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1.5px solid #cad2d1;
    background: transparent;
    cursor: pointer;

    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #717b7a;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    color: #010c33;
    border-color: #9aa5a4;
}

.filter-pill--active {
    border-color: #06c4a2;
    background: hsla(169, 94%, 40%, 0.08);
    color: #010c33;
}

/* ---------- PORTFOLIO GRID ---------- */
.companies-portfolio {
    background: #f4f5f5;
    padding: clamp(24px, 3vw, 40px) 0 clamp(80px, 10vw, 140px);
}

.companies-portfolio-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: minmax(320px, auto);
    gap: 16px;
}

/* Card overrides — all same size, visible immediately */
.companies-grid .bento-card {
    opacity: 1;
    transform: translateY(0);
    border-radius: 16px;
}

.companies-grid .bento-card::before,
.companies-grid .bento-card::after {
    border-radius: 16px;
}

/* Ensure bg images fill uniformly */
.companies-grid .bento-card-bg {
    background-size: cover;
    background-position: center center;
}

/* Exited badge on grid card — top-left corner, always visible */
.bento-card-exited-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #06c4a2;
    color: #fff;

    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------- EMPTY STATE ---------- */
.companies-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;

    font-size: 1rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.35);
}

/* ---------- LIST VIEW ---------- */
.companies-list {
    display: none;
    flex-direction: column;
}

.companies-list.view-active {
    display: flex;
}

.companies-grid.view-active {
    display: grid;
}

.companies-grid:not(.view-active) {
    display: none;
}

/* Column headers */
.list-header {
    display: grid;
    grid-template-columns: 260px 140px 1fr 160px 150px 100px;
    gap: 24px;
    align-items: center;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(1, 12, 51, 0.10);
}

.list-header-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(1, 12, 51, 0.35);
    white-space: nowrap;
}

.list-header-label:first-child {
    text-align: center;
}

/* Row */
.list-row {
    display: grid;
    grid-template-columns: 260px 140px 1fr 160px 150px 100px;
    gap: 24px;
    align-items: center;
    padding: 48px 0;
    border-bottom: 1px solid rgba(1, 12, 51, 0.08);
    transition: background 0.2s ease;
}

.list-row:hover {
    background: rgba(1, 12, 51, 0.025);
}

/* Logo cell */
.list-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.list-logo-img {
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Exited badge — teal, pinned top-center, overlays the logo */
.list-exited-badge {
    position: absolute;
    top: -28px;
    left: calc(50% - 73px);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #06c4a2;
    color: #fff;

    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Text cells */
.list-sector,
.list-ceo,
.list-partnered {
    font-size: 0.82rem;
    font-weight: 500;
    color: #010c33;
    white-space: nowrap;
}

.list-description {
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(1, 12, 51, 0.65);
    line-height: 1.4;
    min-width: 0;
}

/* Website link */
.list-website {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: 0.78rem;
    font-weight: 600;
    color: #010c33;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.list-website:hover {
    color: #06c4a2;
}

.list-website svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.list-website:hover svg {
    transform: translate(2px, -2px);
}

/* ── SCALED DISPLAY FIX — Companies page ── */
@media (min-width: 1025px) and (max-width: 1439px) {

    .companies-banner {
        height: 44vh;
        min-height: 280px;
    }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
    .list-header,
    .list-row {
        grid-template-columns: 200px 120px 1fr 140px 130px 80px;
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .list-header,
    .list-row {
        grid-template-columns: 160px 1fr 130px 80px;
        gap: 12px;
    }

    /* Hide sector and CEO on medium screens */
    .list-header-label:nth-child(2),
    .list-row .list-sector {
        display: none;
    }

    .list-header-label:nth-child(4),
    .list-row .list-ceo {
        display: none;
    }
}

@media (max-width: 768px) {
    /* ── Contain horizontal overflow ── */
    .companies-body,
    .companies-main {
        overflow-x: hidden;
    }

    .companies-banner {
        height: clamp(140px, 30vw, 200px);
    }

    /* ── Filter rows: swipeable, labels stay visible ── */
    .companies-filter-top {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .companies-filter-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }

    .companies-filter-row::-webkit-scrollbar {
        display: none;
    }

    .filter-pill {
        font-size: 0.7rem;
        padding: 5px 11px;
        flex-shrink: 0;
    }

    /* ── View toggle: sits right of status pills naturally ── */
    .companies-filter-row .view-toggle {
        margin-left: auto;
        flex-shrink: 0;
    }

    .view-toggle {
        margin-top: 0;
        align-self: auto;
    }

    /* ── Grid: tighter cards single-column ── */
    .companies-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(200px, auto);
        gap: 12px;
    }

    /* Lock bento cards to 200px; let expand panel grow freely */
    .companies-grid .bento-card {
        height: 200px;
    }

    .companies-grid .expand-panel {
        height: auto;
        min-height: 0;
    }

    /* ── List: stack on mobile ── */
    .list-header {
        display: none;
    }

    .list-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 32px 0;
    }

    .list-logo {
        width: 100%;
        margin-bottom: 4px;
        justify-content: flex-start;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Unstick the exited badge — static flow, above the logo, left-aligned */
    .list-exited-badge {
        position: static;
        transform: none;
        top: auto;
        left: auto;
        order: -1;
        font-size: 0.55rem;
        padding: 2px 7px;
        margin-top: -18px;
    }

    .list-sector,
    .list-ceo {
        display: inline;
    }

    .list-description {
        width: 100%;
    }

    .list-partnered {
        font-size: 0.75rem;
        color: rgba(1, 12, 51, 0.5);
    }
}

@media (max-width: 480px) {
    .companies-grid {
        grid-auto-rows: minmax(200px, auto);
    }

    /* Expand panel must always grow freely on small screens */
    .companies-grid .expand-panel {
        height: auto;
        min-height: 0;
    }
}

/* ============================================
   SKELETON LOADING PLACEHOLDERS
   ============================================ */

.skeleton-card {
    position: relative;
    border-radius: 16px;
    background: #0d1b3e;
    min-height: 320px;
    overflow: hidden;
}

.skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(255, 255, 255, 0.04) 50%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    .skeleton-card {
        min-height: 200px;
    }
}

/* ============================================
   EXPAND-IN-PLACE DETAIL PANEL
   ============================================ */

/* Clickable cursor on cards and rows */
.companies-grid .bento-card { cursor: pointer; }
.list-row { cursor: pointer; }

/* When a panel is open, GSAP dims siblings to 0.5 opacity.
   Restore full brightness on hover so the card feels interactive. */
.companies-grid .bento-card:hover,
.list-row:hover {
    opacity: 1 !important;
    transition: opacity 0.25s ease;
}

/* Panel base */
.expand-panel {
    position: relative;
    grid-column: 1 / -1;
    border-radius: 16px;
    overflow: hidden;
    background: #010e2a;
    border: 1px solid rgba(6, 196, 162, 0.12);
    margin: 12px 0;
    will-change: height, opacity;
}

/* Teal glow line at top edge */
.expand-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 196, 162, 0.4), transparent);
    z-index: 3;
}

/* Blurred background image */
.expand-panel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) saturate(1.2);
    opacity: 0.15;
    transform: scale(1.2);
}

.expand-panel-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(
            135deg,
            rgba(1, 14, 42, 0.92) 0%,
            rgba(1, 14, 42, 0.88) 50%,
            rgba(1, 14, 42, 0.95) 100%
        );
    background-size: 24px 24px, 100% 100%;
}

/* Close button */
.expand-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.expand-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Two-column content grid */
.expand-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 320px 1fr;
    align-items: start;
    gap: 48px;
    padding: 48px 56px 64px;
}

/* Left column */
.expand-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-self: flex-start;
}

.expand-logo {
    padding-bottom: 20px;
}

.expand-logo img {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

/* Meta grid (2-col within left column) */
.expand-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
}

.expand-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.expand-meta-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.expand-meta-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status dot */
.expand-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.expand-status-dot.active {
    background: #06c4a2;
    box-shadow: 0 0 6px rgba(6, 196, 162, 0.5);
}

.expand-status-dot.exited {
    background: #4a90d9;
    box-shadow: 0 0 6px rgba(74, 144, 217, 0.4);
}

/* Deal team pills */
.expand-deal-team {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.expand-deal-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.expand-deal-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);

    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

/* Total Raised */
.expand-total-raised {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.expand-total-raised-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* Website link button — bottom-right of right column */
.expand-website-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1.5px solid #06c4a2;
    background: rgba(6, 196, 162, 0.08);
    color: #06c4a2;

    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
    width: fit-content;
    align-self: flex-start;
    margin-top: 8px;
}

.expand-website-link:hover {
    background: rgba(6, 196, 162, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(6, 196, 162, 0.2);
}

.expand-website-link svg {
    transition: transform 0.3s var(--ease-out-expo);
}

.expand-website-link:hover svg {
    transform: translate(2px, -2px);
}

/* Right column */
.expand-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
    justify-content: flex-start;
}

.expand-long-desc {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    max-width: 560px;
}

/* Co-Investors section */
.expand-coinvestors {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expand-coinvestors-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.expand-coinvestor-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 48px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.expand-coinvestor-logo:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.expand-coinvestor-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.8;
    filter: grayscale(1) brightness(0) invert(1);
    transition: opacity 0.3s ease;
}

.expand-coinvestor-logo:hover img {
    opacity: 1;
}

/* Testimonial block */
.expand-testimonial {
    position: relative;
    padding: 24px 28px;
    border-radius: 12px;
    background: rgba(6, 196, 162, 0.06);
    border: 1px solid rgba(6, 196, 162, 0.1);
    max-width: 560px;
}

.expand-testimonial-quote {
    font-size: 0.92rem;
    font-weight: 400;
    font-style: italic;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 16px;
    border: none;
    padding: 0;
}

/* Footer: photo + author name side by side */
.expand-testimonial-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expand-testimonial-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid rgba(6, 196, 162, 0.25);
}

.expand-testimonial-author {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0;
}

/* ── Expand Panel Responsive ── */

@media (max-width: 900px) {
    .expand-content {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 32px 56px;
    }
}

@media (max-width: 768px) {
    .expand-content {
        padding: 32px 24px 48px;
        gap: 24px;
    }

    .expand-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .expand-logo img {
        height: 32px;
    }

    .expand-long-desc {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .expand-content {
        padding: 28px 20px 44px;
    }

    .expand-meta-grid {
        grid-template-columns: 1fr;
    }
}
