/* Дополнительные улучшения для мобильных устройств */

/* Улучшенные анимации для касаний */
@media (hover: none) and (pointer: coarse) {
    .contact-link {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .contact-link:active {
        transform: scale(0.95) !important;
        transition: transform 0.1s ease !important;
    }
}

/* Улучшенная производительность на мобильных */
.profile-card {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Оптимизация для медленных соединений */
@media (prefers-reduced-motion: reduce) {
    .profile-card,
    .contact-link {
        animation: none !important;
        transition: none !important;
    }
}

/* Улучшенная типографика для мобильных */
@media (max-width: 480px) {
    .profile-name {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
    }
    
    .profile-position {
        font-size: clamp(0.9rem, 4vw, 1rem);
    }
    
    .profile-description {
        font-size: clamp(0.85rem, 3.5vw, 0.95rem);
    }
}

/* Улучшенные состояния загрузки */
.profile-photo {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.profile-photo[src] {
    background: none;
    animation: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Улучшенная доступность */
.contact-link:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 16px;
}

/* Улучшенные тени для мобильных */
@media (max-width: 480px) {
    .profile-card {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .contact-link {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* Улучшенная сетка для разных размеров экранов */
@media (min-width: 481px) and (max-width: 768px) {
    .contacts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 769px) {
    .contacts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* Улучшенные hover эффекты для десктопа */
@media (hover: hover) {
    .contact-link:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    }
    
    .profile-card:hover {
        transform: translateY(-12px);
    }
}

/* Улучшенная поддержка темной темы */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f3f4f6;
        --text-secondary: #d1d5db;
    }
    
    .profile-card {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .contact-link {
        background: rgba(55, 55, 55, 0.8);
        color: #f3f4f6;
    }
    
    .contact-link:hover {
        background: rgba(75, 75, 75, 0.9);
    }
}

/* Улучшенная поддержка высоких DPI экранов */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .profile-photo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Улучшенная поддержка landscape ориентации на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .profile-container {
        max-width: 600px;
    }
    
    .profile-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .profile-photo {
        width: 80px;
        height: 80px;
        margin-bottom: 1rem;
    }
    
    .profile-body {
        padding: 1rem 1rem;
    }
    
    .contacts-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
    }
    
    .contact-link {
        padding: 0.75rem 0.25rem;
    }
    
    .contact-icon {
        font-size: 1.25rem;
    }
    
    .contact-name {
        font-size: 0.7rem;
    }
}

/* Улучшенная поддержка очень маленьких экранов */
@media (max-width: 360px) {
    .profile-header {
        padding: 1.5rem 0.75rem 1rem;
    }
    
    .profile-body {
        padding: 1.25rem 0.75rem;
    }
    
    .contacts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .contact-link {
        padding: 0.75rem 0.25rem;
        border-radius: 10px;
    }
    
    .contact-icon {
        font-size: 1.25rem;
    }
    
    .contact-name {
        font-size: 0.65rem;
    }
}

/* Улучшенная поддержка очень больших экранов */
@media (min-width: 1200px) {
    .profile-container {
        max-width: 500px;
    }
    
    .profile-card {
        border-radius: 32px;
    }
    
    .profile-header {
        padding: 3.5rem 2.5rem 3rem;
    }
    
    .profile-photo {
        width: 160px;
        height: 160px;
    }
    
    .profile-name {
        font-size: 2.25rem;
    }
    
    .contacts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .contact-link {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .contact-icon {
        font-size: 2rem;
    }
    
    .contact-name {
        font-size: 0.9rem;
    }
}
