/* === Основные стили и переменные === */
:root {
    --bg-primary: #fff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #555;
    --accent: #007bff;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #bbbbbb;
    --accent: #0096ff;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* === Навигация и переключатель темы === */
header {
    position: fixed;
    width: 100%;
    background: var(--bg-secondary);
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

nav ul {
    display: flex;
    list-style: none;
    padding: 1rem 0;
}

nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
    gap: 4px;
}

nav a i {
    font-size: 1.2em;
}

@media (max-width: 768px) {
    nav a {
        flex-direction: row;
        gap: 8px;
        margin: 8px 0;
    }
}

nav a:hover {
    color: var(--accent);
}

.theme-toggle {
    font-size: 1.2rem;
}

.theme-toggle input {
    margin-right: 8px;
    transform: scale(1.2);
}

/* === Секции === */
.section {
    padding: 100px 20px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease;
}

#home {
    background: var(--bg-secondary);
}

/* === Услуги === */
#services .services-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.service-card {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow);
    width: 250px;
    border: 1px solid var(--shadow);
    color: var(--text-primary);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow);
}

/* === Контакты === */
#contact form {
    max-width: 500px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
}

#contact input,
#contact textarea {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--text-secondary);
    border-radius: 5px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border 0.3s;
}

#contact input:focus,
#contact textarea:focus {
    border-color: var(--accent);
    outline: none;
}

#contact button {
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

#contact button:hover {
    background: #0056b3;
}

/* === Адаптивность (мобильные устройства) === */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav a {
        margin: 5px 0;
    }

    .theme-toggle {
        margin-top: 8px;
    }

    header {
        flex-direction: column;
        padding: 10px;
        text-align: center;
    }

    .section {
        padding: 80px 16px;
    }

    .service-card {
        width: 100%;
        max-width: 300px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}