/* --- PROJECT PAGE THEME (Dark Mode) --- */
body.project-page {
    background-color: #0b0b0b;
    color: #f0f0f0;
}



/* --- HERO SECTION --- */
.cs-hero {
    height: 85vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

.cs-hero .video-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

.cs-hero video {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0.6; 
}

.cs-hero .overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 0%, #0b0b0b 90%);
}

.cs-hero-content {
    max-width: 800px;
    padding: 0 20px;
    z-index: 2;
}

.cs-hero-content .tag {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: block;
    margin-bottom: 20px;
}

.cs-hero-content h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.cs-hero-content .subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
}

/* --- INFO GRID --- */
.cs-info {
    background: #111;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 60px var(--padding-x);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.info-item h4 {
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.info-item p {
    font-size: 1rem;
    line-height: 1.5;
    color: #ccc;
}

/* --- PIPELINE SECTION --- */
.cs-pipeline {
    padding: 120px var(--padding-x);
    max-width: 1600px;
    margin: 0 auto;
}

.cs-pipeline .section-header {
    margin-bottom: 100px;
}

.cs-pipeline .category {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    font-weight: 600;
}

.pipeline-step {
    display: flex;
    margin-bottom: 150px;
    position: relative;
    gap: 60px;
}

.pipeline-step.reverse {
    flex-direction: row-reverse;
}

.step-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 60px;
}

.pipeline-step.reverse .step-content {
    flex-direction: row-reverse;
}

/* Number Marker */
.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.step-num {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255,255,255,0.1);
    line-height: 1;
}

.step-line {
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.1);
    margin-top: 20px;
}

.step-text {
    flex: 1;
}

.step-text .phase {
    display: block;
    font-family: monospace;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.step-text h3 {
    font-size: 2.5rem;
    margin-bottom: 25px;
    font-weight: 600;
}

.step-text p {
    color: #bbb;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 1.05rem;
}

.tech-tags {
    list-style: none;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.tech-tags li {
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- INTERACTIVE POSTER / MEDIA --- */
.step-media {
    flex: 1.2;
    position: relative;
    cursor: pointer; /* Indicates Clickable */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.step-media img {
    width: 100%;
    transition: transform 0.5s ease, filter 0.5s ease;
    display: block;
}

.step-media:hover img {
    transform: scale(1.05);
    filter: brightness(0.6); 
}

/* Hover Overlay */
.media-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10;
    pointer-events: none;
}

.media-overlay i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--accent);
}

.media-overlay span {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.step-media:hover .media-overlay {
    opacity: 1;
}

.step-media .caption {
    display: block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    text-align: right;
    font-style: italic;
    background: transparent;
    padding-right: 10px;
    padding-bottom: 10px;
}

/* --- MIXED MEDIA LIGHTBOX GALLERY --- */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.show {
    opacity: 1;
}

.gallery-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-wrapper {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Shared styles for Image and Video in Modal */
.gallery-modal img,
.gallery-modal video {
    max-width: 85vw;
    max-height: 75vh;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    display: block; /* Toggled via JS */
    margin: 0 auto;
    background: black;
}

/* Shared styles for Image and Video in Modal */
.gallery-modal img,
.gallery-modal video {
    /* Calculate width to ensure it fits between the fixed buttons */
    /* 100vw minus space for buttons (e.g., 150px on each side) */
    max-width: calc(100vw - 300px); 
    max-height: 80vh;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    display: block; 
    margin: 0 auto;
    background: black;
}

/* Gallery Caption */
.gallery-caption {
    margin-top: 20px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

#gallery-text {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 5px;
}

#gallery-counter {
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 2px;
}

/* Controls */
.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10001;
}

.close-btn:hover { color: var(--accent); }

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 20px;
    transition: 0.3s;
    opacity: 0.5;

    /* Fixed vertically, locked to screen */
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10002; 
}

.nav-btn:hover {
    opacity: 1;
    color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.nav-btn.prev { 
    /* Move button closer to center (100px from edge) */
    left: 50px; 
    margin-right: 0;
}

.nav-btn.next { 
    /* Move button closer to center (100px from edge) */
    right: 50px; 
    margin-left: 0;
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 900px) {
    .step-content, .pipeline-step.reverse .step-content {
        flex-direction: column-reverse;
        gap: 30px;
    }

    .pipeline-step { gap: 20px; }
    .step-num { font-size: 2rem; }
    .step-text h3 { font-size: 1.8rem; }
    
    .nav-btn.prev { 
        left: 10px;
        font-size: 2rem; 
    }

    .nav-btn.next {
        right: 10px;
        font-size: 2rem; 
    }

    .gallery-modal img, .gallery-modal video { max-width: 70vw; }
}

/* --- FINAL RENDER SECTION --- */
.cs-final-render {
    padding: 0 var(--padding-x) 150px; /* Matching bottom padding */
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.cs-final-render .section-header {
    margin-bottom: 60px;
}

.cs-final-render .category {
    color: var(--accent);
}

/* Responsive 16:9 Video Container */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6); /* Deep shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.footer {
    background-color: #0b0b0b;
}

/* --- PROJECT NAVIGATION (Footer Style) --- */
.project-navigation {
    background-color: #050505; /* Slightly darker than main bg */
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 80px 8%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    width: 45%;
    transition: all 0.3s ease;
}

.nav-item.prev { align-items: flex-start; text-align: left; }
.nav-item.next { align-items: flex-end; text-align: right; }

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin-bottom: 10px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.nav-title {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: white;
    font-weight: 600;
}

/* Hover Effects */
.nav-item:not([style*="default"]):hover .nav-label { opacity: 1; color: var(--accent); }
.nav-item:not([style*="default"]):hover .nav-title { opacity: 0.8; }

/* Divider line for Desktop */
.nav-divider {
    width: 1px;
    height: 60px;
    background-color: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .nav-item {
        width: 100%;
        align-items: center !important;
        text-align: center !important;
    }

    .nav-divider {
        width: 60px;
        height: 1px;
    }
}
