/* ================================================
   CASE STUDY — ULTRA PREMIUM DESIGN v4.0
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- Root Variables ---- */
:root {
    --cs-primary:       #2563eb;
    --cs-primary-dark:  #1d4ed8;
    --cs-primary-light: #3b82f6;
    --cs-accent:        #f97316;
    --cs-accent-2:      #f59e0b;
    --cs-success:       #10b981;
    --cs-purple:        #8b5cf6;
    --cs-bg:            #f0f4ff;
    --cs-surface:       #ffffff;
    --cs-border:        rgba(37,99,235,0.1);
    --cs-text-dark:     #0f172a;
    --cs-text-body:     #334155;
    --cs-text-muted:    #64748b;
    --cs-radius:        24px;
    --cs-radius-sm:     14px;
    --cs-shadow-sm:     0 2px 12px rgba(15,23,42,0.06);
    --cs-shadow-md:     0 8px 32px rgba(37,99,235,0.12);
    --cs-shadow-lg:     0 24px 64px rgba(37,99,235,0.18);
    --cs-shadow-xl:     0 40px 80px rgba(15,23,42,0.2);
}

/* ================================================
   SCROLL PROGRESS BAR
   ================================================ */
.cs-progress-bar {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--cs-primary), var(--cs-accent), var(--cs-purple));
    z-index: 9999;
    transition: width 0.08s linear;
    border-radius: 0 3px 3px 0;
}

/* ================================================
   BASE
   ================================================ */
.cs-wrapper {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--cs-text-body);
    background: var(--cs-bg);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================================================
   HERO
   ================================================ */
.cs-hero {
    position: relative;
    overflow: hidden;
    padding: 160px 20px 100px;
    text-align: center;
    background: #050d1f;
    isolation: isolate;
}

/* Mesh gradient background */
.cs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 60%, rgba(37,99,235,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(139,92,246,0.2) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 60% 80%, rgba(249,115,22,0.12) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* Grid overlay */
.cs-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

/* Bottom wave */
.cs-hero-wave {
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    z-index: 2;
    line-height: 0;
}
.cs-hero-wave svg { width: 100%; height: 80px; }

.cs-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 860px;
    margin: 0 auto;
}

/* Floating orbs */
.cs-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    animation: orbFloat 8s ease-in-out infinite;
}
.cs-orb-1 { width: 300px; height: 300px; background: rgba(37,99,235,0.25); top: -60px; left: -80px; animation-delay: 0s; }
.cs-orb-2 { width: 200px; height: 200px; background: rgba(139,92,246,0.2); top: 40px; right: -40px; animation-delay: 3s; }
.cs-orb-3 { width: 150px; height: 150px; background: rgba(249,115,22,0.15); bottom: 40px; left: 30%; animation-delay: 6s; }

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-20px) scale(1.05); }
}

.cs-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.cs-hero-tag .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--cs-accent);
    box-shadow: 0 0 10px var(--cs-accent);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 6px var(--cs-accent); }
    50%       { transform: scale(1.4); box-shadow: 0 0 14px var(--cs-accent); }
}

.cs-hero h1 {
    font-size: clamp(1.9rem, 5vw, 3.4rem);
    font-weight: 900;
    line-height: 1.15;
    color: #ffffff;
    margin: 0 0 28px;
    letter-spacing: -0.025em;
}

.cs-hero-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 32px;
}

.cs-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 50px;
}

/* ================================================
   HERO IMAGE BANNER
   ================================================ */
.cs-hero-image {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
    margin-top: -30px;
}

.cs-hero-image img {
    width: 100%;
    height: 480px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--cs-radius);
    box-shadow: 0 40px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.08);
    display: block;
}

/* ================================================
   STATS BAR
   ================================================ */
.cs-stats-bar {
    max-width: 960px;
    margin: 0 auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 3;
}

.cs-stats-bar-inner {
    background: var(--cs-surface);
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    box-shadow: var(--cs-shadow-xl);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    margin-top: -48px;
}

.cs-stat-item {
    padding: 28px 20px;
    text-align: center;
    border-right: 1px solid var(--cs-border);
    position: relative;
    transition: background 0.3s;
}

.cs-stat-item:last-child { border-right: none; }

.cs-stat-item:hover { background: #f8faff; }

.cs-stat-item::before {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cs-primary), var(--cs-accent));
    border-radius: 3px 3px 0 0;
    transition: width 0.4s ease;
}
.cs-stat-item:hover::before { width: 60%; }

.cs-stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--cs-primary-dark);
    line-height: 1;
    letter-spacing: -0.03em;
    display: block;
}

.cs-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cs-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 6px;
    display: block;
}

/* ================================================
   MAIN CONTAINER
   ================================================ */
.cs-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

/* ================================================
   SECTION CARDS
   ================================================ */
.cs-section {
    background: var(--cs-surface);
    border: 1px solid rgba(226,232,240,0.8);
    border-radius: var(--cs-radius);
    padding: 52px 56px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: var(--cs-shadow-sm);
}

/* Shimmer gradient on hover */
.cs-section::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--cs-radius) + 2px);
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-accent), var(--cs-purple));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cs-section::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--cs-surface);
    border-radius: calc(var(--cs-radius) - 1px);
    z-index: -1;
}

.cs-section:hover {
    transform: translateY(-8px);
    box-shadow: var(--cs-shadow-lg);
}
.cs-section:hover::before { opacity: 1; }

/* ================================================
   SECTION LABELS — hidden on live
   ================================================ */
.cs-section-label { display: none; }

/* ================================================
   TYPOGRAPHY
   ================================================ */
.cs-section h2 {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--cs-text-dark);
    margin: 0 0 20px;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.cs-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cs-primary-dark);
    margin: 28px 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cs-section h3::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cs-primary), var(--cs-accent));
    flex-shrink: 0;
}

.cs-section p {
    font-size: 1.0625rem;
    color: var(--cs-text-body);
    margin-bottom: 18px;
    line-height: 1.85;
    text-align: justify;
}

.cs-cta-container p { text-align: center; }

/* ================================================
   HIGHLIGHT / QUOTE BLOCK
   ================================================ */
.cs-highlight {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(139,92,246,0.06));
    border-left: 4px solid var(--cs-primary);
    border-radius: 0 var(--cs-radius-sm) var(--cs-radius-sm) 0;
    padding: 20px 24px;
    margin: 24px 0;
    font-size: 1rem;
    color: var(--cs-text-dark);
    font-style: italic;
    line-height: 1.7;
    font-weight: 500;
}

/* ================================================
   CHALLENGE / SOLUTION SPLIT
   ================================================ */
.cs-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

.cs-split-card {
    border-radius: var(--cs-radius-sm);
    padding: 24px;
    border: 1px solid transparent;
}

.cs-split-card.challenge {
    background: linear-gradient(135deg, rgba(239,68,68,0.05), rgba(239,68,68,0.02));
    border-color: rgba(239,68,68,0.15);
}
.cs-split-card.solution {
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(16,185,129,0.02));
    border-color: rgba(16,185,129,0.15);
}

.cs-split-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.cs-split-card.challenge .cs-split-card-head { color: #dc2626; }
.cs-split-card.solution  .cs-split-card-head { color: #059669; }

.cs-split-card ul {
    list-style: none;
    padding: 0; margin: 0;
}
.cs-split-card ul li {
    font-size: 0.9rem;
    color: var(--cs-text-body);
    margin-bottom: 8px;
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
    background: none;
    border: none;
    border-radius: 0;
    padding-top: 0; padding-bottom: 0; padding-right: 0;
}
.cs-split-card.challenge ul li::before {
    content: '✗';
    position: absolute; left: 0;
    color: #ef4444;
    font-weight: 900;
    font-size: 0.8rem;
}
.cs-split-card.solution ul li::before {
    content: '✓';
    position: absolute; left: 0;
    color: #10b981;
    font-weight: 900;
    font-size: 0.8rem;
}

/* ================================================
   TIMELINE
   ================================================ */
.cs-timeline {
    position: relative;
    padding-left: 32px;
    margin: 24px 0;
}

.cs-timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--cs-primary) 0%, var(--cs-accent) 100%);
    border-radius: 2px;
}

.cs-timeline-item {
    position: relative;
    margin-bottom: 28px;
    padding-bottom: 4px;
}

.cs-timeline-item:last-child { margin-bottom: 0; }

.cs-timeline-item::before {
    content: '';
    position: absolute;
    left: -27px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--cs-primary);
    border: 3px solid var(--cs-bg);
    box-shadow: 0 0 0 2px var(--cs-primary);
    transition: transform 0.3s, box-shadow 0.3s;
}

.cs-timeline-item:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 0 3px var(--cs-accent);
}

.cs-timeline-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cs-text-dark);
    margin: 0 0 6px;
}

.cs-timeline-item p {
    font-size: 0.9rem;
    color: var(--cs-text-muted);
    margin: 0;
    line-height: 1.6;
    text-align: left;
}

/* ================================================
   LISTS (premium styled)
   ================================================ */
.cs-section ul:not(.cs-split-card ul),
.cs-section ol {
    padding-left: 0;
    margin: 16px 0;
    list-style: none;
    counter-reset: cs-ol;
}

.cs-section ul:not(.cs-split-card ul) li,
.cs-section ol li {
    font-size: 0.975rem;
    color: var(--cs-text-body);
    margin-bottom: 10px;
    padding: 14px 18px 14px 54px;
    background: #f8faff;
    border: 1px solid rgba(37,99,235,0.07);
    border-radius: 12px;
    position: relative;
    line-height: 1.6;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.cs-section ul:not(.cs-split-card ul) li:hover,
.cs-section ol li:hover {
    background: #eef2ff;
    border-color: rgba(37,99,235,0.2);
    transform: translateX(4px);
}

.cs-section ul:not(.cs-split-card ul) li::before {
    content: '✓';
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--cs-primary), #6366f1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cs-section ol li {
    counter-increment: cs-ol;
}
.cs-section ol li::before {
    content: counter(cs-ol);
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--cs-accent), var(--cs-accent-2));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ================================================
   OUTCOME CARDS
   ================================================ */
.cs-outcomes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 24px 0;
}

.cs-outcome-card {
    background: #fff;
    border: 1px solid rgba(37,99,235,0.08);
    border-radius: var(--cs-radius-sm);
    padding: 24px;
    box-shadow: var(--cs-shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-outcome-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--cs-shadow-md);
    border-color: rgba(37,99,235,0.2);
}

.cs-outcome-icon {
    font-size: 2rem;
    line-height: 1;
}

.cs-outcome-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cs-text-dark);
    margin: 0;
}

.cs-outcome-card p {
    font-size: 0.875rem;
    color: var(--cs-text-muted);
    margin: 0;
    text-align: left;
    line-height: 1.6;
}

/* ================================================
   TECH STACK PILLS
   ================================================ */
.tech-stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.tech-stack-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8faff;
    border: 1px solid rgba(37,99,235,0.1);
    border-radius: 50px;
    padding: 10px 22px;
    transition: all 0.3s;
    cursor: default;
}

.tech-stack-pill:hover {
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(99,102,241,0.08));
    border-color: rgba(37,99,235,0.3);
    transform: translateY(-3px);
    box-shadow: var(--cs-shadow-sm);
}

.tech-stack-pill img { height: 28px; width: auto; object-fit: contain; }
.tech-stack-pill span { font-size: 0.875rem; font-weight: 600; color: var(--cs-text-dark); }

/* ================================================
   TEXT HIGHLIGHT
   ================================================ */
.cs-text-orange {
    background: linear-gradient(90deg, #f97316 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================================
   CALL TO ACTION
   ================================================ */
.cs-cta-container {
    text-align: center;
    margin-top: 40px;
    padding: 72px 48px;
    background: #050d1f;
    border-radius: var(--cs-radius);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.cs-cta-container::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 10% 50%, rgba(37,99,235,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 90% 30%, rgba(139,92,246,0.25) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 60% 90%, rgba(249,115,22,0.15) 0%, transparent 55%);
    z-index: 0;
}

.cs-cta-container::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

.cs-cta-container > * { position: relative; z-index: 1; }

.cs-cta-container h2 {
    color: #fff !important;
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    margin: 0 0 16px;
    -webkit-text-fill-color: #fff !important;
}

.cs-cta-container p {
    color: rgba(255,255,255,0.65);
    font-size: 1.05rem;
    margin: 0 auto 36px;
    max-width: 540px;
    line-height: 1.75;
}

.cs-cta-container a:not(.cs-cta-btn) { color: #93c5fd; text-decoration: underline; }

.cs-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--cs-accent) 0%, var(--cs-accent-2) 100%);
    color: #fff;
    padding: 17px 44px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.35s ease;
    box-shadow: 0 8px 28px rgba(249,115,22,0.45);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.cs-cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: opacity 0.3s;
}
.cs-cta-btn:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 16px 40px rgba(249,115,22,0.6); color: #fff; }
.cs-cta-btn:hover::before { opacity: 1; }

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cs-animate-up {
    animation: fadeInUp 0.7s cubic-bezier(0.22,1,0.36,1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.7s; }
.delay-6 { animation-delay: 0.85s; }

/* scroll-reveal (added via JS) */
.cs-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.cs-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .cs-hero { padding: 130px 20px 80px; }
    .cs-hero h1 { font-size: 1.8rem; }
    .cs-hero-image img { height: 260px; }
    .cs-stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
    .cs-stat-item:nth-child(2) { border-right: none; }
    .cs-section { padding: 32px 24px; }
    .cs-split { grid-template-columns: 1fr; }
    .cs-outcomes-grid { grid-template-columns: 1fr; }
    .cs-cta-container { padding: 48px 24px; }
    .cs-cta-container h2 { font-size: 1.6rem; }
}
