/* ----------------------------------------------------------------
	Custom CSS — MDPSync Case Study Pages
	v2.0 — Enhanced visual design
-----------------------------------------------------------------*/

/* ================================================================
   HERO SECTION
   ================================================================ */

section.case-study-hero {
    position: relative !important;
    padding: 160px 0 100px !important;
    background: linear-gradient(160deg, #0a0a0c 0%, #12101f 30%, #1e1230 50%, #12101f 70%, #0a0a0c 100%) !important;
    overflow: hidden !important;
}

section.case-study-hero::before {
    content: '' !important;
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(131,58,180,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 30%, rgba(252,176,69,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(253,29,29,0.06) 0%, transparent 50%) !important;
    pointer-events: none;
}

section.case-study-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(131,58,180,0.4) 30%, rgba(253,29,29,0.4) 50%, rgba(252,176,69,0.4) 70%, transparent 100%);
}

section.case-study-hero .container {
    position: relative;
    z-index: 2;
}

/* Hero title */
section.case-study-hero h1 {
    font-family: 'Playfair Display', serif !important;
    font-weight: 900 !important;
    font-size: 56px !important;
    letter-spacing: -0.5px;
    color: #fff !important;
    text-shadow: 0 2px 40px rgba(131,58,180,0.15);
}

/* Hero title accent ("in 7 Days") */
body.dark section.case-study-hero h1 span.cs-title-accent {
    font-style: italic !important;
    font-weight: 400 !important;
    color: transparent !important;
    background: linear-gradient(135deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 45%, rgba(252,176,69,1) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Hero subtitle */
section.case-study-hero .lead {
    font-size: 19px !important;
    line-height: 1.7 !important;
    color: rgba(255,255,255,0.75) !important;
    font-family: 'Source Sans Pro', sans-serif;
}

/* Visit The Rock Cave button */
section.case-study-hero .button-border {
    border-color: rgba(255,255,255,0.35) !important;
    color: rgba(255,255,255,0.8) !important;
}

section.case-study-hero .button-border:hover {
    border-color: rgba(252,176,69,0.7) !important;
    color: #fff !important;
    background-color: rgba(252,176,69,0.1) !important;
}

/* Case Study label */
.case-study-label {
    display: inline-block !important;
    font-size: 11px !important;
    letter-spacing: 5px !important;
    text-transform: uppercase !important;
    color: rgba(252,176,69,0.7) !important;
    margin-bottom: 20px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
}

/* Hero badge pills */
span.case-study-badge {
    display: inline-block !important;
    padding: 7px 20px !important;
    margin: 4px !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 100px !important;
    font-size: 10px !important;
    letter-spacing: 2.5px !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.6) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.03) !important;
    transition: all 0.3s ease !important;
}

span.case-study-badge:hover {
    border-color: rgba(255,255,255,0.35) !important;
    color: rgba(255,255,255,0.85) !important;
    background: rgba(255,255,255,0.06) !important;
}

/* ================================================================
   SECTION NAVIGATION PILLS
   ================================================================ */

.cs-section-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
}

a.cs-nav-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 7px 14px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    letter-spacing: 0.3px !important;
    color: rgba(255,255,255,0.55) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    background: rgba(255,255,255,0.05) !important;
}

a.cs-nav-pill::after {
    content: '↓' !important;
    font-size: 10px !important;
    opacity: 0.5 !important;
    transition: all 0.3s ease !important;
}

a.cs-nav-pill:hover {
    background: linear-gradient(135deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 45%, rgba(252,176,69,1) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    text-decoration: none !important;
}

a.cs-nav-pill:hover::after {
    opacity: 1 !important;
    -webkit-text-fill-color: transparent !important;
}

/* ================================================================
   GRADIENT DIVIDER LINE (reusable)
   ================================================================ */

.cs-gradient-line {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(131,58,180,0.3) 30%, rgba(253,29,29,0.3) 50%, rgba(252,176,69,0.3) 70%, transparent 100%);
    margin: 0 auto;
    max-width: 600px;
}

/* ================================================================
   COUNTER / METRICS SECTION
   ================================================================ */

.cs-counter-value {
    font-size: 52px !important;
    font-weight: 700 !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    line-height: 1.1 !important;
}

.counter-gradient {
    background: linear-gradient(135deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 45%, rgba(252,176,69,1) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.cs-counter-label {
    font-size: 12px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.4) !important;
    margin-top: 10px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
}

/* ================================================================
   SECTION BACKGROUNDS & LAYOUT
   ================================================================ */

.cs-bg-dark {
    background-color: #0a0a0c !important;
}

.cs-bg-alt {
    background-color: #0e0e10 !important;
}

.page-section.cs-bg-dark,
.page-section.cs-bg-alt,
.page-section.cs-gradient-bg {
    padding: 80px 0 !important;
}

/* Gradient accent background */
.cs-gradient-bg {
    position: relative !important;
    background-color: #0a0a0c !important;
}

.cs-gradient-bg::before {
    content: '' !important;
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg,
        rgba(131,58,180,0.06) 0%,
        rgba(253,29,29,0.04) 50%,
        rgba(252,176,69,0.04) 100%) !important;
    pointer-events: none;
}

.cs-gradient-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(131,58,180,0.3) 30%, rgba(253,29,29,0.3) 50%, rgba(252,176,69,0.3) 70%, transparent 100%);
}

.cs-gradient-bg .container {
    position: relative;
    z-index: 1;
}

/* ================================================================
   HEADINGS & TYPOGRAPHY
   ================================================================ */

.cs-heading {
    font-family: 'Playfair Display', serif !important;
    font-weight: 700 !important;
    color: #f8f9fa !important;
}

.cs-subheading {
    font-size: 12px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    color: rgba(252,176,69,0.6) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
}

/* Challenge and Solution body text */
#section-challenge p,
#section-solution p {
    color: rgba(255,255,255,0.65) !important;
    line-height: 1.8 !important;
    font-size: 16px !important;
}

#section-challenge .lead,
#section-solution .lead {
    font-size: 18px !important;
    color: rgba(255,255,255,0.8) !important;
}

/* ================================================================
   SCREENSHOTS
   ================================================================ */

.case-study-screenshot {
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03) !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
    width: 100% !important;
}

.case-study-screenshot:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 35px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06) !important;
}

/* ================================================================
   FEATURE GRID (What We Built)
   ================================================================ */

#section-features .feature-box {
    transition: background-color 0.3s ease;
}

#section-features .feature-box:hover {
    background-color: rgba(255,255,255,0.02);
}

#section-features .fbox-content h3 {
    font-size: 17px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}

#section-features .fbox-content p {
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: rgba(255,255,255,0.5) !important;
}

/* ================================================================
   PLATFORM SHOWCASE (Alternating rows)
   ================================================================ */

.cs-showcase-row {
    margin-bottom: 100px !important;
    padding-bottom: 100px !important;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cs-showcase-row:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

#section-showcase h3.cs-heading {
    font-size: 30px !important;
    margin-bottom: 20px !important;
}

#section-showcase p {
    color: rgba(255,255,255,0.6) !important;
    line-height: 1.85 !important;
    font-size: 16px !important;
}

/* ================================================================
   MEET THE BOTS
   ================================================================ */

.bot-card {
    background: rgba(255,255,255,0.025) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 14px !important;
    padding: 28px !important;
    height: 100%;
    transition: all 0.35s ease !important;
}

.bot-card:hover {
    border-color: rgba(131,58,180,0.25) !important;
    background: rgba(255,255,255,0.04) !important;
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.bot-card-header {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 18px !important;
    gap: 18px !important;
}

.bot-avatar {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255,255,255,0.1) !important;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.bot-card:hover .bot-avatar {
    border-color: rgba(131,58,180,0.4) !important;
}

.bot-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bot-name {
    font-family: 'Playfair Display', serif !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #f8f9fa !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.bot-handle {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 13px !important;
    color: rgba(176,106,240,1) !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

.bot-tagline {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 12px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: rgba(252,176,69,0.6) !important;
    font-weight: 600 !important;
    margin-top: 2px;
}

.bot-bio {
    font-size: 14.5px !important;
    line-height: 1.75 !important;
    color: rgba(255,255,255,0.5) !important;
    margin: 0 0 12px !important;
}
.bot-intro-trigger {
    display: inline-block;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(176,106,240,1);
    transition: color 0.2s;
}
.bot-intro-trigger:hover { color: rgba(252,176,69,0.9); }

/* Bot intro modal */
#bot-intro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#bot-intro-overlay.active { opacity: 1; pointer-events: auto; }
#bot-intro-modal {
    background: #16141a;
    border: 1px solid rgba(131,58,180,0.4);
    border-radius: 12px;
    max-width: 580px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
#bot-intro-overlay.active #bot-intro-modal { transform: scale(1) translateY(0); opacity: 1; }
.bim-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    position: relative;
}
.bim-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bim-meta { flex: 1; min-width: 0; }
.bim-name { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700; color: #f8f9fa; margin: 0 0 2px; display: block; }
.bim-handle { font-size: 12px; color: rgba(176,106,240,1); margin: 0 0 3px; display: block; }
.bim-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: rgba(252,176,69,0.85); margin: 0; display: block; }
.bim-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none;
    color: rgba(255,255,255,0.4); font-size: 22px;
    cursor: pointer; line-height: 1; padding: 0; transition: color 0.15s;
}
.bim-close:hover { color: rgba(255,255,255,0.9); }
.bim-body { padding: 20px 22px; overflow-y: auto; flex: 1; font-size: 14px; line-height: 1.7; color: rgba(255,255,255,0.75); }
.bim-body p { margin: 0 0 12px; }
.bim-body p:last-child { margin-bottom: 0; }
.bim-footer { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.07); text-align: right; }
.bim-footer a { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(176,106,240,1); text-decoration: none; transition: color 0.2s; }
.bim-footer a:hover { color: rgba(252,176,69,0.9); }

@media (max-width: 991px) {
    .bot-card {
        padding: 22px !important;
    }
    .bot-avatar {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ================================================================
   TECHNOLOGY STACK
   ================================================================ */

span.tech-badge {
    display: inline-block !important;
    padding: 10px 24px !important;
    margin: 5px !important;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    letter-spacing: 0.5px !important;
    color: rgba(255,255,255,0.6) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 400 !important;
    transition: all 0.3s ease !important;
}

span.tech-badge:hover {
    border-color: rgba(131,58,180,0.4) !important;
    color: rgba(255,255,255,0.85) !important;
    background: rgba(131,58,180,0.06) !important;
}

#section-techstack h4 {
    color: rgba(255,255,255,0.5) !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

/* ================================================================
   RESULTS & IMPACT
   ================================================================ */

#section-results .lead {
    color: rgba(255,255,255,0.65) !important;
    font-size: 18px !important;
    line-height: 1.8 !important;
}

/* ================================================================
   VIBE-CODING ADVANTAGE
   ================================================================ */

#section-vibecoding h4 {
    color: #f8f9fa !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-top: 8px;
}

#section-vibecoding p {
    color: rgba(255,255,255,0.55) !important;
    font-size: 15px !important;
    line-height: 1.75 !important;
}

#section-vibecoding .op-gradient-icon {
    font-size: 52px !important;
}

/* ================================================================
   CTA SECTION
   ================================================================ */

#section-cta {
    position: relative;
}

#section-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(131,58,180,0.3) 30%, rgba(253,29,29,0.3) 50%, rgba(252,176,69,0.3) 70%, transparent 100%);
}

#section-cta h2 {
    font-family: 'Playfair Display', serif !important;
}

#section-cta .lead {
    color: rgba(255,255,255,0.6) !important;
}

#section-cta .button {
    letter-spacing: 2px !important;
    font-size: 12px !important;
    padding: 14px 40px !important;
    text-transform: uppercase !important;
}

/* ================================================================
   COST COMPARISON CARDS
   ================================================================ */

.cs-cost-card {
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 12px !important;
    padding: 28px 32px !important;
    background: rgba(255,255,255,0.025) !important;
    transition: all 0.3s ease !important;
}

.cs-cost-traditional {
    opacity: 0.7;
}

.cs-cost-vibecoding {
    border-color: rgba(131,58,180,0.35) !important;
    background: rgba(131,58,180,0.06) !important;
}

.cs-cost-card-header {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 11px !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.45) !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.cs-cost-vibecoding .cs-cost-card-header {
    color: rgba(252,176,69,0.7) !important;
}

.cs-cost-card-timeline {
    font-family: 'Playfair Display', serif !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #f8f9fa !important;
    margin-bottom: 14px !important;
}

.cs-cost-card-team {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-bottom: 16px !important;
}

.cs-team-role {
    display: inline-block !important;
    padding: 4px 12px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 100px !important;
    font-size: 11px !important;
    color: rgba(255,255,255,0.5) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 400 !important;
}

.cs-cost-vibecoding .cs-team-role {
    border-color: rgba(131,58,180,0.3) !important;
    color: rgba(255,255,255,0.7) !important;
}

.cs-cost-card-price {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: rgba(255,255,255,0.4) !important;
    margin-top: 4px !important;
}

.cs-cost-highlight {
    background: linear-gradient(135deg, rgba(131,58,180,1) 0%, rgba(253,29,29,1) 45%, rgba(252,176,69,1) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 22px !important;
}

/* ================================================================
   MOBILE APP FAN SPREAD
   ================================================================ */

.phone-fan-container {
    display: flex !important;
    justify-content: center !important;
    padding: 40px 0 20px !important;
    overflow: hidden !important;
}

.phone-fan-wrapper {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    position: relative !important;
    height: 460px !important;
    width: 100% !important;
    max-width: 1100px !important;
}

.phone-fan-item {
    position: absolute !important;
    text-align: center !important;
    transition: all 0.4s ease !important;
}

.phone-fan-item .phone-screen {
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08) !important;
    transition: all 0.4s ease !important;
}

.phone-fan-item .phone-label {
    display: block !important;
    margin-top: 12px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.35) !important;
    font-weight: 600 !important;
}

/* Fan positions: 1=far left, 2=inner left, 3=center, 4=inner right, 5=far right */
.phone-pos-1 {
    left: 20px !important;
    bottom: 40px !important;
    z-index: 1 !important;
    transform: rotate(-6deg) !important;
}
.phone-pos-1 .phone-screen {
    height: 300px !important;
    width: auto !important;
}

.phone-pos-2 {
    left: 190px !important;
    bottom: 20px !important;
    z-index: 2 !important;
    transform: rotate(-3deg) !important;
}
.phone-pos-2 .phone-screen {
    height: 350px !important;
    width: auto !important;
}

.phone-pos-3 {
    left: 50% !important;
    bottom: 0 !important;
    z-index: 3 !important;
    transform: translateX(-50%) rotate(0deg) !important;
}
.phone-pos-3 .phone-screen {
    height: 400px !important;
    width: auto !important;
}

.phone-pos-4 {
    right: 190px !important;
    bottom: 20px !important;
    z-index: 2 !important;
    transform: rotate(3deg) !important;
}
.phone-pos-4 .phone-screen {
    height: 350px !important;
    width: auto !important;
}

.phone-pos-5 {
    right: 20px !important;
    bottom: 40px !important;
    z-index: 1 !important;
    transform: rotate(6deg) !important;
}
.phone-pos-5 .phone-screen {
    height: 300px !important;
    width: auto !important;
}

/* Hover: lift individual phone */
.phone-fan-item:hover {
    z-index: 10 !important;
    transform: translateY(-10px) rotate(0deg) !important;
}
.phone-pos-3:hover {
    transform: translateX(-50%) translateY(-10px) rotate(0deg) !important;
}

.phone-fan-item:hover .phone-screen {
    box-shadow: 0 20px 60px rgba(131,58,180,0.3), 0 0 0 1px rgba(131,58,180,0.3) !important;
}

.phone-fan-item:hover .phone-label {
    color: rgba(255,255,255,0.7) !important;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 991px) {
    section.case-study-hero {
        padding: 130px 0 70px !important;
    }

    section.case-study-hero h1 {
        font-size: 42px !important;
    }

    .cs-showcase-row {
        margin-bottom: 60px !important;
        padding-bottom: 60px !important;
    }

    .page-section.cs-bg-dark,
    .page-section.cs-bg-alt,
    .page-section.cs-gradient-bg {
        padding: 60px 0 !important;
    }

    /* Tablet: tighter fan */
    .phone-fan-wrapper {
        height: 360px !important;
        max-width: 700px !important;
    }
    .phone-pos-1 .phone-screen { height: 220px !important; }
    .phone-pos-2 .phone-screen { height: 260px !important; }
    .phone-pos-3 .phone-screen { height: 300px !important; }
    .phone-pos-4 .phone-screen { height: 260px !important; }
    .phone-pos-5 .phone-screen { height: 220px !important; }
    .phone-pos-1 { left: 0 !important; bottom: 40px !important; }
    .phone-pos-2 { left: 105px !important; bottom: 25px !important; }
    .phone-pos-4 { right: 105px !important; bottom: 25px !important; }
    .phone-pos-5 { right: 0 !important; bottom: 40px !important; }
}

@media (max-width: 767px) {
    section.case-study-hero {
        padding: 110px 0 50px !important;
    }

    section.case-study-hero h1 {
        font-size: 34px !important;
    }

    .cs-counter-value {
        font-size: 38px !important;
    }

    .cs-showcase-row .flex-row-reverse {
        flex-direction: column !important;
    }

    .cs-showcase-row {
        margin-bottom: 40px !important;
        padding-bottom: 40px !important;
    }

    #section-showcase h3.cs-heading {
        font-size: 24px !important;
    }

    /* Mobile: horizontal scroll strip instead of fan */
    .phone-fan-container {
        padding: 20px 0 10px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .phone-fan-wrapper {
        display: flex !important;
        position: relative !important;
        height: auto !important;
        max-width: none !important;
        gap: 16px !important;
        padding: 0 20px !important;
        width: max-content !important;
    }
    .phone-fan-item {
        position: relative !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        flex-shrink: 0 !important;
    }
    .phone-fan-item .phone-screen {
        height: 280px !important;
        width: auto !important;
        border-radius: 16px !important;
    }
    .phone-pos-1, .phone-pos-2, .phone-pos-3, .phone-pos-4, .phone-pos-5 {
        transform: none !important;
        z-index: 1 !important;
    }
    .phone-pos-3 {
        transform: none !important;
    }
}

/* ================================================================
   TECHNICAL CASE STUDY — THESIS STYLES
   ================================================================ */

/* Thesis body text */
.cs-thesis-text {
    color: rgba(255,255,255,0.7) !important;
    font-size: 16px !important;
    line-height: 1.9 !important;
    font-family: 'Source Sans Pro', sans-serif !important;
}

.cs-thesis-text p {
    margin-bottom: 1.2em !important;
}

/* Lists — constrain within body text margins */
.cs-thesis-text ol,
.cs-thesis-text ul {
    padding-left: 24px !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.cs-thesis-text ol li,
.cs-thesis-text ul li {
    padding-left: 8px !important;
    margin-bottom: 4px !important;
}

.cs-thesis-text .lead {
    font-size: 18px !important;
    color: rgba(255,255,255,0.8) !important;
    line-height: 1.8 !important;
}

/* Sub-section headings (h3 within sections) */
.cs-thesis-text h3 {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 700 !important;
    font-size: 22px !important;
    color: #f8f9fa !important;
    margin-top: 40px !important;
    margin-bottom: 16px !important;
    letter-spacing: 0.3px;
}

/* Sub-sub-section headings (h4) */
.cs-thesis-text h4 {
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
    font-size: 18px !important;
    color: rgba(255,255,255,0.85) !important;
    margin-top: 28px !important;
    margin-bottom: 12px !important;
}

/* Code blocks */
.cs-code-block {
    background: #111114 !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 24px 0 !important;
    overflow: hidden !important;
}

.cs-code-block pre {
    background: transparent !important;
    margin: 0 !important;
    padding: 20px 24px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    overflow-x: auto !important;
}

.cs-code-block code {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace !important;
    font-size: 13px !important;
    color: rgba(255,255,255,0.85) !important;
}

/* Code block header (language label) */
.cs-code-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 16px !important;
    background: rgba(255,255,255,0.03) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 11px !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.35) !important;
    font-weight: 600 !important;
}

/* Architecture diagram container */
.cs-diagram {
    background: #0d0d10 !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 8px !important;
    padding: 24px !important;
    margin: 24px 0 !important;
    overflow-x: auto !important;
}

.cs-diagram pre {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'SF Mono', 'Fira Code', Menlo, Consolas, monospace !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    color: rgba(255,255,255,0.6) !important;
    white-space: pre !important;
}

.cs-diagram-label {
    display: block !important;
    margin-bottom: 12px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 11px !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: rgba(252,176,69,0.5) !important;
    font-weight: 600 !important;
}

.cs-diagram svg {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 4px !important;
}

.cs-diagram:has(svg) {
    overflow-x: visible !important;
    padding: 16px 24px 24px !important;
}

/* Academic reference list */
.cs-references {
    counter-reset: ref-counter !important;
    padding-left: 0 !important;
    list-style: none !important;
}

.cs-references li {
    counter-increment: ref-counter !important;
    padding: 8px 0 8px 40px !important;
    position: relative !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: rgba(255,255,255,0.55) !important;
    border-bottom: 1px solid rgba(255,255,255,0.03) !important;
}

.cs-references li::before {
    content: '[' counter(ref-counter) ']' !important;
    position: absolute !important;
    left: 0 !important;
    color: rgba(252,176,69,0.5) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
}

.cs-references li a {
    color: rgba(176,106,240,1) !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.cs-references li a:hover {
    color: rgba(131,58,180,1) !important;
}

/* Figure captions for screenshots */
.cs-figure {
    margin: 30px 0 !important;
    text-align: center !important;
}

.cs-figure-caption {
    display: block !important;
    margin-top: 12px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-size: 13px !important;
    font-style: italic !important;
    color: rgba(255,255,255,0.4) !important;
}

/* Metrics table */
.cs-metrics-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 24px 0 !important;
}

.cs-metrics-table th,
.cs-metrics-table td {
    padding: 12px 16px !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    font-size: 14px !important;
    color: rgba(255,255,255,0.7) !important;
}

.cs-metrics-table th {
    background: rgba(255,255,255,0.03) !important;
    color: rgba(255,255,255,0.5) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 11px !important;
}

/* Prism.js dark theme overrides */
.cs-code-block .token.comment { color: rgba(255,255,255,0.3) !important; }
.cs-code-block .token.keyword { color: #c792ea !important; }
.cs-code-block .token.string { color: #c3e88d !important; }
.cs-code-block .token.function { color: #82aaff !important; }
.cs-code-block .token.number { color: #f78c6c !important; }
.cs-code-block .token.operator { color: #89ddff !important; }
.cs-code-block .token.punctuation { color: rgba(255,255,255,0.5) !important; }
.cs-code-block .token.class-name { color: #ffcb6b !important; }
.cs-code-block .token.property { color: #f07178 !important; }

/* Inline reference citations */
.cs-cite {
    color: rgba(252,176,69,0.7) !important;
    font-size: 12px !important;
    vertical-align: super !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

/* Cross-link banner between case studies */
.cs-crosslink {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 14px 24px !important;
    background: rgba(131,58,180,0.06) !important;
    border: 1px solid rgba(131,58,180,0.15) !important;
    border-radius: 8px !important;
    margin-top: 20px !important;
    transition: all 0.3s ease !important;
}

.cs-crosslink:hover {
    border-color: rgba(131,58,180,0.35) !important;
    background: rgba(131,58,180,0.1) !important;
}

.cs-crosslink a {
    color: rgba(255,255,255,0.7) !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-family: 'Source Sans Pro', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

/* Responsive for thesis elements */
@media (max-width: 767px) {
    .cs-code-block pre {
        font-size: 11px !important;
        padding: 16px !important;
    }

    .cs-diagram pre {
        font-size: 10px !important;
    }

    .cs-thesis-text h3 {
        font-size: 19px !important;
        margin-top: 30px !important;
    }
}
