* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

:root {
    /* Светлая тема (яркая) */
    --primary: #4361EE;
    --secondary: #3A0CA3;
    --accent: #F72585;
    --dark: #1A1A2E;
    --light: #FFFFFF;
    --bg-light: #F8F9FA;
    --text-light: #2D3748;
    --text-muted-light: #718096;
    --glass-light: rgba(255, 255, 255, 0.15);
    --glass-border-light: rgba(255, 255, 255, 0.25);
    --shadow-light: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    /* Темная тема */
    --bg-dark: #0F0F1B;
    --text-dark: #E2E8F0;
    --text-muted-dark: #A0AEC0;
    --glass-dark: rgba(255, 255, 255, 0.05);
    --glass-border-dark: rgba(255, 255, 255, 0.1);
    --shadow-dark: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Применение темы */
.theme-light {
    --bg: var(--bg-light);
    --text: var(--text-light);
    --text-muted: var(--text-muted-light);
    --glass: var(--glass-light);
    --glass-border: var(--glass-border-light);
    --shadow: var(--shadow-light);
}

.theme-dark {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --text-muted: var(--text-muted-dark);
    --glass: var(--glass-dark);
    --glass-border: var(--glass-border-dark);
    --shadow: var(--shadow-dark);
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Скрываем видимые полосы прокрутки и оставляем монолитный скролл */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
section::-webkit-scrollbar,
.container::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* Светлая тема — мягкий светлый фон с легким градиентом */
body.theme-light {
    background: 
        linear-gradient(120deg, #f6f7fb 60%, #e9eaf3 100%);
    color: #232323;
}

/* Темная тема — глубокий фон с мягким градиентом */
body.theme-dark {
    background:
        radial-gradient(circle at 70% 30%, #23272f 60%, #353a45 100%);
    color: #f1f1f1;
}

/* Glassmorphism эффекты */
.glass {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.glass-dark {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
}

body.theme-light .glass,
header.glass-dark,
footer.glass-dark {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

body.theme-dark .glass,
body.theme-dark header.glass-dark,
body.theme-dark footer.glass-dark {
    background: rgba(40, 44, 52, 0.85);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

.animate-fadeIn {
    animation: fadeIn 1s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Flexbox & Grid */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    flex-direction: column;
}

.grid {
    display: grid;
}

.grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Общие стили */
section {
    padding: 6rem 2rem 5rem 2rem; /* Увеличил верхний отступ для header */
    scroll-margin-top: 80px; /* Добавил отступ для навигации */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    overflow-x: hidden;
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
}

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--glass-border);
}

.btn-outline:hover {
    background: var(--glass);
    transform: translateY(-3px);
}

/* Улучшение видимости полоски под пунктами меню */
body.theme-light .nav-links a::after {
    background: var(--primary);
    opacity: 0.7;
}

/* Улучшение видимости outline-кнопки на светлой теме */
body.theme-light .btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
}

body.theme-light .btn-outline:hover {
    background: rgba(67, 97, 238, 0.08);
    color: var(--primary);
    border-color: var(--secondary);
}

/* Header - ИСПРАВЛЕННАЯ ВЕРСИЯ */
header {
    padding: 1rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    height: 70px; /* Фиксированная высота header */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    flex-shrink: 0;
}

.logo.handwrite {
    font-family: 'Rock Salt', cursive;
    font-size: 1.6rem;
    letter-spacing: 0.04em;
    color: var(--primary, #4361ee);
    text-shadow: 0 2px 8px rgba(67, 97, 238, 0.08);
    font-weight: 400;
    user-select: none;
    transition: color 0.2s;
    max-width: none;
    overflow: visible;
}

header .logo.handwrite,
footer .logo.handwrite {
    margin-bottom: 0.2em;
}

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

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    white-space: nowrap;
}

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

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

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

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.theme-btn, .lang-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
    flex-shrink: 0;
}

.theme-btn:hover, .lang-btn:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0 2rem;
    margin-top: 70px; /* Отступ для фиксированного header */
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%; /* Уменьшил размер эффекта */
    right: -15%; /* Уменьшил размер эффекта */
    width: 300px; /* Уменьшил размер для мобильных */
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.15) 0%, rgba(67, 97, 238, 0) 70%);
    z-index: -1;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
    width: 100%;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    word-wrap: break-word;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
    color: var(--text-muted);
}

.hero-btns {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-image {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 350px; /* Уменьшил размер для мобильных */
    height: 350px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    opacity: 0.7;
    animation: float 5s ease-in-out infinite;
}

/* Services Section */
.services {
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 250px; /* Уменьшил размер эффекта */
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247, 37, 133, 0.15) 0%, rgba(247, 37, 133, 0) 70%);
    z-index: -1;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.1rem;
    margin-bottom: 3rem;
    text-align: center;
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
    line-height: 1.6;
}

.service-card {
    padding: 2.5rem 2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.service-desc {
    opacity: 0.8;
    line-height: 1.6;
    color: var(--text-muted);
    flex-grow: 1;
}

/* Portfolio Section */
.portfolio {
    position: relative;
}

.portfolio::after {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 250px; /* Уменьшил размер эффекта */
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.15) 0%, rgba(67, 97, 238, 0) 70%);
    z-index: -1;
}

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

.portfolio-item {
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    height: 300px;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* УЛУЧШЕННЫЙ КОНТРАСТ ДЛЯ OVERLAY */
.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.85) 0%, 
        rgba(0, 0, 0, 0.7) 50%, 
        rgba(0, 0, 0, 0.4) 100%);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    color: white;
    backdrop-filter: blur(5px);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

.portfolio-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.portfolio-iframe-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 16px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* Кнопка "Открыть сайт" в портфолио */
.portfolio-item .btn-open-site {
    display: inline-block;
    padding: 0.7em 1.6em;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    background: linear-gradient(90deg, #4361ee 0%, #4cc9f0 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.10);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    text-decoration: none;
    margin-top: 1em;
    cursor: pointer;
    text-align: center;
}

.portfolio-item .btn-open-site:hover,
.portfolio-item .btn-open-site:focus {
    background: linear-gradient(90deg, #4cc9f0 0%, #4361ee 100%);
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.18);
    transform: translateY(-2px) scale(1.03);
    color: #fff;
}

/* Для темной темы — чуть более светлый градиент */
body.theme-dark .portfolio-item .btn-open-site {
    background: linear-gradient(90deg, #4cc9f0 0%, #4361ee 100%);
    color: #232323;
}

body.theme-dark .portfolio-item .btn-open-site:hover,
body.theme-dark .portfolio-item .btn-open-site:focus {
    background: linear-gradient(90deg, #4361ee 0%, #4cc9f0 100%);
    color: #232323;
}

/* Skills Section - ИСПРАВЛЕННЫЕ СТИЛИ */
.skills-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.skill-item {
    margin-bottom: 2rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-header span:first-child {
    font-weight: 600;
    color: var(--text);
}

.skill-header span:last-child {
    font-weight: 500;
    color: var(--primary);
}

.skill-bar {
    height: 12px;
    background: var(--glass);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 1.5s ease, opacity 0.5s ease;
    width: 0% !important;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

/* Добавляем легкий блеск для прогресс-баров */
.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Убедимся, что секция skills имеет правильные стили */
.skills {
    position: relative;
    overflow: hidden;
}

.skills::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 12, 163, 0.1) 0%, rgba(58, 12, 163, 0) 70%);
    z-index: -1;
}

/* Contact Section */
.contact {
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    bottom: -10%;
    left: 20%;
    width: 250px; /* Уменьшил размер эффекта */
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(247, 37, 133, 0.15) 0%, rgba(247, 37, 133, 0) 70%);
    z-index: -1;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: start;
    justify-items: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.contact-form .btn,
.contact-form .form-message {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

/* УЛУЧШЕННЫЕ ПОЛЯ ВВОДА - БОЛЬШЕ КОНТРАСТА */
.form-control {
    padding: 15px 20px;
    border-radius: 10px;
    background: var(--glass);
    border: 2px solid var(--glass-border);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    -webkit-appearance: none;
}

/* УСИЛЕННЫЙ КОНТРАСТ ДЛЯ СВЕТЛОЙ ТЕМЫ */
body.theme-light .form-control {
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #cbd5e0;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.08);
    color: #2d3748;
}

body.theme-light .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    background: white;
}

/* УСИЛЕННЫЙ КОНТРАСТ ДЛЯ ТЕМНОЙ ТЕМЫ */
body.theme-dark .form-control {
    background: rgba(30, 34, 43, 0.95);
    border: 2px solid #4a5568;
    color: #f7fafc;
}

body.theme-dark .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
    background: rgba(26, 32, 44, 0.95);
}

.form-control:focus {
    outline: none;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary);
    flex-shrink: 0;
}

/* Form Message */
.form-message {
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    margin-top: 1rem;
    display: none;
    width: 100%;
}

.form-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

/* Footer */
footer {
    padding: 3rem 2rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.social-link:hover {
    background: var(--primary);
    transform: translateY(-5px);
    color: white;
}

/* ==================== */
/* РАСШИРЕННАЯ АДАПТИВНОСТЬ */
/* ==================== */

/* Большие мониторы (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .hero h1 {
        font-size: 4rem;
    }

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

    section {
        padding: 7rem 2rem 6rem 2rem;
    }
}

/* Ноутбуки (1200px - 1439px) */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 3.2rem;
    }

    .hero-image {
        width: 300px;
        height: 300px;
        right: 5%;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Планшеты горизонтально (992px - 1199px) */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .hero-image {
        width: 250px;
        height: 250px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

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

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Планшеты вертикально и Телефоны (768px и ниже) */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
        padding-bottom: 3rem;
    }

    .hero-image {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin: 2rem auto;
        width: 200px;
        height: 200px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

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

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

    .section-subtitle {
        font-size: 1rem;
    }

    .service-card {
        padding: 1.5rem;
    }

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

    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .header-controls {
        gap: 8px;
    }

    .theme-btn, .lang-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Уменьшаем эффекты на мобильных */
    .hero::before,
    .services::before,
    .portfolio::after,
    .contact::before,
    .skills::before {
        display: none;
    }
}

/* Средние телефоны (576px - 767px) */
@media (max-width: 576px) {
    .hero {
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 250px;
    }

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

    .service-card {
        padding: 1rem;
    }

    .header-controls {
        gap: 6px;
    }

    .theme-btn, .lang-btn {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }

    .logo.handwrite {
        font-size: 1.4rem;
    }

    section {
        padding: 5rem 1rem 4rem 1rem;
    }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    section {
        padding: 4rem 1rem 3rem 1rem;
    }

    .hero {
        padding: 80px 1rem 2rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

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

    .section-subtitle {
        font-size: 0.9rem;
    }

    .header-controls {
        gap: 5px;
    }

    .theme-btn, .lang-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .logo.handwrite {
        font-size: 1.3rem;
    }
}

/* Очень маленькие телефоны (до 360px) */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.4rem;
    }

    .header-controls {
        gap: 4px;
    }

    .theme-btn, .lang-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .logo.handwrite {
        font-size: 1.2rem;
    }
}

/* Ландшафтная ориентация телефонов */
@media (max-width: 800px) and (max-height: 500px) and (orientation: landscape) {
    header {
        padding: 0.5rem 1rem;
    }

    .hero {
        padding-top: 70px;
        min-height: auto;
    }

    .header-controls {
        gap: 10px;
    }

    .theme-btn, .lang-btn {
        width: 36px;
        height: 36px;
    }
}

/* Поддержка касаний */
@media (hover: none) and (pointer: coarse) {
    .service-card:hover {
        transform: none;
    }

    .portfolio-item:hover {
        transform: none;
    }

    .portfolio-item:hover img {
        transform: none;
    }

    .portfolio-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, 
            rgba(0, 0, 0, 0.9) 0%, 
            rgba(0, 0, 0, 0.7) 50%, 
            rgba(0, 0, 0, 0.5) 100%);
    }

    .btn:hover, .social-link:hover {
        transform: none;
    }
}

/* Поддержка reduced-motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Языковые версии */
.lang-ru {
    display: block;
}
.lang-en,
.lang-it {
    display: none;
}

body:lang(en) .lang-en {
    display: block;
}
body:lang(en) .lang-ru,
body:lang(en) .lang-it {
    display: none;
}

body:lang(it) .lang-it {
    display: block;
}
body:lang(it) .lang-ru,
body:lang(it) .lang-en {
    display: none;
}

body:lang(ru) .lang-ru {
    display: block;
}
body:lang(ru) .lang-en,
body:lang(ru) .lang-it {
    display: none;
}

/* Импорт современного шрифта Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rock+Salt&display=swap');

/* Сглаживание шрифтов для мягкости */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Заголовки — чуть мягче и легче */
h1, h2, h3, h4, h5, h6, .section-title {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

/* Текстовые элементы — мягкий цвет и высота строки */
body, p, .section-subtitle, .form-control, .btn, .portfolio-overlay, .service-desc {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text);
}

/* Кнопки — чуть крупнее и мягче */
.btn, .btn-primary, .btn-open-site {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-size: 1.08rem;
}

/* ИСПРАВЛЕНИЕ ДЛЯ ПРОГРЕСС-БАРОВ */
.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 1.5s ease, opacity 0.5s ease;
    width: 0% !important; /* Важно: начальная ширина 0 */
    opacity: 0; /* Начальная прозрачность */
    position: relative;
    overflow: hidden;
}

/* Анимация появления при загрузке */
.skills-section-visible .skill-progress {
    opacity: 1;
}

/* Убедитесь, что секция skills имеет правильные стили */
.skills {
    position: relative;
    overflow: hidden;
}

.skills::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(58, 12, 163, 0.1) 0%, rgba(58, 12, 163, 0) 70%);
    z-index: -1;
}

/* ПРОСТОЕ ИСПРАВЛЕНИЕ ПРОГРЕСС-БАРОВ */
.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #4361EE, #F72585) !important;
    border-radius: 10px;
    width: 0%;
    opacity: 0;
    transition: all 1.5s ease 0.3s;
}

/* Принудительное отображение для тестирования - УДАЛИТЬ ПОСЛЕ ПРОВЕРКИ */
.skills .skill-progress {
    opacity: 1 !important;
}

.skills .skill-progress[data-width="95%"] { width: 95% !important; }
.skills .skill-progress[data-width="90%"] { width: 90% !important; }
.skills .skill-progress[data-width="85%"] { width: 85% !important; }
.skills .skill-progress[data-width="80%"] { width: 80% !important; }
