:root {
    --primary-color: #0a192f;
    --accent-color: #ffcc00;
    --text-color: #333;
    --light-bg: #f4f4f4;
    --white: #ffffff;
    --container-width: 1200px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.header {
    background: var(--primary-color);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-list {
    display: flex;
    list-style: none;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    margin-left: 25px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--accent-color);
    text-align: center;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(rgba(10, 25, 47, 0.7), rgba(10, 25, 47, 0.7)), 
                url('https://images.unsplash.com/photo-1516937941344-00b4e0337589?auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 80px 20px; /* Отступы сверху для компенсации фиксированной шапки */
}

.hero-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрирование контента внутри hero */
}

/* Адаптивный заголовок: уменьшается на мобильных, не обрезается */
.hero h1 {
    /* 1.3rem — минимальный размер на самых маленьких телефонах */
    /* 7vw — динамический размер в зависимости от ширины экрана */
    /* 3.5rem — максимальный размер на ПК */
    font-size: clamp(1.3rem, 7vw, 3.5rem); 
    margin-bottom: 20px;
    line-height: 1.2;
    word-wrap: break-word; /* Защита от обрезания длинных слов */
    overflow-wrap: break-word;
    max-width: 100%;
}

.hero p {
    /* Уменьшил минимальный размер текста для мобильных */
    font-size: clamp(0.9rem, 4vw, 1.2rem);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
}

/* Дополнительная страховка для мобильных устройств */
@media (max-width: 480px) {
    .hero {
        padding: 80px 10px; /* Уменьшил боковые отступы, чтобы дать больше места тексту */
    }
    
    .hero h1 {
        /* Еще более агрессивное уменьшение для совсем маленьких экранов */
        font-size: 1.4rem; 
    }
}

.btn {
    display: inline-block;
    padding: 12px 35px;
    background: var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: var(--transition);
}

.btn:hover {
    background: var(--white);
    transform: translateY(-3px);
}

/* Секции */
.section {
    padding: 80px 0;
}

/* Центрирование заголовков секций */
.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 40px;
}

.section-text {
    text-align: center; /* Чтобы текст не прижимался влево на Android */
    font-size: clamp(1rem, 3vw, 1.1rem);
    max-width: 800px;
    margin: 0 auto;
}

.bg-light {
    background: var(--light-bg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    transition: var(--transition);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

/* Футер */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 50px 20px;
    text-align: center;
}

.footer p {
    margin: 10px 0;
}

.copyright {
    margin-top: 30px;
    font-size: 0.8rem;
    opacity: 0.6;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

/* --- АДАПТИВНОСТЬ ДЛЯ ANDROID / IPHONE --- */

@media (max-width: 768px) {
    .nav-list {
        gap: 10px;
    }
    
    .nav-link {
        margin-string: 0 10px;
        font-size: 0.8rem;
    }

    .header {
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        margin: 5px;
    }

    /* Убираем прижатие к краям на мобильных */
    .section {
        padding: 50px 15px;
    }

    /* Убеждаемся, что все текстовые блоки центрированы */
    .hero-content, .section-text, .service-card, .footer {
        text-align: center;
    }
}