/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-dark: #0a0a0a;
    --background-light: #fff;
    --text-light: #fff;
    --text-dark: #2d3748;
    --text-muted: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-radius: 10px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--background-dark);
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    -webkit-backdrop-filter: blur(20px); /* Safari support */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.logo-text {
    color: #fff;
}

.logo-accent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback for older browsers */
    color: #667eea;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 2rem;
}

.lang-btn {
    padding: 0.5rem 1.2rem;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px; /* маленькое скругление для современности */
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}



.lang-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 40px 60px, rgba(102, 126, 234, 0.3), transparent),
        radial-gradient(2px 2px at 120px 25px, rgba(118, 75, 162, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(102, 126, 234, 0.2), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, -200px); }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    color: #fff;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    opacity: 0;
    animation: slideInUp 0.8s ease forwards;
}

.title-line:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }
.title-line:nth-child(3) { animation-delay: 0.6s; }

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback for older browsers */
    color: #667eea;
    display: inline-block;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    max-width: 500px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1.2s forwards;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeInRight 1s ease 0.5s forwards;
}

@keyframes fadeInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.code-window {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    width: 450px;
}

.window-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.window-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #28ca42; }

.window-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.window-content {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-line {
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: typeWriter 0.5s ease forwards;
}

.code-line:nth-child(1) { animation-delay: 1.5s; }
.code-line:nth-child(2) { animation-delay: 2s; }
.code-line:nth-child(3) { animation-delay: 2.5s; }
.code-line:nth-child(4) { animation-delay: 3s; }
.code-line:nth-child(5) { animation-delay: 3.5s; }

@keyframes typeWriter {
    from { opacity: 0; }
    to { opacity: 1; }
}

.code-indent { padding-left: 2rem; }
.code-indent-2 { padding-left: 4rem; }
.code-deccorator { color: #d6c20c; }
.code-keyword { color: #ff79c6; }
.code-module { color: #8be9fd; }
.code-class { color: #50fa7b; }
.code-function { color: #f1fa8c; }
.code-variable { color: #bd93f9; }
.code-method { color: #50fa7b; }
.code-string { color: #f1fa8c; }
.code-bracket { color: #ff79c6; }
.code-param { color: #ffb86c; }
.code-dot { color: #ff79c6; }

/* Services Section */
.services {
    padding: 6rem 0;
    background: #fff;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.section-subtitle {
    font-size: 1.25rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.service-card.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transform: scale(1.05);
}

.service-card.featured:hover {
    transform: scale(1.05) translateY(-10px);
}

.service-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #ff6b6b;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    color: #667eea;
}

.service-card.featured .service-icon {
    color: #fff;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.service-card.featured .service-title {
    color: #fff;
}

.service-description {
    color: #718096;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.service-card.featured .service-description {
    color: rgba(255, 255, 255, 0.9);
}

.service-features {
    list-style: none;
    margin-bottom: 2rem;
}

.service-features li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
    color: #4a5568;
}

.service-card.featured .service-features li {
    color: rgba(255, 255, 255, 0.9);
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 700;
}

.service-card.featured .service-features li::before {
    color: #fff;
}

.service-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #667eea;
}

.service-card.featured .service-price {
    color: #fff;
}

/* Portfolio Section */
.portfolio {
    padding: 6rem 0;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.portfolio-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #4a5568;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    transition: all 0.3s ease;
}

.portfolio-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.portfolio-image {
    height: 120px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.portfolio-icon {
    font-size: 3rem;
    filter: grayscale(1) brightness(0) invert(1);
    opacity: 0.8;
}

.portfolio-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    line-height: 1.3;
}

.portfolio-description {
    color: #718096;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.portfolio-technologies {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tech-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: var(--transition);
}

.tech-tag:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}

/* About Section */
.about {
    padding: 6rem 0;
    background: #fff;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-skills {
    margin-top: 2rem;
}

.about-skills h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
    font-size: 1.25rem;
}

.skills-grid {
    display: grid;
    gap: 1rem;
}

.skill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-name {
    font-weight: 600;
    color: #2d3748;
    min-width: 120px;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-left: 1rem;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 2s ease;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url("./avatar.png");
    background-size: cover;       /* или contain, если нужно вписать */
    background-position: center;  /* выравнивание */
    background-repeat: no-repeat; /* отключает повтор */
    width: 320px;
    height: 390px;
    border-radius: 5%;
   
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    position: relative;

}

.avatar-text {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
}

.floating-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: float-around 6s ease-in-out infinite;
}

.floating-icon.python {
    top: -25%;
    left: -25%;
    animation-delay: 0s;
}

.floating-icon.telegram {
    top: -25%;
    right: -25%;
    animation-delay: 1.5s;
}

.floating-icon.web {
    bottom: -25%;
    left: -25%;
    animation-delay: 3s;
}

.floating-icon.automation {
    bottom: -25%;
    right: -25%;
    animation-delay: 4.5s;
}

/* Мобильная адаптация */

@keyframes float-around {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Contact Section */
.contact {
    padding: 6rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.contact .section-title,
.contact .section-subtitle {
    color: #fff;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.contact-icon svg {
    width: 54px;
    height: 54px;
}
.contact-info {
    display: grid;
    grid-template-columns: repeat(2, 0.2fr);  /* две колонки — твои «четкие 4 ячейки» сохраняются визуально */
 
    margin-bottom: 2rem;
  }
.contact-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-details p {
    color: rgba(255, 255, 255, 0.8);
}

/* Form Styles */
.form {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label,
.form-group textarea:valid + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    background: rgba(102, 126, 234, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    color: #fff;
    z-index: 1;
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #2d3748;
    color: #fff;
    padding: 0.5rem;
}

/* Special styling for select form groups */
.form-group-select {
    margin-bottom: 2rem;
}

.form-group-select label {
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    background: rgba(102, 126, 234, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    color: #fff;
    z-index: 2;
    pointer-events: none;
}

.form-group-select select {
    margin-top: 0.5rem;
    padding-top: 1rem;
}

/* Ensure select options are visible */
.form-group-select select option:first-child {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.form-group-select select:invalid {
    color: rgba(255, 255, 255, 0.6);
}

.form-group-select select:valid {
    color: #fff;
}

/* Footer */
.footer {
    background: #0a0a0a;
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-toggle {
        display: flex;
    }

    .language-switcher {
        margin-left: 0;
        margin-right: 1rem;
    }


    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .code-window {
        width: 100%;
        max-width: 350px;
    }
    .floating-icon.python {
        top: 5%;
        left: 5%;
        animation-delay: 0s;
    }

    .floating-icon.telegram {
        top: 5%;
        right: 5%;
        animation-delay: 1.5s;
    }

    .floating-icon.web {
        bottom: 5%;
        left: 5%;
        animation-delay: 3s;
    }

    .floating-icon.automation {
        bottom: 5%;
        right: 5%;
        animation-delay: 4.5s;
    }
    .hero-visual {
        display: flex;
        justify-content: center;
        align-items: center;
        opacity: 0;
        animation: fadeInRight 1s ease 0.5s forwards;
        height: 400px;
    }
    .contact-info {
        display: grid;
        grid-template-columns: repeat(2, 0.3fr);  /* две колонки — твои «четкие 4 ячейки» сохраняются визуально */
        column-gap: 2rem;
        row-gap: 1.25rem;
        margin-bottom: 2rem;
        margin-left: 2rem;
      }
      
      /* Каждая колонка — собственная мини‑сетка с общими треками для иконки и текста */
      .col {
        display: grid;
        grid-template-columns: auto max-content; /* иконка | текст; ширина текста общая по колонке */
        column-gap: .75rem;
        row-gap: 1.25rem;
        justify-content: center;   /* центрируем связку внутри колонки */
      }
      
      /* Поднимаем детей .contact-item в сетку колонки, не ломая разметку ячейки */
      .col .contact-item {
        display: contents;         /* контент .contact-item занимает ячейки .col */
      }
      
      .contact-icon {
        justify-self: end;         /* иконка «прилипает» к тексту */
        align-self: center;
        width: 54px; 
        height: 54px;
      }
      
      .contact-text {
        justify-self: end;         /* ключ: правая кромка текста по колонке общая */
        text-align: left;
        align-self: center;
        white-space: nowrap;       /* без переносов — идеальная кромка */
      }
      .code-window {
        background: rgba(0, 0, 0, 0.8);
        border-radius: 12px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: left;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        width: 350px;
    }
    .window-content {
      
        display: flex;
        flex-direction: column;
        align-items: start;
        font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
        font-size: 0.8rem;
        line-height: 1.2;
        
    }
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 1rem;
    }

    .hero {
        padding-top: 80px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }

    .service-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    .portfolio-filter {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .form {
        padding: 1.5rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .image-placeholder {
        width: 250px;
        height: 250px;
    }

    .avatar {
        width: 250px;
        height: 290px;
    }

    .avatar-text {
        font-size: 2rem;
    }

    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .nav-menu {
        gap: 2rem;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
}

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Improved animations for different elements */
.service-card.fade-in {
    transition-delay: 0.1s;
}

.service-card:nth-child(2).fade-in {
    transition-delay: 0.2s;
}

.service-card:nth-child(3).fade-in {
    transition-delay: 0.3s;
}

.portfolio-item.fade-in {
    transition-delay: calc(var(--delay, 0) * 0.1s);
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: initial !important;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth scrolling for anchor links */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
.nav-link:focus-visible,
.filter-btn:focus-visible,
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .hero-background,
    .hero-particles {
        opacity: 0.3;
    }
    
    .service-card {
        border: 2px solid var(--primary-color);
    }
} 