/* === CSS Variables & Themes === */
:root {
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-alt: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

/* === Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.bg-alt { background-color: var(--bg-alt); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }

/* === Typography === */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
.section-title { font-size: 1.875rem; margin-bottom: 2rem; display: flex; align-items: center; gap: 0.75rem; }
.section-title i { color: var(--primary); }

/* === Header === */
.header {
    position: sticky; top: 0; z-index: 100;
    background-color: rgba(var(--bg-color), 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-color); text-decoration: none; }
.logo span { color: var(--primary); }
.nav { display: flex; gap: 2rem; align-items: center; }
.nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: var(--transition); font-size: 0.95rem; }
.nav a:hover { color: var(--primary); }

.theme-btn {
    background: var(--bg-alt); border: 1px solid var(--border-color);
    color: var(--text-color); width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); transform: rotate(15deg); }

/* === Hero === */
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: center; }
.greeting { color: var(--primary); font-weight: 600; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.hero h1 { font-size: 3.5rem; margin: 0.5rem 0; }
.hero .subtitle { font-size: 1.5rem; color: var(--text-muted); font-weight: 500; margin-bottom: 1.5rem; }
.hero .about-text { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 2rem; max-width: 550px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.image-wrapper {
    position: relative; width: 300px; height: 300px; margin: 0 auto;
    border-radius: 50%; overflow: hidden; border: 4px solid var(--primary);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}
.image-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 1.75rem; border-radius: var(--radius);
    text-decoration: none; font-weight: 600; transition: var(--transition); border: none; cursor: pointer; font-size: 1rem;
}
.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background-color: var(--bg-alt); color: var(--text-color); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }

/* === Timeline === */
.timeline { border-left: 2px solid var(--border-color); margin-left: 1rem; padding-left: 2rem; }
.timeline-item { position: relative; margin-bottom: 3rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -2.6rem; top: 0.25rem;
    width: 1rem; height: 1rem; background-color: var(--primary);
    border-radius: 50%; border: 3px solid var(--bg-color); box-shadow: 0 0 0 3px var(--primary);
}
.timeline-period { font-size: 0.875rem; color: var(--primary); font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.timeline-content h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.timeline-content .company { color: var(--text-muted); font-weight: 500; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.details { list-style: none; }
.details li { position: relative; padding-left: 1.5rem; margin-bottom: 0.75rem; color: var(--text-muted); }
.details li::before { content: '▹'; position: absolute; left: 0; color: var(--primary); font-weight: bold; }
.cert-list li::before { content: none; }
.cert-list li { display: flex; align-items: center; gap: 0.75rem; }
.cert-list li i { color: var(--primary); }

/* === Skills & Education === */
.skills-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.skill-tag {
    background-color: var(--bg-color); border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem; border-radius: 2rem; font-size: 0.9rem; font-weight: 500;
    transition: var(--transition);
}
.skill-tag:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.skill-tag.secondary { background-color: var(--bg-alt); border-style: dashed; }

.edu-item { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); }
.edu-item:last-child { border-bottom: none; }
.edu-period { font-size: 0.875rem; color: var(--primary); font-weight: 600; margin-bottom: 0.25rem; }
.edu-item h4 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.edu-item p { color: var(--text-muted); }

/* === Contact === */
.contact-info { display: flex; flex-direction: column; gap: 1.5rem; }
.info-item { display: flex; align-items: center; gap: 1rem; font-size: 1.1rem; }
.info-item i { color: var(--primary); width: 24px; text-align: center; }
.info-item a { color: var(--text-color); text-decoration: none; transition: var(--transition); }
.info-item a:hover { color: var(--primary); }

.contact-form { display: flex; flex-direction: column; gap: 1rem; background: var(--bg-alt); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--border-color); }
.form-group input, .form-group textarea {
    width: 100%; padding: 0.875rem; border-radius: var(--radius); border: 1px solid var(--border-color);
    background-color: var(--bg-color); color: var(--text-color); font-family: inherit; font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-status { margin-top: 1rem; text-align: center; font-weight: 500; min-height: 1.5rem; }
.form-status.success { color: #10b981; }
.form-status.error { color: #ef4444; }

/* === Footer === */
.footer { text-align: center; padding: 2rem 0; color: var(--text-muted); border-top: 1px solid var(--border-color); font-size: 0.9rem; }

/* === Animations === */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* === Mobile Responsive === */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; height: auto; padding: 1rem 0; gap: 1rem; }
    .nav { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero h1 { font-size: 2.5rem; }
    .hero .about-text { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .image-wrapper { width: 200px; height: 200px; order: -1; margin-bottom: 1.5rem; }
    .grid-2 { grid-template-columns: 1fr; gap: 2rem; }
    .timeline { margin-left: 0.5rem; padding-left: 1.5rem; }
    .timeline-item::before { left: -2.1rem; }
}
/* === Language Switcher === */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
.lang-switch a:hover {
    color: var(--text-color);
    background-color: var(--bg-alt);
}
.lang-switch a.active {
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.1);
}
.lang-switch .divider {
    color: var(--border-color);
    font-weight: 400;
}

@media (max-width: 768px) {
    .lang-switch {
        border-right: none;
        margin-right: 0;
        padding-right: 0;
        order: -1; /* На мобильных переключатель будет первым в строке меню */
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
}
/* === Social Links === */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.social-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}
.social-link:hover {
    background-color: var(--social-color);
    color: #ffffff;
    border-color: var(--social-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}