/* Общие стили и Матрица */
:root {
    --matrix-green: #00FF41;
    --matrix-green-light: #39FF14;
    --matrix-green-dark: #00A32A;
    --matrix-bg: #050A05; /* Еще темнее для глубины */
    --text-color: #E0E0E0;
    --text-color-darker: #A0A0A0;
    --panel-bg: rgba(0, 20, 0, 0.65); /* Полупрозрачный фон панелей */
    --panel-border: rgba(0, 255, 65, 0.2);
    --panel-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
    --font-family-main: 'Arial', monospace; /* Более "технический" моноширинный */
    --font-family-accent: 'Arial', monospace; /* Для заголовков и акцентов */
    --hover-glow: 0 0 8px var(--matrix-green-light), 0 0 12px var(--matrix-green-light), 0 0 16px var(--matrix-green);
}

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

body {
    font-family: var(--font-family-main);
    background-color: var(--matrix-bg);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--matrix-green) var(--matrix-bg);
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--matrix-bg);
}
::-webkit-scrollbar-thumb {
    background-color: var(--matrix-green);
    border-radius: 4px;
    border: 1px solid var(--matrix-bg);
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--matrix-green-light);
}

svg{
    width: 16px;
    height: 16px;
    fill: #00a42a;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

.container {
    display: flex;
    max-width: 1500px; /* Чуть шире для современного вида */
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Сайдбар */
.sidebar {
    width: 320px;
    background: linear-gradient(to bottom, rgba(0,10,0,0.7), rgba(0,25,0,0.85));
    border-right: 1px solid var(--panel-border);
    padding: 30px 25px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(3px); /* Легкий блюр фона */
}

.profile {
    text-align: center;
    margin-bottom: 30px;
}

.profile-image-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid #00ff4161;
    margin: 15px auto 20px auto;
    padding: 5px;
    /* box-shadow: 0 0 15px var(--matrix-green), inset 0 0 10px rgba(0, 255, 65, 0.3); */
    overflow: hidden;
}
.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(50%) contrast(120%) brightness(0.9);
    transition: transform 0.4s ease-out;
}
.profile-img:hover {
    transform: scale(1.1);
    filter: grayscale(0%) contrast(100%) brightness(1);
}

.profile h1 {
    font-family: var(--font-family-accent);
    color: var(--matrix-green-light);
    font-size: 26px;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.profile .job-title {
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

.contact-info h2 {
    font-family: var(--font-family-accent);
    color: var(--matrix-green);
    font-size: 1.3em;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--panel-border);
    text-align: center;
}

.project-card-navs a{
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffff;
    padding: 10px 20px;
    border: 1px solid #414141;
    width: fit-content;
    border-radius: 100px;
    font-size: 14px;
}
.project-card-navs{
    display: flex;
    gap: 20px;
    padding: 0px 20px;
    padding-bottom: 20px;
}
.project-card-navs a img{
    display: flex;
    width: 24px;
    filter: brightness(0) invert(1); /* Делает белым */
}

.contact-info ul {
    list-style: none;
}
.contact-info ul li {
    margin-bottom: 12px;
}
.contact-info ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease, text-shadow 0.3s ease, padding-left 0.3s ease;
    display: flex;
    padding: 10px 20px;
    border: 1px solid #00a42a66;
    border-radius: 10px;
    align-items: center;
    gap: 10px;
}
.contact-info ul li a i {
    margin-right: 10px;
    width: 20px; /* Фиксированная ширина для выравнивания */
    text-align: center;
    color: var(--matrix-green-dark);
    transition: color 0.3s ease;
}
.contact-info ul li a:hover {
    color: var(--matrix-green-light);
    text-shadow: 0 0 5px var(--matrix-green-light);
    padding-left: 25px;
}
.contact-info ul li a:hover i {
    color: var(--matrix-green-light);
}

hr.matrix-hr {
    border: 0;
    height: 1px;
    background: var(--panel-border);
    margin: 20px 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
    font-size: 0.85em;
    text-align: center;
    color: var(--text-color-darker);
}
.sidebar-footer .scanline {
    font-family: var(--font-family-accent);
    font-size: 0.9em;
    color: var(--matrix-green-dark);
}
.sidebar-footer .ok-status {
    color: var(--matrix-green);
    font-weight: bold;
    animation: blinkStatus 2s infinite;
}
@keyframes blinkStatus {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.project-card-image{
    width: 100%;
    display: flex;
}
.project-card-image img{
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 0px 100% 100% 0px;
    border-right: 1px solid #07f940;
}
.project-card-left{

}
.comming_soon{
    text-align: center;
}
.project-card-right{
    display: flex;
    flex-direction: column;
}
.project-card-inner{
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* Основной контент */
.content {
    flex: 1;
    padding: 40px 50px;
}

.content-section {
    margin-bottom: 50px;
    padding: 30px;
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px); /* Сквозь панель виден фон */
    position: relative;
    border-radius: 20px;
}

.content-section h2 {
    font-family: var(--font-family-accent);
    color: var(--matrix-green);
    font-size: 2.2em;
    margin-bottom: 25px;
    padding-bottom: 0px;
    position: relative;
    display: inline-block; /* Чтобы граница была по ширине текста */
}
/* Эффект "сканирующей линии" для заголовков */
.content-section h2::after {
    display: none;
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px; /* Чуть ниже основной линии */
    width: 0%;
    height: 2px;
    background-color: var(--matrix-green-light);
    box-shadow: 0 0 10px var(--matrix-green-light);
    transition: width 0.5s ease-out;
}
.content-section.is-visible h2::after {
    width: 100%;
}
/* Глитч на data-text (появляется при наведении на h2 span) */
.content-section h2 span {
    position: relative;
    display: inline-block;
}
.content-section h2:hover span::before,
.content-section h2:hover span::after {
    content: attr(data-text); /* Используем data-text из родительского h2 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--panel-bg); /* Цвет фона панели */
    overflow: hidden;
    clip-path: inset(0); /* По умолчанию не обрезано */
    color: var(--matrix-green);
}
.content-section h2 span::before { /* Инициализируем data-text для h2 */
    content: attr(data-text);
}
.content-section h2:hover span::before {
    left: 2px;
    text-shadow: -1px 0 var(--matrix-green-dark);
    animation: glitch-effect 0.5s infinite linear alternate-reverse;
}
.content-section h2:hover span::after {
    left: -2px;
    text-shadow: 1px 0 var(--matrix-green-light);
    animation: glitch-effect 0.5s infinite linear alternate-reverse;
    animation-delay: -0.25s; /* Сдвигаем анимацию для асинхронности */
}
@keyframes glitch-effect {
    0% { clip-path: polygon(0 0, 100% 0, 100% 5%, 0 5%); }
    25% { clip-path: polygon(0 20%, 100% 20%, 100% 25%, 0 25%); }
    50% { clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%); }
    75% { clip-path: polygon(0 70%, 100% 70%, 100% 75%, 0 75%); }
    100% { clip-path: polygon(0 90%, 100% 90%, 100% 95%, 0 95%); }
}


.content p {
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: justify;
    font-size: 1.05em;
}

.content ul {
    list-style: none;
    padding-left: 0;
}
.content section ul li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}
.content section ul li::before {
    content: ">>";
    color: var(--matrix-green);
    position: absolute;
    left: 0;
    font-weight: normal;
    font-family: var(--font-family-accent);
}

/* Навыки */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.skill-category h3 {
    font-family: var(--font-family-accent);
    color: var(--matrix-green-light);
    margin-bottom: 15px;
    font-size: 1.3em;
}
.skill-bar {
    width: 100%;
    background-color: rgba(0, 255, 65, 0.1);
    height: 12px;
    border-radius: 100px;
    border: 1px solid var(--panel-border);
    margin-top: 5px;
    overflow: hidden;
}
.skill-level {
    height: 100%;
    background: linear-gradient(to right, var(--matrix-green-dark), var(--matrix-green-light));
    width: 0; /* Начальная ширина для анимации */
    border-radius: 1px;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); /* Плавный переход */
    box-shadow: 0 0 5px var(--matrix-green);
}
.content-section.is-visible .skill-level { /* Анимация при видимости */
    /* Ширина будет установлена из data-level в JS */
}

/* Таймлайн для Опыта и Образования */
.timeline {
    position: relative;
    padding-left: 30px; /* Отступ для линии и иконок */
}
.timeline::before { /* Вертикальная линия таймлайна */
    content: '';
    position: absolute;
    left: 8px; /* Позиционирование линии */
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--panel-border);
}
.timeline-item {
    position: relative;
    margin-bottom: 30px;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-icon {
    position: absolute;
    left: -30px; /* (30px отступа - (ширина иконки 22px / 2) - (ширина линии 2px / 2)) -> смещаем к линии */
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--matrix-green);
    color: var(--matrix-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    box-shadow: 0 0 10px var(--matrix-green);
    z-index: 1; /* Над линией */
}
.timeline-content {
    padding-left: 20px; /* Отступ от иконки */
}
.timeline-content h3 {
    color: var(--text-color);
    font-size: 1.25em;
    margin-bottom: 3px;
}
.timeline-content h3 .company {
    color: var(--matrix-green-light);
    font-family: var(--font-family-accent);
}
.timeline-content .date {
    color: var(--text-color-darker);
    font-size: 0.9em;
    margin-bottom: 10px;
    font-family: var(--font-family-accent);
}

/* Проекты */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}
.project-card {
    background-color: rgba(0, 30, 0, 0.5);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    display: flex;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    gap: 10px;
}
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.2);
}
.project-card-header {
    padding: 15px 20px;
    padding-bottom: 0px;
}
.project-card-header h3 a {
    color: var(--matrix-green-light);
    text-decoration: none;
    font-family: var(--font-family-accent);
    font-size: 1.3em;
}
.project-card-header h3 a i {
    font-size: 0.8em;
    margin-left: 5px;
    color: var(--matrix-green);
}
.project-card-body {
    padding: 15px 20px;
    flex-grow: 1; /* Чтобы тело занимало доступное пространство */
    font-size: 0.95em;
}
.project-card-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--panel-border);
    font-size: 0.85em;
    color: var(--text-color-darker);
    text-align: right;
    font-family: var(--font-family-accent);
}
.contact-info li a svg{

}

/* Анимации при прокрутке */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.fade-in-up { transform: translateY(30px); }
.fade-in-left { transform: translateX(-30px); }
.fade-in-right { transform: translateX(30px); }

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);

}
.contact-info{
    animation-delay: 0.2s;
    margin-bottom: 20px;
}


/* Адаптивность */
@media (max-width: 1200px) {
    .sidebar { width: 280px; }
    .content { padding: 30px 40px; }
}

@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
        padding: 20px;
    }
    .profile-image-container { width: 140px; height: 140px; }
    .contact-info ul { display: flex; flex-wrap: wrap; justify-content: center; }
    .contact-info ul li { margin: 5px 10px; }
    .content { padding: 30px 20px; }
}

@media (max-width: 576px) {
    .project-card{
        flex-direction: column;
    }
    .project-card-image img {
        width: 100%;
        height: 280px;
        object-fit: cover;
        border-radius: 0;
    }
    .project-card-navs {
        flex-direction: column;
    }
    .project-card-navs a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .profile h1 { font-size: 2em; }
    .profile .job-title { font-size: 1em; }
    .content-section h2 { font-size: 1.8em; }
    .timeline::before { left: 6px; } /* Немного сдвигаем линию для мобильных */
    .timeline-icon { left: -18px; width: 20px; height: 20px; font-size: 0.7em; }
    .timeline-content { padding-left: 15px; }
    .projects-grid, .skills-container {
        grid-template-columns: 1fr;
    }
}



:root {
    /* * ВАЖНО:
     * Подберите эту высоту. Она должна быть равна высоте 3-х ваших
     * карточек + 2 промежутка между ними.
     * * У вас .project-card ~300px высотой, и .projects-grid gap: 25px.
     * Расчет: (300px * 3) + (25px * 2) = 950px.
     * Поставим 950px. Если что, поправьте это значение.
     */
    --project-list-max-height: 950px;
}

/* 1. Стили навигации табов */
.projects-tabs-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--panel-border);
}
.tab-link {
    font-family: var(--font-family-accent);
    font-size: 1.1em;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color-darker);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    transform: translateY(1px); /* Для точного прилегания к нижней границе */
}
.tab-link:hover {
    color: var(--text-color);
}
.tab-link.active {
    color: var(--matrix-green-light);
    border-bottom-color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green-light);
}

/* 2. Стили панелей табов */
.tab-panel {
    display: none; /* Скрываем все панели */
}
.tab-panel.active {
    display: block; /* Показываем активную */
}

/* 3. Обертка для логики "Показать еще" */
.projects-list-wrapper {
    position: relative; /* Необходимо для градиента */
}

/* 4. Сам список проектов (ваш .projects-grid) */
.projects-grid {
    /* Применяем ограничение по высоте */
    max-height: var(--project-list-max-height);
    overflow: hidden;
    transition: max-height 0.6s ease-in-out;
}

/* 5. Эффект затухания (градиент) */
.projects-list-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    /* Градиент от прозрачного к цвету фона вашей панели */
    background: linear-gradient(to bottom, transparent, var(--panel-bg));
    pointer-events: none; /* Позволяет кликать "сквозь" него */
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 0 20px 20px; /* Скругляем углы под родителя */
}

/* 6. Кнопка "Показать еще" */
.show-more-btn {
    display: none; /* Скрыта по умолчанию */
    width: calc(100% - 40px); /* Чуть меньше ширины, с отступами */
    margin: 20px auto 0 auto;
    padding: 12px 20px;
    font-family: var(--font-family-accent);
    font-size: 1em;
    font-weight: bold;
    color: var(--matrix-bg);
    background-color: var(--matrix-green);
    border: 1px solid var(--matrix-green-light);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}
.show-more-btn:hover {
    background-color: var(--matrix-green-light);
    color: #000;
    box-shadow: var(--hover-glow);
}


/* 7. Логика отображения (управляется через JS) */

/* Показываем градиент, если есть класс .has-overflow и список НЕ раскрыт */
.projects-list-wrapper.has-overflow:not(.is-expanded)::after {
    opacity: 1;
}

/* Показываем кнопку, если есть класс .has-overflow и список НЕ раскрыт */
.projects-list-wrapper.has-overflow:not(.is-expanded) + .show-more-btn {
    display: block;
}

/* Когда список раскрыт (.is-expanded) */
.projects-list-wrapper.is-expanded .projects-grid {
    max-height: 5000px; /* "Бесконечная" высота для раскрытия */
}

/* ---- ЗАГЛУШКА ДЛЯ ДЕМО (можете удалить) ---- */
.project-card-placeholder {
    height: 300px; /* Примерная высота вашей карточки */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--text-color-darker);
    background-color: rgba(0, 30, 0, 0.5);
    border: 1px dashed var(--panel-border);
    border-radius: 20px;
}


/* --- Стили для секции "Услуги" --- */

.services-list {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Тот же отступ, что и в .projects-grid */
}

.service-item {
    display: flex;
    flex-direction: row; /* Горизонтальное расположение */
    align-items: flex-start; /* Выравнивание по верху */
    gap: 20px;
    padding: 25px;
    background-color: rgba(0, 30, 0, 0.5); /* Фон как у .project-card */
    border: 1px solid var(--panel-border);
    border-radius: 15px; /* Чуть менее круглый, чем секция */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.2); /* Эффект при наведении как у .project-card */
}

/* 1. Иконка */
.service-icon {
    flex-shrink: 0; /* Иконка не будет сжиматься */
    width: 55px;
    height: 55px;
    background-color: rgba(0, 255, 65, 0.05); /* Легкая подсветка фона */
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--matrix-green-light); /* Яркая иконка */
}

/* 2. Контент (Название + Описание) */
.service-content {
    flex-grow: 1; /* Занимает все доступное место */
}

.service-content h3 {
    color: var(--matrix-green-light);
    font-family: var(--font-family-accent);
    font-size: 1.25em;
    margin: 0 0 8px 0; /* Убираем верхний отступ, добавляем нижний */
}

.service-content p {
    font-size: 0.95em;
    color: var(--text-color);
    margin: 0; /* Убираем стандартный отступ P */
    text-align: left; /* Переопределяем text-align: justify, если он есть */
    line-height: 1.6;
}

/* 3. Цена (Справа) */
.service-price {
    flex-shrink: 0; /* Цена не будет сжиматься */
    margin-left: auto; /* <--- Магия! Прижимает блок вправо */
    padding-left: 20px; /* Отступ от контента */
    text-align: right;
}

.service-price span {
    display: block;
    font-family: var(--font-family-accent);
    font-size: 1.2em; /* Чуть крупнее основного текста */
    color: var(--matrix-green);
    font-weight: bold;
    white-space: nowrap; /* Чтобы цена не переносилась */
}

/* --- Адаптация для мобильных --- */
@media (max-width: 576px) {
    .service-item {
        flex-direction: column; /* Ставим все в колонку */
        gap: 15px;
        padding: 20px;
    }

    .service-content {
        /* Контент идет после иконки */
        order: 2;
    }

    .service-icon {
        /* Иконка вначале */
        order: 1;
    }

    .service-price {
        /* Цена идет в конце */
        order: 3;
        margin-left: 0; /* Убираем прижатие вправо */
        padding-left: 0;
        text-align: left; /* Выравниваем по левому краю */
        margin-top: 10px;
        font-size: 1.3em; /* Делаем цену заметнее */
    }
}