/* =========================================
   CASE STUDY EXPERT REDESIGN (VANGUARD)
   Inspired by: Stripe, Linear, Apple
   ========================================= */

:root {
    --cs-expert-bg: #020617;
    /* Deep midnight */
    --cs-expert-accent: #3b82f6;
    /* Electric Blue */
    --cs-expert-accent-glow: rgba(59, 130, 246, 0.4);
    --cs-expert-glass: rgba(15, 23, 42, 0.6);
    --cs-expert-glass-border: rgba(255, 255, 255, 0.08);
    --cs-expert-text-muted: #94a3b8;
}

/* --- Base Overrides --- */
.show-expert-wrapper {
    background-color: #fff;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* --- Cinematic Hero --- */
.expert-hero {
    background-color: var(--cs-expert-bg);
    padding: 180px 0 120px;
    position: relative;
    overflow: hidden;
}

.expert-hero::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.1), transparent 40%);
    animation: aurora-drift 20s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes aurora-drift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(5%, 5%);
    }
}

.expert-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    color: var(--cs-expert-accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

.expert-hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #fff;
    margin-bottom: 2.5rem;
    max-width: 1000px;
}

.expert-hero-meta {
    display: flex;
    gap: 3rem;
    color: var(--cs-expert-text-muted);
    font-size: 1rem;
}

.expert-hero-meta strong {
    color: #fff;
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

/* --- Bento Executive Summary --- */
.expert-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.5rem;
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.bento-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.12);
}

/* Specific Bento Placements */
.bento-main-metric {
    grid-column: span 5;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #000;
    color: #fff;
    border: none;
}

.bento-client {
    grid-column: span 4;
}

.bento-duration {
    grid-column: span 3;
}

.bento-tech {
    grid-column: span 7;
}

.bento-main-metric h3 {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 1rem;
}

.bento-main-metric .big-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.bento-main-metric .sub-text {
    color: #3b82f6;
    font-weight: 600;
    font-size: 1.1rem;
}

.bento-tech-list {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.bento-tech-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: grayscale(1) opacity(0.6);
    transition: all 0.3s ease;
}

.bento-tech-icon:hover {
    filter: grayscale(0) opacity(1);
    transform: scale(1.1);
}

.bento-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
}

/* --- Scrollytelling Narrative --- */
.narrative-section {
    padding: 120px 0;
}

.narrative-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 5rem;
}

.narrative-sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.narrative-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 2rem;
}

.narrative-nav-item {
    font-size: 1.1rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.narrative-nav-item.active {
    color: #3b82f6;
}

.chapter {
    margin-bottom: 10rem;
    max-width: 800px;
}

.chapter-header {
    margin-bottom: 2.5rem;
}

.chapter-index {
    color: #3b82f6;
    font-weight: 800;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.chapter-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.chapter-body {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #475569;
}

.chapter-body p {
    margin-bottom: 2rem;
}

.chapter-body strong {
    color: #0f172a;
}

/* --- Highlight Quote --- */
.expert-quote {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: #0f172a;
    padding: 5rem 4rem;
    background: #f8fafc;
    border-radius: 3rem;
    margin: 8rem 0;
    position: relative;
    border-left: 12px solid #3b82f6;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.05);
}

.expert-quote::before {
    content: '“';
    position: absolute;
    top: -1rem;
    left: 2rem;
    font-size: 8rem;
    color: #3b82f6;
    opacity: 0.15;
    font-family: serif;
}

/* --- Elite Impact (Chapter 03) --- */
.elite-impact-section {
    background: #020617;
    margin: 6rem 0;
    border-radius: 4rem;
    padding: 8rem 5rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 100px 150px -50px rgba(2, 6, 23, 0.4);
}

.elite-impact-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.impact-grid-elite {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6rem;
    margin-bottom: 6rem;
}

.impact-metric-elite {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.impact-value-big {
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    background: linear-gradient(to bottom, #fff 30%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.impact-label-elite {
    font-size: 1.5rem;
    color: #94a3b8;
    font-weight: 600;
    max-width: 350px;
    line-height: 1.3;
}

.impact-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.impact-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #2563eb, #60a5fa);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    width: 0;
    /* Animated with intersection observer */
    transition: width 2s cubic-bezier(0.19, 1, 0.22, 1);
}

.expert-insight-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3.5rem;
    border-radius: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    backdrop-filter: blur(10px);
}

.insight-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.5);
}

.insight-icon svg {
    width: 40px;
    height: 40px;
    color: #fff;
}

.insight-content h4 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.insight-content p {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.7;
}

/* --- Visual Showcase (Chapter 04) --- */
.visual-showcase {
    background: #f1f5f9;
    border-radius: 4rem;
    padding: 8rem 6rem;
    margin-top: 6rem;
}

.showcase-layout {
    display: flex;
    flex-direction: column;
    gap: 12rem;
}

.showcase-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: 6rem;
}

.showcase-row:nth-child(even) .showcase-image {
    order: 2;
}

.showcase-row:nth-child(even) .showcase-text {
    order: 1;
    text-align: right;
}

.showcase-text {
    grid-column: span 5;
}

.showcase-image {
    grid-column: span 7;
    position: relative;
}

.showcase-title {
    font-size: 2.75rem;
    font-weight: 900;
    margin-bottom: 2rem;
    color: #0f172a;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.showcase-desc {
    font-size: 1.25rem;
    color: #475569;
    line-height: 1.8;
}

/* Desktop Frame Elite */
.mockup-desktop-elite {
    background: #000;
    padding: 15px;
    border-radius: 2rem;
    box-shadow: 0 60px 120px -30px rgba(0, 0, 0, 0.3);
    border: 1px solid #1e293b;
    position: relative;
    max-width: 100%;
}

.mockup-desktop-elite .screen {
    background: #fff;
    border-radius: 1.25rem;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.mockup-desktop-elite img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Frame Overlap Elite */
.mockup-mobile-elite {
    width: 280px;
    background: #000;
    border: 10px solid #0f172a;
    border-radius: 3.5rem;
    padding: 12px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
    position: absolute;
    bottom: -80px;
    right: -50px;
    z-index: 30;
    transform: rotate(3deg);
    transition: transform 0.5s ease;
}

.mockup-mobile-elite:hover {
    transform: rotate(0deg) translateY(-10px);
}

.mockup-mobile-elite .screen {
    background: #fff;
    border-radius: 2.75rem;
    overflow: hidden;
    aspect-ratio: 9/19.5;
}

.mockup-mobile-elite img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Secondary Visuals Grid (Fallback) --- */
.expert-gallery {
    margin-top: 4rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2rem;
}

.gallery-item {
    grid-column: span 3;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.15);
}

.gallery-item:nth-child(3n) {
    grid-column: span 6;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* --- Responsive Polish --- */
@media (max-width: 1280px) {
    .showcase-row {
        gap: 4rem;
    }
}

@media (max-width: 1024px) {
    .expert-bento-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: -40px;
    }

    .bento-main-metric,
    .bento-tech,
    .bento-client,
    .bento-duration {
        grid-column: span 2;
    }

    .narrative-grid {
        grid-template-columns: 1fr;
    }

    .narrative-sidebar {
        display: none;
    }

    .showcase-row {
        grid-template-columns: 1fr;
        gap: 5rem;
    }

    .showcase-text,
    .showcase-image {
        grid-column: span 1;
    }

    .showcase-row:nth-child(even) .showcase-text {
        text-align: left;
    }

    .mockup-mobile-elite {
        display: none;
    }

    .visual-showcase {
        padding: 4rem 2rem;
    }
}

@media (max-width: 768px) {
    .expert-hero {
        padding-top: 120px;
    }

    .expert-hero-title {
        font-size: 2.75rem;
    }

    .expert-hero-meta {
        flex-direction: column;
        gap: 1.5rem;
    }

    .expert-quote {
        font-size: 1.75rem;
        padding: 3rem 2rem;
    }

    .elite-impact-section {
        padding: 4rem 2rem;
    }

    .impact-grid-elite {
        grid-template-columns: 1fr;
    }

    .impact-value-big {
        font-size: 4rem;
    }

    .expert-insight-box {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================================
   CHAPTER 03 -- FULL-BLEED EDITORIAL IMPACT DASHBOARD
   ========================================================= */

.impact-full-bleed {
    background: #020617;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.impact-full-bleed::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.impact-top-bar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.75rem 0;
    background: rgba(255, 255, 255, 0.02);
}

.impact-headline {
    font-size: clamp(3.5rem, 7vw, 7rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    color: #fff;
    margin-bottom: 1.5rem;
}

.impact-headline em {
    font-style: normal;
    background: linear-gradient(90deg, #3b82f6, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.impact-subline {
    font-size: 1.35rem;
    color: #64748b;
    font-weight: 500;
    max-width: 560px;
}

.impact-metrics-row {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.impact-metrics-row::-webkit-scrollbar { display: none; }

.impact-stat-card {
    flex: 1 0 220px;
    padding: 4rem 3.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: background 0.3s ease;
}

.impact-stat-card:last-child { border-right: none; }

.impact-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #a78bfa);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.impact-stat-card:hover::before { transform: scaleX(1); }
.impact-stat-card:hover { background: rgba(59, 130, 246, 0.04); }

.impact-stat-number {
    font-size: clamp(3rem, 5vw, 5.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    background: linear-gradient(to bottom, #fff 20%, #3b82f6 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.impact-stat-label {
    font-size: 1.1rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.3;
}

.impact-stat-bar-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: auto;
}

.impact-stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #a78bfa);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
    width: 0;
    transition: width 2s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.impact-split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 6rem;
    align-items: start;
}

.impact-split-heading {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fff;
    margin-bottom: 2rem;
}

.impact-split-body {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #64748b;
}

.impact-split-body strong { color: #94a3b8; }

.impact-split-aside {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.impact-insight-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1.5rem;
    backdrop-filter: blur(10px);
    transition: background 0.3s, border-color 0.3s;
}

.impact-insight-card:hover {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.2);
}

.impact-insight-icon {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.impact-insight-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
}

.impact-insight-body {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}

@media (max-width: 1200px) {
    .impact-split { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .impact-stat-card { padding: 3rem 2rem; }
    .impact-headline { font-size: 3rem; }
    .impact-metrics-row { flex-direction: column; }
    .impact-stat-card { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
}
