body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
    overflow-x: hidden;
}

header {
    background-color: #ffffff;
    color: #0c113c;
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    border-bottom: 1px solid rgba(12,17,60,0.08);
    min-height: 100px;
}

/* Скрытый переключатель для мобильного меню */
header #nav-toggle {
    display: none;
}

/* Кнопка-бургер */
header .burger {
    display: none; /* по умолчанию скрыта, показываем на мобиле */
    width: 36px;
    height: 36px;
    margin-left: auto;
    margin-right: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

header .burger span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #0c113c;
    border-radius: 50%;
    margin: 0 3px;
}

/* Простой вид из трёх точек без анимации */

header img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    margin: 0;
    margin-left: 20px;
}

header h1 {
    margin: 0;
    margin-left: 10px;
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
}

header nav {
    position: static;
    margin: 0;
    margin-left: auto;
    margin-right: 20px;
}



header nav ul {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    white-space: nowrap;
}

header nav ul li a {
    text-decoration: none;
    color: #0c113c;
    font-weight: 500;
    font-size: clamp(14px, 1.6vw, 16px);
}

header nav ul li a:hover {
    color: #0d07c5;
}

section#home {
    position: relative;
    padding: 0;
    margin: 0;
    min-height: 600px;
    background-image: url('homebg.jpeg');
    background-size: cover;
    background-position: top;
    padding-top: 1px;
    margin-top: -1px;
}

section#home div.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    padding: 0 24px; /* небольшой боковой отступ, чтобы текст не касался края */
}

section#home div.overlay h2 {
    color: #ffffff;
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 700;
    margin-top: 150px;
    margin-left: 0; /* используем паддинг контейнера вместо внешнего отступа */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    overflow-wrap: anywhere;
    word-break: break-word;
}

section#home div.overlay p {
    color: #ffffff;
    font-size: clamp(16px, 2vw, 24px);
    margin-top: 20px;
    margin-left: 0; /* используем паддинг контейнера вместо внешнего отступа */
    max-width: 80%;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    overflow-wrap: anywhere;
    word-break: break-word;
}

section#home div.overlay button {
    margin-top: 30px;
    margin-left: 0; /* используем паддинг контейнера вместо внешнего отступа */
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #0c113c;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

section#home div.overlay button:hover {
    background-color: #0d07c5;
    scale: 1.05;
    transition: all .1s ease-in-out;
}

section#cyberpolice {
    padding: 0;
    margin: 0;
    padding-top: 1px;
    margin-top: -1px;
    background-color: #0c113c;
    color: #ffffff;
    min-height: 550px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    align-items: center;
    padding-bottom: 100px;
}

section#cyberpolice div.cyber {
    width: 50%;
    margin: 0 auto;
    text-align: left;
    padding: 0 24px; /* небольшой внутренний отступ по краям на десктопе */
}

section#cyberpolice div.cyber h2 {
    font-size: clamp(24px, 4vw, 48px);
    font-weight: 700;
    margin-top: 50px;
}

section#cyberpolice div.cyber p {
    font-size: clamp(10px, 1vw, 18px);
    line-height: 1.6;
}

section#cyberpolice div.cyber ul {
    font-size: clamp(10px, 1vw, 18px);
}

section#cyberpolice div.cyber ol {
    font-size: clamp(10px, 1vw, 18px);
}

section#chinazes {
    padding: 0;
    margin: 0;
    padding-top: 1px;
    margin-top: -1px;
    background-color: #f5f7fa;
    color: #0c113c;
    min-height: 550px;
    text-align: center;
}

section#chinazes div.content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    padding: 50px 50px;
    flex-wrap: wrap;
    font-size: clamp(10px, 1vw, 18px);
}

section#chinazes div.content h2 {
    width: 100%;
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    margin-bottom: 0;
}


section#chinazes div.One {
    width: 30%;
    margin: 70px auto 50px 150px;
    text-align: left;
    font-size: clamp(10px, 1vw, 18px);
}

/* Адаптивные изображения внутри блоков секции chinazes */
section#chinazes img {
    max-width: 100%;
    height: auto;
    display: block;
}

section#chinazes div.Two {
    width: 30%;
    margin: 0px 150px 50px auto;
    text-align: left;
    font-size: clamp(10px, 1vw, 18px);
}

section#chinazes div.Three {
    width: 30%;
    margin: 0px 0 50px 150px;
    text-align: left;
    font-size: clamp(10px, 1vw, 18px);
}

section#chinazes div.Four {
    width: 30%;
    margin: 0px 150px 50px auto;
    text-align: left;
    font-size: clamp(10px, 1vw, 18px);
}

section#chinazes div.One:hover,
section#chinazes div.Two:hover,
section#chinazes div.Three:hover,
section#chinazes div.Four:hover {
    transform: scale(1.02);
    transition: all .2s ease-in-out;
}

footer {
    background-color: #0c113c;
    color: #ffffff;
    text-align: center;
    padding: 20px 16px;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

footer ul li a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: block;
}

footer ul li a:hover {
    transform: scale(1.02);
    transition: all .2s ease-in-out;
}

footer p {
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
}

/* Mobile: phones */
@media (max-width: 639px) {
    header {
        flex-wrap: wrap;
        gap: 12px;
        padding: calc(env(safe-area-inset-top) + 8px) 12px 8px 12px;
    }

    /* показываем бургер, скрываем обычное меню */
    header .burger {
        display: inline-flex;
    }

    header img {
        width: 44px;
        height: 44px;
        margin-left: 0;
    }

    header h1 {
        font-size: clamp(16px, 5vw, 22px);
        margin-left: 6px;
    }

    header nav {
        width: 100%;
        margin: 0;
        order: 3; /* перенести ниже хедера */
    }

    /* Выпадающее меню: по умолчанию скрыто */
    header nav ul {
        display: none;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
        background: #ffffff;
        border: 1px solid rgba(12,17,60,0.08);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        margin-top: 4px;
    }

    /* Показать меню при включённом переключателе */
    header #nav-toggle:checked ~ nav ul {
        display: flex;
    }

    header nav ul li a {
        font-size: clamp(13px, 4vw, 15px);
    }

    /* Prevent right-edge overflow on small screens */
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
    }
    /* HOME: на мобильных контент поверх фона, на всю ширину */
    section#home {
        min-height: 520px;
        background-position: center;
    }

    section#home div.overlay {
        position: static;
        width: 100%;
        height: auto;
        background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.1));
        padding: 24px 20px 28px 20px; /* чуть больше боковой отступ на телефонах */
    }

    section#home div.overlay h2 {
        margin-top: 0;
        margin-left: 0;
        font-size: clamp(22px, 6vw, 28px);
    }

    section#home div.overlay p {
        margin-left: 0;
        max-width: 96%; /* небольшой внутренний запас от края */
        font-size: clamp(14px, 4.2vw, 18px);
    }

    section#home div.overlay button {
        margin-left: 0;
        font-size: 15px;
        padding: 10px 18px;
    }

    /* CYBERPOLICE: на мобильных полноценная ширина и отступы */
    section#cyberpolice {
        text-align: left;
        padding-bottom: 24px;
        padding-left: 12px;  /* небольшой общий отступ слева */
        padding-right: 12px; /* и справа для края секции */
    }

    section#cyberpolice div.cyber {
        width: 100%;
        padding: 0 20px; /* чуть больше внутренний отступ для текста */
    }

    section#cyberpolice div.cyber h2 {
        margin-top: 24px;
        font-size: clamp(20px, 5.5vw, 28px);
        padding-right: 4%; /* небольшой запас справа от края */
    }

    section#cyberpolice div.cyber p,
    section#cyberpolice div.cyber ul,
    section#cyberpolice div.cyber ol {
        font-size: clamp(14px, 4.2vw, 18px);
        overflow-wrap: anywhere;
        word-break: break-word;
        max-width: 96%; /* небольшой внутренний запас по ширине */
    }

    /* отступы для маркеров списков, чтобы не быть впритык */
    section#cyberpolice div.cyber ul,
    section#cyberpolice div.cyber ol {
        padding-left: 20px;
        margin-left: 0;
    }

    /* CHINAZES: одна колонка, карточки на всю ширину */
    section#chinazes {
        text-align: left;
    }

    section#chinazes h2 {
        padding: 0 16px;
        margin-top: 24px;
        margin-bottom: 8px;
        font-size: clamp(20px, 5.5vw, 26px);
    }

    section#chinazes div.content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 8px 16px 24px 16px;
        font-size: clamp(14px, 4.2vw, 18px);
    }

    section#chinazes div.One,
    section#chinazes div.Two,
    section#chinazes div.Three,
    section#chinazes div.Four {
        width: 100%;
        margin: 0;
        text-align: left;
        overflow: hidden;
    }

    section#chinazes img {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 8px;
    }

    section#chinazes h1,
    section#chinazes p {
        overflow-wrap: anywhere;
        word-wrap: break-word;
    }
}

/* Tablet: portrait/landscape */
@media (min-width: 640px) and (max-width: 959px) {
    header {
        gap: 14px;
        padding: calc(env(safe-area-inset-top) + 10px) 16px 10px 16px;
    }

    header nav ul {
        gap: 16px;
        flex-wrap: wrap; /* allow wrap if needed */
    }

    header nav ul li a {
        font-size: clamp(14px, 1.8vw, 16px);
    }
    /* HOME: слегка меньше отступы и центр фона */
    section#home {
        background-position: center;
    }

    /* CYBERPOLICE: читаемые отступы */
    section#cyberpolice div.cyber {
        width: 80%;
    }

    /* CHINAZES: две колонки сетки */
    section#chinazes div.content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        padding: 24px 24px;
    }

    section#chinazes div.One,
    section#chinazes div.Two,
    section#chinazes div.Three,
    section#chinazes div.Four {
        width: 100%;
        margin: 0;
    }
}

/* Desktop: widen spacing */
@media (min-width: 960px) {
    header {
        gap: 16px;
    }

    header nav ul {
        gap: 24px;
    }
}

