/* --- Case Study Header --- */
.back-link {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.back-link:hover {
    color: var(--accent);
}

.project-title {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.project-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin-bottom: 4rem;
    line-height: 1.6;
}

/* --- High Impact Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 3rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Main Narrative Layout --- */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 2.5fr; /* 1 part sidebar, 2.5 parts content */
    gap: 4rem;
    align-items: start;
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Sticky Sidebar --- */
.project-meta {
    position: sticky;
    top: 100px; /* Sticks to the screen as you scroll past */
}

.meta-group {
    margin-bottom: 2.5rem;
}

.meta-group h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Inherit role styling from your main JS logic, but adjust for sidebar */
.sidebar-roles {
    margin: 0;
    padding: 0;
    border: none;
}
.sidebar-roles li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

/* --- Long Form Typography --- */
.project-content h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 3rem 0 1.5rem 0;
}

.project-content h2:first-child {
    margin-top: 0;
}

.project-content p {
    font-size: 1.15rem;
    color: #d4d4d8; /* Slightly brighter than secondary text for long reading */
    margin-bottom: 1.8rem;
    line-height: 1.8;
}

.project-content ul {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.project-content li {
    font-size: 1.1rem;
    color: #d4d4d8;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.project-content strong {
    color: var(--accent);
}

blockquote {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
    padding: 1.5rem 2rem;
    margin: 3rem 0;
    background: rgba(56, 189, 248, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

/* --- Pagination / Next Project --- */
.project-pagination {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

.next-project {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.next-project:hover {
    transform: translateX(10px);
}

.pagination-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.pagination-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

/* --- Mobile Layout Fix --- */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem; /* Reduces the massive gap for mobile screens */
    }

    .project-meta {
        position: static; /* This disables the sticky behavior on mobile */
        margin-bottom: 1rem; 
        border-bottom: 1px solid var(--border); /* Adds a nice divider before the text */
        padding-bottom: 2rem;
    }
    
    /* Optional: Makes the sidebar roles flow horizontally on phones to save vertical space */
    .sidebar-roles {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .sidebar-roles li {
        border-bottom: none;
        padding-bottom: 0;
    }

    .back-link {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-top: 100px !important;
}
}

