/* ============================================
   SCALR APEX — Case Study Pages
   ============================================ */

/* --- Case Study Hero --- */
.cs-hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: clamp(120px, 15vh, 200px) 0 clamp(60px, 8vh, 120px);
    position: relative;
    overflow: hidden;
}

.cs-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cs-hero-bg-gradient {
    width: 100%;
    height: 100%;
}

.cs-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,0) 0%, rgba(10,10,10,0.6) 100%);
}

.cs-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.cs-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.cs-hero-tag::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--accent);
}

.cs-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--white);
    margin-bottom: 32px;
}

.cs-hero-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 40px;
}

.cs-hero-metric-value {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.cs-hero-metric-label {
    font-family: var(--font-body);
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 400;
    color: rgba(255,255,255,0.7);
}

.cs-hero-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cs-hero-tags span {
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.02em;
}


/* --- Nav override for case study pages (dark hero background) --- */
body:has(.cs-hero) .nav:not(.scrolled) .nav-logo-dark {
    display: none !important;
}

body:has(.cs-hero) .nav:not(.scrolled) .nav-logo-light {
    display: block !important;
}

body:has(.cs-hero) .nav:not(.scrolled) .nav-link,
body:has(.cs-hero) .nav:not(.scrolled) .nav-num {
    color: rgba(255,255,255,0.7);
}

body:has(.cs-hero) .nav:not(.scrolled) .nav-cta {
    border-color: rgba(255,255,255,0.3);
    color: var(--white);
}

body:has(.cs-hero) .nav:not(.scrolled) .nav-hamburger span {
    background: var(--white);
}


/* --- Overview Strip --- */
.cs-overview {
    padding: clamp(60px, 8vw, 100px) 0;
    border-bottom: 1px solid var(--gray-200);
}

.cs-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.cs-overview-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-overview-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-400);
}

.cs-overview-value {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--black);
}


/* --- Section Shared --- */
.cs-section {
    padding: clamp(80px, 10vw, 140px) 0;
}

.cs-section-alt {
    background: var(--gray-50);
}

.cs-section-tag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
}

.cs-section-tag::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent);
}

.cs-section-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--black);
    margin-bottom: 40px;
}


/* --- Challenge Section --- */
.cs-challenge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 5vw, 80px);
    align-items: start;
}

.cs-challenge-text {
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.7;
    color: var(--gray-600);
}

.cs-challenge-text p + p {
    margin-top: 24px;
}

.cs-challenge-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cs-challenge-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-600);
}

.cs-challenge-list li::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 8px;
}

.cs-challenge-list li strong {
    color: var(--black);
    font-weight: 700;
}


/* --- Solution Section --- */
.cs-solution-intro {
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.7;
    color: var(--gray-600);
    max-width: 800px;
    margin-bottom: clamp(48px, 6vw, 80px);
}

.cs-solution-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.cs-solution-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: clamp(28px, 3vw, 40px);
    transition: all 0.4s var(--ease-out-expo);
}

.cs-solution-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.08);
}

.cs-solution-card-num {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 900;
    color: var(--gray-100);
    line-height: 1;
    margin-bottom: 20px;
}

.cs-solution-card h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 12px;
}

.cs-solution-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--gray-500);
}


/* --- Results Section --- */
.cs-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: clamp(48px, 6vw, 80px);
}

.cs-result-card {
    text-align: center;
    padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 40px);
    background: var(--black);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.cs-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
}

.cs-result-value {
    font-family: var(--font-heading);
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 12px;
}

.cs-result-label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.02em;
}

.cs-results-summary {
    font-size: clamp(17px, 1.8vw, 20px);
    line-height: 1.7;
    color: var(--gray-600);
    max-width: 800px;
}

.cs-results-summary strong {
    color: var(--black);
}


/* --- Testimonial --- */
.cs-testimonial {
    padding: clamp(80px, 10vw, 140px) 0;
    background: var(--black);
    color: var(--white);
}

.cs-testimonial-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.cs-testimonial-quote {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 40px;
    color: var(--white);
}

.cs-testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
}

.cs-testimonial-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    color: var(--white);
}

.cs-testimonial-info {
    text-align: left;
}

.cs-testimonial-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
}

.cs-testimonial-role {
    font-size: 14px;
    color: var(--gray-400);
}


/* --- Visual Showcase --- */
.cs-showcase {
    padding: clamp(60px, 8vw, 100px) 0;
}

.cs-showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.cs-showcase-item {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    position: relative;
}

.cs-showcase-item.full-width {
    grid-column: 1 / -1;
    aspect-ratio: 21 / 9;
}

.cs-showcase-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: clamp(14px, 1.5vw, 20px);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}


/* --- Next Project --- */
.cs-next {
    padding: clamp(80px, 10vw, 120px) 0;
    border-top: 1px solid var(--gray-200);
}

.cs-next-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.cs-next-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.cs-next-title {
    font-family: var(--font-heading);
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--black);
    transition: color 0.3s;
}

.cs-next-link:hover .cs-next-title {
    color: var(--accent);
}

.cs-next-arrow {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s var(--ease-out-expo);
}

.cs-next-link:hover .cs-next-arrow {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.cs-next-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}


/* --- CTA Banner --- */
.cs-cta {
    padding: clamp(80px, 10vw, 120px) 0;
    background: var(--gray-50);
    text-align: center;
}

.cs-cta-title {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.cs-cta-sub {
    font-size: clamp(16px, 1.5vw, 20px);
    color: var(--gray-500);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cs-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: var(--black);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 100px;
    transition: all 0.3s var(--ease-out-expo);
}

.cs-cta-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.3);
}


/* --- Responsive --- */
@media (max-width: 768px) {
    .cs-hero {
        min-height: 80vh;
        padding-top: 100px;
    }

    .cs-overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .cs-challenge-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .cs-solution-grid {
        grid-template-columns: 1fr;
    }

    .cs-results-grid {
        grid-template-columns: 1fr;
    }

    .cs-showcase-grid {
        grid-template-columns: 1fr;
    }

    .cs-showcase-item {
        aspect-ratio: 16 / 10;
    }

    .cs-showcase-item.full-width {
        aspect-ratio: 16 / 10;
    }

    .cs-next-link {
        flex-direction: column;
        text-align: center;
    }

    .cs-next-arrow {
        width: 48px;
        height: 48px;
    }
}
