:root {
    --bg-main: #0b0f19;
    --term-bg: #111827;
    --term-header: #1f2937;
    --text-primary: #e2e8f0;
    
    --p10k-os: #005fdf;        
    --p10k-user: #10b981;      
    --p10k-branch: #0f172a;    
    --p10k-branch-text: #10b981;
    
    --accent: #38bdf8;
    --font: 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    height: 100vh;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#terminal-container {
    width: 100%;
    max-width: 1300px;
    height: 96vh;
    background-color: var(--term-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
}

#terminal-header {
    background-color: var(--term-header);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #000;
}

.dots { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #f59e0b; }
.dot.green { background-color: #10b981; }

.terminal-title {
    margin-left: auto;
    margin-right: auto;
    color: #64748b;
    font-size: 13px;
    padding-right: 40px; 
}

#terminal {
    flex-grow: 1;
    /* БЫЛО: padding: 25px 30px 120px 30px; */
    /* СТАЛО: 30px снизу вместо 120px */
    padding: 25px 30px 30px 30px; 
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
#terminal::-webkit-scrollbar { display: none; }

.sys-line { color: #64748b; margin-bottom: 4px; }
.ascii-banner { color: #10b981; font-weight: bold; font-size: 12px; line-height: 1.2; margin: 15px 0; overflow-x: auto; }

.zsh-prompt {
    display: flex;
    align-items: center;
    margin-top: 45px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 14px;
}

.prompt-segment { padding: 2px 10px 2px 14px; position: relative; color: white; }
.os-segment { background-color: var(--p10k-os); clip-path: polygon(0 0, 85% 0, 100% 50%, 85% 100%, 0 100%); padding-right: 20px; z-index: 3; }
.user-segment { background-color: var(--p10k-user); color: #000; clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%, 10% 50%); margin-left: -12px; padding-left: 20px; padding-right: 20px; z-index: 2; }
.branch-segment { background-color: var(--p10k-branch); color: var(--p10k-branch-text); clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%, 10% 50%); margin-left: -12px; padding-left: 20px; padding-right: 20px; z-index: 1; }

.typed-cmd { margin-left: 10px; color: #f8fafc; font-size: 15px; }
.cursor { animation: blink 1s infinite; color: #10b981; margin-left: 2px; font-weight: bold; }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hidden { display: none !important; }

.cmd-content {
    padding-left: 15px;
    border-left: 2px solid #334155;
    margin-bottom: 35px;
    opacity: 0;
}
.cmd-content.fade-in { animation: fadeIn 0.6s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.title { color: #38bdf8; font-weight: bold; font-size: 16px; margin-top: 5px; margin-bottom: 20px; text-transform: uppercase; }

/* Динамические ретро-терминальные прогресс-бары */
.infographic-box { background-color: #111827; padding: 15px; border-radius: 6px; border: 1px solid #334155; margin-bottom: 25px; }
.real-progress { margin-bottom: 12px; }
.real-progress:last-child { margin-bottom: 0; }
.prog-header { display: flex; justify-content: space-between; margin-bottom: 6px; color: #94a3b8; font-size: 13px; text-transform: uppercase; font-weight: bold;}
.prog-percent { color: #38bdf8; }
.prog-track { width: 100%; background-color: #111827; height: 14px; border-radius: 0px; overflow: hidden; border: 1px solid #4b5563; }
.prog-fill { 
    height: 100%; 
    background: repeating-linear-gradient(
        90deg,
        #00d2ff,
        #00d2ff 10px,
        #111827 10px,
        #111827 12px
    );
    width: 0%; 
    transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1); 
}

/* Макеты */
.profile-layout { display: flex; gap: 30px; align-items: flex-start; }
.profile-avatar img { width: 180px; height: 180px; border-radius: 8px; object-fit: cover; border: 2px solid var(--accent); }
.profile-info p { margin-bottom: 12px; line-height: 1.6; }

.content-with-side-img { display: flex; gap: 30px; margin-bottom: 20px; align-items: flex-start; }
.text-side { flex: 1.2; }
.img-side { flex: 1; display: flex; flex-direction: column; align-items: center; }

/* Сделали картинки большими! */
.inline-media { width: 100%; max-height: 450px; border-radius: 6px; border: 1px solid #374151; object-fit: contain; background: #0f172a; }
.img-caption { font-size: 12px; color: #64748b; margin-top: 8px; font-family: monospace; text-align: center; }

.skills-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.skill-category h4 { color: #f59e0b; margin-bottom: 8px; font-size: 15px;}
.skill-category p { line-height: 1.5; color: #cbd5e1;}

.project-item { margin-bottom: 30px; background: #111c2e; padding: 20px; border-radius: 8px; border-left: 3px solid var(--accent); }
.project-item h5 { font-size: 16px; color: #f8fafc; margin-bottom: 8px; }
.project-item .role { color: #10b981; font-size: 13px; margin-bottom: 15px; font-weight: bold; }
.project-item p { margin-bottom: 12px; line-height: 1.5; }

/* Дипломы */
.awards-layout { display: flex; gap: 25px; margin-bottom: 20px; }
.award-card { flex: 1; background: #151f32; border: 1px solid #2d3748; border-radius: 8px; padding: 15px; text-align: center; }
.award-card img { max-width: 100%; max-height: 250px; border-radius: 4px; object-fit: contain; margin-bottom: 10px; cursor: pointer; }

/* Модалка */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: var(--term-bg); border: 1px solid #374151; border-radius: 8px; width: 95%; max-width: 1000px; max-height: 95vh; display: flex; flex-direction: column; }
.modal-header { background: var(--term-header); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #000; }
.close-btn { font-size: 32px; cursor: pointer; color: #94a3b8; line-height: 1; }
.close-btn:hover { color: white; }
#modal-body { padding: 20px; overflow-y: auto; text-align: center; background: #05070c; }
#modal-body img { max-width: 100%; max-height: 80vh; border-radius: 4px; border: 1px solid #334155; }
.clickable-media { cursor: pointer; transition: 0.2s; }
.clickable-media:hover { opacity: 0.85; transform: scale(1.02); border-color: var(--accent);}

/* =========================================
   ФИНАЛЬНЫЙ АДАПТИВНЫЙ ПАТЧ ДЛЯ МОБИЛЬНЫХ (В самый конец style.css)
   ========================================= */


@media (max-width: 900px) {
    /* 1. Настройка главного контейнера терминала */
    body {
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    #terminal-container {
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important; /* Фикс для мобильных браузеров */
        border-radius: 0 !important;
        border: none !important;
        max-width: 100% !important;
    }

    #terminal {
        padding: 15px 15px 30px 15px !important;
    }

    /* 2. Переводим все контентные блоки в режим колонки и растягиваем по ширине */
    .profile-layout, 
    .content-wrapper, 
    .content-with-side-img, 
    .awards-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important; /* Не даёт тексту сжиматься в узкую полоску */
        gap: 20px !important;
    }

    /* 3. МАГИЯ ПОРЯДКА: ТЕКСТ ВСЕГДА СВЕРХУ, А ГРАФИКА/АРТЫ ВСЕГДА СНИЗУ */
    .profile-info, 
    .case-info {
        order: 1 !important; /* Первая очередь отображения */
        width: 100% !important;
        flex: none !important;
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    .profile-avatar, 
    .img-container {
        order: 2 !important; /* Вторая очередь отображения (после текста) */
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-top: 10px !important;
    }

    /* Корректируем обычные картинки внутри блоков */
    .profile-avatar img, 
    .img-container img {
        width: 100% !important;
        max-width: 450px !important; /* Чтобы на планшетах фото не становилось гигантским */
        height: auto !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }

    /* 4. Полный фикс для ASCII-артов и схем (поведение как у картинок) */
    pre, 
    pre.ascii-banner, 
    #infra-map {
        order: 2 !important; /* Гарантированно после текста */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        
        /* Жестко запрещаем ломать строки структуры арта */
        white-space: pre !important;
        word-wrap: normal !important;
        
        /* Включаем аккуратный внутренний свайп, если арт шире экрана */
        overflow-x: auto !important; 
        
        /* Уменьшаем шрифт, чтобы на смартфонах схемы влезали целиком */
        font-size: 7px !important; 
        line-height: 1.1 !important;
        padding: 10px !important;
        background-color: #111827 !important;
        border-radius: 6px !important;
        border: 1px solid #1f2937 !important;
        margin: 10px 0 0 0 !important;
    }

    /* 5. Адаптация сеток навыков */
    .skills-grid {
        grid-template-columns: 1fr !important; /* Выстраиваем карточки в один ряд */
        gap: 15px !important;
    }

    /* 6. Оптимизация шрифтов заголовков */
    .title {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }
    
    .sub-title {
        font-size: 13px !important;
        margin-bottom: 15px !important;
    }
    .adaptive-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    /* 2. Тексту отдаем высший приоритет (будет первым сверху) */
    .adaptive-text {
        order: 1 !important;
        width: 100% !important;
        flex: none !important;
    }

    /* 3. Арту отдаем второй приоритет (встанет строго ПОД текстом) */
    .responsive-art {
        order: 2 !important;
        display: block !important;   /* Возвращаем видимость, если он сжался в 0 */
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        
        /* Фиксы, чтобы арт не разрывал экран и уменьшался */
        white-space: pre !important; 
        overflow-x: auto !important; /* Если экран совсем крохотный — внутри появится свайп */
        font-size: 7px !important;   /* Уменьшаем буквы, чтобы схема влезла целиком */
        line-height: 1.1 !important;
        
        background-color: #111827 !important; /* Темная подложка, чтобы выделялся */
        padding: 10px !important;
        border-radius: 6px !important;
        border: 1px solid #1f2937 !important;
        margin-top: 10px !important;
    }
}

/* Экстра-маленькие экраны (смартфоны до 480px) */
@media (max-width: 480px) {
    /* Дополнительно жмем самый первый приветственный логотип BELOKON */
    #log-output > pre.ascii-banner {
        font-size: 5.5px !important;
        line-height: 1.05 !important;
    }

    /* Делаем zsh-строку адаптивной к переносам */
    .zsh-prompt {
        font-size: 11px !important;
        flex-wrap: wrap !important;
        line-height: 1.6 !important;
    }
    
    .prompt-segment {
        padding: 2px 6px !important;
    }
    
    .typed-cmd {
        font-size: 12px !important;
        margin-left: 5px !important;
    }
}

.content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.img-container {
    width: 350px; 
    flex-shrink: 0;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.img-container:hover {
    transform: scale(1.05); 
}

.img-container img {
    width: 100%;
    height: 500px; /* Фиксированный размер для идеальной симметрии */
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #374151;
}

.img-caption {
    font-size: 11px;
    color: #6b7280;
    font-family: monospace;
    text-align: center;
    margin-top: 8px;
}

.custom-list {
    list-style-type: none;
    padding-left: 0;
}

.custom-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.custom-list li::before {
    /* Берем цвет из переменной, если она не задана — по умолчанию будет серый */
    content: var(--marker-content, ">");
    color: var(--marker-color, #6b7280); 
    position: absolute;
    left: 0;
    font-size: 14px;
}
@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* --- ДИНАМИЧЕСКИЕ ПРОГРЕСС-БАРЫ --- */
.infographic-box {
    width: 100%;
    margin-bottom: 30px;
    background-color: #111827;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #334155;
}

.real-progress {
    margin-bottom: 15px;
}
.real-progress:last-child {
    margin-bottom: 0;
}

.prog-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
    font-family: monospace;
    font-weight: bold;
}

/* Контейнер для полосы */
.prog-track {
    width: 100%;
    height: 12px;              /* Высота полоски */
    background-color: #1e293b; /* Цвет пустой части */
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #4b5563; /* Тонкая рамка для терминального стиля */
}

/* Сама заливка */
.prog-fill {
    height: 100%;
    background-color: var(--bar-color); /* Берем цвет прямо из HTML */
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1); /* Плавная красивая анимация */
}


/* Адаптивная верстка для мобильных устройств */
@media (max-width: 768px) {
    /* Переводим flex-контейнер в режим колонки */
    .profile-layout {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }

    /* Делаем так, чтобы блок с текстом шел первым */
    .profile-info {
        order: 1;
        font-size: 15px !important; /* Немного уменьшаем шрифт для мобильных */
    }

    /* Блок с картинкой будет идти вторым (после текста) */
    .profile-avatar {
        order: 2;
        flex: 0 0 auto !important; /* Сбрасываем жесткую ширину */
        width: 100% !important;   /* Картинка займет всю ширину экрана */
        max-width: 400px;         /* Ограничиваем максимальный размер, чтобы не гигантская */
        margin: 0 auto;           /* Центрируем */
    }

    /* Корректируем сетку навыков (skills-grid), чтобы на телефоне она шла в 1 колонку */
    .skills-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Убираем фиксированную высоту body, чтобы на телефоне можно было нормально скроллить */
    body {
        height: auto !important;
        overflow-y: auto !important;
    }
    
    #terminal-container {
        height: auto !important;
        max-height: none !important;
    }
}


/* =========================================
   ПАТЧ ДЛЯ СОРТИРОВКИ АРТОВ НА МОБИЛЬНЫХ
   ========================================= */

