/* ==========================================
   RESET & TYPOGRAPHIE
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 60% 40%, #000000 0%, #000000 60%, #000000 100%);
    background-attachment: fixed;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    height: 100dvh; /* Adaptatif navigateurs mobiles */
    overflow: hidden;
    cursor: none;
}

.crt-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ==========================================
   GRILLE ET LIGNES DE FOND
========================================== */
.hud-bg-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.line-v {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.25);
}

.line-h {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.v-left   { left: 10%; }
.v-mid    { left: 68%; }
.v-right  { left: 93%; }

.h-top    { top: 22%; }
.h-center { top: 50%; }
.h-mid    { top: 62%; }
.h-bottom { top: 78%; }

.grid-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 1);
}

.dot-1 { left: 10%; top: 22%; }
.dot-2 { left: 93%; top: 22%; }
.dot-3 { left: 10%; top: 78%; }
.dot-4 { left: 93%; top: 78%; }

/* ==========================================
   ÉLÉMENTS TECH / HUD
========================================== */
.hud-tech-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    font-size: 8px;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
}

.tech-micro-header, .tech-micro-footer {
    position: absolute;
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.top-l { top: 15px; left: 20px; }
.top-c { top: 15px; left: 50%; transform: translateX(-50%); }
.top-r { top: 15px; right: 20px; }

.bot-l { bottom: 15px; left: 20px; }
.bot-c { bottom: 15px; left: 50%; transform: translateX(-50%); }
.bot-r { bottom: 15px; right: 20px; }

.pill-label {
    position: absolute;
    padding: 4px 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
}

.pill-top-left { top: 22%; left: 18%; }
.pill-top-right { top: 22%; right: 18%; }
.pill-bottom-left { top: 78%; left: 18%; }
.pill-bottom-right { top: 78%; right: 18%; }

.micro-paragraph {
    position: absolute;
    width: 200px;
    font-size: 7px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.6px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}

.para-top-left { top: 26%; left: 5%; }
.para-top-right { top: 26%; right: 5%; text-align: right; }

.micro-code-stack {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.code-top-mid { top: 26%; left: 48%; transform: translateX(-50%); text-align: center; }
.code-bottom-left { top: 72%; left: 18%; }
.code-bottom-right { top: 72%; right: 18%; text-align: right; }

/* ==========================================
   ANIMATIONS DE GLITCH
========================================== */
@keyframes glitchAnimation {
    0% {
        opacity: 0;
        transform: translate(0, 0) skew(0deg);
        filter: blur(2px);
    }
    2% {
        opacity: 1;
        transform: translate(-3px, 1px) skew(-10deg);
        filter: blur(0px);
        text-shadow: -2px 0 #ff0055, 2px 0 #00e5ff;
    }
    4% {
        transform: translate(3px, -1px) skew(10deg);
        text-shadow: 2px 0 #ff0055, -2px 0 #00e5ff;
    }
    6% {
        transform: translate(0, 0) skew(0deg);
        text-shadow: none;
        opacity: 1;
    }
    45% {
        opacity: 1;
        transform: translate(0, 0);
        text-shadow: none;
    }
    47% {
        opacity: 0.4;
        transform: translate(-2px, 2px) skew(5deg);
        text-shadow: -2px 0 #ff0055;
    }
    49% {
        opacity: 1;
        transform: translate(0, 0) skew(0deg);
        text-shadow: none;
    }
    85% {
        opacity: 1;
        transform: translate(0, 0);
    }
    88% {
        opacity: 0.8;
        transform: translate(4px, -2px) skew(-8deg);
        text-shadow: 3px 0 #00e5ff, -2px 0 #ff0055;
    }
    92% {
        opacity: 0.1;
        transform: translate(-4px, 1px) skew(12deg);
        filter: blur(1px);
    }
    100% {
        opacity: 0;
        transform: translate(0, 0);
        filter: blur(3px);
    }
}

.blink-anim-1 { animation: glitchAnimation 6s infinite ease-in-out; }
.blink-anim-2 { animation: glitchAnimation 8s infinite ease-in-out 1.5s; }
.blink-anim-3 { animation: glitchAnimation 7s infinite ease-in-out 3s; }
.blink-anim-4 { animation: glitchAnimation 9s infinite ease-in-out 0.8s; }

/* ==========================================
   BLOC MENU TYPOGRAPHIQUE
========================================== */
.moodboard-menu-container {
    position: absolute;
    left: 68%;
    top: 62%;
    width: 28%;
    padding-left: 20px;  
    padding-top: 15px;
    z-index: 30;
    pointer-events: auto;
}

.moodboard-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;            
}

.menu-link {
    text-decoration: none;
    color: #ffffff;
    font-size: clamp(20px, 2.5vw, 36px);
    line-height: 1.05;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: opacity 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
    text-align: left;    
    display: block;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.8);
}

.text-thin {
    font-weight: 200;    
    opacity: 0.85;
}

.text-bold {
    font-weight: 700;    
    opacity: 1;
}

.menu-link:hover {
    opacity: 1;
    transform: translateX(8px);
    color: #00f0ff;
    text-shadow: 0 0 14px rgba(0, 240, 255, 0.8), -2px 0 #ff0055;
}

/* ==========================================
   ÉCRANS VIDÉO AVEC EFFET VHS
========================================== */
.screens-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.screen-card {
    position: absolute;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.12);
}

.screen-card.visible {
    opacity: 1;
}

.screen-card:hover {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.3);
}

.screen-card video {
    position: absolute;
    pointer-events: none;
}

.screen-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.4) 50%
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.7;
}

.screen-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    z-index: 11;
    pointer-events: none;
    animation: vhsSweep 6s linear infinite;
}

@keyframes vhsSweep {
    0% { top: -20%; }
    100% { top: 120%; }
}

.screen-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 8px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 5px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 12;
}

.screen-card.expanded {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 100 !important;
    box-shadow: none !important;
}

/* ==========================================
   REFLETS LUMINEUX HAUT/BAS
========================================== */
.crt-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    z-index: 999;
    pointer-events: none;
}

.crt-screen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
    z-index: 999;
    pointer-events: none;
}

/* ==========================================
   CURSEUR TECH UNIFIÉ
========================================== */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    will-change: transform;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.2s ease,
                background-color 0.2s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px #ffffff;
    z-index: 2;
}

.cursor-pixel-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px);
    background-size: 6px 6px;
    transition: opacity 0.2s ease;
}

.custom-cursor.hovered {
    width: 60px;
    height: 60px;
    border-color: rgba(0, 240, 255, 0.9);
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.custom-cursor.hovered .cursor-pixel-grid {
    opacity: 0.6;
    animation: pixelShift 2s linear infinite;
}

@keyframes pixelShift {
    0% { background-position: 0 0; }
    100% { background-position: 12px 12px; }
}

/* ==========================================
   RESPONSIVE DESIGN (TABLETTES & MOBILES)
========================================== */
@media (max-width: 768px) {
    /* Desactiver le curseur custom sur ecran tactile */
    body {
        cursor: auto;
    }
    .custom-cursor {
        display: none !important;
    }

    /* Repositionnement de la grille de fond */
    .v-left   { left: 5%; }
    .v-mid    { left: 50%; }
    .v-right  { left: 95%; }

    .h-top    { top: 12%; }
    .h-center { top: 48%; }
    .h-mid    { top: 68%; }
    .h-bottom { top: 88%; }

    .dot-1 { left: 5%; top: 12%; }
    .dot-2 { left: 95%; top: 12%; }
    .dot-3 { left: 5%; top: 88%; }
    .dot-4 { left: 95%; top: 88%; }

    /* Masquer les elements micro-textes secondaires */
    .tech-micro-header.top-c,
    .micro-paragraph,
    .micro-code-stack,
    .tech-micro-footer.bot-c {
        display: none;
    }

    /* Repositionnement des pilules et header/footer */
    .top-l { top: 10px; left: 10px; font-size: 7px; }
    .top-r { top: 10px; right: 10px; font-size: 7px; }
    .bot-l { bottom: 10px; left: 10px; font-size: 7px; }
    .bot-r { bottom: 10px; right: 10px; font-size: 7px; }

    .pill-label {
        font-size: 9px;
        padding: 3px 12px;
    }
    .pill-top-left { top: 12%; left: 8%; }
    .pill-top-right { top: 12%; right: 8%; }
    .pill-bottom-left { top: 88%; left: 8%; }
    .pill-bottom-right { top: 88%; right: 8%; }

    /* Replacement du menu typographique en bas */
    .moodboard-menu-container {
        left: 5%;
        top: auto;
        bottom: 14%;
        width: 90%;
        padding-left: 0;
        padding-top: 0;
    }

    .moodboard-menu {
        gap: 2px;
    }

    .menu-link {
        font-size: clamp(22px, 6.5vw, 32px);
        text-align: left;
    }

    /* Retouche sur les tags d'ecran */
    .screen-tag {
        font-size: 7px;
        padding: 1px 4px;
        top: 4px;
        left: 4px;
    }
}

/* ============================================================
   START BUTTON - ANIMATED HUD
   ============================================================ */

/* Conteneur principal */
.start-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Bouton stylisé et animé */
.start-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 52px;
    text-decoration: none;
    color: #ffffff;
    background: rgba(5, 5, 5, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    
    /* Découpe HUD sci-fi */
    clip-path: polygon(
        0 14px, 
        14px 0, 
        100% 0, 
        100% calc(100% - 14px), 
        calc(100% - 14px) 100%, 
        0 100%
    );
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Animation de respiration HUD */
    animation: hudPulse 4s infinite ease-in-out;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

/* Ligne d'accent lumineuse à gauche */
.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 0 10px #ffffff;
    animation: hudBlink 2.5s infinite alternate;
}

/* Étiquette technique en haut à droite */
.start-btn::after {
    content: 'SYS//01';
    position: absolute;
    top: 4px;
    right: 8px;
    font-family: 'Inter', monospace;
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    animation: hudBlink 1.8s infinite alternate;
}

/* Texte principal [ START SYSTEM ] */
.start-btn .btn-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ffffff;
    transition: all 0.3s ease;
}

/* Sous-texte micro-tech */
.start-btn .btn-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    font-weight: 300;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    transition: all 0.3s ease;
}

/* ============================================================
   EFFETS HOVER & CLIC
   ============================================================ */

.start-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 255, 255, 0.2);
    transform: scale(1.04);
    animation: none; /* Désactive la respiration au survol */
}

.start-btn:hover::before {
    background: #000000;
    box-shadow: none;
    animation: none;
}

.start-btn:hover::after {
    color: rgba(0, 0, 0, 0.6);
    animation: none;
}

.start-btn:hover .btn-text {
    color: #000000;
    letter-spacing: 6px;
}

.start-btn:hover .btn-sub {
    color: rgba(0, 0, 0, 0.8);
    font-weight: 400;
}

.start-btn:active {
    transform: scale(0.97);
}

/* ============================================================
   ANIMATIONS KEYFRAMES HUD
   ============================================================ */

/* Effet de respiration / variation d'opacité du cadre */
@keyframes hudPulse {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.25);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.6);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    }
}

/* Scintillement du sous-élément */
@keyframes hudBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
    70% { opacity: 0.5; }
    85% { opacity: 0.9; }
}

/* Animation d'entrée automatique quand une page s'ouvre */
.crt-screen {
    animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: scale(1.05);
        filter: blur(8px) brightness(1.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0) brightness(1);
    }
}

/* Animation de sortie déclenchée par le JS lors du clic sur START */
.crt-screen.page-exit {
    animation: pageExit 0.5s cubic-bezier(0.7, 0, 0.84, 0) forwards !important;
}

@keyframes pageExit {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
    50% {
        filter: brightness(2) contrast(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(12px) brightness(0);
    }
}

