* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0a0c0f;
    --bg-light: #14181c;
    --text-primary: #ffffff;
    --text-secondary: #a0a8b5;
    --text-muted: #6c7a8a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    --border-color: #2a2f35;
    --card-bg: #14181c;
    --success: #10b981;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Canvas для Three.js */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Прелоадер */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-text {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.preloader-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    animation: preloaderLine 1.5s infinite;
}

@keyframes preloaderLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px 20px;
}

.btn-text i {
    transition: transform 0.3s ease;
}

.btn-text:hover {
    color: var(--accent-primary);
}

.btn-text:hover i {
    transform: translateX(5px);
}

.btn-block {
    width: 100%;
}

/* Шапка */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
    background: rgba(10, 12, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header.scrolled {
    padding: 15px 0;
    background: rgba(10, 12, 15, 0.95);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-dot {
    color: var(--accent-primary);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-light);
    z-index: 99;
    padding: 100px 30px 30px;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border-color);
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-list {
    list-style: none;
    margin-bottom: 40px;
}

.mobile-nav-link {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: color 0.3s;
}

.mobile-nav-link:hover {
    color: var(--accent-primary);
}

.mobile-social {
    display: flex;
    gap: 20px;
}

.mobile-social-link {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: color 0.3s;
}

.mobile-social-link:hover {
    color: var(--accent-primary);
}

/* Главный экран */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    margin-right: 40px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 15px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 50px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-3d {
    flex: 1;
    min-height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.scroll-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
}

/* Секции */
.section-header {
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 20px;
    max-width: 600px;
}

.section-line {
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 3px;
}

/* Обо мне */
.about {
    padding: 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.about-content {
    max-width: 500px;
}

.about-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.about-feature i {
    color: var(--success);
}

.about-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.about-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.2);
}

.about-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-size: 1.3rem;
}

.about-card-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.about-card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Работы */
.works {
    padding: 100px 0;
    background: rgba(0, 0, 0, 0.2);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.work-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.work-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.2);
}

.work-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.work-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-card:hover .work-img {
    transform: scale(1.05);
}

.work-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    left: 15px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.work-tech span {
    background: rgba(10, 12, 15, 0.9);
    backdrop-filter: blur(5px);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.work-card-content {
    padding: 20px;
}

.work-card-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.work-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.work-card-footer {
    display: flex;
    justify-content: flex-end;
}

.work-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.work-link i {
    transition: transform 0.3s;
}

.work-link:hover i {
    transform: translateX(5px);
}

.works-more {
    text-align: center;
}

/* НАВЫКИ / КОМПЕТЕНЦИИ (ЧТО Я УМЕЮ) */
.skills-compact {
    padding: 100px 0;
    background: #0a0c0f;  /* Такой же фон, как у всего сайта */
    position: relative;
    z-index: 1;
}

.skills-compact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 50px;
}

.skill-compact-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px 20px;
    transition: all 0.3s ease;
    text-align: left;
}

.skill-compact-card:hover {
    transform: translateY(-5px);
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.2);
}

.skill-compact-icon {
    width: 45px;
    height: 45px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #6366f1;
    font-size: 1.3rem;
    transition: all 0.3s;
}

.skill-compact-card:hover .skill-compact-icon {
    background: #6366f1;
    color: white;
}

.skill-compact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: white;
}

.skill-compact-card p {
    color: #a0b3c9;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Отзывы */
.testimonials {
    padding: 100px 0;
    background: rgba(0, 0, 0, 0.2);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s;
}

.testimonial-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.testimonial-rating {
    color: #ffb800;
    font-size: 1.2rem;
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.testimonial-text {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.7;
}

.testimonial-author-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.testimonial-author-position {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Контакты */
.contact {
    padding: 100px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 40px;
    padding: 60px;
}

.contact-title {
    font-size: 2.2rem;
    margin: 20px 0 30px;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.contact-info {
    margin-bottom: 30px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.contact-info-item i {
    width: 20px;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.contact-info-item a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info-item a:hover {
    color: var(--accent-primary);
}

.contact-social {
    display: flex;
    gap: 15px;
}

.contact-social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.contact-social-link:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}

/* Футер */
.footer {
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Кнопка наверх */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 90;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Ховер для соцсетей */
.contact-social-link .fa-instagram:hover {
    color: #e4405f;
}

.contact-info-item .fa-instagram {
    color: #e4405f;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-content {
        max-width: 100%;
    }

    .about-cards {
        max-width: 600px;
        margin: 0 auto;
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-container {
        grid-template-columns: 1fr;
        padding: 40px;
    }

    .skills-compact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-actions .btn {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .hero-stat {
        align-items: center;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .skills-compact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .about-cards {
        grid-template-columns: 1fr;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .contact-container {
        padding: 30px 20px;
    }

    .contact-title {
        font-size: 1.8rem;
    }
}
/* Поднимаем контент над канвасом */
.skills-compact {
    position: relative;
    z-index: 2;
    background: #0a0c0f; /* Убедимся, что фон есть */
}

.skills-compact * {
    position: relative;
    z-index: 3;
}