:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-light: #334155;
    --text: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 0.5rem;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* SCROLLBAR */
/* Стили для скроллбара для всего сайта */

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

/* Для Chrome, Safari, Edge и других WebKit браузеров */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b; /* Темный фон трека */
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #475569; /* Основной цвет ползунка */
    border-radius: 5px;
    border: 2px solid #1e293b;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Цвет при наведении */
}

::-webkit-scrollbar-thumb:active {
    background: #94a3b8; /* Цвет при активном нажатии */
}

::-webkit-scrollbar-corner {
    background: #0f172a; /* Цвет угла при наличии горизонтального и вертикального скролла */
}

/* Стили для скроллбара в модальном окне (дополнительно) */
.modal-content::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 5px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #475569;
    border: 2px solid #334155;
}

/* Для темной темы (если у вас есть переключатель) */
@media (prefers-color-scheme: dark) {
    * {
        scrollbar-color: #475569 #1e293b;
    }
}

.modal-content {
    /* Для Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(236, 108, 108, 0.7) transparent;

    /* Для старых версий Firefox с поддержкой вендорных префиксов */
    -moz-scrollbar-color: rgba(236, 108, 108, 0.7) transparent;
    -moz-scrollbar-width: thin;
}

/* Для Webkit-браузеров */
.modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* для горизонтального скролла */
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(236, 108, 108, 0.7);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 71, 71, 0.7);
}

.modal-content::-webkit-scrollbar-corner {
    background: transparent;
}
/* SCROLLBAR */

.code-font {
    font-family: 'JetBrains Mono', monospace;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
}

.skill-tag {
    display: inline-block;
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    margin: 0.25rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.skill-tag:hover {
    background-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
}

.header {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
    z-index: -2;
}

.header-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, var(--bg-dark) 100%), url('bg-books-580.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: -1;
}

.header-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    background: linear-gradient(90deg, #818cf8, #6366f1, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 90%;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-light);
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 4px;
    background-color: var(--primary);
    border-radius: 2px;
}

.section-title-secondary::after {
    background-color: var(--secondary);
}

.section-dark {
    background-color: rgba(0, 0, 0, 0.2);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.all-skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
}

/*.project-card:hover {*/
/*    transform: translateY(-5px);*/
/*    border-color: var(--primary);*/
/*    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);*/
/*}*/

.project-header {
    padding: 1.5rem 1.5rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-title-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-term {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.project-body {
    padding: 1rem 1.5rem;
}

.project-short-desc {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    white-space: pre-line;
}

.project-desc ul {
    list-style-type: none;
    padding-left: 0;
}

.project-desc li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.project-desc li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.project-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.project-integrations {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.integrations-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.integrations-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.integration-tag {
    display: inline-block;
    background-color: rgba(139, 92, 246, 0.15);
    color: var(--secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.project-gallery {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.gallery-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-item-container {
  position: relative;
  display: inline-block;
}

/*.gallery-item-container::after {*/
/*  content: '';*/
/*  position: absolute;*/
/*  top: 0;*/
/*  left: 0;*/
/*  width: 100%;*/
/*  height: 100%;*/
/*  background: linear-gradient(*/
/*    to bottom,*/
/*    rgba(15, 23, 42, 0.4) 0%,*/
/*    rgba(15, 23, 42, 0.7) 100%*/
/*  );*/
/*  pointer-events: none;*/
/*  mix-blend-mode: multiply;*/
/*}*/

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    height: 80px;
    margin-right: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    filter: grayscale(.8);
}

.gallery-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.5rem;
}

.gallery-placeholder i {
    font-size: 2rem;
}

.opensource-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.opensource-card {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/*.opensource-card:hover {*/
/*    transform: translateY(-5px);*/
/*    border-color: var(--secondary);*/
/*    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);*/
/*}*/

.opensource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.opensource-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.opensource-link {
    color: var(--secondary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
}

.opensource-link:hover {
    text-decoration: underline;
}

.opensource-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.opensource-icon {
    color: var(--secondary);
    font-size: 1.5rem;
}

.page-break {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 3rem 0;
    opacity: 0.5;
}

.footer {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-light);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border: none;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-5px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-card);
    position: relative;
}

.modal-image {
    border-radius: var(--radius);
    max-width: 1200px;
    display: block;
}

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background-color: rgba(236, 108, 108, 0.7);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 1.2rem;
}

.modal-close:hover {
    background-color: rgba(191, 71, 71, 0.7);
}

@media (max-width: 768px) {
    .header {
        height: 60vh;
        min-height: 400px;
    }

    .header-title {
        font-size: 2.5rem;
    }

    .header-subtitle {
        font-size: 1.1rem;
    }

    .nav-links {
        display: none;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .header-image {
        width: 100%;
    }

    .opensource-container {
        grid-template-columns: 1fr;
    }
}
