/* ===========================================================================
   ПЕРЕМЕННЫЕ (VARIABLES)
   =========================================================================== */
   :root {
    /* Основная палитра: Глубокие и сочные тона */
    --color-bg: #f8faff;
    --color-white: #ffffff;
    --color-black: #1a1a1a;
    --color-gray: #64748b;
    
    /* Акцентные цвета (Эмоциональный градиент) */
    --color-primary: #6366f1; /* Indigo */
    --color-secondary: #ec4899; /* Pink */
    --color-accent-gradient: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    
    --color-border: rgba(0, 0, 0, 0.08);
    
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-optical-sizing: auto;

    --fs-h1: clamp(40px, 8vw, 64px);    
    --fs-h2: clamp(24px, 5vw, 32px);    
    --fs-h3: clamp(18px, 3vw, 20px);    
    --fs-small: clamp(12px, 2vw, 14px); 
    
    --max-width: 1000px;
    --spacing-unit: 8px;
    --border-radius: 12px;
    
    --transition-speed: 0.3s;
    --shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
    --shadow-hover: 0 20px 40px rgba(236, 72, 153, 0.15);
}

/* ===========================================================================
   БАЗОВЫЕ СТИЛИ (RESET & BASE)
   =========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    background: radial-gradient(circle at top right, #eef2ff, #f8faff);
    color: var(--color-black);
    font-family: var(--font-family);
    font-optical-sizing: var(--font-optical-sizing);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: auto; /* Базовый курсор. Скроется только если загрузится JS */
}

/* Если JS загрузился и работает, прячем системный курсор */
body.js-active {
    cursor: none;
}

.illustration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    width: 90vw;
    max-width: 600px;
    height: auto;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: multiply;
    animation: float 6s ease-in-out infinite;
}

.section {
    padding: calc(var(--spacing-unit) * 12) calc(var(--spacing-unit) * 5);
    position: relative;
}

.section:nth-child(even) {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 2);
}

h1, h2, .hero-name, .why-title, .skill-title, 
.slider-title, .timeline-title, .about-title, .contacts-title {
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
}

/* Эффект градиентного текста для заголовков */
.hero-name, .why-title, .skill-title, .slider-title, 
.timeline-title, .about-title, .contacts-title { 
    font-size: var(--fs-h1); 
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-size: var(--fs-h3);
    font-weight: 900;
    line-height: 1;
    margin-bottom: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
}

.hero-subtitle, .slider-subtitle, .about-subtitle, .contacts-subtitle, 
.why-subtitle, .timeline-subtitle {
    font-size: var(--fs-h2);
    font-weight: 500;
    line-height: 1.1;
    color: var(--color-gray);
}

p { line-height: 1.3; }
ul { padding: calc(var(--spacing-unit) * 2); }
li { padding: calc(var(--spacing-unit) * 0.5); line-height: 1.2; }

.highlight {
    background: var(--color-white);
    color: var(--color-accent);
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1.5);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    border: 1.5px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

/* Карточки с эффектом свечения */
.why-card, .skill-card, .contact-card, .timeline-card, .education-item {
    background: var(--color-white);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.why-card:hover, .skill-card:hover, .timeline-card:hover, .education-item:hover, .contact-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-hover);
}

/* Кастомный курсор */
.custom-cursor {
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease, background 0.3s ease;
    mix-blend-mode: difference;
    left: -50px;
    top: -50px;
    border: 1px solid white;
}

.custom-cursor.hover {
    transform: scale(5);
    background: var(--color-secondary);
}

/* ===========================================================================
   НАВИГАЦИЯ (NAVIGATION)
   =========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all var(--transition-speed) ease;
}

.nav.scrolled { box-shadow: var(--shadow); }

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 4);
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-black);
    font-weight: 500;
    font-size: 14px;
    transition: color var(--transition-speed) ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-black);
    transition: width var(--transition-speed) ease;
}

.nav-menu a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--color-black);
    transition: all var(--transition-speed) ease;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===========================================================================
   HERO СЕКЦИЯ
   =========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--spacing-unit) * 15) calc(var(--spacing-unit) * 5);
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 10);
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.8);
    padding: calc(var(--spacing-unit) * 5);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 5);
    flex: 1;
}

.hero-photo {
    width: 220px;
    height: 280px;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: var(--shadow);
    animation: fadeIn 1s ease-in-out forwards;
}

.hero-text { flex: 1; }

.hero-location {
    font-size: 14px;
    color: var(--color-gray);
    margin-bottom: calc(var(--spacing-unit) * 1);
    animation: fadeInUp 1s ease-in-out 0.2s both forwards;
}

.hero-name {
    font-size: var(--fs-h1);
    font-weight: 900;
    line-height: 0.9;
    margin-bottom: calc(var(--spacing-unit) * 1);
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeInUp 1s ease-in-out 0.4s both forwards;
    padding-bottom: 16px;
}

.hero-title {
    font-size: 32px;
    color: var(--color-black);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    font-weight: 600;
    line-height: 1;
    animation: fadeInUp 1s ease-in-out 0.6s both forwards;
}

.hero-subtitle {
    font-size: 16px;
    line-height: 1.2;
    color: var(--color-gray);
    margin-bottom: calc(var(--spacing-unit) * 4);
    animation: fadeInUp 1s ease-in-out 0.8s both forwards;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1);
    margin-bottom: calc(var(--spacing-unit) * 3);
    animation: fadeInUp 1s ease-in-out 1s both forwards;
}

.hero-cta {
    display: inline-block;
    padding: 18px 40px;
    background: var(--color-accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.hero-cta:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px rgba(236, 72, 153, 0.4);
}

/* ===========================================================================
   КОМПОНЕНТЫ (CARDS & GRIDS)
   =========================================================================== */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 3);
    margin-top: calc(var(--spacing-unit) * 4);
}

.why-card {
    background: var(--color-white);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.why-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.why-icon { margin-bottom: calc(var(--spacing-unit) * 1.4); }

.why-card h3 {
    font-size: 18px;
    margin-bottom: calc(var(--spacing-unit) * 1);
    color: var(--color-black);
}

.why-card p {
    font-size: 14px;
    color: var(--color-gray);
    line-height: 1.3;
}

/* ===========================================================================
   КОМПЕТЕНЦИИ (SKILLS)
   =========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--spacing-unit) * 3);
    margin-top: calc(var(--spacing-unit) * 4);
}

.skill-card {
    background: var(--color-white);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
    width: 100%;
    max-width: auto;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.skill-level {
    display: inline-block;
    padding: 9px 20px 8px 20px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: calc(var(--spacing-unit) * 2);
}

.skill-level.expert { background: var(--color-gray); color: var(--color-white); }
.skill-level.advanced { background: var(--color-white); color: var(--color-accent); border: 1px solid var(--color-border); }

.skill-icon { margin-bottom: calc(var(--spacing-unit) * 1.4); }

.skill-card h3 {
    font-size: 20px;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--color-black);
}

.soft-skills { list-style: none; padding-left: 0; }
.soft-skills li { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.soft-skills li::before {
    content: "•";
    color: var(--color-accent);
    font-size: 1.2rem;
    line-height: 0;
    margin-top: -4px;
}

/* ===========================================================================
   (SLIDER)
   =========================================================================== */
.slider-grid { margin-top: calc(var(--spacing-unit) * 3); }

.slider-grid p {
    color: var(--color-gray);
    padding-bottom: calc(var(--spacing-unit) * 2);
    max-width: 450px;
} 
   
.slider-grid a {
    color: var(--color-black); 
    text-decoration: underline;
    font-size: 12px;
    font-weight: 700;
}

.slider-wrapper {
    position: relative;
    overflow-x: auto; /* Фолбэк: если JS не работает, слайдер можно будет скроллить */
    overflow-y: hidden;
    padding-top: calc(var(--spacing-unit) * 5);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    scrollbar-width: none; /* Скрываем полосу прокрутки для фолбэка */
}
.slider-wrapper::-webkit-scrollbar { display: none; }

/* Если JS загрузился, отключаем нативный скролл, переходим на управление мышью */
body.js-active .slider-wrapper {
    overflow-x: hidden;
}

.slider-track {
    display: flex;
    gap: 20px;
    cursor: grab;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slider-track.dragging { transition: none; cursor: grabbing; }
.slider-track:active { cursor: grabbing; }

.progress-bar {
    height: 2px;
    background: #d2dae6;
    margin-top: 40px;
    width: 100%;
}

.slide-item {
    min-width: 300px;
    flex-shrink: 0;
    pointer-events: auto;
}

.slide-item img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.slide-info h3 {
    font-size: 14px;
    margin-top: 10px;
    font-weight: bold;
}

.project-link_none {
    text-decoration: none !important;
}

.project-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
    transition: all 0.3s ease;
    color: inherit;
}

.project-link::after {
    content: attr(data-label); 
    opacity: 0;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.project-link:hover::after {
    opacity: 1;
}

.project-link:hover {
    color: #6366f1;
    text-decoration: underline !important;
}


.slider-controls {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.slider-btn {
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: all var(--transition-speed) ease;
}

.slider-btn:hover {
    background: var(--color-black);
    transform: translateY(-2px) scale(0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: var(--color-accent-gradient);
    width: 33%;
    transition: width 0.3s;
}

/* ===========================================================================
   БЭКГРАУНД (TIMELINE)
   =========================================================================== */
.timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 3);
    margin-top: calc(var(--spacing-unit) * 4);
}

.timeline-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 0.25);
    background: var(--color-white);
    padding: calc(var(--spacing-unit) * 4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all var(--transition-speed) ease;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.timeline-achievements {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
    margin-top: calc(var(--spacing-unit) * 2);
}

.timeline-company { color: var(--color-accent); font-weight: 600; margin-bottom: calc(var(--spacing-unit) * 0.5); }
.timeline-date { color: var(--color-gray); font-size: 14px; margin-bottom: calc(var(--spacing-unit) * 2); }

.timeline-achievements .tag {
    background: var(--color-gray);
    color: var(--color-white);
    padding: calc(var(--spacing-unit) * 0.25) calc(var(--spacing-unit) * 1.5);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 400;
}

/* ===========================================================================
   ОБО МНЕ & ОБРАЗОВАНИЕ
   =========================================================================== */
.about-grid { margin-top: calc(var(--spacing-unit) * 2.5); }
.education-heading { padding-top: calc(var(--spacing-unit) * 2); padding-bottom: var(--spacing-unit); }

.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 2);
}

.education-item {
    background: var(--color-white);
    padding: calc(var(--spacing-unit) * 2.5);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--color-primary);
    box-shadow: var(--shadow);
}

.education-title { font-weight: 700; margin-bottom: calc(var(--spacing-unit) * 0.5); color: var(--color-black); }
.education-desc { font-size: 14px; color: var(--color-gray); }

/* ===========================================================================
   КОНТАКТЫ
   =========================================================================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-top: calc(var(--spacing-unit) * 4);
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--spacing-unit) * 4);
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--color-black);
    transition: all var(--transition-speed) ease;
    text-align: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.contact-label { font-size: 14px; color: var(--color-gray); margin-bottom: calc(var(--spacing-unit) * 0.5); text-transform: uppercase; letter-spacing: 1px; }
.contact-value { font-weight: 600; font-size: 16px; color: var(--color-accent); }

/* ===========================================================================
   ФУТЕР (FOOTER)
   =========================================================================== */
.footer {
    background: var(--color-black);
    color: var(--color-white);
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 5);
    text-align: center;
}

.footer p { font-size: 14px; opacity: 0.8; }

/* ===========================================================================
   АНИМАЦИИ (ANIMATIONS)
   =========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translate(-50%, -50%) rotate(0deg); } 50% { transform: translate(-50%, -40%) rotate(2deg); } }

/* ===========================================================================
   МЕДИА-ЗАПРОСЫ (RESPONSIVENESS)
   =========================================================================== */
@media (max-width: 1024px) {
    .why-grid { grid-template-columns: 1fr; }
    .hero-container { flex-direction: column; text-align: center; }
    .hero-content { flex-direction: column; }
    .hero-highlights { justify-content: center; }

    .hero-name, .why-title, .skill-title, .slider-title, .timeline-title, .about-title, .contacts-title {
        font-size: calc(var(--fs-h1) / 1.4);
        letter-spacing: -1px;
    }

    .hero-title, .why-subtitle, .slider-subtitle, .timeline-subtitle, .about-subtitle, .contacts-subtitle {
        font-size: calc(var(--fs-h2) / 1.4);
    }
}

@media (max-width: 768px) {
    .hero-highlights { justify-content: center; }
    .nav-container { padding: 20px; }
    .nav-logo { font-size: 20px; }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--color-bg);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        z-index: 999;
        transform: translateX(100%); 
        transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
        padding: 0;
        overflow-y: auto; /* Чтобы меню можно было скроллить, если оно не влезает */
    }

    .nav-menu.active { transform: translateX(0); }

    .nav-menu a {
        font-size: clamp(40px, 10vw, 60px);
        color: var(--color-black);
        font-weight: 700;
        text-decoration: none;
        text-transform: none;
        line-height: 1.1;
    }

    .nav-menu a::after { height: 4px; bottom: -8px; }
    .nav-toggle { display: flex; z-index: 1001; }
    .nav-toggle span { background: var(--color-black); }

    .section { padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 3); }
    .hero { padding: calc(var(--spacing-unit) * 12) calc(var(--spacing-unit) * 3); }
    .hero-photo { width: 180px; height: 230px; }
    .skills-grid, .contacts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .nav-container { padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2); }
    .hero-highlights { justify-content: center; }

    .hero-name, .why-title, .skill-title, .slider-title, .timeline-title, .about-title, .contacts-title {
        font-size: calc(var(--fs-h1) / 1.4);
        letter-spacing: -1px;
    }

    .hero-title, .why-subtitle, .slider-subtitle, .timeline-subtitle, .about-subtitle, .contacts-subtitle {
        font-size: calc(var(--fs-h2) / 1.4);
    }

    .hero-subtitle { font-size: calc(var(--fs-h2) / 1.6); }
    .hero-photo { width: 150px; height: 190px; }
}

/* ===========================================================================
   ОТКЛЮЧЕНИЕ КАСТОМНОГО КУРСОРА НА МОБИЛЬНЫХ
   =========================================================================== */
   @media (hover: none) and (pointer: coarse) {
    /* Возвращаем стандартный курсор, если он вдруг понадобится */
    body, body.js-active {
        cursor: auto !important;
    }

    /* Полностью скрываем кастомный курсор */
    .custom-cursor {
        display: none !important;
    }
}