/* =========================================
   CASE STUDIES PREMIUM STYLES
   Theme: Mixed Light/Dark (Linear/Stripe inspired)
   ========================================= */

/* --- Variables & Theming --- */
:root {
    --cs-bg-dark: #0f172a;
    --cs-bg-darker: #020617;
    --cs-text-light: #f8fafc;
    --cs-text-dim: #94a3b8;
    --cs-accent-blue: #3b82f6;
    --cs-accent-cyan: #06b6d4;
    --cs-accent-purple: #8b5cf6;
    --cs-surface-glass: rgba(255, 255, 255, 0.05);
    --cs-surface-glass-border: rgba(255, 255, 255, 0.1);
    --cs-card-hover-y: -8px;
    --cs-transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Global Utilities --- */
.cs-wrapper {
    font-family: var(--font-heading, sans-serif);
    color: var(--text-heading);
    background: var(--bg-warm);
    overflow-x: hidden;
}

/* --- Hero Section (Dark Theme) --- */
.cs-hero {
    background-color: var(--cs-bg-darker);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
    color: var(--cs-text-light);
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.cs-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

.cs-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.cs-hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff 20%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cs-hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--cs-text-dim);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* --- Filter Bar --- */
.cs-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 3rem;
}

.cs-filter-btn {
    display: inline-block;
    text-decoration: none;
    background: var(--cs-surface-glass);
    border: 1px solid var(--cs-surface-glass-border);
    color: var(--cs-text-dim);
    padding: 0.6rem 1.25rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--cs-transition);
    backdrop-filter: blur(10px);
}

.cs-filter-btn:hover,
.cs-filter-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Masonry Grid --- */
.cs-grid-section {
    padding: 80px 0;
    background: var(--bg-warm);
}

.cs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    /* Masonry effect usually needs JS or specific CSS grid alignment for true masonry, 
       but for uniform cards grid is fine. */
}

.cs-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 320px;
}

.cs-card--featured .cs-card-thumb {
    min-height: 100%;
}

.cs-card--featured .cs-card-body {
    padding: 2rem 2.5rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .cs-card--featured {
        grid-template-columns: 1fr;
    }
}

.cs-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transition: var(--cs-transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.cs-card:hover {
    transform: translateY(var(--cs-card-hover-y));
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.cs-card-thumb {
    position: relative;
    padding-top: 60%;
    /* 16:10 Aspect Ratio */
    overflow: hidden;
    background-color: #f1f5f9;
}

.cs-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.cs-card:hover .cs-card-thumb img {
    transform: scale(1.05);
}

.cs-card-overlay {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

.cs-category-badge {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cs-bg-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cs-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cs-card-client {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs-card-client::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--cs-accent-blue);
    border-radius: 50%;
}

.cs-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.cs-card:hover .cs-card-title {
    color: var(--cs-accent-blue);
}

.cs-card-metrics {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.cs-metric-mini {
    flex: 1;
}

.cs-metric-val {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
}

.cs-metric-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Show Page Specifics --- */
.show-hero {
    background: var(--cs-bg-darker);
    color: #fff;
    padding: 120px 0 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.show-meta-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    color: var(--cs-text-dim);
    font-size: 0.9rem;
}

.show-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.show-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    transform: translateY(-50%);
    background: #fff;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.show-metric-card {
    text-align: center;
    padding: 1rem;
    border-right: 1px solid var(--border-light);
}

.show-metric-card:last-child {
    border-right: none;
}

.metric-big {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-logo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 0.5rem;
}

.show-content {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 4rem;
    /* offset for negative margin of metrics */
}

.show-section {
    margin-bottom: 5rem;
}

.show-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.show-section h2 svg {
    width: 32px;
    height: 32px;
    color: var(--cs-accent-blue);
}

.tech-stack-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-pill {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-body);
}

.show-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
}

.show-gallery img {
    border-radius: 0.75rem;
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-lg);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .cs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .cs-grid,
    .show-metrics-grid {
        grid-template-columns: 1fr;
    }

    .show-metrics-grid {
        padding: 2rem;
        transform: translateY(-2rem);
    }

    .show-metric-card {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 2rem;
        margin-bottom: 2rem;
    }

    .show-metric-card:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .show-content {
        padding-top: 0;
    }
}

/* --- Case Studies Premium Empty State --- */
.cs-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    margin: 40px auto;
    max-width: 680px;
}

.cs-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 2.5rem;
    color: #3b82f6;
    animation: float 3s ease-in-out infinite;
}

.cs-empty-state h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
}

.cs-empty-state p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cs-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--cs-accent-blue), var(--cs-accent-purple));
    color: #ffffff !important;
    padding: 12px 28px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--cs-transition);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.cs-empty-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}