/**
 * style.css — Feuille de styles de CORRIDORS
 * ============================================
 * Identité visuelle : minimalisme radical, gravure sur cuivre numérique.
 * Palette : noir absolu (#000000) + lignes blanches (#FFFFFF) uniquement.
 * Aucun gradient, aucune ombre, aucune couleur supplémentaire.
 */

/* ─── Réinitialisation et base ──────────────────────────────────────────── */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;               /* Pas de scrollbar */
    background-color: #000000;      /* Noir absolu */
    color: #FFFFFF;
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
}

/* ─── Écran d'accueil ────────────────────────────────────────────────────── */

#ecran-accueil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50000;
    background-color: #000000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    transition: opacity 0.8s ease;
    overflow: hidden;
}

/* Conteneur scrollable interne (résout le bug iOS position:fixed + overflow) */
#accueil-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
    align-items: center;
}

#ecran-accueil.masque {
    opacity: 0;
    pointer-events: none;
}

/* Conteneur vertical centré — tailles adaptatives à la hauteur d'écran */
#accueil-contenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 680px;
    width: 90%;
    padding: clamp(2vh, 5vh, 8vh) 0 clamp(3vh, 6vh, 10vh) 0;
}

/* Titre : TPF TAKUYA (gras) + beta (light) */
#accueil-titre {
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
    font-size: clamp(16px, 2.4vmin, 24px);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: clamp(2vh, 4vh, 6vh);
}

.accueil-titre-gras {
    font-weight: bold;
    color: #FFFFFF;
}

.accueil-titre-light {
    font-weight: normal;
    font-size: clamp(12px, 1.8vmin, 18px);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.15em;
}

/* Bloc de texte descriptif — police et espacement adaptatifs */
#accueil-texte {
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
    font-size: clamp(13px, 2vmin, 18px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    text-align: left;
    width: 100%;
    margin-bottom: clamp(3vh, 5vh, 8vh);
}

#accueil-texte p {
    margin-bottom: clamp(1vh, 2vh, 2.5vh);
}

#accueil-texte p:last-child {
    margin-bottom: 0;
}

/* Bouton ENTRER — blanc pur, taille adaptative */
#accueil-bouton {
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
    font-size: clamp(14px, 2vmin, 18px);
    letter-spacing: 0.5em;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    padding: clamp(10px, 1.8vh, 18px) clamp(32px, 6vw, 64px);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#accueil-bouton:hover {
    background-color: #FFFFFF;
    color: #000000;
}

/* ─── Écran de rotation (mobile portrait) ───────────────────────────────── */

#rotation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background-color: #000000;
    align-items: center;
    justify-content: center;
}

#rotation-message {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    line-height: 2.2;
    padding: 0 24px;
}

@media screen and (orientation: portrait) and (max-width: 900px) {
    #rotation-overlay {
        display: flex;
    }
}

/* ─── Canvas Three.js ───────────────────────────────────────────────────── */

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;                     /* Explicite : sous le HUD, le voile et la lightbox */
}

/* ─── HUD — Overlay texte (bas d'écran, gauche) ────────────────────────── */

#hud {
    display: none;                  /* Remplacé par les panneaux latéraux */
}

/* Ligne individuelle du HUD */
.hud-ligne {
    display: flex;
    gap: 0;
}

/* Étiquette (SECTION, GAMME, ACCORD) — largeur fixe pour l'alignement */
.hud-label {
    display: inline-block;
    width: 72px;                    /* Largeur fixe pour aligner les valeurs */
    opacity: 0.5;                   /* Légèrement atténuée pour hiérarchie visuelle */
    text-transform: uppercase;
}

/* Valeur (I / III, Ré mineur, Am sus4) */
.hud-valeur {
    display: inline-block;
    opacity: 1;
}

/* ─── Labels des jonctions (3 divs positionnés en 3D→2D) ───────────────── */

.junction-label {
    position: fixed;
    z-index: 20;

    /* Typographie monospace, même famille que le HUD */
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FFFFFF;

    /* Centré horizontalement sur le point de projection */
    transform: translateX(-50%);

    /* Invisible par défaut */
    display: none;
    pointer-events: none;
    user-select: none;

    /* Légère atténuation pour les labels non sélectionnés */
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Label visible (jonction active) */
.junction-label.visible {
    display: block;
}

/* Label de la jonction sélectionnée — pleine opacité */
.junction-label.selected {
    opacity: 1.0;
}

/* ─── Voile de transition (fondu au noir entre couloirs) ────────────────── */

#voile-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    opacity: 0;                     /* Invisible au départ */
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.8s ease;  /* Durée de fondu : 800ms */
}

/* État visible du voile (classe ajoutée par JS) */
#voile-transition.actif {
    opacity: 1;
    pointer-events: all;            /* Bloque les interactions pendant la transition */
}

/* ─── Lightbox (fenêtre modale centrée pour afficher une image murale) ── */

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    background-color: #000000;
    background-size: cover;
    background-position: center;
}

#lightbox.actif {
    display: block;
}

/* Voile semi-transparent par-dessus la capture */
#lightbox-voile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

/* Fenêtre intérieure — centrage fixe sur l'écran */
#lightbox-fenetre {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    max-width: min(750px, 90vw);
    max-height: min(750px, 85vh);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: #000000;
    padding: 12px;
    cursor: pointer;
}

#lightbox-fenetre img {
    display: block;
    max-width: min(726px, calc(90vw - 24px));
    max-height: min(726px, calc(85vh - 24px));
    object-fit: contain;
    cursor: pointer;
}

/* Bouton fermer (croix) */
#lightbox-close {
    position: absolute;
    top: -28px;
    right: -2px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    user-select: none;
    letter-spacing: 0;
    line-height: 1;
}

#lightbox-close:hover {
    color: #FFFFFF;
}

/* ─── Panneaux latéraux (infos + contrôles) ──────────────────────────────── */

/* Base commune des deux panneaux */
#panneau-gauche,
#panneau-droit {
    position: fixed;
    bottom: 3vh;
    z-index: 15;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    padding: 1.5vh 1.2vw;
    font-family: 'Courier New', 'IBM Plex Mono', Courier, monospace;
    font-size: 18px;
    letter-spacing: 0.12em;
    color: #FFFFFF;
    text-transform: uppercase;
    user-select: none;
}

/* Panneau gauche — infos gamme / accord / système */
#panneau-gauche {
    left: 2vw;
    width: clamp(200px, 18vw, 340px);
}

/* Panneau droit — contrôles + aide */
#panneau-droit {
    right: 2vw;
    width: clamp(220px, 20vw, 360px);
    text-align: right;
}

/* Blocs de contenu dans le panneau gauche */
.panneau-bloc {
    margin-bottom: 1.4vh;
}

.panneau-bloc:last-child {
    margin-bottom: 0;
}

.panneau-label {
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 0.4vh;
}

.panneau-valeur {
    opacity: 1;
    line-height: 1.5;
}

.panneau-systeme-label {
    font-size: 14px;
    opacity: 0.5;
    letter-spacing: 0.08em;
}

.panneau-systeme-valeur {
    font-size: 14px;
    opacity: 0.5;
}

/* Animation clignotement panneau (3s, vert fluo) */
@keyframes panneau-clignotement {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

.panneau-valeur.clignote {
    color: #39FF14;
    animation: panneau-clignotement 0.3s ease-in-out 10;
}

/* Clignotement blanc pour le texte d'aide au premier chargement (4s) */
@keyframes aide-clignotement {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

#panneau-aide.clignote-aide {
    animation: aide-clignotement 0.8s ease-in-out 5;
}

/* Boutons du panneau droit */
.panneau-bouton {
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.7vh 1.2vw;
    margin-bottom: 1vh;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.panneau-bouton:hover {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.6);
}

/* Texte d'aide en bas du panneau droit */
#panneau-aide {
    font-size: 16px;
    opacity: 1;
    color: #FFFFFF;
    text-align: left;
    line-height: 1.6;
    margin-top: 1.5vh;
}

/* Par défaut : texte desktop visible, texte mobile masqué */
.aide-mobile {
    display: none;
}

/* Mobile paysage : inverser les textes d'aide + réduire les panneaux */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .aide-desktop { display: none; }
    .aide-mobile  { display: inline; }

    #panneau-gauche,
    #panneau-droit {
        font-size: 9px;
        padding: 1.2vh 1.5vw;
        bottom: 1.5vh;
        letter-spacing: 0.06em;
    }
    #panneau-gauche {
        width: auto;
        max-width: 22vw;
    }
    #panneau-droit {
        width: auto;
        max-width: 24vw;
    }
    .panneau-label {
        font-size: 7px;
        margin-bottom: 0.3vh;
    }
    .panneau-bloc {
        margin-bottom: 0.8vh;
    }
    .panneau-bouton {
        padding: 0.8vh 1.5vw;
        margin-bottom: 0.8vh;
        font-size: 9px;
    }
    #panneau-aide {
        font-size: 9px;
        margin-top: 1vh;
        line-height: 1.5;
    }
    .panneau-systeme-label {
        font-size: 7px;
    }
    .panneau-systeme-valeur {
        font-size: 7px;
    }
}

/* Masquer les panneaux sur mobile portrait */
@media screen and (orientation: portrait) and (max-width: 900px) {
    #panneau-gauche,
    #panneau-droit {
        display: none;
    }
}

/* ─── Accueil responsive — mobile paysage ─────────────────────────────────── */
@media screen and (max-width: 900px) and (orientation: landscape) {
    #accueil-scroll {
        align-items: flex-start;
        overflow-y: auto;
    }
    /* Grille 2 colonnes : texte à gauche, titre+bouton à droite */
    #accueil-contenu {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        max-width: 95%;
        width: 95%;
        padding: 2vh 0 3vh 0;
        gap: 1.5vh 4vw;
    }
    /* Texte : colonne gauche, occupe les 2 rangées */
    #accueil-texte {
        grid-column: 1;
        grid-row: 1 / 3;
        font-size: clamp(10px, 1.8vmin, 15px);
        line-height: 1.35;
        margin-bottom: 0;
        align-self: center;
    }
    #accueil-texte p {
        margin-bottom: 0.6vh;
    }
    #accueil-texte p:last-child {
        margin-bottom: 0;
    }
    /* Titre : colonne droite, rangée 1 */
    #accueil-titre {
        grid-column: 2;
        grid-row: 1;
        font-size: clamp(11px, 1.8vmin, 14px);
        margin-bottom: 0;
        text-align: center;
    }
    .accueil-titre-light {
        font-size: clamp(8px, 1.3vmin, 10px);
    }
    /* Bouton : colonne droite, rangée 2 — noir sur blanc */
    #accueil-bouton {
        grid-column: 2;
        grid-row: 2;
        font-size: clamp(11px, 1.6vmin, 14px);
        padding: clamp(8px, 1.5vh, 12px) clamp(20px, 4vw, 32px);
        background-color: #FFFFFF;
        color: #000000;
        border-color: #FFFFFF;
        align-self: start;
        justify-self: center;
    }
}

/* ─── Accueil responsive — mobile portrait ────────────────────────────────── */
@media screen and (orientation: portrait) and (max-width: 900px) {
    #accueil-scroll {
        align-items: flex-start;
        overflow-y: auto;
    }
    #accueil-contenu {
        padding: clamp(3vh, 5vh, 6vh) 0 clamp(4vh, 6vh, 8vh) 0;
    }
    #accueil-titre {
        font-size: clamp(16px, 4vmin, 20px);
        margin-bottom: clamp(2vh, 3vh, 4vh);
    }
    .accueil-titre-light {
        font-size: clamp(12px, 3vmin, 15px);
    }
    #accueil-texte {
        font-size: clamp(13px, 2.5vmin, 15px);
        line-height: 1.4;
        margin-bottom: clamp(3vh, 4vh, 5vh);
    }
    #accueil-texte p {
        margin-bottom: clamp(0.8vh, 1.4vh, 1.8vh);
    }
    #accueil-bouton {
        font-size: clamp(13px, 2.8vmin, 16px);
        padding: clamp(12px, 2vh, 16px) clamp(36px, 8vw, 50px);
    }
}

