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

:root {
    --primary-color: #F97316;
    --primary-dark: #EA580C;
    --primary-light: #FB923C;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --bg-light: #F3F4F6;
    --bg-white: #FFFFFF;
    --bg-dark: #1F2937;
    --border-color: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-orange: 0 4px 20px rgba(249, 115, 22, 0.3);
}

html {
    scroll-behavior: smooth;
    cursor: none;
}

body {
    font-family: 'Montserrat', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-white);
    overflow-x: hidden;
    cursor: none;
}

/* Кастомный курсор */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out;
    box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color), 0 0 30px rgba(249, 115, 22, 0.5);
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

.cursor.hover {
    transform: translate(-50%, -50%) scale(2.5);
    background: var(--primary-dark);
    box-shadow: 0 0 15px var(--primary-color), 0 0 30px var(--primary-color), 0 0 45px rgba(249, 115, 22, 0.6);
}

.cursor.click {
    transform: translate(-50%, -50%) scale(0.8);
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--primary-color);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 2px;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.logo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: logoShine 3s infinite;
}

@keyframes logoShine {
    0%, 100% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
}

.logo:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-orange);
}

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

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
}

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

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

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

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: 0.3s;
}

.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(7px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--bg-white) 50%, var(--gray-100) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.05) 0%, transparent 70%);
    animation: pulseBg 8s ease-in-out infinite;
}

@keyframes pulseBg {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: slideInLeft 1s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
    position: relative;
    display: inline-block;
}

.hero-content h1::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 15px;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.3), transparent);
    z-index: -1;
    animation: highlightPulse 3s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Hero Stack */
.hero-stack {
    margin-bottom: 2rem;
}

.stack-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stack-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-white);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.stack-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-orange);
    border-color: var(--primary-color);
}

.stack-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.stack-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-orange);
    border: none;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideInRight 1s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.avatar-container {
    position: relative;
    width: 350px;
    height: 350px;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: var(--shadow-lg), var(--shadow-orange);
    animation: morph 8s ease-in-out infinite;
    border: 5px solid white;
    position: relative;
    z-index: 2;
}

@keyframes morph {
    0%, 100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
    25% {
        border-radius: 58% 42% 75% 25% / 66% 35% 65% 34%;
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
    }
}

.avatar-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(234, 88, 12, 0.1));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    z-index: 1;
    animation: morph 8s ease-in-out infinite reverse;
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--gray-800);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark), var(--primary-color));
    border-radius: 2px;
    background-size: 200% 100%;
    animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* About Section */
.about {
    background: var(--bg-white);
    position: relative;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-content p:first-child {
    font-size: 1.2rem;
    color: var(--gray-700);
}

/* Projects Section */
.projects {
    background: var(--bg-white);
}

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

.project-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--gray-200);
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), var(--shadow-orange);
    border-color: var(--primary-color);
}

.project-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

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

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

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: var(--primary-color);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tag {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(234, 88, 12, 0.1));
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.project-link-btn {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    position: relative;
}

.project-link-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.project-link-btn:hover::after {
    width: 100%;
}

.project-link-btn:hover {
    color: var(--primary-dark);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.apk-btn {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #22C55E;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.apk-btn:hover {
    background: #16A34A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.loading,
.error,
.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.error {
    color: var(--error, #EF4444);
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-700) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    animation: rotateBg 20s linear infinite;
}

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

.contact .section-title {
    color: white;
}

.contact-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--gray-300);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    text-decoration: none;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.3), transparent);
    transition: left 0.5s ease;
}

.contact-link:hover::before {
    left: 100%;
}

.contact-link:hover {
    transform: translateY(-5px);
    background: rgba(249, 115, 22, 0.2);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-orange);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.contact-link:hover .contact-icon {
    transform: scale(1.2);
}

.contact-icon svg {
    transition: all 0.3s ease;
}

.contact-link:hover .contact-icon svg {
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.8));
}

.contact-link span:last-child {
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--gray-900, #111827);
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--gray-700);
}

.footer p {
    color: var(--gray-400);
}

/* Animations on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for skill cards */
.skill-card {
    opacity: 0;
    transform: translateY(50px);
}

.skill-card.visible {
    animation: cardAppear 0.6s ease forwards;
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--gray-200);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

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

    .avatar-container {
        width: 280px;
        height: 280px;
    }

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

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .avatar-container {
        width: 220px;
        height: 220px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .stack-icons {
        justify-content: center;
    }

    .stack-item {
        padding: 0.4rem 0.8rem;
    }

    .stack-item img {
        width: 20px;
        height: 20px;
    }

    .stack-item span {
        font-size: 0.75rem;
    }
}

/* Отключаем кастомный курсор на сенсорных устройствах */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    html, body {
        cursor: auto;
    }
    
    .cursor,
    .cursor-dot {
        display: none;
    }
}

/* Скрываем стандартный курсор на интерактивных элементах */
a, button, .contact-link, .btn, .project-card, .stack-item, input, textarea, .nav-links a {
    cursor: none !important;
}

/* Beta badge */
.project-card-image-wrap {
    position: relative;
}

.beta-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #EF4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

/* Галерея */
.project-image.gallery {
    position: relative;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-prev:hover,
.gallery-next:hover { background: rgba(0,0,0,0.8); }

.gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active { background: white; }
