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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f8fafc;
    --accent-color: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --background: #ffffff;
    --background-secondary: #f1f5f9;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar:hover {
    background: rgba(26, 38, 64, 0.84);
}

.nav-left, .nav-right {
    display: flex;
    gap: 2rem;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-btn:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-btn:hover::before {
    left: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #bbb;
    transition: background 0.3s;
}

.dot.active {
    background: #007bff;
}

/* Sections */
.section {
    margin-bottom: 8rem;
    position: relative;
}

.section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* About Section */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 60vh;
}

.description-container {
    position: relative;
}

.description-container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background: var(--gradient-accent);
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
}

.description-container h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: left;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.description-container h1::after {
    display: none;
}

.description-container p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.8;
    font-family: 'Martel Sans', sans-serif;
}

.image-container {
    display: flex;
    justify-content: center;
    position: relative;
}

.image-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: var(--gradient-secondary);
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.image-container img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid white;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.05);
}

/* Portfolio Section */
.project-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-item {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
}

.project-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.project-item:hover::before {
    transform: scaleX(1);
}

.project-image {
    height: 300px;
    overflow: hidden;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-image::after {
    opacity: 1;
}

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

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

.project-details {
    padding: 1.5rem;
    height: 260px;
}

.project-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-details p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* skills Section */
.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skills-list a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.skills-item {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 21.4em;
}

.skills-item:hover::before {
    opacity: 0.1;
}

.skills-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.skills-img {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skills-img img {
    filter: invert(1);
    width: 60px;
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.skills-img canvas {
    position: absolute;
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
}

.skills-item:hover .skills-img img {
    transform: scale(1.2) rotate(3deg);
}

.skills-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.skills-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Contact Section */
.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--background-secondary);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-info p {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.contact-info a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.contact-info a:hover::after {
    width: 100%;
}

.message-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-form input,
.message-form textarea {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.message-form input:focus,
.message-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.message-form textarea {
    resize: vertical;
    min-height: 120px;
}

.message-form button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.message-form button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.message-form button:hover::before {
    left: 100%;
}

.message-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Messages */
.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.hidden {
    opacity: 0;
    transform: translateY(-20px);
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 1280px !important;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-left, .nav-right {
        gap: 1rem;
    }
    
    .container {
        padding: 8rem 1rem 2rem;
    }

    .about-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 30px 20px;
    }
    
    /* Меняем порядок элементов с помощью order */
    .image-container {
        order: -1;
    }
    
    .description-container h1 {
        font-size: 2rem;
        text-align: center;
    }
    
    .section h1 {
        font-size: 2rem;
    }
    
    .contact {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
    
    .project-list {
        grid-template-columns: 1fr;
    }
    
    .skills-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .image-container img {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .about-section {
        gap: 1.5rem;
        text-align: center;
        padding: 20px 15px;
    }
    
    .description-container h1 {
        font-size: 2.5rem;
    }
    
    .section h1 {
        font-size: 1.75rem;
    }
    
    .image-container img {
        width: 200px;
        height: 200px;
    }
    
    .nav-btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --background-secondary: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border-color: #334155;
    }
    
    .navbar {
        background: rgba(15, 23, 42, 0.95);
        border-bottom-color: var(--border-color);
    }
    
    .project-item,
    .skills-item {
        background: var(--background-secondary);
    }
    
    .message-form input,
    .message-form textarea {
        background: var(--background-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
}