.case-study-wrapper {
    width: 100%;
    padding-bottom: 140px;
    background-color: var(--bg-main);
}

.case-block-row {
    padding-top: 80px;
    padding-bottom: 80px;
    border-bottom: 1px solid var(--border-color);
}

.case-block-row:last-child {
    border-bottom: none;
}

.block-header-wrap {
    max-width: 820px;
    margin-bottom: 40px;
}

.block-main-title {
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    color: var(--text-primary);
    margin-top: 10px;
    margin-bottom: 14px;
}

.block-desc-text {
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.hero-split-block {
    padding-top: 20px;
}

.hero-split-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--project-accent, var(--brand-accent)) 8%, var(--bg-surface));
    border: 1px solid color-mix(in srgb, var(--project-accent, var(--brand-accent)) 30%, transparent);
    color: var(--project-accent, var(--brand-accent));
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hero-main-title {
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.hero-lead-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-tags-stream {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hero-tag-item {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.hero-meta-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.03);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.meta-row:last-of-type {
    border-bottom: none;
}

.meta-title {
    color: var(--text-muted);
}

.meta-val {
    color: var(--text-primary);
    font-weight: 600;
}

.meta-accent-pill {
    margin-top: 24px;
    background: color-mix(in srgb, var(--project-accent, var(--brand-accent)) 8%, transparent);
    color: var(--project-accent, var(--brand-accent));
    border: 1px solid var(--project-accent, var(--brand-accent));
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.metrics-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.metric-display-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 6px 16px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-display-card:hover {
    transform: translateY(-3px);
    border-color: var(--project-accent, var(--brand-accent));
}

.metric-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.metric-digit {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.metric-unit {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--project-accent, var(--brand-accent));
}

.metric-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.metric-context {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.narrative-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
}

.narrative-heading {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.narrative-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.narrative-p {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.narrative-quote {
    margin-top: 40px;
    padding: 24px 32px;
    background: color-mix(in srgb, var(--project-accent, var(--brand-accent)) 4%, var(--bg-surface));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--project-accent, var(--brand-accent));
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.narrative-quote p {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.narrative-quote cite {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-muted);
    font-style: normal;
    display: block;
}

.architecture-diagram-frame {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 40px;
    overflow: hidden;
}

.diagram-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.pipeline-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pipeline-step-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.step-num-pill {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--project-accent, var(--brand-accent));
    background: color-mix(in srgb, var(--project-accent, var(--brand-accent)) 10%, transparent);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 14px;
}

.step-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.step-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tech-stack-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 24px;
}

.tech-stack-caption {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.tech-badge-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-main);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
}

.comparison-widget-container {
    width: 100%;
    margin-top: 20px;
}

.comparison-slider-stage {
    position: relative;
    width: 100%;
    height: 540px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    user-select: none;
    cursor: ew-resize;
}

.comparison-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.comparison-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.comparison-layer.layer-before {
    width: 50%;
    overflow: hidden;
    z-index: 2;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.comparison-layer.layer-before img {
    width: var(--stage-width, 100%);
    max-width: none;
}

.layer-pill {
    position: absolute;
    bottom: 24px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 999px;
    z-index: 5;
    font-family: var(--font-mono);
}

.pill-before {
    left: 24px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.pill-after {
    right: 24px;
    background: var(--project-accent, var(--brand-accent));
    color: #ffffff;
}

.slider-handle-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #ffffff;
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.handle-thumb-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.embed-viewport-frame {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.embed-top-notch {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}

.notch-traffic-lights {
    display: flex;
    gap: 6px;
}

.notch-traffic-lights .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.notch-traffic-lights .dot.red { background: #ef4444; }
.notch-traffic-lights .dot.yellow { background: #f59e0b; }
.notch-traffic-lights .dot.green { background: #10b981; }

.notch-url-text {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.embed-responsive-screen {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
}

.embed-frame-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 1024px) {
    .metrics-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .hero-split-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .narrative-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .comparison-slider-stage {
        height: 380px;
    }
}

@media (max-width: 600px) {
    .metrics-card-grid {
        grid-template-columns: 1fr;
    }
}