/* ========================================================
   RBLCØRE — Studio créatif underground
   Direction : signal pirate / diffusion clandestine
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg: #0a0908;
    --bg-surface: #161311;
    --bg-surface-2: #1f1a17;
    --line: #332c27;
    --text: #ede7e0;
    --text-dim: #9a8f85;
    --accent: #ff2e2e;
    --accent-dim: #7a1616;
    --accent-glow: rgba(255, 46, 46, 0.35);
    --warn: #ffb020;

    --font-display: 'Archivo Black', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Grain / bruit ambiant */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Scanlines */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.12) 3px,
        rgba(0,0,0,0) 4px
    );
    opacity: 0.4;
}

a { color: inherit; text-decoration: none; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.4rem 2rem;
    background: linear-gradient(to bottom, rgba(10,9,8,0.9), transparent);
    backdrop-filter: blur(2px);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.logo .zero { color: var(--accent); }

.site-header nav {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    display: flex;
    gap: 1.8rem;
}

.site-header nav a {
    color: var(--text-dim);
    transition: color 0.2s;
}
.site-header nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 2rem;
    position: relative;
    border-bottom: 1px solid var(--line);
}

.hero-signal {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.hero-signal .dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.5em;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 11vw, 8.5rem);
    line-height: 0.92;
    margin: 0;
    letter-spacing: -0.01em;
    position: relative;
    width: fit-content;
}

.hero h1 .zero { color: var(--accent); }

/* Effet glitch au survol du titre */
.hero h1 {
    cursor: default;
}
.hero h1 span.glitch-target {
    position: relative;
    display: inline-block;
}
.hero h1 span.glitch-target::before,
.hero h1 span.glitch-target::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    overflow: hidden;
    opacity: 0;
}
.hero h1:hover span.glitch-target::before {
    color: var(--accent);
    opacity: 0.8;
    animation: glitch-1 0.4s steps(2) infinite;
}
.hero h1:hover span.glitch-target::after {
    color: #2ec4ff;
    opacity: 0.6;
    animation: glitch-2 0.4s steps(2) infinite;
}
@keyframes glitch-1 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 0); }
    50% { clip-path: inset(60% 0 5% 0); transform: translate(3px, 0); }
    100% { clip-path: inset(30% 0 40% 0); transform: translate(-2px, 0); }
}
@keyframes glitch-2 {
    0% { clip-path: inset(50% 0 20% 0); transform: translate(3px, 0); }
    50% { clip-path: inset(5% 0 70% 0); transform: translate(-3px, 0); }
    100% { clip-path: inset(35% 0 35% 0); transform: translate(2px, 0); }
}

.hero-sub {
    max-width: 48ch;
    margin-top: 1.8rem;
    color: var(--text-dim);
    font-size: 1.05rem;
}

.hero-meta {
    margin-top: 3rem;
    display: flex;
    gap: 3rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}
.hero-meta strong { color: var(--text); display: block; font-size: 0.9rem; margin-top: 0.2rem; }

/* ---------- Section générique ---------- */
section { padding: 6rem 2rem; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1.2rem;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin: 0.3rem 0 0 0;
}

.section-count {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ---------- Grille de projets ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.card {
    background: var(--bg-surface);
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.25s;
}
.card:hover { background: var(--bg-surface-2); }

.card-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: #000;
}
.card-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(45%) contrast(1.05);
    transition: filter 0.35s, transform 0.5s;
}
.card:hover .card-media img {
    filter: grayscale(0%) contrast(1.1);
    transform: scale(1.04);
}

.card-media::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 1.4rem;
    background: rgba(10,9,8,0.35);
    opacity: 0;
    transition: opacity 0.25s;
}
.card:hover .card-media::after { opacity: 1; }

.card-body { padding: 1.4rem; }

.card-body .idx {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.card-body h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0.5rem 0 0.5rem 0;
    text-transform: uppercase;
}

.card-body p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin: 0;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border: 1px dashed var(--line);
}

/* ---------- Modal vidéo ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,4,3,0.92);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal-overlay.open { display: flex; }

/* Le grain et les scanlines de l'ambiance générale du site passent
   par-dessus tout (z-index 9999/9998) pour rester visibles même sur
   les sections en dessous — mais ça les fait aussi passer par-dessus
   la modal, ce qui se voit comme de fines lignes sur les images
   agrandies. On les masque tant qu'une modal est ouverte. */
body:has(.modal-overlay.open)::before,
body:has(.modal-overlay.open)::after,
body.modal-active::before,
body.modal-active::after {
    display: none;
}

.modal-box {
    width: min(960px, 100%);
}
.modal-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid var(--accent-dim);
}
.modal-video iframe {
    width: 100%; height: 100%; border: 0;
}

/* Images (catégorie "Image IA") : pas de cadre 16:9 forcé ni de
   bordure — l'image garde ses propres proportions et s'agrandit
   bien plus, dans la limite de l'écran disponible. */
.modal-box:has(.modal-video.is-image) {
    width: min(1400px, 96vw);
}
.modal-video.is-image {
    aspect-ratio: auto;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-video.is-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
}
.modal-info { padding: 1.2rem 0.2rem; }
.modal-info h3 { font-family: var(--font-display); text-transform: uppercase; margin: 0 0 0.5rem 0; }
.modal-info p { color: var(--text-dim); margin: 0; }

.modal-close {
    position: absolute;
    top: 1.5rem; right: 2rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    background: none;
    border: 1px solid var(--line);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Footer ---------- */
footer {
    padding: 3rem 2rem;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

/* ---------- Accessibilité ---------- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .site-header { padding: 1rem 1.2rem; }
    .site-header nav { display: none; }
    section { padding: 4rem 1.2rem; }
    .hero-meta { flex-wrap: wrap; gap: 1.5rem; }
    .modal-overlay { padding: 1rem; }
    .modal-close { top: 0.75rem; right: 0.75rem; padding: 0.65rem 1rem; }
    /* 300px minimum column width overflows on phones narrower than ~340px
       (e.g. iPhone SE at 320px) once section padding is subtracted. */
    .grid { grid-template-columns: 1fr; }
}

/* Touch devices have no :hover — show the play affordance and the
   image's active state without waiting for an interaction that will
   never fire, so a card visibly reads as clickable before it's tapped. */
@media (hover: none) {
    .card-media::after { opacity: 0.85; }
    .card-media img { filter: grayscale(20%) contrast(1.05); }
}

/* ========================================================
   ADMIN — même identité, densité fonctionnelle
   ======================================================== */
.admin-body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
}

.admin-shell { max-width: 960px; margin: 0 auto; padding: 3rem 1.5rem; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
}

.admin-header .logo { font-family: var(--font-display); font-size: 1.1rem; }

.btn {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    background: var(--accent);
    color: #0a0908;
    border: none;
    padding: 0.75rem 1.3rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }

.btn-ghost {
    background: none;
    border: 1px solid var(--line);
    color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.btn-danger { background: var(--accent); }

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    padding: 1.8rem;
    margin-bottom: 2rem;
}

.panel h2 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 0;
}

.field { margin-bottom: 1.2rem; }
.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.field input[type=text],
.field input[type=password],
.field input[type=url],
.field textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 90px; resize: vertical; }
.field input[type=file] { color: var(--text-dim); font-size: 0.85rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    text-align: left;
    padding: 0.9rem 0.6rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
    vertical-align: middle;
}
.admin-table th {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}
.admin-table img.thumb { width: 56px; height: 40px; object-fit: cover; }

.row-actions { display: flex; gap: 0.6rem; }
.row-actions a, .row-actions button {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.row-actions a:hover, .row-actions button:hover { color: var(--accent); }

.alert {
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--warn);
    color: var(--warn);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}
.alert-error { border-color: var(--accent); color: var(--accent); }

.login-shell {
    max-width: 360px;
    margin: 12vh auto;
    padding: 2rem;
}

/* ---------- Admin : catégories de contenu ---------- */
.cat-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.cat-choice-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--line);
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    transition: border-color 0.2s, color 0.2s;
}
.cat-choice-option:has(input:checked) {
    border-color: var(--accent);
    color: var(--text);
}
.cat-choice-option input {
    accent-color: var(--accent);
}

.field-hint {
    margin: 0.4rem 0 0 0;
    font-size: 0.76rem;
    color: var(--text-dim);
}

.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
}
.cat-tab {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
}
.cat-tab span {
    color: var(--text-dim);
    margin-left: 0.3rem;
}
.cat-tab.active {
    color: var(--accent);
    border-color: var(--accent);
}

.cat-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--line);
    color: var(--text-dim);
    white-space: nowrap;
}
.cat-badge-video { border-color: rgba(0, 229, 255, .4); color: #7fd8e6; }
.cat-badge-image { border-color: rgba(214, 138, 84, .5); color: #d68a54; }
.cat-badge-dj_set { border-color: rgba(204, 0, 255, .4); color: #c98ee0; }
