/* ============================================================
   Case Study Styles
   ============================================================ */

/* ── Scroll Progress Bar ───────────────────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    z-index: 1001;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Case Study Hero ───────────────────────────────────────── */
.case-hero {
    padding: 148px 0 64px;
    text-align: center;
    background: var(--background);
    position: relative;
    overflow: hidden;
}

.case-hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.case-hero .container { position: relative; z-index: 1; }

.case-tags {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.case-tag {
    background: rgba(99,102,241,0.08);
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    border: 1px solid rgba(99,102,241,0.2);
    letter-spacing: 0.3px;
}

.case-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -1.5px;
    color: var(--text-primary);
}

.case-subtitle {
    font-size: 19px;
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0 auto 44px;
    line-height: 1.7;
}

.case-meta {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    max-width: 700px;
    margin: 0 auto;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.meta-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.meta-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Featured Image ────────────────────────────────────────── */
.case-featured {
    padding: 60px 0 80px;
    background: var(--background-light);
}

.featured-image {
    width: 100%;
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 32px 80px rgba(0,0,0,0.14);
    position: relative;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Case Study Sections ───────────────────────────────────── */
.case-section {
    padding: 80px 0;
}

.case-section.bg-light {
    background: var(--background-light);
}

.case-container {
    max-width: 860px;
}

.case-content h2 {
    font-size: clamp(24px, 3.5vw, 34px);
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.8px;
    color: var(--text-primary);
}

.case-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.case-content p {
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.case-content p.highlight {
    font-size: 19px;
    color: var(--primary);
    font-weight: 500;
    padding: 20px 24px;
    background: rgba(99,102,241,0.06);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    margin: 32px 0;
    line-height: 1.6;
}

/* ── Lists ─────────────────────────────────────────────────── */
.insights-list,
.next-steps-list {
    list-style: none;
    padding: 0;
    margin: 28px 0;
}

.insights-list li,
.next-steps-list li {
    padding: 16px 0 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    position: relative;
}

.insights-list li::before,
.next-steps-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.insights-list li:last-child,
.next-steps-list li:last-child {
    border-bottom: none;
}

.insights-list li strong,
.next-steps-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Features Grid ─────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 36px 0;
}

.feature-card {
    background: var(--background-card);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}

.feature-card h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* ── Process Steps ─────────────────────────────────────────── */
.process-step {
    margin: 36px 0;
    padding-left: 20px;
    border-left: 2px solid var(--border-hover);
}

.process-step h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 10px;
}

/* ── Design Images ─────────────────────────────────────────── */
.design-image {
    margin: 36px 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.09);
    border: 1px solid var(--border);
}

.design-image img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.design-image:hover img { transform: scale(1.015); }

.image-caption {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 12px 16px;
    background: var(--background-light);
    margin: 0;
    font-style: italic;
    border-top: 1px solid var(--border);
}

/* ── Screen Showcase ───────────────────────────────────────── */
.screen-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    margin: 60px 0;
}

.screen-showcase.reverse { direction: rtl; }
.screen-showcase.reverse > * { direction: ltr; }

.screen-image {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(0,0,0,0.12);
}

.screen-image img {
    width: 100%;
    display: block;
}

.screen-description h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.4px;
}

.screen-description p {
    font-size: 16px;
    line-height: 1.75;
}

/* ── Decision & Learning Cards ─────────────────────────────── */
.decision-card,
.learning-card {
    padding: 24px;
    background: var(--background-card);
    border-left: 3px solid var(--primary);
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
}

.decision-card:hover,
.learning-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    border-color: var(--border-hover);
    border-left-color: var(--primary);
}

.decision-card h3,
.learning-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.decision-card p,
.learning-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
}

/* ── More Projects ─────────────────────────────────────────── */
.more-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 36px;
}

.project-preview {
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
}

.project-preview:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1);
    border-color: var(--border-hover);
}

.project-preview-image {
    width: 100%;
    height: 200px;
    background: var(--background-light);
    overflow: hidden;
}

.project-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-preview:hover .project-preview-image img {
    transform: scale(1.05);
}

.project-preview h3 {
    padding: 18px 18px 6px;
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.project-preview p {
    padding: 0 18px 18px;
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.project-preview.view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-light);
    min-height: 280px;
}

.view-all-content {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.2px;
}

/* ── Case Study CTA ────────────────────────────────────────── */
.case-cta {
    padding: 100px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    position: relative;
    overflow: hidden;
}

.case-cta::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    top: -200px;
    right: -100px;
    pointer-events: none;
}

.case-cta h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: -1px;
    position: relative;
}

.case-cta p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.88;
    position: relative;
}

.case-cta .button-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    position: relative;
}

.case-cta .button-primary:hover {
    background: var(--background-light);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

/* ── Section Title (case study pages) ─────────────────────── */
.text-center {
    text-align: center;
    margin-bottom: 8px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -0.8px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .case-hero { padding: 110px 0 48px; }

    .case-meta { gap: 24px; padding: 20px 0; }

    .featured-image { height: 320px; }

    .features-grid { grid-template-columns: 1fr; }

    .screen-showcase {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .screen-showcase.reverse { direction: ltr; }

    .more-projects { grid-template-columns: 1fr; }

    .case-cta { padding: 72px 0; }
}

/* ── Scroll Progress Script (inline via JS) ────────────────── */
/* The scroll progress bar element is injected by case-study-init.js
   or by inline script at bottom of each case study page */
