:root {
    --main-color: #2c3e50;
    --accent-color: #e67e22;
    --bg-light: #f4f7f6;
    --transition-speed: 0.3s;
}

/* Згруповані базові стилі */
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Segoe UI', sans-serif;
    padding-top: 80px;
    background-color: var(--bg-light);
}

header {
    background: var(--main-color);
    color: white;
    padding: 0 5%;
    position: fixed;
    top: 0;
    width: 90%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform var(--transition-speed);
}
.logo:hover { transform: scale(1.1); }

/* Оптимізована анімація: додано will-change для зменшення навантаження на браузер */
.fade-in-title {
    will-change: opacity;
    animation: fadeIn 2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

nav ul { list-style: none; display: flex; gap: 25px; }
nav a { color: white; text-decoration: none; font-weight: 500; transition: color var(--transition-speed); }
nav a:hover { color: var(--accent-color); }

/* Випадаюче меню */
.dropdown { position: relative; }
.dropdown-content {
    display: none;
    position: absolute;
    background: #34495e;
    min-width: 160px;
    top: 100%;
    border-radius: 4px;
    transform: translateY(10px);
    transition: transform 0.3s, opacity 0.3s;
    will-change: transform, opacity;
}

.dropdown:hover .dropdown-content {
    display: block;
    transform: translateY(0);
}
.dropdown-content a { display: block; padding: 10px; border-bottom: 1px solid #2c3e50; }

/* Основний контент */
main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 5%;
}

.news-layout { display: flex; flex-direction: column; gap: 30px; }

section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Оптимізована анімація появи секцій */
.slide-in {
    will-change: transform, opacity;
    animation: slideIn 1s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Зображення та картки */
.card img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.5s ease;
    will-change: transform;
}
.card:hover img { transform: scale(1.05) rotate(2deg); }

.office-img-wrapper { overflow: hidden; border-radius: 10px; height: 200px; }
.office-img { width: 100%; height: 100%; object-fit: cover; }

/* Прогрес-бари */
.progress-container { background: #eee; height: 12px; border-radius: 6px; margin: 10px 0; }
.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0;
    transition: width 2s ease-in-out;
}
.active .progress-fill { width: 90%; }

/* Форми та кнопки (перенесено з inline) */
.contact-input { padding: 10px; margin-bottom: 10px; width: 100%; box-sizing: border-box; }
.btn-animate {
    background: var(--accent-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
    will-change: transform, box-shadow;
    animation: pulse 2s infinite;
}
.btn-animate:hover { transform: scale(1.05); }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(230, 126, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0); }
}

/* Посилання новин */
.news-link { color: var(--main-color); text-decoration: none; transition: color var(--transition-speed); }
.news-link:hover { color: var(--accent-color); }

/* Футер */
footer {
    background: var(--main-color);
    color: white;
    text-align: center;
    padding: 40px 0;
    margin-top: 50px;
}
.footer-link { color: white; text-decoration: none; }

@media (max-width: 768px) {
    header { flex-direction: column; height: auto; padding: 10px; position: static; }
    body { padding-top: 0; }
    nav ul { flex-direction: column; gap: 10px; padding: 10px 0; align-items: center; }
    main { grid-template-columns: 1fr; }
}