/* ============================================================================
   MAIN.CSS - Основні стилі портфоліо
   
   Зміст:
   1. CSS змінні
   2. Reset стилів
   3. Базові стилі (body, typography)
   4. Header & Navigation
   5. Hero секція
   6. Секції контенту
   7. Картки проектів
   8. Footer
   9. Утиліти
   10. Адаптивність
   ============================================================================ */


/* ============================================================================
   1. CSS ЗМІННІ
   ============================================================================ */

:root {
    /* Кольори - Темна тема (за замовчуванням) */
    --bg-primary: #0a192f;
    --bg-secondary: #112240;
    --bg-card: #1a2942;
    --text-primary: #e6f1ff;
    --text-secondary: #8892b0;
    --accent: #64ffda;
    --accent-hover: #52d4b3;
    --border: #233554;
    
    /* Статуси */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Переходи */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Тіні */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 15px 40px rgba(0, 0, 0, 0.3);
    
    /* Розміри */
    --header-height: 80px;
    --container-max-width: 1200px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Z-index шари */
    --z-modal: 2000;
    --z-header: 1000;
    --z-dropdown: 100;
    --z-content: 1;
    --z-background: -1;
}


/* ============================================================================
   2. RESET СТИЛІВ
   ============================================================================ */

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

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

/* Видалення дефолтних стилів списків */
ul, ol {
    list-style: none;
}

/* Видалення дефолтних стилів посилань */
a {
    text-decoration: none;
    color: inherit;
}

/* Кнопки */
button {
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* Інпути та текстові поля */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Зображення */
img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ============================================================================
   3. БАЗОВІ СТИЛІ
   ============================================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Контейнер */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Типографія */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: 1rem;
}


/* ============================================================================
   4. HEADER & NAVIGATION
   ============================================================================ */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 25, 47, 0.4);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
    z-index: var(--z-header);
    transition: var(--transition);
}

/* Header для світлої теми (перевизначається в themes.css) */
[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.4);
    border-bottom: 1px solid rgba(14, 165, 233, 0.08);
}

nav {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* Логотип */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 1px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

/* Навігаційні посилання */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

/* Активне посилання */
.nav-links a.active {
    color: var(--accent);
}

/* Анімація підкреслення при ховері */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Контроли (кнопки теми та мови) */
.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle,
.lang-switch {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.theme-toggle:hover,
.lang-switch:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}


/* ============================================================================
   5. HERO СЕКЦІЯ (Головна сторінка)
   ============================================================================ */

.hero {
    min-height: 80vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    position: relative;
    z-index: var(--z-content);
    animation: fadeInUp 1s ease-out;
}

.hero-label {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero h1 {
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero h1 .name {
    color: var(--accent);
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    animation: fadeInUp 1s ease-out 0.6s both;
}

/* Кнопки Hero */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.8s both;
}


/* ============================================================================
   6. СЕКЦІЇ КОНТЕНТУ
   ============================================================================ */

main {
    padding-top: var(--header-height);
    min-height: 100vh;
    position: relative;
    z-index: var(--z-content);
}

/* Секція з фоном */
.featured-preview,
.page-section {
    padding: 5rem 2rem;
    background: rgba(17, 34, 64, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: var(--z-content);
}

[data-theme="light"] .featured-preview,
[data-theme="light"] .page-section {
    background: rgba(255, 255, 255, 0.4);
}

/* Заголовки секцій */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

/* Декоративна лінія під заголовком */
.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 800px;
}

/* Заголовок сторінки */
.page-header {
    margin-bottom: 3rem;
    padding-top: 5rem;
    animation: fadeInUp 0.6s ease-out;
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.page-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 3.5rem;
}


/* ============================================================================
   7. КНОПКИ
   ============================================================================ */

.btn {
    padding: 0.7rem 1.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ефект пульсації */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

/* Типи кнопок */
.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(100, 255, 218, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-3px);
}

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

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

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


/* ============================================================================
   8. КАРТКИ ПРОЕКТІВ
   ============================================================================ */

/* Сітка проектів */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Картка проекту */
.project-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Анімації для карток (по черзі) */
.project-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out;
}

.project-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.project-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(100, 255, 218, 0.35);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(100, 255, 218, 0.08);
}

/* Зображення проекту */
.project-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-card));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-image-placeholder {
    font-size: 3rem;
    color: var(--text-secondary);
}

/* Статус проекту — пілюля з кольоровою точкою */
.project-status {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 25, 47, 0.55);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 2;
}

.project-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Завершено — зелений */
.project-status[data-status="completed"] {
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
}

/* В розробці — жовтий */
.project-status[data-status="inProgress"] {
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

/* Контент картки */
.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Опис на картках проєктів (обмежений) */
.project-card .project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Обмеження в 3 рядки */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Теги технологій */
.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.4rem 0.9rem;
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent);
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

.tag.featured {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: var(--success);
}


/* ============================================================================
   9. ФІЛЬТРИ (Сторінка проектів)
   ============================================================================ */

/* Єдина пілюля-бар: пошук + кнопки */
.filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(26, 41, 66, 0.3);
    backdrop-filter: blur(12px);
    padding: 0.6rem 0.75rem 0.6rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 255, 218, 0.12);
    box-shadow: 0 0 0 1px rgba(35, 53, 84, 0.8), 0 4px 20px rgba(0, 0, 0, 0.25);
    margin-bottom: 4rem;
}

[data-theme="light"] .filters {
    background: rgba(255, 255, 255, 0.7);
}

/* Поле пошуку — займає вільний простір */
.search-box {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.5rem;
    min-width: 0;
}

.search-icon {
    flex-shrink: 0;
    opacity: 0.5;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Роздільник між пошуком і кнопками */
.filter-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}

/* Кнопки фільтрів */
.filter-buttons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.filter-btn {
    padding: 0.45rem 1.1rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: rgba(100, 255, 218, 0.06);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}


/* ============================================================================
   10. СТОРІНКА "ПРО МЕНЕ"
   ============================================================================ */

/* Секція про мене */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out;
}

.about-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.about-content h1::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.about-text {
    margin-top: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

.highlight {
    color: var(--accent);
    font-weight: 600;
}

/* Аватар */
.about-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--bg-card));
    padding: 5px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 5rem;
    color: var(--accent);
}

/* Секція навичок */
.skills-section,
.experience-section,
.goals-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .skills-section,
[data-theme="light"] .experience-section,
[data-theme="light"] .goals-section {
    background: rgba(255, 255, 255, 0.4);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: rgba(100, 255, 218, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Іконка у квадраті + назва категорії */
.skill-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-icon-box {
    width: 36px;
    height: 36px;
    background: rgba(100, 255, 218, 0.1);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.skill-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Теги навичок — pills */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-category:hover .skill-tag {
    border-color: rgba(100, 255, 218, 0.3);
    color: var(--text-primary);
}

/* Timeline (Освіта) */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.timeline-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent);
    padding: 1.5rem 1.5rem 1.5rem 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: var(--transition);
}

.timeline-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(100, 200, 255, 0.08);
}

.timeline-item:hover .timeline-icon-wrap {
    background: var(--accent);
}

.timeline-item:hover .timeline-icon-wrap .icon {
    background-color: var(--bg-primary);
}

.timeline-icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.timeline-icon-wrap .icon {
    width: 20px;
    height: 20px;
    background-color: var(--accent);
    transition: var(--transition);
}

.timeline-body {
    flex: 1;
    min-width: 0;
}

.timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.timeline-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.timeline-year-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(100, 200, 255, 0.1);
    border: 1px solid rgba(100, 200, 255, 0.25);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin: 0;
}

/* Секція цілей */
.goals-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
    animation: fadeInUp 0.6s ease-out 0.7s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .goals-section {
    background: rgba(255, 255, 255, 0.4);
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.goal-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.goal-item:hover {
    border-color: var(--accent);
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
}

.goal-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.goal-content {
    flex: 1;
}

.goal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.goal-content strong {
    color: var(--accent);
    font-weight: 600;
}

/* Контакти */
.contact-section {
    background: rgba(26, 41, 66, 0.4);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.8s both;
    border: 1px solid var(--border);
}

[data-theme="light"] .contact-section {
    background: rgba(255, 255, 255, 0.4);
}

.contact-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    font-weight: 500;
    transition: var(--transition);
}

.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}


/* ============================================================================
   10.5 ICON STYLES
   ============================================================================ */

/* Базовий клас для адаптивних SVG-іконок */
.icon {
    display: inline-block;
    background-color: var(--accent); /* Колір для темної теми за замовчуванням */
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: -0.2em; /* Вирівнювання по тексту */
}

/* Розмір іконок за замовчуванням */
.btn-icon, .link-icon, .contact-icon, .title-icon, .category-icon, .timeline-icon {
    width: 1.2em;
    height: 1.2em;
}

/* Іконки всередині кнопок */
.btn-primary .icon {
    background-color: var(--bg-primary);
}

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

/* Посилання на картках проєктів */
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.project-link:hover {
    color: var(--accent);
}

/* Специфічні розміри іконок */
.search-icon {
    width: 18px;
    height: 18px;
}

.project-image-placeholder .icon,
.no-results-icon .icon {
    width: 48px;
    height: 48px;
}

.feature-icon .icon {
    width: 24px;
    height: 24px;
}


.modal-close .icon {
    width: 20px;
    height: 20px;
}

.goal-icon .icon {
    width: 40px;
    height: 40px;
    margin: 0 auto;
}

/* Loader animation */
.loader-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin-right: 0.5em;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
   11. FOOTER
   ============================================================================ */

footer {
    background: rgba(17, 34, 64, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(100, 255, 218, 0.08);
    margin-top: 5rem;
    position: relative;
    z-index: var(--z-content);
}

[data-theme="light"] footer {
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(14, 165, 233, 0.08);
}

footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}


/* ============================================================================
   12. MODAL
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--border-radius-sm);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}


/* ============================================================================
   13. УТИЛІТИ
   ============================================================================ */

/* Стани завантаження */
.loading {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Порожні стани */
.no-results,
.no-data,
.no-projects {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-secondary);
}

.no-results h3,
.no-data h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results a,
.no-data a {
    color: var(--accent);
    text-decoration: underline;
}

/* Сховати елемент */
.hidden {
    display: none !important;
}

/* Показати тільки для скрінрідерів */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================================
   13.5 НОВІ КОМПОНЕНТИ
   ============================================================================ */

/* --- Hero: двоколонковий layout --- */
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1100px;
    width: 100%;
}

.hero .hero-content {
    max-width: none;
    text-align: left;
}

.hero .hero-buttons {
    justify-content: flex-start;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Обгортка аватара з float-badge позиціями */
.hero-avatar-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
}

.avatar-hero-ring {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), rgba(139, 92, 246, 0.5));
    padding: 4px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.avatar-hero-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-card);
}

/* Float badges навколо аватара */
.float-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    animation: floatY 6s ease-in-out infinite;
    white-space: nowrap;
    z-index: 2;
}

.float-badge.pos-1 { top: 4%;    right: 2%;  animation-delay: 0s;  }
.float-badge.pos-2 { top: 40%;   right: -5%; animation-delay: -2s; }
.float-badge.pos-3 { bottom: 8%; left: 8%;   animation-delay: -4s; }
.float-badge.pos-4 { bottom: 32%;left: -2%;  animation-delay: -1s; }

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

[data-theme="light"] .float-badge {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.15);
}

/* --- Status pill з пульсуючою точкою --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    background: rgba(100, 255, 218, 0.08);
    color: var(--accent);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out 0s both;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulseDot 2.4s ease-out infinite;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(100, 255, 218, 0.4); }
    50%       { box-shadow: 0 0 0 8px transparent; }
}

[data-theme="light"] .status-pill {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.25);
}

/* --- Tech Marquee (нескінченна стрічка) --- */
.tech-marquee {
    overflow: hidden;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(100, 255, 218, 0.06);
    border-bottom: 1px solid rgba(100, 255, 218, 0.06);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%);
    position: relative;
    z-index: var(--z-content);
}

[data-theme="light"] .tech-marquee {
    border-color: rgba(14, 165, 233, 0.08);
}

.marquee-track {
    display: inline-flex;
    gap: 2.5rem;
    align-items: center;
    white-space: nowrap;
    animation: marqueeScroll 28s linear infinite;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: default;
    user-select: none;
}

.marquee-item:hover {
    color: var(--accent);
}

.marquee-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    flex-shrink: 0;
}

/* --- Tag hover на картках --- */
.tag {
    transition: var(--transition);
}

.project-card:hover .tag {
    border-color: rgba(100, 255, 218, 0.5);
    background: rgba(100, 255, 218, 0.15);
}

/* --- Scroll reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
}

.reveal.in-view {
    animation: revealIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.reveal[data-delay="1"].in-view { animation-delay: 40ms;  }
.reveal[data-delay="2"].in-view { animation-delay: 80ms;  }
.reveal[data-delay="3"].in-view { animation-delay: 120ms; }
.reveal[data-delay="4"].in-view { animation-delay: 160ms; }
.reveal[data-delay="5"].in-view { animation-delay: 200ms; }
.reveal[data-delay="6"].in-view { animation-delay: 240ms; }
.reveal[data-delay="7"].in-view { animation-delay: 280ms; }

@keyframes revealIn {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Картки з reveal: скасовуємо nth-child анімації (конфліктують через відсутній forwards) */
.featured-preview .project-card.reveal,
.projects-grid .project-card.reveal         { animation: none; }

.featured-preview .project-card.reveal.in-view,
.projects-grid .project-card.reveal.in-view { animation: revealIn 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* --- Contact CTA (index page) --- */
.contact-cta {
    padding: 5rem 2rem;
    position: relative;
    z-index: var(--z-content);
}

.contact-cta-card {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: clamp(2.5rem, 6vw, 4rem);
    border-radius: 24px;
    background:
        radial-gradient(80% 80% at 20% 0%, rgba(100, 255, 218, 0.08) 0%, transparent 60%),
        var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
    text-align: center;
}

.contact-cta-card::after {
    content: '';
    position: absolute;
    inset: auto -20% -50% -20%;
    height: 70%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(100, 255, 218, 0.12) 0%, transparent 65%);
    filter: blur(40px);
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
}

.contact-cta-card > * {
    position: relative;
    z-index: 1;
}

.contact-cta-card h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.contact-cta-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

[data-theme="light"] .contact-cta-card {
    background:
        radial-gradient(80% 80% at 20% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 60%),
        #ffffff;
}

[data-theme="light"] .contact-cta-card::after {
    background: radial-gradient(50% 50% at 50% 50%, rgba(14, 165, 233, 0.12) 0%, transparent 65%);
}


/* ============================================================================
   14. АДАПТИВНІСТЬ
   ============================================================================ */

/* ============================================================================
   MOBILE RESPONSIVE FIXES V2 - Виправлення для мобільних пристроїв
   Замініть існуючі @media (max-width: 768px) та @media (max-width: 480px)
   ============================================================================ */

/* Мобільні пристрої */
@media (max-width: 768px) {
    /* ✅ HEADER - УЛЬТРА КОМПАКТНИЙ, горизонтальний */
    header {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: var(--z-header);
    }
    
    nav {
        flex-direction: row; /* ✅ горизонтально! */
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        max-height: 50px; /* ✅ обмеження висоти */
    }
    
    .logo {
        font-size: 1.2rem;
        margin: 0;
    }
    
    .nav-links {
        gap: 0.5rem;
        font-size: 0.85rem;
        margin: 0;
        flex: 1;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .nav-links a {
        padding: 0.25rem 0.5rem;
    }
    
    .controls {
        gap: 0.35rem;
        display: flex;
        align-items: center;
    }
    
    .theme-toggle,
    .lang-switch {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    /* ✅ MAIN - компенсація зменшеного header */
    main {
        padding-top: 50px; /* ✅ тільки 50px замість 100px */
    }
    
    /* ✅ HERO - менший текст, без зайвого margin-top */
    .hero {
        padding: 2rem 1rem 2rem 1rem;
        min-height: auto;
        align-items: flex-start;
        margin-top: 0;
    }
    
    .hero h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }
    
    .hero p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .hero-label {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.85rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* ✅ ЗАГОЛОВКИ - менші */
    .page-title {
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    /* ✅ ПРОЕКТИ */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        border-radius: 10px;
    }
    
    .project-title {
        font-size: 1.25rem;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .project-content {
        padding: 1.2rem;
    }
    
    .project-tags {
        gap: 0.4rem;
    }
    
    .tag {
        padding: 0.3rem 0.7rem;
        font-size: 0.75rem;
    }
    
    /* ✅ ФІЛЬТРИ - вертикально на мобільних */
    .filters {
        flex-direction: column;
        align-items: stretch;
        border-radius: 16px;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .filter-divider {
        width: 100%;
        height: 1px;
    }

    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .filter-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.82rem;
    }
    
    /* ✅ СЕКЦІЇ - менші відступи */
    .featured-preview,
    .page-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
        padding-top: 0.5rem;
    }
    
    /* ✅ ПРО МЕНЕ - !!!КРИТИЧНО ВИПРАВЛЕНО!!! */
    .about-section {
        display: flex; /* ✅ змінено з grid */
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
        padding: 0;
    }
    
    .about-content {
        order: 2; /* ✅ текст ПІСЛЯ аватарки */
        width: 100%;
    }
    
    .about-avatar {
        order: 1; /* ✅ аватар ПЕРШИМ */
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .about-content h1 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }
    
    .about-text {
        font-size: 0.95rem; /* ✅ нормальний розмір! */
        line-height: 1.7; /* ✅ більше простору між рядками */
        max-width: 100%; /* ✅ на всю ширину */
    }
    
    .about-text p {
        margin-bottom: 1rem; /* ✅ відступи між параграфами */
    }
    
    .avatar-container {
        width: 160px;
        height: 160px;
        margin: 0 auto; /* ✅ по центру */
    }
    
    .avatar-placeholder {
        font-size: 2.2rem;
    }
    
    /* ✅ НАВИЧКИ */
    .skills-section,
    .experience-section,
    .goals-section,
    .contact-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .skill-category {
        padding: 1.2rem;
    }
    
    .skill-category h3 {
        font-size: 1.05rem;
        margin-bottom: 0.8rem;
    }
    
    .skill-category li {
        font-size: 0.9rem;
        padding: 0.35rem 0;
        line-height: 1.5;
    }
    
    /* ✅ ОСВІТА */
    .timeline {
        gap: 1rem;
    }

    .timeline-item {
        padding: 1.2rem 1.2rem 1.2rem 1rem;
        gap: 1rem;
    }

    .timeline-icon-wrap {
        width: 38px;
        height: 38px;
    }

    .timeline-icon-wrap .icon {
        width: 18px;
        height: 18px;
    }

    .timeline-title {
        font-size: 1rem;
    }

    .timeline-desc {
        font-size: 0.88rem;
    }
    
    /* ✅ ЦІЛІ */
    .goal-item {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .goal-icon {
        font-size: 1.5rem;
        min-width: 40px;
    }
    
    .goal-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    /* ✅ КОНТАКТИ */
    .contact-section h2 {
        font-size: 1.4rem;
        margin-bottom: 0.85rem;
    }
    
    .contact-section p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .contact-links {
        flex-direction: column;
        gap: 0.85rem;
    }
    
    .contact-link {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* ✅ FOOTER */
    footer {
        padding: 1.5rem 1rem;
        margin-top: 2.5rem;
    }

    footer p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* ✅ HERO TWO-COLUMN → ONE COLUMN */
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero .hero-content {
        text-align: center;
        order: 2;
    }

    .hero .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        order: 1;
    }

    .hero-avatar-wrapper {
        width: 300px;
        height: 300px;
    }

    .avatar-hero-ring {
        width: 240px;
        height: 240px;
    }

    .float-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .status-pill {
        justify-content: center;
    }

    /* ✅ CONTACT CTA */
    .contact-cta {
        padding: 3rem 1rem;
    }

    .contact-cta-card {
        padding: 2rem 1.25rem;
    }

    .contact-cta-card p {
        font-size: 1rem;
    }
}

/* ✅ ДУЖЕ МАЛЕНЬКІ ЕКРАНИ */
@media (max-width: 480px) {
    nav {
        padding: 0.4rem 0.75rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .nav-links {
        font-size: 0.8rem;
        gap: 0.35rem;
    }
    
    .nav-links a {
        padding: 0.2rem 0.4rem;
    }
    
    .theme-toggle,
    .lang-switch {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-height: 28px;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 1.5rem 0.75rem 1.25rem 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .featured-preview,
    .page-section {
        padding: 1.5rem 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .page-title {
        font-size: 1.4rem;
    }
    
    .filters {
        padding: 1rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-title {
        font-size: 1.15rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .skills-section,
    .experience-section,
    .goals-section,
    .contact-section {
        padding: 1.5rem 0.75rem;
    }
    
    .skill-category,
    .timeline-content,
    .goal-item {
        padding: 1rem;
    }
    
    .about-text {
        font-size: 0.9rem;
        line-height: 1.65;
    }
    
    .avatar-container {
        width: 140px;
        height: 140px;
    }

    .hero-avatar-wrapper {
        width: 260px;
        height: 260px;
    }

    .avatar-hero-ring {
        width: 200px;
        height: 200px;
    }

    footer {
        padding: 1rem 0.75rem;
    }

    footer p {
        font-size: 0.8rem;
    }
}

/* Preference для зменшення анімацій */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
