* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --light: #f8fafc;
    --gray: #94a3b8;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --sidebar-width: 280px;
}

body {
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 50px;
    text-decoration: none;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.logo-text {
    color: white;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    display: block;
    font-size: 11px;
    color: var(--gray);
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu li a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.nav-menu li a.active {
    background: var(--gradient);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.nav-menu li a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 13px;
    text-align: center;
}

.socials {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--gray);
    transition: all 0.3s;
}

.socials a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* ===== HEADER (МОБИЛЬНЫЙ) ===== */
.header-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--dark);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 1100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.header-logo .logo-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
}

.header-logo .logo-text {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

/* Бургер */
.burger {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s;
}

.burger:hover {
    background: var(--primary);
}

.burger span {
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.burger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MAIN CONTENT ===== */
.main {
    margin-left: var(--sidebar-width);
    padding: 60px 50px;
    min-height: 100vh;
    transition: margin-left 0.4s;
}

.page-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--gray);
    font-size: 17px;
    margin-bottom: 50px;
    max-width: 600px;
}

/* HERO */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: 56px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 24px;
    color: var(--dark);
}

.hero h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--gray);
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 32px;
}

.btn-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: white;
    color: var(--dark);
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-card {
    background: var(--dark);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.3);
    transform: rotate(-2deg);
    transition: transform 0.4s;
}

.code-card:hover {
    transform: rotate(0deg) scale(1.02);
}

.code-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.code-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-card pre {
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    overflow: hidden;
}

.code-card .kw { color: #c792ea; }
.code-card .fn { color: #82aaff; }
.code-card .str { color: #c3e88d; }
.code-card .cm { color: #546e7a; }

/* STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 80px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-number {
    font-size: 38px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
    font-weight: 500;
}

/* SERVICES */
.section-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.section-subtitle {
    color: var(--gray);
    margin-bottom: 40px;
    font-size: 16px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.service-card {
    background: white;
    padding: 32px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

.service-card p {
    color: var(--gray);
    line-height: 1.7;
    font-size: 15px;
}

.service-price {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.service-price strong {
    color: var(--primary);
    font-size: 18px;
}

/* PORTFOLIO */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.portfolio-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    transition: all 0.4s;
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.15);
}

.portfolio-img {
    height: 220px;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 60px;
    font-weight: 800;
    opacity: 0.9;
}

.portfolio-card:nth-child(2) .portfolio-img {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.portfolio-card:nth-child(3) .portfolio-img {
    background: linear-gradient(135deg, #10b981, #06b6d4);
}

.portfolio-card:nth-child(4) .portfolio-img {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
}

.portfolio-body {
    padding: 26px;
}

.portfolio-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.portfolio-body p {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ABOUT */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: start;
}

.about-photo {
    aspect-ratio: 1;
    background: var(--gradient);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    color: white;
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.3);
    position: relative;
}

.about-photo::after {
    content: '';
    position: absolute;
    inset: -12px;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 32px;
    z-index: -1;
}

.about-text h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.about-text p {
    color: var(--gray);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.skills {
    margin-top: 40px;
}

.skills h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 20px;
    transition: width 1.5s ease;
}

/* CONTACT */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 24px;
    background: white;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s;
}

.contact-item:hover {
    transform: translateX(6px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

.contact-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.contact-item p {
    color: var(--gray);
    font-size: 14px;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s;
    background: var(--light);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 130px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-visual {
        height: 320px;
    }
    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .header-mobile {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        padding: 100px 24px 40px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .hero h1 {
        font-size: 40px;
    }
}

@media (max-width: 600px) {
    .main {
        padding: 90px 16px 40px;
    }
    
    .hero h1 {
        font-size: 32px;
        letter-spacing: -1px;
    }
    
    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .btn {
        padding: 13px 22px;
        font-size: 14px;
    }
    
    .contact-form {
        padding: 24px;
    }
    
    .about-photo {
        font-size: 80px;
    }
}

/* Плавное появление */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
