@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&display=swap');

:root {
    --dynamic-color: rgba(0, 242, 255, 1);
    --dynamic-color-low: rgba(0, 242, 255, 0.15);
    --bg-dark: #000000;
}

* { box-sizing: border-box; }
body { 
    margin: 0; background: var(--bg-dark); color: #fff; 
    font-family: 'Fira Code', monospace; overflow-x: hidden;
    min-height: 100vh;
}

#bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; pointer-events: none;
}

.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%; pointer-events: none; z-index: 100;
}

/* VIM-STYLE HEADER */
.terminal-header {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 0; background: #000;
    color: #fff; font-size: 11px; z-index: 110;
    display: flex; align-items: stretch;
    height: 32px; border-bottom: 1px solid var(--dynamic-color-low);
    text-transform: uppercase; font-weight: 700;
}

.nav-segment {
    display: flex; align-items: center;
    padding: 0 20px 0 25px;
    text-decoration: none;
    transition: all 0.2s ease;
    /* Фигурная стрелка справа */
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    margin-right: -10px;
    position: relative; /* Для работы z-index */
}

/* Порядок наслоения: левые элементы поверх правых */
.nav-segment:nth-child(1) { z-index: 10; padding-left: 20px; }
.nav-segment:nth-child(2) { z-index: 9; }
.nav-segment:nth-child(3) { z-index: 8; }
.nav-segment:nth-child(4) { z-index: 7; }
.nav-segment:nth-child(5) { z-index: 6; }
.nav-segment:nth-child(6) { z-index: 5; }
.nav-segment:nth-child(7) { z-index: 4; }

.seg-nav {
    background: #2a2a2a;
    color: #aaa;
}
.seg-nav:hover {
    background: #333;
    color: var(--dynamic-color);
}

.seg-active {
    background: var(--dynamic-color);
    color: #000;
}

.vim-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 20px;
    font-size: 10px;
    color: var(--dynamic-color);
    opacity: 0.6;
}

/* Container & titles */
.container { 
    max-width: 1200px; margin: 0 auto; 
    padding: 100px 20px 60px 20px; 
    position: relative; z-index: 10; 
}

.content-title {
    margin-bottom: 40px; border-left: 4px solid var(--dynamic-color); 
    padding: 5px 20px; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

h1 { 
    font-size: 28px; letter-spacing: 4px; 
    text-transform: uppercase; margin: 0; color: #fff; 
    display: flex; align-items: center;
}

.title-cursor {
    display: inline-block; width: 12px; height: 24px;
    background: var(--dynamic-color); margin-left: 10px;
    animation: blink 1s infinite;
}

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

/* --- Адаптация для мобильных: плотная сетка в несколько строк --- */
@media (max-width: 768px) and (orientation: portrait) {
    .terminal-header {
        flex-wrap: wrap;          
        height: auto;             
        display: flex;
        background: #000;
        overflow: hidden; 
    }
    
    .nav-segment {
        flex: 0 1 auto;
        margin-right: -12px;      
        margin-bottom: 0;         
        height: 32px;             
        padding: 0 12px 0 18px;   
        font-size: 10px;
    }

    .vim-right {
        display: none;
    }
    
    .container {
        padding-top: 110px; /* Увеличили отступ для двух строк меню */
    }
}

/* Modal windows */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 1000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    width: 90%; max-width: 1000px;
    border: 1px solid var(--dynamic-color);
    background: #000;
}

.modal-content video {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    display: block;
}

.close-hint {
    position: absolute;
    top: -30px;
    right: 0;
    color: var(--dynamic-color);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}

footer {
    margin-top: 50px; text-align: center; font-size: 10px; 
    letter-spacing: 2px; opacity: 0.3;
}