/* ===== ОБЩИЕ СТИЛИ ===== */
:root {
    --primary: #4a6cf7;
    --primary-dark: #3a5bd9;
    --secondary: #6c757d;
    --success: #28a745;
    --dark: #1e1e2f;
    --light: #f8f9fa;
    --text: #4a4a68;
    --text-light: #6c6c8c;
    --border: #e5e9f2;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: -o-linear-gradient(315deg, #f5f7fa 0%, #e9ecef 100%);
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.btn_primary {
    background: var(--primary);
    color: white;
    -webkit-box-shadow: 0 5px 15px rgba(74, 108, 247, 0.3);
    box-shadow: 0 5px 15px rgba(74, 108, 247, 0.3);
}

.btn_primary:hover {
    background: var(--primary-dark);
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 8px 25px rgba(74, 108, 247, 0.4);
    box-shadow: 0 8px 25px rgba(74, 108, 247, 0.4);
}

.btn_outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn_outline:hover {
    background: var(--primary);
    color: white;
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
}

.btn_large {
    padding: 15px 40px;
    font-size: 18px;
}

/* ===== НАВИГАЦИЯ ===== */
.navbar {
    background: white;
    -webkit-box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar .container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    -webkit-transition: color 0.3s ease;
    -o-transition: color 0.3s ease;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    -webkit-transition: width 0.3s ease;
    -o-transition: width 0.3s ease;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 2px 0;
    -webkit-transition: 0.3s;
    -o-transition: 0.3s;
    transition: 0.3s;
}

/* ===== HERO СЕКЦИЯ ===== */
.hero {
    padding: 150px 0 100px;
    color: white;
    height: 100vh;
    text-align: center;

    /* Добавьте эти свойства для центрирования */
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    /* Вертикальное центрирование */
}

.hero_content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    -webkit-animation: fadeInUp 1s ease;
    animation: fadeInUp 1s ease;
}

.hero .container {
    width: 100%;
    /* Растягиваем контейнер на всю ширину */
    margin: 0 auto;
    /* Центрируем контейнер по горизонтали */
}

.hero_content-box {
    display: flex;
    justify-content: center;
    /* Горизонтальное центрирование содержимого */
    width: 100%;
}

.hero_content {
    text-align: center;
    /* Центрируем текст внутри блока (опционально) */
    /*max-width: 800px;
     Ограничиваем максимальную ширину для читаемости */
    width: 100%;
    /* Адаптивная ширина */
}

.hero_subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
    -webkit-animation: fadeInUp 1s ease 0.2s both;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero_buttons {
    -webkit-animation: fadeInUp 1s ease 0.4s both;
    animation: fadeInUp 1s ease 0.4s both;
}

@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* ===== СЕКЦИИ ===== */
.section {
    padding: 80px 0;
}

.section_title-box {
    text-align: center;
    margin-bottom: 50px;
}

.section_title {
    font-size: 36px;
    color: var(--dark);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section_title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
}

.section_subtitle {
    color: var(--text-light);
    font-size: 18px;
}

/* ===== НАВЫКИ ===== */
.skills_grid {
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill_card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.skill_card:hover {
    -webkit-transform: translateY(-10px);
    -ms-transform: translateY(-10px);
    transform: translateY(-10px);
    -webkit-box-shadow: var(--shadow-hover);
    box-shadow: var(--shadow-hover);
}

.skill_icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}

/* .skill-card h3 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 15px;
} */

.skill_level {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(74, 108, 247, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
}

/* ===== ПОРТФОЛИО ===== */
.projects-grid {
    display: -ms-grid;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.project-card:hover {
    -webkit-transform: translateY(-10px);
    -ms-transform: translateY(-10px);
    transform: translateY(-10px);
    -webkit-box-shadow: var(--shadow-hover);
    box-shadow: var(--shadow-hover);
}

.project-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -webkit-transition: -webkit-transform 0.5s ease;
    transition: -webkit-transform 0.5s ease;
    -o-transition: transform 0.5s ease;
    transition: transform 0.5s ease;
    transition: transform 0.5s ease, -webkit-transform 0.5s ease;
}

.project-card:hover .project-image img {
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: -o-linear-gradient(315deg, rgba(74, 108, 247, 0.9), rgba(118, 75, 162, 0.9));
    background: linear-gradient(135deg, rgba(74, 108, 247, 0.9), rgba(118, 75, 162, 0.9));
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    -o-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 20px;
}

.project-link {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-size: 20px;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.project-link:hover {
    -webkit-transform: scale(1.1);
    -ms-transform: scale(1.1);
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
}

.project-tech {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    padding: 5px 15px;
    background: rgba(74, 108, 247, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
}

/* ===== О СЕБЕ ===== */
.about-section {
    background: white;
    padding: 60px;
    border-radius: 20px;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
}

.about-content {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 50px 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* --- */
.flex-greeting {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    /* Разрешаем перенос элементов */
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 5px;
    /* Отступ между словами/фразами */
}

.about-text h3 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 20px;
}

/* === */
.about-text p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-stats {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 20px 1fr 20px 1fr;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

.about-image img {
    width: 100%;
    border-radius: 15px;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
}

/* ===== ЗАЩИТА КОНТАКТОВ ===== */
.reveal-contact-btn {
    background: rgba(0, 123, 255, 0.1);
    color: var(--text);
    border: 1px dashed var(--primary);
    padding: 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.reveal-contact-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.02);
}

.reveal-contact-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.contact-value-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    word-break: break-all;
}

.contact-value-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== КОНТАКТНАЯ ФОРМА ===== */
.contact_section {
    background: white;
    padding: 60px;
    border-radius: 20px;
    -webkit-box-shadow: var(--shadow);
    box-shadow: var(--shadow);
}

.contact_grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 50px 1fr;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact_info h3 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 20px;
}

.contact_details {
    margin: 30px 0;
}

.contact_item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact_icon {
    width: 50px;
    height: 50px;
    background: rgba(74, 108, 247, 0.1);
    border-radius: 50%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: var(--primary);
    font-size: 20px;
}

.contact_text {
    color: var(--text);
}

.soc-icons {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: left;
    -ms-flex-pack: left;
    justify-content: left;
    gap: 15px;
}

.social-links {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(74, 108, 247, 0.1);
    border-radius: 50%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary);
    color: white;
    -webkit-transform: translateY(-3px);
    -ms-transform: translateY(-3px);
    transform: translateY(-3px);
}

.contact_form .form-group {
    margin-bottom: 20px;
}

.contact_form input,
.contact_form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    font-family: inherit;
}

.contact_form input:focus,
.contact_form textarea:focus {
    outline: none;
    border-color: var(--primary);
    -webkit-box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.contact_form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Сообщения об успехе/ошибке */
/* Добавьте в ваш CSS-файл */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: inherit;
    animation: slideDown 0.3s ease-out;
}

.alert_success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert_error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Иконки для сообщений (если нужно) */
.alert_success::before {
    content: "✓ ";
    font-weight: bold;
}

.alert_error::before {
    content: "✗ ";
    font-weight: bold;
}

/* ===== ФУТЕР ===== */
.footer {
    background: var(--dark);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer_text {
    margin: 5px 0;
    opacity: 0.8;
}

.footer_link {
    color: rgb(243, 207, 47);
    text-decoration: none;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {

    .about-content,
    .contact_grid {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
    }

    .about-image {
        -webkit-box-ordinal-group: 0;
        -ms-flex-order: -1;
        order: -1;
    }

    .contact_item-box {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }

    .contact_item {
        width: 50%;

    }

}

@media (max-width: 768px) {
    .navbar .container {
        height: 50px;
    }

    .nav-menu {
        position: fixed;
        top: 52px;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: white;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        padding: 50px 0;
        -webkit-transition: left 0.3s ease;
        -o-transition: left 0.3s ease;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
    }

    .hero_content h1 {
        font-size: 36px;
    }

    .hero_content .subtitle {
        font-size: 18px;
    }

    .projects-grid {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
    }

    /* перенос части заголовка <h3> Я Александр */
    .grid-greeting {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        /* Одна колонка */
    }

    .contact_text {
        max-width: 178px;
    }

    .footer {
        padding: 10px 0;
    }
}

@media (max-width: 650px) {
    .contact_item-box {
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .contact_item {
        width: 100%;

    }
}

@media (max-width: 480px) {
    .hero {
        padding: 120px 0 80px;
    }

    .hero_content h1 {
        font-size: 28px;
    }

    .hero_buttons .btn {
        display: block;
        margin: 10px 0;
    }

    .section {
        padding: 80px 0;
    }

    .section-title h2 {
        font-size: 28px;
    }

}

@media (max-width: 454px) {

    .contact_section,
    .about-section {
        padding: 30px;
        padding: 30px;
    }
}