/* ============================================================= */
/* GLOBAL PROJECT PAGE STYLES (Cosmic Noir Theme) */
/* ============================================================= */

:root {
    --page-bg: #020617;
    /* Deepest blue/black */
    --sidebar-bg: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(56, 189, 248, 0.15);
}

body {
    background-color: var(--bg-color, #020617);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    color: var(--text-main, #f8fafc);
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-y: auto !important;
    /* Allow scroll on detail pages */
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

/* Navbar specific overrides */
.navbar {
    position: absolute;
    top: 1.2rem;
    left: 2rem;
    z-index: 1000;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.back-link svg {
    transition: transform 0.3s ease;
}

.back-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-3px);
}

/* ============================================================= */
/* PIONEER THEME (Specific to Promo 2025 index) */
/* ============================================================= */

.hero-pioneer h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.context-panel.pioneer-theme {
    max-width: 1100px;
    margin: 0 auto 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.context-header {
    text-align: center;
    margin-bottom: 2rem;
}

.context-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #f59e0b;
    font-weight: 700;
}

.context-header h3 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
}

.competencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.comp-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.comp-item:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.05);
    transform: translateY(-3px);
}

.comp-icon {
    font-size: 1.5rem;
}

/* Responsiveness for high-density screens / smaller heights */
@media (max-height: 900px) {
    .hero-pioneer {
        padding: 1.5rem 0 2rem !important;
    }

    .context-panel.pioneer-theme {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }

    .carousel-wrapper {
        margin-top: 0;
    }
}

@media (max-height: 800px) {
    .hero-pioneer h1 {
        font-size: 2.5rem;
    }

    .hero-pioneer .subtitle {
        font-size: 0.9rem !important;
    }

    .context-panel.pioneer-theme {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .context-header h3 {
        font-size: 1.4rem;
    }

    .comp-item {
        padding: 0.8rem;
    }

    footer {
        margin-top: 4rem;
        padding-top: 3rem;
    }
}

/* Global Project Page Variable */
:root {
    --project-color: #38bdf8;
    /* Default accent color */
}

/* Project Header - Innovative "Celestial" Design */
.project-header-wrapper {
    padding: 3.5rem 0 2rem;
    /* Reduced from 6rem/3.5rem to eliminate excessive void */
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Atmospheric Glow Layered */
    background:
        radial-gradient(ellipse at 50% -20%, color-mix(in srgb, var(--project-color) 25%, transparent), transparent 70%),
        radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--project-color) 5%, transparent), transparent 50%);
}

/* Subtle Cosmic Accent Line */
.project-header-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--project-color), transparent);
    opacity: 0.2;
}

.project-title {
    margin: 0;
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff 20%, var(--project-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    animation: titleEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes titleEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
        letter-spacing: 0.1em;
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: -0.05em;
    }
}

.project-header-wrapper .subtitle {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--project-color) 40%, #94a3b8);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0.8;
}

/* Layout Grid - Integration with Header */
.project-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* Reduced from 3rem */
    max-width: 1100px;
    margin: 0.5rem auto 3rem;
    /* Brought much closer to celestial header */
    padding: 0 2rem;
    transition: all 0.5s ease;
}

/* Sidebar Layout for Desktop */
@media (min-width: 1150px) {
    .project-layout {
        display: grid;
        grid-template-columns: 1fr 350px;
        grid-template-areas: "main side";
        gap: 5rem;
        max-width: 1450px;
        align-items: start;
    }

    .documents-section {
        grid-area: main;
    }

    .project-info-bar {
        grid-area: side;
        position: relative;
        /* JS will handle verticality */
        margin: 0 !important;
        flex-direction: column !important;
        padding: 0 !important;
        max-width: 350px;
        will-change: transform;
    }

    .project-info-bar .info-grid-left {
        width: 100%;
    }

    .project-info-bar .team-block {
        width: 100% !important;
        margin-top: 1rem;
    }

    /* Hide bridge on desktop sidebar */
    .project-info-bar::before {
        display: none;
    }

    /* Floating Effect Support */
    .project-info-bar {
        transform: translateY(var(--sidebar-scroll, 0px));
        transition: all 0.4s ease;
        /* Remove transform transition, JS handles it */
    }
}

/* Sidebar as a sub-header info bar */
/* Sidebar as a sub-header info bar */
/* ==========================================================================
   PRECISION MINIMALIST SIDEBAR (High-End Professional)
   ========================================================================== */

.project-info-bar {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 4rem;
    max-width: 1100px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
    transition: all 0.4s ease;
}

/* Energy Conduit (Dynamic Vertical Anchor) */
@media (min-width: 1150px) {
    .project-info-bar::after {
        content: '';
        position: absolute;
        left: -1.5rem;
        top: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(to bottom,
                transparent 0%,
                var(--project-color) 15%,
                var(--project-color) 85%,
                transparent 100%);
        opacity: 0.15;
    }

    /* Ambient Glow Layer */
    .project-info-bar::before {
        content: '';
        position: absolute;
        left: -1.5rem;
        top: 10%;
        bottom: 10%;
        width: 1px;
        background: var(--project-color);
        filter: blur(4px);
        opacity: 0.05;
        z-index: -1;
    }

    /* Energy Pulse Animation */
    @keyframes conduitPulse {
        0% {
            top: -20%;
            opacity: 0;
        }

        10% {
            opacity: 0.8;
        }

        40% {
            opacity: 0.8;
        }

        60% {
            top: 120%;
            opacity: 0;
        }

        100% {
            top: 120%;
            opacity: 0;
        }
    }

    .project-info-bar .info-grid-left::after {
        content: '';
        position: absolute;
        left: -1.5rem;
        top: -20%;
        width: 1px;
        height: 100px;
        background: linear-gradient(to bottom, transparent, #fff, transparent);
        box-shadow: 0 0 10px #fff;
        opacity: 0;
        animation: conduitPulse 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
        z-index: 2;
    }
}

/* Left side: Metadata Grid */
.project-info-bar .info-grid-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Tighter for ultra-min */
    position: relative;
    flex: 1;
}

.info-block {
    position: relative;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: row;
    /* Single line alignment */
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: none !important;
}

/* Precision Nodes & Tapered Ticks */
@media (min-width: 1150px) {
    .info-block::before {
        content: '';
        position: absolute;
        left: -1.5rem;
        top: 50%;
        width: 10px;
        height: 1px;
        background: linear-gradient(to left, var(--project-color), transparent);
        opacity: 0.4;
        transition: all 0.3s ease;
    }

    /* Junction Node (Micro-dot) */
    .info-block::after {
        content: '';
        position: absolute;
        left: -1.56rem;
        /* Perfectly centered on 1px spine */
        top: calc(50% - 2px);
        width: 3px;
        height: 3px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 0 5px var(--project-color);
        opacity: 0.6;
        z-index: 5;
        transition: all 0.3s ease;
    }

    .info-block:hover::after {
        transform: scale(1.5);
        opacity: 1;
        box-shadow: 0 0 8px #fff;
    }
}

.info-label {
    display: none;
    /* Hide redundant labels as requested */
}

/* Minimalist Icon Accent */
.info-block .info-icon,
.info-block i,
.info-block .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--project-color);
    opacity: 0.6;
    font-size: 0.9rem;
    width: 20px;
}

.info-value,
.tag {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Integrated Team Feed */
.project-info-bar .team-block {
    width: 280px;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: none !important;
}

.team-block .info-label {
    display: block;
    /* Restore for team only */
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--project-color);
    font-weight: 800;
    opacity: 0.5;
    margin-bottom: -0.5rem;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.member-badge {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: transparent;
    padding: 0;
    border: none;
    transition: all 0.3s ease;
}

.member-avatar {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.member-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.3s ease;
}

.member-badge:hover .member-name {
    color: #fff;
    transform: translateX(4px);
}

.member-badge:hover .member-avatar {
    border-color: var(--project-color);
    color: var(--project-color);
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
    .project-info-bar {
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .project-info-bar .team-block {
        width: 100%;
    }

    .project-info-bar::before {
        display: none;
    }
}


/* Document Viewers Section */
.documents-section {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.viewer-block {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.viewer-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.main-content section {
    margin-bottom: 3rem;
}

/* Viewer Controls & Headers */
.viewer-header {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.viewer-header h3 {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.9;
}

.viewer-content {
    min-height: 400px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* File Tabs */
.file-tabs {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* PDF Viewer Specifics */
.pdf-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    min-height: 400px;
}

.pdf-canvas-wrapper canvas {
    max-width: 100%;
    height: auto !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.pdf-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.pdf-nav,
.pdf-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pdf-page-info {
    font-size: 0.9rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    margin: 0 0.5rem;
    white-space: nowrap;
}

.pdf-zoom-level {
    font-size: 0.85rem;
    color: #94a3b8;
    min-width: 4ch;
    text-align: center;
}

/* Powerpoint Viewer Specifics */
.ppt-iframe-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
}

.ppt-iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ppt-controls {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.3);
    border-top: 1px solid var(--border-color);
}

.download-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.download-btn-large:hover {
    background: var(--project-color);
    border-color: var(--project-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Viewer States (Error/Offline) */
.viewer-error,
.viewer-offline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #94a3b8;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

.viewer-error-icon,
.viewer-offline-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.viewer-error p,
.viewer-offline p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #cbd5e1;
    margin: 0;
}

.viewer-error small,
.viewer-offline small {
    display: block;
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
}

.file-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-tab.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.file-tab:hover:not(.active) {
    color: #fff;
}

/* Highlight Box (Stats) */
.highlight-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.stat-group {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to bottom right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Viewer Block (Specific overrides for project pages if needed) */
.viewer-block {
    margin-top: 3rem;
    background: rgba(2, 6, 23, 0.5);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 900px) {
    .project-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .project-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1.5rem;
    }

    .span-2 {
        grid-column: span 1;
    }

    .card-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .sidebar {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-group {
        flex-direction: column;
        gap: 1.5rem;
    }

    .project-info-bar {
        padding: 0 1rem;
        gap: 1rem;
    }

    .info-block {
        min-width: 100%;
    }
}


/* ============================================================= */
/* CAROUSEL / MOVIE CARD STYLES */
/* ============================================================= */

.carousel-wrapper {
    width: 100%;
    margin-top: 1rem;
    position: relative;
    padding-bottom: 2rem;
}

.project-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10vw;
    /* Wide gap to space out non-active projects */
    padding: 1rem calc(50% - (clamp(260px, 30vw, 380px) / 2));
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: center;
    height: auto;
    flex-grow: 1;
    min-height: 0;
    /* VERY STRICT MASK: Show only the center and 1 neighbor on each side */
    mask-image: linear-gradient(to right,
            transparent,
            black 15%,
            black 85%,
            transparent);
    -webkit-mask-image: linear-gradient(to right,
            transparent,
            black 15%,
            black 85%,
            transparent);
}

/* Ensure the last card can be centered */
.project-carousel::after {
    content: '';
    flex: 0 0 calc(50% - (clamp(260px, 30vw, 380px) / 2));
}

@media (max-width: 768px) {
    .project-carousel {
        gap: 1.5rem;
        /* Center the 80vw card: 50% - 40vw */
        padding: 1rem calc(50% - 40vw);
        mask-image: none;
        -webkit-mask-image: none;
    }

    .project-carousel::after {
        flex: 0 0 calc(50% - 40vw);
    }

    /* Override v-layout specificity for mobile */
    .project-slide.v-layout {
        flex-basis: 80vw;
        max-width: 80vw;
        flex: 0 0 80vw;
        min-height: 500px;
    }

    /* Adjust arrows for mobile - ensured non-overlapping gap */
    .nav-arrow {
        width: 40px;
        height: 40px;
    }

    .left-arrow {
        left: calc(50% - 40vw - 45px);
        /* Move arrow outside the 80vw centered card boundary */
    }

    .right-arrow {
        right: calc(50% - 40vw - 45px);
    }
}

.project-carousel::-webkit-scrollbar {
    display: block;
    height: 8px;
}

.project-carousel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    margin: 0 20vw;
    /* Centered scrollbar visual */
    border-radius: 4px;
}

.project-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
}

.project-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Project Slide "Card" */
.project-slide {
    flex: 0 0 clamp(280px, 85vw, 750px);
    height: 600px;
    max-height: 82vh;
    min-height: 450px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    overflow: hidden;
    scroll-snap-align: center;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.5;
    transform: scale(0.9);
    position: relative;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
    .project-slide {
        flex-direction: column;
        height: auto;
        min-height: 600px;
        flex: 0 0 90vw;
    }

    .project-poster {
        flex: 0 0 200px;
    }

    .project-title-large {
        font-size: 1.8rem;
    }
}

/* Active State (Focus) - Simulated via Hover for now or JS later */
/* Active State (Selection centered) */
.project-slide.active,
.project-slide:hover,
.project-slide:focus-within {
    opacity: 1;
    transform: scale(1);
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.7),
        0 0 0 1px var(--theme-color);
}

/* Vertical Layout Modifier (Used on home page index.html) */
.project-slide.v-layout {
    flex-direction: column;
    height: auto;
    min-height: 480px;
    max-height: 82vh;
    flex-basis: clamp(260px, 30vw, 380px);
}

.project-slide.v-layout .project-poster {
    flex: 0 0 240px;
    width: 100%;
}

.project-slide.v-layout .project-details {
    padding: 0.8rem 1.2rem;
}

.project-slide.v-layout .project-title-large {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
    letter-spacing: -0.01em;
}

.project-slide.v-layout .meta-row {
    margin-bottom: 0.3rem;
    transform: scale(0.85);
    transform-origin: left;
}

.project-slide.v-layout .rating-row {
    display: none !important;
    /* Force hide stars and Proyecto Majeur */
}

.project-slide.v-layout .project-synopsis {
    display: block;
    margin: 0.2rem 0;
}

.project-slide.v-layout .synopsis-text {
    display: none;
    /* Cache la citation en italique */
}

.project-slide.v-layout .description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* On affiche 3 lignes maintenant */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.project-slide.v-layout .project-cast {
    display: flex;
    align-items: center;
    margin: 0.6rem 0;
    gap: 0.5rem;
}

.project-slide.v-layout .cast-names,
.project-slide.v-layout .cast-label {
    display: none !important;
    /* Supprime les textes d'équipe */
}

.project-slide.v-layout .avatar {
    width: 26px;
    height: 26px;
    border: 2px solid #1e293b;
    background: #334155;
    color: #f8fafc;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    font-size: 0.7rem;
    font-weight: 700;
}

.project-slide.v-layout .avatar:not(:first-child) {
    margin-left: -10px;
}

.project-slide.v-layout .project-actions {
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
}

.project-slide.v-layout .action-btn.play-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.project-slide.v-layout .icon-btn {
    width: 36px;
    height: 36px;
}

.project-slide.v-layout .poster-overlay {
    background: linear-gradient(to top, rgba(30, 41, 59, 0.8) 0%, transparent 30%);
}

.project-slide.v-layout .project-details {
    padding: 1.5rem 2rem;
}

/* LEFT COLUMN: POSTER */
.project-poster {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Recadre l'image pour remplir */
    transition: transform 0.7s ease;
}

.project-slide:hover .poster-img {
    transform: scale(1.1);
}

.poster-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.2), rgba(30, 41, 59, 0.7) 80%);
}

/* RIGHT COLUMN: DETAILS */
.project-details {
    flex: 1;
    padding: 1.25rem 1.5rem 1.5rem;
    /* Tighter padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

/* Metadata */
.project-title-large {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    /* Légèrement réduit pour éviter l'encombrement vertical */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.8rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.year-badge {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.duration,
.genre-tag {
    color: var(--theme-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.genre-tag {
    border: 1px solid var(--theme-color);
    padding: 2px 8px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--theme-color) 10%, transparent);
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.stars {
    color: #fbbf24;
    /* Gold */
}

.likes {
    color: #94a3b8;
}

/* Synopsis */
.project-synopsis {
    margin-bottom: 0.75rem;
    /* Reduced */
}

.synopsis-text {
    font-style: italic;
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: serif;
    /* Elegant contrast */
}

.description {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Réduit à 2 lignes pour gagner de la place */
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cast */
.project-cast {
    margin-bottom: 2rem;
}

.cast-label {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-slide .cast-names {
    display: none;
}


.cast-avatars {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: help;
}

/* Tooltip on hover */
.project-slide .avatar::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.project-slide .avatar:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Actions */
.project-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.play-btn {
    background: #fff;
    color: #000;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

.play-btn:hover {
    background: var(--theme-color);
    color: #fff;
    transform: translateY(-2px);
}

.icon-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    /* Circle button */
    position: relative;
    /* For tooltip */
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* Share Tooltip */
.share-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.share-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Controls Visual Cue */
.carousel-controls {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin-top: 1rem;
    opacity: 0.6;
    animation: pulse 2s infinite;
}

.scroll-indicator {
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.nav-arrow:hover {
    background: var(--accent-blue, #38bdf8);
    border-color: var(--accent-blue, #38bdf8);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.left-arrow {
    /* (50% - half card width) = card edge. Then move arrow width + gap */
    left: calc(50% - (clamp(260px, 30vw, 380px) / 2) - 48px - 30px);
}

.right-arrow {
    right: calc(50% - (clamp(260px, 30vw, 380px) / 2) - 48px - 30px);
}

/* Responsive */
/* Responsive cleanup - Removed duplicate conflicting block */
@media (max-width: 768px) {
    .project-poster {
        height: 250px;
        flex: none;
    }

    .poster-overlay {
        background: linear-gradient(to top, rgba(30, 41, 59, 1), transparent);
    }

    .project-details {
        padding: 1.5rem;
    }
}

/* ============================================================= */
/* FOOTER STYLES */
/* ============================================================= */
footer {
    text-align: center;
    padding: 6rem 2rem 4rem;
    margin-top: 8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 0.95rem;
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.4));
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(56, 189, 248, 0.3), transparent);
}

footer p {
    margin: 0;
    line-height: 2;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: 0.02em;
}

footer p b {
    color: #fff;
    font-weight: 600;
}