* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: system-ui, -apple-system, Arial, sans-serif; 
    line-height: 1.6; 
    color: #333; 
}

header { 
    background: #2c3e50; 
    color: white; 
    padding: 1rem 0; 
    position: fixed; 
    width: 100%; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav ul { 
    list-style: none; 
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    padding: 0 1rem;
}

nav li { 
    margin: 0 0.5rem; 
}

nav a { 
    color: white; 
    text-decoration: none; 
    padding: 0.75rem 1.25rem; 
    border-radius: 6px; 
    transition: all 0.3s ease; 
    font-weight: 500;
    white-space: nowrap;
}

nav a:hover, 
nav a:focus { 
    background: #34495e; 
    outline: none;
    transform: translateY(-1px);
}

main { 
    margin-top: 90px; 
}

section { 
    padding: 5rem 2rem; 
    max-width: 1200px; 
    margin: 0 auto; 
}

#hero { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
    color: white; 
    text-align: center; 
    padding: 8rem 2rem 6rem; 
}

.photo { 
    width: 220px; 
    height: 220px; 
    border-radius: 50%; 
    background: #e9ecef; 
    margin: 0 auto 2rem; 
    display: block; 
    border: 5px solid rgba(255,255,255,0.9); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    object-fit: cover;
}

#hero h1 { 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    margin-bottom: 1.5rem; 
    font-weight: 700;
}

h2 { 
    color: #2c3e50; 
    margin-bottom: 3rem; 
    font-size: clamp(2rem, 4vw, 3rem); 
    text-align: center; 
    position: relative;
}

h2::after {
    content: ''; 
    display: block; 
    width: 60px; 
    height: 4px; 
    background: linear-gradient(90deg, #667eea, #764ba2); 
    margin: 1rem auto 0;
}

.experience { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2.5rem; 
}

.job { 
    background: white; 
    padding: 2.5rem; 
    border-radius: 12px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.08); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Улучшенные стили для друзей и семьи */
.friends { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 2rem; 
}

.friend { 
    background: #f8f9fa; 
    padding: 1.5rem 2.5rem; 
    border-radius: 12px; 
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    min-width: 260px;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.friend::before { 
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: left 0.4s ease;
    z-index: -1;
}

.friend:hover { 
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(102,126,234,0.4);
    color: white !important;
}

.friend:hover::before {
    left: 0;
}

.friend:hover strong {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.friend:active { 
    transform: translateY(-4px) scale(0.98);
    box-shadow: 0 10px 25px rgba(102,126,234,0.6);
}

.friend:focus-visible { 
    outline: none;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.5), 0 4px 20px rgba(102,126,234,0.3);
}

/* Выравнивание текста по ширине в разделе "Обо мне" */
#about p {
    text-align: justify;
    hyphens: auto;
    text-justify: inter-word;
}

footer { 
    background: #2c3e50; 
    color: #bdc3c7; 
    text-align: center; 
    padding: 3rem 2rem; 
}

@media (max-width: 768px) { 
    nav ul { 
        flex-direction: column; 
        align-items: center; 
        gap: 0.5rem; 
    }
    
    nav li { 
        margin: 0; 
    }
    
    nav a { 
        padding: 0.75rem 1rem; 
        font-size: 1rem; 
    }
    
    main { 
        margin-top: 120px; 
    }
    
    section { 
        padding: 3rem 1.5rem; 
    }
    
    #hero { 
        padding: 6rem 1.5rem 4rem; 
    }
    
    .experience { 
        grid-template-columns: 1fr; 
        gap: 2rem; 
    }
    
    .friends { 
        gap: 1rem; 
        flex-direction: column; 
        align-items: center; 
    }
    
    .friend { 
        padding: 1.5rem 2rem; 
        min-width: auto; 
        width: 100%; 
        max-width: 320px; 
    }
}

@media (max-width: 480px) { 
    .photo { 
        width: 180px; 
        height: 180px; 
    }
    
    section { 
        padding: 2rem 1rem; 
    }
}
