:root {
    --ia-violet: #06b6d4; 
    --ia-cyan: #06b6d4;
    --ia-rose: #06b6d4; 
    --fond-neural: #03040b;
    --volet-verre: rgba(15, 10, 30, 0.9);
    --volet-sombre: #070510;
    --volet-profond: #030208;
    --bordure-douce: rgba(255, 255, 255, 0.05);
    --texte-principal: #cbd5e1;
    --texte-discret: rgba(255, 255, 255, 0.3);
    --texte-efface: rgba(255, 255, 255, 0.2);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--fond-neural);
    color: var(--texte-principal);
    font-family: "JetBrains Mono", monospace;
    overflow-x: hidden;
    overflow-y: auto;
    background-image: radial-gradient(circle at 2px 2px, rgba(6, 182, 212, 0.05) 1px, transparent 0);
    background-size: 30px 30px;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.orbitron {
    font-family: "Orbitron", sans-serif;
}

.hidden {
    display: none !important;
}

.app-shell {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    overflow: hidden;
}

.neural-node {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, var(--ia-cyan) 0%, transparent 70%);
    opacity: 0.05;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.neural-node-top {
    top: -50px;
    left: -50px;
}

.neural-node-bottom {
    right: -50px;
    bottom: -50px;
}

.sidebar {
    width: 80px;
    background: var(--volet-sombre);
    border-right: 1px solid var(--bordure-douce);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 32px 0;
    z-index: 10;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-btn {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.25s ease;
}

.sidebar-btn:hover {
    color: #ffffff;
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.18);
}

.sidebar-btn.active {
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.6);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.22);
}

.sidebar-label {
    margin-top: auto;
    opacity: 0.2;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 5px;
    writing-mode: vertical-lr;
    transform: rotate(180deg);
}

.main-panel {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header-bar {
    height: 80px;
    min-height: 80px;
    border-bottom: 1px solid var(--bordure-douce);
    background: rgba(7, 5, 16, 0.8);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    min-width: 0;
}

.header-brand {
    flex-shrink: 0;
}

.brand-title {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.brand-subtitle {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    font-weight: 700;
    color: var(--ia-cyan);
    text-transform: uppercase;
}

.brand-pulse {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--ia-cyan);
    animation: pulse 1.4s infinite ease-in-out;
}

.top-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.top-filter-btn,
.home-btn {
    height: 34px;
    padding: 0 18px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.top-filter-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    background: transparent;
}

.top-filter-btn:hover {
    border-color: rgba(6, 182, 212, 0.45);
    color: #ffffff;
}

.top-filter-btn.active {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.45);
    color: #ffffff;
}

.home-btn {
    border: 1px solid rgba(34, 211, 238, 0.4);
    color: var(--ia-cyan);
    background: rgba(34, 211, 238, 0.1);
}

.home-btn:hover {
    background: var(--ia-cyan);
    color: #000000;
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 40px;
}

.stat-box {
    text-align: right;
}

.stat-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--texte-discret);
    text-transform: uppercase;
}

.stat-value {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
}

.stat-cyan {
    color: var(--ia-cyan);
    text-transform: uppercase;
}

.stat-purple {
    color: var(--ia-violet);
}

.projects-grid {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    align-content: start;
    grid-auto-flow: row;
}

@media (max-width: 1500px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.card-ai {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    border: 1px solid rgba(6, 182, 212, 0.15);
    background: var(--volet-verre);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-ai::before {
    content: "INT8_QUANTIZED";
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 7px;
    color: var(--ia-rose);
    letter-spacing: 1px;
    font-weight: 700;
    z-index: 5;
}

.card-ai:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--ia-violet);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.2);
}

.diffusion-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0.1), transparent);
    z-index: 2;
    display: none;
    pointer-events: none;
}

.card-ai:hover .diffusion-overlay {
    display: block;
    animation: diffusion 0.8s ease-out forwards;
}

.card-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
}

.card-visual.portrait {
    aspect-ratio: 9 / 16;
}

.card-meta {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.65);
}

.card-id {
    font-size: 7px;
    color: var(--ia-violet);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.card-model {
    font-size: 8px;
    color: #67e8f9;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-main-icon {
    color: rgba(255, 255, 255, 0.1);
    transition: all 0.7s ease;
}

.card-ai:hover .card-main-icon {
    color: rgba(6, 182, 212, 0.2);
}

.card-image,
.card-video-thumb,
.card-audio-thumb {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.04) contrast(1.02);
    transform: scale(1.01);
    transition: transform 0.4s ease, filter 0.4s ease;
}

.card-ai:hover .card-image,
.card-ai:hover .card-video-thumb,
.card-ai:hover .card-audio-thumb {
    transform: scale(1.05);
    filter: saturate(1.1) contrast(1.05);
}

.card-video-badge,
.card-audio-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    background: rgba(3, 4, 11, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: flex-start;
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.card-type {
    font-size: 8px;
    color: var(--texte-discret);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

.card-time {
    font-size: 8px;
    color: var(--ia-cyan);
    font-weight: 700;
}

.card-title {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.5;
    min-height: 34px;
    transition: color 0.25s ease;
}

.card-ai:hover .card-title {
    color: var(--ia-violet);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
}

.card-tag {
    padding: 2px 8px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
}

.terminal-footer {
    height: auto;
    min-height: 90px;
    border-top: 1px solid var(--bordure-douce);
    background: var(--volet-profond);
    padding: 16px 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.cluster-panel {
    width: 25%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meter-row {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 700;
}

.meter-row-gap {
    margin-top: 8px;
}

.meter-label {
    color: var(--texte-discret);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.meter-value {
    font-weight: 700;
}

.meter-purple {
    color: var(--ia-violet);
}

.meter-cyan {
    color: var(--ia-cyan);
}

.meter-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
}

.meter-fill-purple {
    width: 82%;
    background: var(--ia-violet);
    box-shadow: 0 0 10px var(--ia-violet);
}

.meter-fill-cyan {
    background: var(--ia-cyan);
    box-shadow: 0 0 10px var(--ia-cyan);
}

.meter-fill-wide {
    width: 94%;
}

.terminal-panel {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bordure-douce);
    border-radius: 4px;
    overflow-y: auto;
    font-size: 10px;
    color: var(--texte-discret);
}

.log-purple {
   color: rgba(6, 182, 212, 0.6);
}

.log-cyan {
    color: rgba(34, 211, 238, 0.65);
}

.log-dim {
    color: rgba(255, 255, 255, 0.2);
}

.log-pink {
    color: rgba(6, 182, 212, 0.8);
}

/* BOÎTE D'AFFICHAGE */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(3, 2, 8, 0.98);
    backdrop-filter: blur(24px);
    z-index: 200;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 1300px;
    display: flex;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    background: #0c0818;
    box-shadow: 0 0 150px rgba(6, 182, 212, 0.15);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.25);
    z-index: 5;
}

.lightbox-close:hover {
    color: #ffffff;
}

.lightbox-media {
    position: relative;
    flex: 1;
    min-height: 520px;
    background: rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--bordure-douce);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-image,
.lightbox-audio-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-video-wrap,
.lightbox-audio-cover-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lightbox-video-wrap iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.lightbox-icon-wrap {
    color: rgba(6, 182, 212, 0.12);
    transition: color 3s ease;
    z-index: 2;
}

.lightbox-panel {
    width: 450px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.lightbox-badges {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lightbox-badge-primary {
    padding: 4px 12px;
    background: #06b6d4;
    color: #ffffff;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.lightbox-badge-type {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.25em;
}

.lightbox-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.lightbox-desc {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.4);
}

.lightbox-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lightbox-stat-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bordure-douce);
    border-radius: 4px;
}

.lightbox-stat-label {
    font-size: 8px;
    font-weight: 700;
    color: var(--texte-efface);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.lightbox-stat-value {
    font-size: 12px;
    font-weight: 700;
}

.lightbox-audio {
    width: 100%;
    margin-top: auto;
}

.purple-text {
    color: var(--ia-violet);
}

.cyan-text {
    color: var(--ia-cyan);
}

.icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-wrap.small svg {
    width: 16px;
    height: 16px;
}

.icon-wrap.giant svg {
    width: 240px;
    height: 240px;
    stroke-width: 1.2;
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--ia-violet);
}

@keyframes diffusion {
    0% {
        filter: blur(10px) contrast(2);
        opacity: 0.3;
    }
    50% {
        filter: blur(4px) contrast(1.5);
        opacity: 0.7;
        border-bottom: 1px solid var(--ia-rose);
    }
    100% {
        filter: blur(0) contrast(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* RESPONSIVE */

.app-shell {
    min-height: 100vh;
    height: auto;
    min-width: 0;
}

.main-panel,
.header-left,
.header-brand,
.top-filters,
.header-stats,
.stat-box {
    min-width: 0;
    max-width: 100%;
}

.brand-title,
.brand-subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* GRAND ÉCRAN / INTERMÉDIAIRE */
@media (max-width: 1366px) {
    .sidebar {
        width: 72px;
        gap: 28px;
        padding: 24px 0;
    }

    .sidebar-logo {
        width: 42px;
        height: 42px;
    }

    .sidebar-btn {
        width: 42px;
        height: 42px;
    }

    .header-bar {
        height: auto;
        min-height: 112px;
        padding: 14px 24px;
        align-items: flex-start;
        gap: 16px;
    }

    .header-left {
        flex: 1 1 auto;
        width: 100%;
        align-items: flex-start;
        gap: 20px;
        flex-wrap: wrap;
    }

    .header-brand {
        flex: 1 1 100%;
        width: 100%;
    }

    .brand-title {
        font-size: 9px;
        letter-spacing: 4px;
        line-height: 1.5;
        white-space: normal;
    }

    .brand-subtitle {
        font-size: 8px;
        line-height: 1.6;
        flex-wrap: wrap;
    }

    .top-filters {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-filter-btn,
    .home-btn {
        height: 32px;
        padding: 0 14px;
        font-size: 8px;
    }

    .header-stats {
        width: 100%;
        gap: 18px;
        flex-wrap: wrap;
        justify-content: flex-start ;
        align-self: flex-start;
        margin-top: 0;
    }

    .stat-box {
        text-align: left;
    }

    .stat-value {
        font-size: 11px;
    }
}

/* PORTABLE / TABLETTE LARGE */
@media (max-width: 1100px) {
    .sidebar {
        width: 64px;
        gap: 20px;
        padding: 20px 0;
    }

    .sidebar-logo {
        width: 38px;
        height: 38px;
    }

    .sidebar-btn {
        width: 38px;
        height: 38px;
    }

    .sidebar-label {
        letter-spacing: 3px;
        font-size: 7px;
    }

    .header-bar {
        height: auto;
        min-height: 132px;
        padding: 16px 20px;
        align-items: flex-start;
    }

    .header-left {
        width: 100%;
        gap: 16px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .header-brand {
        width: 100% ;
    }

    .brand-title {
        font-size: 8px;
        letter-spacing: 3px;
        line-height: 1.5;
    }

    .brand-subtitle {
        font-size: 8px;
        line-height: 1.5;
        flex-wrap: wrap;
    }

    .top-filters {
        width: 100%;
        gap: 8px;
    }

    .top-filter-btn,
    .home-btn {
        padding: 0 12px;
        letter-spacing: 0.1em;
    }

    .header-stats {
        width: 100%;
        gap: 14px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .stat-box {
        text-align: left;
    }

    .projects-grid {
        padding: 20px;
        gap: 20px;
    }

    .terminal-footer {
        height: auto;
        min-height: 0;
        flex-direction: column;
        gap: 20px;
    }

    .cluster-panel {
        width: 100%;
    }
}

/* TABLETTE / MOBILE */
@media (max-width: 768px) {
    .app-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .main-panel {
        overflow-x: hidden;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid var(--bordure-douce);
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 10px;
    }

    .sidebar-label {
        writing-mode: initial;
        transform: none;
        margin-top: 0;
        font-size: 7px;
        letter-spacing: 2px;
    }

    .header-bar {
        padding: 16px;
        min-height: 0;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-left,
    .header-stats {
        width: 100%;
        max-width: 100%;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .brand-title {
        font-size: 8px;
        letter-spacing: 2px;
    }

    .brand-subtitle {
        font-size: 8px;
        line-height: 1.5;
    }

    .top-filters {
        gap: 6px;
        flex-wrap: wrap;
        width: 100%;
    }

    .top-filter-btn,
    .home-btn {
        flex: 0 0 auto;
        font-size: 8px;
        padding: 0 10px;
    }

    .header-stats {
        justify-content: space-between;
    }

    .projects-grid {
        padding: 16px;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .card-ai {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .lightbox {
        padding: 16px;
    }

    .lightbox-content {
        flex-direction: column;
    }

    .lightbox-media {
        min-height: 280px;
        border-right: none;
        border-bottom: 1px solid var(--bordure-douce);
    }

    .lightbox-panel {
        width: 100%;
        padding: 24px 18px;
    }
}

/* PETIT MOBILE */
@media (max-width: 480px) {
    .sidebar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .sidebar-logo {
        order: 1;
    }

    .sidebar-nav {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sidebar-label {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .header-bar {
        padding: 14px;
    }

    .top-filters {
        justify-content: flex-start;
    }

    .top-filter-btn,
    .home-btn {
        height: 30px;
    }

    .lightbox-title {
        font-size: 24px;
    }

    .lightbox-stats-grid {
        grid-template-columns: 1fr;
    }
}