/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%; /* Предотвращает растягивание элементов */
    -webkit-tap-highlight-color: transparent; /* Убирает синий highlight при тапе на мобильных */
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Предотвращает авто-масштабирование текста в iOS */
    -webkit-font-smoothing: antialiased; /* Улучшает рендеринг шрифтов */
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: background 0.5s ease;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    text-rendering: optimizeLegibility; /* Улучшает читаемость текста */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

body.bg-gradient1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body.bg-gradient2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body.bg-pattern1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
}

body.bg-pattern2 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 40px 40px;
}

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

/* Кнопка настроек */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-width: 48px; /* Минимальный размер для touch */
    min-height: 48px;
    will-change: transform; /* Оптимизация анимаций */
}

.settings-btn:hover {
    transform: rotate(30deg);
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.settings-btn i {
    font-size: 24px;
    color: #667eea;
}

/* Панель настроек */
.settings-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); /* Более мягкая тень для мобильных */
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease;
    max-width: 90vw; /* Ограничение ширины на мобильных */
    will-change: transform, opacity; /* Оптимизация анимаций */
}

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

.settings-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem; /* Увеличенный размер для мобильных */
}

.background-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bg-option {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-width: 48px; /* Минимальный размер для touch */
    min-height: 48px;
    will-change: transform; /* Оптимизация анимаций */
}

.bg-option:hover {
    transform: scale(1.1);
}

.bg-option[data-bg="default"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-option[data-bg="gradient1"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-option[data-bg="gradient2"] {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-option[data-bg="pattern1"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
}

.bg-option[data-bg="pattern2"] {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 40px 40px;
}

.bg-option.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.close-settings {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px; /* Увеличенные отступы для мобильных */
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    touch-action: manipulation;
    min-height: 44px;
    font-size: 1rem; /* Увеличенный размер шрифта */
    will-change: transform; /* Оптимизация анимаций */
}

.close-settings:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Праздничные баннеры в честь 200-го пользователя */
.celebration-banner {
    position: relative;
    z-index: 100;
    animation: fadeInDown 0.5s ease-out;
}

.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcf7f, #4d96ff);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.section-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 20px 0 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.celebration-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.celebration-icon {
    font-size: 2rem;
    animation: bounce 1s infinite alternate;
}

.celebration-text {
    flex: 1;
    text-align: center;
}

.celebration-text h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.celebration-text p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
}

.celebration-confetti {
    display: flex;
    gap: 10px;
    font-size: 1.2rem;
}

.celebration-confetti i {
    animation: float 3s ease-in-out infinite;
}

.celebration-confetti i:nth-child(1) { animation-delay: 0s; }
.celebration-confetti i:nth-child(2) { animation-delay: 0.5s; }
.celebration-confetti i:nth-child(3) { animation-delay: 1s; }

.celebration-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.celebration-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.section-banner .celebration-content {
    justify-content: center;
    gap: 10px;
}

.section-banner .celebration-content i {
    font-size: 1.5rem;
    animation: spin 2s linear infinite;
}

.section-banner .celebration-content span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Анимации для праздничных баннеров */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

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

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

/* Адаптивность для праздничных баннеров */
@media (max-width: 768px) {
    .top-banner {
        padding: 12px 15px;
    }
    
    .celebration-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .celebration-text h3 {
        font-size: 1.1rem;
    }
    
    .celebration-text p {
        font-size: 0.85rem;
    }
    
    .celebration-icon {
        font-size: 1.5rem;
    }
    
    .celebration-confetti {
        display: none;
    }
    
    .section-banner {
        padding: 10px 15px;
        margin: 15px 0 25px;
    }
    
    .section-banner .celebration-content span {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .top-banner {
        padding: 10px 12px;
    }
    
    .celebration-text h3 {
        font-size: 1rem;
    }
    
    .section-banner .celebration-content {
        flex-direction: column;
        gap: 8px;
    }
    
    .celebration-close {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
    }
}

/* Для пользователей, предпочитающих уменьшенное движение */
@media (prefers-reduced-motion: reduce) {
    .celebration-banner,
    .celebration-icon,
    .celebration-confetti i,
    .section-banner .celebration-content i {
        animation: none;
    }
    
    .top-banner {
        animation: none;
    }
}


/* Главный экран */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    position: relative;
    color: white;
    will-change: transform, opacity; /* Оптимизация параллакса */
}

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

.company-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    line-height: 1.2;
    will-change: transform, color; /* Оптимизация анимаций */
}

.company-title:hover {
    animation: dance 1s infinite alternate;
}

@keyframes dance {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5px, -5px) rotate(-2deg); }
    50% { transform: translate(5px, 5px) rotate(2deg); }
    75% { transform: translate(-5px, 5px) rotate(-2deg); }
    100% { transform: translate(5px, -5px) rotate(2deg); }
}

.company-title.color-change {
    animation: rainbow 3s infinite;
}

@keyframes rainbow {
    0% { color: #ff0000; }
    14% { color: #ff7f00; }
    28% { color: #ffff00; }
    42% { color: #00ff00; }
    57% { color: #0000ff; }
    71% { color: #4b0082; }
    85% { color: #9400d3; }
    100% { color: #ff0000; }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.4;
}

.navigation-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    width: 100%;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    touch-action: manipulation;
    min-height: 50px;
    min-width: 140px; /* Минимальная ширина для touch */
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex: 0 1 auto;
    will-change: transform; /* Оптимизация анимаций */
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Активные состояния для touch */
.nav-btn:active,
.project-card:active,
.bg-option:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    animation: bounce 2s infinite;
    will-change: transform; /* Оптимизация анимаций */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.scroll-indicator i {
    font-size: 2rem;
    color: white;
    opacity: 0.7;
}

/* Секции */
.section {
    padding: 100px 0;
    background: white;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    width: 100%;
    will-change: transform, opacity; /* Оптимизация анимаций */
}

.section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.section:nth-child(even) {
    background: #f8f9fa;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.2;
}

.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 50px;
    line-height: 1.4;
}

/* О компании */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.about-text p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #555;
}

.company-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.fact {
    text-align: center;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    width: 100%;
    will-change: transform, opacity; /* Оптимизация анимаций */
}

.section.animate-in .fact {
    opacity: 1;
    transform: translateY(0);
}

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

.fact i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 15px;
}

.fact h3 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.2;
    font-size: 1.3rem; /* Увеличенный размер для мобильных */
}

.fact p {
    color: #666;
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* Проекты */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.project-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    touch-action: manipulation;
    width: 100%;
    min-height: 48px; /* Минимальная высота для touch */
    will-change: transform, opacity; /* Оптимизация анимаций */
}

.section.animate-in .project-card {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.project-image i {
    font-size: 4rem;
    color: white;
    opacity: 0.9;
}

.project-info {
    padding: 30px;
}

.project-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
    line-height: 1.3;
}

.project-info p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tag {
    background: #f0f2ff;
    color: #667eea;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.project-link {
    color: #667eea;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-link i {
    font-size: 0.9rem;
}

/* Команда - Оптимизация изображений */
.team-member {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    touch-action: manipulation;
    width: 100%;
    will-change: transform, opacity; /* Оптимизация анимаций */
}

.section.animate-in .team-member {
    opacity: 1;
    transform: translateY(0);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 30px;
    overflow: hidden;
    border: 4px solid #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    background: #f8f9fa; /* Фон на время загрузки */
}

.member-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.member-photo:hover .member-photo-img {
    transform: scale(1.05);
}

/* Запасной стиль если изображение не загрузится */
.member-photo::before {
    content: "ТК";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    opacity: 0.7;
    display: none;
}

.member-photo.img-error::before {
    display: block;
}

.member-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.2;
}

.member-role {
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.4;
}

.member-details {
    text-align: left;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.member-details p {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

.member-details strong {
    color: #333;
}

.member-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #666;
}

/* О создателях */
.creators-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.creators-content p {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 25px;
    color: #555;
}

.contact-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin: 40px 0;
    width: 100%;
}

.contact-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.3;
}

.contact-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-item i {
    color: #667eea;
    font-size: 1.2rem;
    width: 30px;
}

.contact-item span {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.4;
    word-break: break-all; /* Перенос длинных контактов */
}

.closing-text {
    font-style: italic;
    color: #667eea !important;
    font-weight: 500;
    border-left: 4px solid #667eea;
    padding-left: 20px;
    line-height: 1.6;
}

/* Футер */
.footer {
    background: #333;
    color: white;
    padding: 60px 0 30px;
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.footer-logo p {
    opacity: 0.8;
    line-height: 1.4;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-link {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.footer-link:hover {
    opacity: 1;
    color: #667eea;
    transform: translateX(5px);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    opacity: 0.8;
    line-height: 1.4;
    word-break: break-all; /* Перенос длинных контактов */
}

.footer-contact i {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-bottom p {
    margin-bottom: 10px;
}

/* Анимации появления с задержками */
.section.animate-in .project-card:nth-child(1) { transition-delay: 0.1s; }
.section.animate-in .project-card:nth-child(2) { transition-delay: 0.2s; }
.section.animate-in .fact:nth-child(1) { transition-delay: 0.1s; }
.section.animate-in .fact:nth-child(2) { transition-delay: 0.2s; }
.section.animate-in .fact:nth-child(3) { transition-delay: 0.3s; }
.section.animate-in .fact:nth-child(4) { transition-delay: 0.4s; }
.section.animate-in .project-card:nth-child(3) { transition-delay: 0.3s; }
.section.animate-in .project-card:nth-child(4) { transition-delay: 0.4s; }
.section.animate-in .project-card:nth-child(5) { transition-delay: 0.5s; }

/* Адаптивность */
@media (max-width: 768px) {
    .company-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .nav-btn {
        padding: 14px 20px; /* Увеличенные отступы */
        font-size: 1rem;
        min-height: 52px; /* Выше кнопки */
        min-width: 160px; /* Шире на мобильных */
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .company-facts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-member {
        padding: 30px 20px;
    }
    
    .member-info h3 {
        font-size: 1.8rem;
    }
    
    .member-photo {
        width: 120px;
        height: 120px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px; /* Уменьшенный gap для мобильных */
    }
    
    .nav-btn {
        width: 90%; /* Шире кнопки на мобильных */
        max-width: 280px;
    }
    
    .settings-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .settings-panel {
        top: 70px;
        right: 15px;
        left: 15px;
    }
    
    .project-image i {
        font-size: 3.5rem; /* Уменьшенные иконки на мобильных */
    }
    
    .fact i {
        font-size: 2rem; /* Уменьшенные иконки фактов */
    }
    
    /* Улучшение touch targets на мобильных */
    .nav-btn, .project-card, .bg-option {
        min-height: 44px;
        min-width: 44px;
    }
    
    .close-settings {
        padding: 14px 20px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .company-title {
        font-size: 2.8rem;
    }
    
    .company-facts {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 70px 0;
    }
    
    .background-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-card, .nav-btn, .bg-option {
        min-height: 44px;
        min-width: 44px;
    }
    
    .member-photo {
        width: 100px;
        height: 100px;
    }
    
    .project-image {
        height: 180px; /* Уменьшенная высота на маленьких экранах */
    }
    
    .project-info {
        padding: 20px;
    }
    
    .contact-item span {
        font-size: 1rem; /* Уменьшенный текст контактов */
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Медиа-запрос для очень маленьких экранов */
@media (max-width: 360px) {
    .container {
        padding: 0 15px;
    }
    
    .company-title {
        font-size: 2.4rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 140px;
    }
    
    .member-photo {
        width: 90px;
        height: 90px;
    }
    
    .settings-btn {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .settings-panel {
        top: 60px;
        right: 10px;
        left: 10px;
        padding: 15px;
    }
    
    .project-image {
        height: 160px;
    }
    
    .project-image i {
        font-size: 3rem;
    }
    
    .fact h3 {
        font-size: 1.2rem;
    }
    
    .fact p {
        font-size: 0.9rem;
    }
}

/* Улучшение hover эффектов для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .nav-btn:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.2);
    }
    
    .project-card:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }
    
    .fact:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
    
    .member-photo:hover .member-photo-img {
        transform: none;
    }
    
    .settings-btn:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.9);
    }
    
    .bg-option:hover {
        transform: none;
    }
    
    .close-settings:hover {
        transform: none;
        background: #667eea;
    }
    
    .footer-link:hover {
        transform: none;
        color: white;
    }
    
    /* Улучшенная обратная связь для touch */
    .nav-btn:active,
    .project-card:active,
    .bg-option:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Стили для touch устройств */
body.touch-device .nav-btn,
body.touch-device .project-card,
body.touch-device .bg-option {
    min-height: 48px;
    min-width: 48px;
}

body.touch-device .company-title {
    cursor: default;
}

/* Улучшения для производительности */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .company-title:hover {
        animation: none;
    }
    
    .company-title.color-change {
        animation: none;
    }
}

/* Оптимизация загрузки изображений */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Предотвращение layout shift для изображений */
.aspect-ratio {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
}

.aspect-ratio img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Оптимизация скролла на iOS */
.scroll-container {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Улучшение рендеринга на мобильных устройствах */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Базовый размер шрифта для мобильных */
    }
    
    h1, h2, h3, h4 {
        font-weight: 600; /* Улучшенная читаемость заголовков */
    }
    
    /* Уменьшение сложных эффектов на мобильных */
    .nav-btn {
        backdrop-filter: none; /* Убираем blur на мобильных для производительности */
    }
}

/* Оптимизация для медленных соединений */
@media (prefers-reduced-data: reduce) {
    .project-image i,
    .fact i,
    .contact-item i {
        font-size: 1.5rem; /* Уменьшаем размер иконок */
    }
    
    .company-title {
        text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Упрощаем тени */
    }
    
    body {
        background: #667eea; /* Упрощаем градиент */
    }
    
    .bg-option {
        background: #667eea !important; /* Упрощаем превью фонов */
        background-image: none !important;
    }
}

/* Баннеры о соцсети FUN */
.fun-banner {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 100;
    animation: fadeInDown 0.5s ease-out;
}

.fun-banner:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(90deg, #5a6fd8 0%, #6a4190 100%);
}

.fun-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.fun-banner i {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.fun-banner span {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

.fun-banner .fa-arrow-right {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Баннер вверху страницы */
.fun-banner:first-of-type {
    margin-top: 80px;
    margin-bottom: 30px;
}

/* Баннеры в секциях */
.section-fun-banner {
    margin: 20px 0 30px;
}

/* Анимация пульсации для иконки */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Контейнер для главного проекта */
.main-project-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.main-project-card {
    max-width: 800px;
    width: 100%;
}

.main-project-card .project-image {
    height: 250px;
}

.main-project-card .project-image i {
    font-size: 5rem;
}

.main-project-card .project-info h3 {
    font-size: 2rem;
}

.main-project-card .project-info p {
    font-size: 1.2rem;
}

/* Контейнер для проектов в ряд */
.projects-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Адаптивность для баннеров */
@media (max-width: 768px) {
    .fun-banner-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .fun-banner span {
        font-size: 1rem;
    }
    
    .fun-banner i {
        font-size: 1.3rem;
    }
    
    .main-project-card .project-image {
        height: 200px;
    }
    
    .main-project-card .project-image i {
        font-size: 4rem;
    }
    
    .main-project-card .project-info h3 {
        font-size: 1.7rem;
    }
    
    .projects-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fun-banner {
        padding: 12px 15px;
    }
    
    .fun-banner span {
        font-size: 0.9rem;
    }
    
    .main-project-card .project-image {
        height: 180px;
    }
    
    .main-project-card .project-image i {
        font-size: 3.5rem;
    }
    
    .main-project-card .project-info h3 {
        font-size: 1.5rem;
    }
}

/* Для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .fun-banner:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    }
    
    .fun-banner:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}