/* ========================================
   STAGE 3 — CLIENTS (CSS 3D Auto-Rotating Carousel)
   ======================================== */

.clients-content {
    width: 100%;
    text-align: center;
    overflow: visible;
    padding-top: 80px;
}

/* --- Header --- */
.clients-header {
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.clients-tag {
    font-family: var(--font-tech);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 12px;
}

.clients-title {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin: 0 0 16px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clients-subtitle {
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    color: var(--dim);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- 3D Carousel --- */
.carousel-3d-wrapper {
    width: 100%;
    height: 280px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.carousel-3d-track {
    position: relative;
    width: 180px;
    height: 180px;
    transform-style: preserve-3d;
    animation: carousel3dSpin 45s linear infinite;
}

/* --- Square Cards --- */
.carousel-3d-card {
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    position: absolute;
    width: 180px;
    height: 180px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    backface-visibility: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.carousel-3d-card.no-quote {
    cursor: default;
}

/* Position cards in 3D circle - 10 cards (36° apart) */
.carousel-3d-card:nth-child(1)  { transform: rotateY(0deg) translateZ(260px); }
.carousel-3d-card:nth-child(2)  { transform: rotateY(36deg) translateZ(260px); }
.carousel-3d-card:nth-child(3)  { transform: rotateY(72deg) translateZ(260px); }
.carousel-3d-card:nth-child(4)  { transform: rotateY(108deg) translateZ(260px); }
.carousel-3d-card:nth-child(5)  { transform: rotateY(144deg) translateZ(260px); }
.carousel-3d-card:nth-child(6)  { transform: rotateY(180deg) translateZ(260px); }
.carousel-3d-card:nth-child(7)  { transform: rotateY(216deg) translateZ(260px); }
.carousel-3d-card:nth-child(8)  { transform: rotateY(252deg) translateZ(260px); }
.carousel-3d-card:nth-child(9)  { transform: rotateY(288deg) translateZ(260px); }
.carousel-3d-card:nth-child(10) { transform: rotateY(324deg) translateZ(260px); }

/* Client logo image */
.client-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
}

.client-industry {
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--dim);
    white-space: nowrap;
}

/* Mic active: front-facing card glows red */
.carousel-3d-track.mic-active .carousel-3d-card {
    border-color: rgba(255, 59, 59, 0.3);
}

/* --- Auto-rotation keyframe --- */
@keyframes carousel3dSpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* ========================================
   MOBILE
   ======================================== */
@media (max-width: 768px) {
    .clients-content {
        padding: 0 20px;
    }

    .clients-header {
        margin-bottom: 24px;
    }

    .carousel-3d-wrapper {
        height: 220px;
    }

    .carousel-3d-track {
        width: 130px;
        height: 130px;
    }

    .carousel-3d-card {
        width: 130px;
        height: 130px;
        border-radius: 12px;
        gap: 10px;
    }

    .carousel-3d-card:nth-child(1)  { transform: rotateY(0deg) translateZ(190px); }
    .carousel-3d-card:nth-child(2)  { transform: rotateY(36deg) translateZ(190px); }
    .carousel-3d-card:nth-child(3)  { transform: rotateY(72deg) translateZ(190px); }
    .carousel-3d-card:nth-child(4)  { transform: rotateY(108deg) translateZ(190px); }
    .carousel-3d-card:nth-child(5)  { transform: rotateY(144deg) translateZ(190px); }
    .carousel-3d-card:nth-child(6)  { transform: rotateY(180deg) translateZ(190px); }
    .carousel-3d-card:nth-child(7)  { transform: rotateY(216deg) translateZ(190px); }
    .carousel-3d-card:nth-child(8)  { transform: rotateY(252deg) translateZ(190px); }
    .carousel-3d-card:nth-child(9)  { transform: rotateY(288deg) translateZ(190px); }
    .carousel-3d-card:nth-child(10) { transform: rotateY(324deg) translateZ(190px); }

    .client-logo {
        width: 55px;
        height: 55px;
    }

    .client-industry {
        font-size: 9px;
    }
}

/* ========================================
   TESTIMONIAL BOTTOM SHEET (Glass)
   ======================================== */
.testimonial-sheet {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-sheet.active {
    pointer-events: auto;
    opacity: 1;
}

.testimonial-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.testimonial-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 14px 24px 32px;
    box-shadow:
        0 -4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.testimonial-sheet.active .testimonial-sheet-content {
    transform: translateY(0);
}

/* Handle */
.testimonial-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* Close button */
.testimonial-sheet-close {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    z-index: 2;
}
.testimonial-sheet-close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: scale(1.05);
}

/* Header */
.testimonial-sheet-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-right: 44px; /* leave room for close button */
}

.testimonial-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
}

.testimonial-name {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: #fff;
}

/* Quote */
.testimonial-quote {
    font-family: var(--font-body);
    font-style: normal;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #fff;
    margin: 0 0 24px;
    padding: 0;
    border: none;
    text-align: left;
}

.testimonial-quote::before {
    content: '"';
    font-size: 2rem;
    color: var(--accent);
    line-height: 0;
    vertical-align: -0.3em;
    margin-right: 4px;
}

.testimonial-quote::after {
    content: '"';
    font-size: 2rem;
    color: var(--accent);
    line-height: 0;
    vertical-align: -0.3em;
    margin-left: 4px;
}

/* Author */
.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.testimonial-author-name {
    font-family: var(--font-head);
    font-size: 0.95rem;
    color: #fff;
}

.testimonial-author-role {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--dim);
}

/* Tap hint - matches scroll hint style */
.clients-tap-hint {
    font-family: var(--font-tech);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    margin-top: 24px;
    pointer-events: none;
}

/* Desktop: move tap hint up (closer to carousel, away from dock) */
@media (min-width: 769px) {
    .clients-tap-hint {
        margin-top: 12px;
    }
}

/* Card clickable state */
.carousel-3d-card {
    cursor: pointer;
}

/* Intentional blue hover/focus — applies to both <button> and <div> cards
   (Replaces inconsistent browser default <button>:focus background) */
.carousel-3d-card:hover,
.carousel-3d-card:focus,
.carousel-3d-card:focus-visible {
    background: linear-gradient(145deg, #2563eb 0%, #1d4fd6 100%) !important;
    border-color: rgba(120, 170, 255, 0.7) !important;
    box-shadow:
        0 12px 40px rgba(37, 99, 235, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    outline: none !important;
}

/* ========================================
   MOBILE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .testimonial-sheet-content {
        padding: 14px 20px 20px;
        max-height: 45vh;
        bottom: 180px;
        border-radius: 16px;
        margin: 0 12px;
        left: 0;
        right: 0;
        width: auto;
    }

    .testimonial-logo {
        width: 40px;
        height: 40px;
    }

    .testimonial-name {
        font-size: 1.05rem;
    }

    .testimonial-quote {
        font-size: 0.95rem;
    }

    .clients-tap-hint {
        margin-top: 16px;
    }
}

/* ========================================
   NARROW VIEWPORT — ≤ 374px
   ======================================== */
@media (max-width: 374px) {
    .clients-content { padding: 0 12px; }
    .clients-title { font-size: 1.4rem; letter-spacing: 0.05em; }
    .clients-subtitle { font-size: 0.78rem; }
    .clients-tag { font-size: 9px; letter-spacing: 2px; }
    .carousel-3d-wrapper { height: 180px; }
    .carousel-3d-track { width: 110px; height: 110px; }
    .carousel-3d-card { width: 110px; height: 110px; border-radius: 10px; gap: 8px; }
    .carousel-3d-card:nth-child(1)  { transform: rotateY(0deg) translateZ(160px); }
    .carousel-3d-card:nth-child(2)  { transform: rotateY(36deg) translateZ(160px); }
    .carousel-3d-card:nth-child(3)  { transform: rotateY(72deg) translateZ(160px); }
    .carousel-3d-card:nth-child(4)  { transform: rotateY(108deg) translateZ(160px); }
    .carousel-3d-card:nth-child(5)  { transform: rotateY(144deg) translateZ(160px); }
    .carousel-3d-card:nth-child(6)  { transform: rotateY(180deg) translateZ(160px); }
    .carousel-3d-card:nth-child(7)  { transform: rotateY(216deg) translateZ(160px); }
    .carousel-3d-card:nth-child(8)  { transform: rotateY(252deg) translateZ(160px); }
    .carousel-3d-card:nth-child(9)  { transform: rotateY(288deg) translateZ(160px); }
    .carousel-3d-card:nth-child(10) { transform: rotateY(324deg) translateZ(160px); }
    .client-logo { width: 46px; height: 46px; }
    .client-industry { font-size: 8px; letter-spacing: 1px; }
    .testimonial-sheet-content { padding: 12px 14px 22px; max-height: 78vh; margin: 0 8px; bottom: 110px; }
    .testimonial-quote { font-size: 0.85rem; }
    .testimonial-name { font-size: 0.9rem; }
    .testimonial-logo { width: 36px; height: 36px; }
    .testimonial-sheet-close { width: 30px; height: 30px; top: 10px; right: 10px; font-size: 11px; }
    .testimonial-sheet-header { padding-right: 38px; gap: 10px; }
    .clients-tap-hint { font-size: 10px; margin-top: 12px; }
}

/* Desktop: Center modal instead of bottom sheet */
@media (min-width: 769px) {
    .testimonial-sheet-content {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        max-width: 600px;
        width: 90%;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 32px 40px 40px;
    }

    .testimonial-sheet.active .testimonial-sheet-content {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .testimonial-sheet-handle {
        display: none;
    }
}

/* Gold decorative elements */
.testimonial-name::after {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
    margin-top: 8px;
    opacity: 0.6;
}

.testimonial-author-name::before {
    content: '✦';
    font-size: 8px;
    color: var(--accent);
    margin-right: 6px;
    opacity: 0.7;
}
