:root {
    --bg: #093350;
    --accent: #0BB4E1;
    --white: #FFFFFF;
    --black: #000000;
    --blue: #0B4369;
    --blue-dark: #072539;
    --blue-light: #3C6987;
    /* Высота липкой шапки — для отступов якорей и фокуса; меняется в медиазапросах ниже */
    --header-h: 92px;
}

*, ::after, ::before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Обводка фокуса только при работе с клавиатуры, клик мышью её не показывает */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-background-clip: text;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
}

html,
body {
	border: none;
	margin: 0;
	padding: 0;
	font-family: 'Roboto', sans-serif;
	background: var(--bg);
	color: var(--black);
}

/* Якоря и фокус с клавиатуры не уходят под липкую шапку */
html {
    scroll-padding-top: var(--header-h);
}

/* Плавная прокрутка к #contact только на главной: на /brief/ scrollIntoView должен оставаться мгновенным */
@media (prefers-reduced-motion: no-preference) {
    html.home {
        scroll-behavior: smooth;
    }
}

/* Страховка от горизонтальной прокрутки; clip, а не hidden — hidden ломает sticky внутри main */
main,
footer {
    overflow-x: clip;
}

img {
    max-width: 100%;
    height: auto;
}

h1 {
    font-weight: 500;
    font-size: 80px;
    line-height: 70px;
    color: var(--white);
    position: relative;
}

h2,
.h2 {
    font-weight: 500;
    font-size: 56px;
    line-height: 52px;
    color: var(--white);
    letter-spacing: -1.68px;
}

h3,
.h3 {
    font-weight: 600;
    font-size: 30px;
    line-height: 36px;
    color: var(--white);
}

.text-0 {
    font-size: 30px;
    line-height: 42px;
    color: var(--white);
}

.text {
    font-size: 18px;
    line-height: 24px;
    color: var(--white);
}

.text-med {
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: var(--blue-light);
}

.text-2 {
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: var(--white);
}

header {
    position: sticky;
    top: 0;
    box-shadow: 0px 4px 36px 0px rgba(4, 30, 47, 0.48);
    z-index: 99999;
    background: var(--bg);
    padding-top: 20px;
    padding-bottom: 20px;
}

.button {
    background: var(--accent);
    border: none;
    border-radius: 100px;
    padding: 16px 65px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    color: var(--white);
}

/* На сенсорных экранах :hover залипает после тапа, поэтому только для мыши */
@media (hover: hover) {
    .button:hover {
        background: var(--blue-dark);
    }
}

.button:active {
    filter: brightness(.9);
}

.container {
    max-width: 1240px;
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
    margin-right: auto;
    margin-left: auto
}

.row {
    margin-right: -20px;
    margin-left: -20px;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.col-6 {
    padding-right: 20px;
    padding-left: 20px;
    -ms-flex: 0 0 50%;
    flex: 0 0 50%;
    max-width: 50%;
}

.col-12 {
    padding-right: 20px;
    padding-left: 20px;
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.d-flex {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
}

.justify-content-between {
    -webkit-box-pack: justify !important;
    -ms-flex-pack: justify !important;
    justify-content: space-between !important;
}

.mt8 {
    margin-top: 8px;
}

.mt12 {
    margin-top: 12px;
}

.mt24 {
    margin-top: 24px;
}

.mt32 {
    margin-top: 32px;
}

.mt40 {
    margin-top: 40px;
}

.mt60 {
    margin-top: 60px;
}

.mt90 {
    margin-top: 90px;
}

.mt120 {
    margin-top: 120px;
}

.mv780 {
    max-width: 780px;
}

.slider .container {
    max-width: 1208px;
    padding-right: 4px;
    padding-left: 4px;
}

.slider .row {
    margin-right: -4px;
    margin-left: -4px;
}

.slider .row .slide {
    padding-right: 4px;
    padding-left: 4px;
    min-height: 460px;
    display: flex;
    position: relative;
    width: 100%;
}

.slider .big {
    -ms-flex: 0 0 46%;
    flex: 0 0 46%;
    max-width: 46%;
}

.slider .small {
    -ms-flex: 0 0 27%;
    flex: 0 0 27%;
    max-width: 27%;
}

.slider .row .slide .holder {
    flex: 1;
    border-radius: 16px;
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: flex-end;
    padding: 24px 16px;
}

/* Сначала простой url() — для браузеров без image-set() с type() */
.slider .row .slide.slide_1 .holder {
    background-image: url('1.jpg');
    background-image: image-set(url('1.webp') type('image/webp'), url('1.jpg') type('image/jpeg'));
    display: flex;
    gap: 24px;
}

.slider .row .slide.slide_1 .holder .text-med {
    color: var(--white);
}

.slider .row .slide.slide_2 .holder {
    background-image: url('2.jpg');
    background-image: image-set(url('2.webp') type('image/webp'), url('2.jpg') type('image/jpeg'));
    background-position-x: 75%;
}

.slider .row .slide.slide_3 .holder {
    background-image: url('3.jpg');
    background-image: image-set(url('3.webp') type('image/webp'), url('3.jpg') type('image/jpeg'));
    background-position-x: 40%;
}

.slider .row .slide .holder::before {
    position: absolute;
    left: 16px;
    top: 16px;
    border-radius: 100px;
    width: 40px;
    height: 20px;
    border: 1px solid var(--white);
    content: '01';
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 20px;
}

.slider .row .slide_2 .holder::before {
    content: '02';
}

.slider .row .slide_3 .holder::before {
    content: '03';
}

.product_block .row {
    align-items: center;
}

.product_block .row > div {
    padding-right: 20px;
    padding-left: 20px;
}

.product_block .image {
    -ms-flex: 0 0 53.22%;
    flex: 0 0 53.22%;
    max-width: 53.22%;
}

.product_block .description {
    -ms-flex: 0 0 46.78%;
    flex: 0 0 46.78%;
    max-width: 46.78%;
    display: flex;
    flex-direction: column;
}

.product_block .list {
    list-style: none;
    color: var(--accent);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product_block .list li::before {
    content: '';
    background: url('data:image/svg+xml, <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.95 12L10.65 14.7L16.05 9.3M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="%230BB4E1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    width: 24px;
    height: 24px;
    display: block;
    position: absolute;
    left: 0px;
}

.product_block .list li {
    padding-left: 36px;
    position: relative;
}

.blue {
    background: var(--blue);
    border-radius: 40px;
    padding: 90px 0;
}

footer {
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    background: var(--blue);
    padding-bottom: 60px;
    padding-top: 90px;
}

.services {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.services > div {
    position: relative;
}

/* Чекбокс скрыт визуально, но доступен с клавиатуры и для экранных дикторов */
.services input[type="checkbox"] {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.services input[type="checkbox"]:focus-visible + label {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.services label {
    border: 1px solid var(--blue-light);
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    display: block;
}

@media (hover: hover) {
    .services label:hover {
        border: 1px solid var(--accent);
    }
}

.services label:active {
    border-color: var(--accent);
}

.services input[type="checkbox"]:checked + label {
    background: var(--accent);
    border: 1px solid var(--accent);
}

.form {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 24px;
}

.form .row {
    margin-right: -12px;
    margin-left: -12px;
    gap: 32px 0;
}

.form .col-6 {
    position: relative;
    display: flex;
    align-items: end;
    padding-right: 12px;
    padding-left: 12px;
}

.form .button {
    width: 100%;
}

.form input[type="text"],
.form input[type="tel"],
.form input[type="email"] {
    font-size: 30px;
    line-height: 66px;
    padding-top: 29px;
    background: none;
    border: none;
    color: white;
    border-bottom: 1px solid var(--blue-light);
    width: 100%;
}

/* У текстовых полей вместо обводки — акцентная линия снизу */
.form input[type="text"]:focus-visible,
.form input[type="tel"]:focus-visible,
.form input[type="email"]:focus-visible {
    outline: none;
    border-bottom-color: var(--accent);
}

.form input:user-invalid {
    border-bottom-color: #FFA8A8;
}

/* Подпись поднимается, когда в поле есть любой текст (placeholder=" "), а не только корректный */
.form input:focus + .floating_label,
.form input:not(:placeholder-shown) + .floating_label {
    bottom: 60px;
    opacity: 1;
    font-size: 18px;
    line-height: 24px;
}

.form .floating_label {
    position: absolute;
    pointer-events: none;
    left: 12px;
    bottom: 13px;
    transition: 0.2s ease all;
    color: var(--blue-light);
    font-size: 30px;
    line-height: 42px;
}

.form .button_holder {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form .hp {
    position: absolute;
    left: -9999px;
}

.op07 {
    opacity: 0.7;
}

footer a {
    color: var(--white);
    text-decoration: none;
}

footer .form a {
    text-decoration: underline;
}

/* inset вместо 100vw/100vh — подложка совпадает с видимой областью и на телефонах */
.modal_holder {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: rgba(9, 51, 80, 0.8);
}

.modal {
    border-radius: 16px;
    background: var(--white);
    padding: 40px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 660px;
}

.modal .h3 {
    color: var(--blue);
}

.modal .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .text {
    color: var(--black);
}

/* Крестик: иконка 24px, область нажатия 44px */
.modal_close {
    flex: none;
    width: 44px;
    height: 44px;
    margin: -10px;
    padding: 0;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    cursor: pointer;
}

.modal .button {
    display: block;
    width: 100%;
    font: inherit;
}

/* На белом окне белая обводка не видна */
.modal :focus-visible {
    outline-color: var(--blue);
}

@media (max-width: 991px) {
    :root {
        --header-h: 76px;
    }
    
	header img {
	    height: 32px;
	    width: auto;
	}
	
	.button {
	    padding: 8px 16.5px;
	}
	
    /* Кнопка в шапке остаётся 36px, область нажатия — 44px, высота шапки не меняется */
    header .button {
        position: relative;
    }
    
    header .button::after {
        content: '';
        position: absolute;
        inset: -4px 0;
    }
    
    /* Длинное «сопровождение» не помещалось в 280–374px и давало горизонтальную прокрутку */
	h1 {
	    font-size: clamp(32px, 10.5vw, 56px);
	    line-height: .93;
	}
    
    /* Только на главной: на /merch/ разрыв посреди слова хуже, там размер H1 подбирает merch.css */
    html.home h1 {
        overflow-wrap: break-word;
    }
	
	.mt60 {
	    margin-top: 40px;
	}
	
	.mt120 {
	    margin-top: 80px;
	}
	
	.slider .container {
	    padding-right: 20px;
        padding-left: 20px;
	}
	
	.slider .row {
	    gap: 8px;
        margin-right: -20px;
        margin-left: -20px;
    }
    
    .slider .row .slide {
        padding-right: 20px;
        padding-left: 20px;
        min-height: 200px;
    }
    
    .slider .big,
    .slider .small {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .slider .row .slide .holder {
        position: relative;
    }
    
    /* Затемнение снизу под белым текстом: в узкой обрезке за ним светлый айсберг и закатное небо.
       Градиент не выносим в переменную: с var() пропал бы запасной url() для браузеров без image-set() */
    .slider .row .slide.slide_1 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), url('1.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), image-set(url('1.webp') type('image/webp'), url('1.jpg') type('image/jpeg'));
        background-position: center 35%;
    }

    .slider .row .slide.slide_2 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .6) 0%, rgba(4, 30, 47, 0) 60%), url('2.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .6) 0%, rgba(4, 30, 47, 0) 60%), image-set(url('2.webp') type('image/webp'), url('2.jpg') type('image/jpeg'));
    }

    /* Вертолёт в верхней части фото — сдвигаем кадр, иначе в низкой карточке видны только полозья */
    .slider .row .slide.slide_3 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), url('3.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), image-set(url('3.webp') type('image/webp'), url('3.jpg') type('image/jpeg'));
        background-position: 40% 20%;
    }
    
    .product_block .row {
        flex-direction: column;
        gap: 40px;
        align-items: stretch;
    }
    
    .product_block .row.reverse {
        flex-direction: column-reverse;
    }
    
    .product_block .image,
    .product_block .description {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .product_block .image {
        text-align: center;
    }
    
    h2, .h2 {
        font-size: 30px;
        line-height: 36px;
        letter-spacing: -.02em;
    }
    
    h2 br,
    .h2 br {
        display: none;
    }
    
    .blue {
        padding: 40px 0;
    }
    
    .mt90 {
        margin-top: 40px;
    }
    
    footer {
        padding-bottom: 40px;
        padding-top: 40px;
    }
    
    .services label {
        padding: 11px 14px;
        min-height: 44px;
    }
    
    .col-6 {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .form input[type="text"], .form input[type="tel"], .form input[type="email"] {
        padding-top: 10px;
    }
    
    .form input {
        font-family: inherit;
    }
    
    /* «Отправить»: шрифт как у остальных кнопок, высота 44px, на всю ширину полей */
    .form input[type="submit"].button {
        font-size: 14px;
        line-height: 20px;
        min-height: 44px;
        padding: 12px 16.5px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form .button_holder {
        width: 100%;
    }
    
    .product_block .description .button {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 24px;
    }
    
    /* Почта и телефон — по 44px в высоту, отступ между ними дают сами ссылки */
    .contacts a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
    
    .contacts,
    .contacts .row {
        gap: 0;
    }
    
    .modal {
        min-width: 0;
        width: calc(100% - 32px);
        max-width: 660px;
        max-height: calc(100% - 32px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 24px;
    }
    
    .modal .h3 {
        font-size: 24px;
        line-height: 30px;
    }
    
    .modal .top {
        align-items: flex-start;
        gap: 12px;
    }
    
    .modal .top .modal_close {
        margin-top: -7px;
    }
    
    .modal .button {
        min-height: 44px;
    }
}

/* Планшеты и телефоны в альбомной ориентации: услуги в две колонки, как на десктопе */
@media (min-width: 560px) and (max-width: 991px) {
    .product_block .row,
    .product_block .row.reverse {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }
    
    .product_block .image,
    .product_block .description {
        -ms-flex: 0 0 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* В колонке 240–260px заголовки в 30px рвутся на «и web- | презентаций» и одинокое «PR» */
@media (min-width: 560px) and (max-width: 639px) {
    .product_block h2 {
        font-size: 26px;
        line-height: 30px;
    }
}

@media (min-width: 600px) and (max-width: 991px) {
    .slider .row .slide {
        min-height: 260px;
    }
}

/* Телефоны: карточки слайдера узкие, хватает фото шириной 800px. На планшетах оставляем 1200px, иначе мыльно */
@media (max-width: 599px) {
    .slider .row .slide.slide_1 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), url('1-800.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), image-set(url('1-800.webp') type('image/webp'), url('1-800.jpg') type('image/jpeg'));
    }

    .slider .row .slide.slide_2 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .6) 0%, rgba(4, 30, 47, 0) 60%), url('2-800.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .6) 0%, rgba(4, 30, 47, 0) 60%), image-set(url('2-800.webp') type('image/webp'), url('2-800.jpg') type('image/jpeg'));
    }

    .slider .row .slide.slide_3 .holder {
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), url('3-800.jpg');
        background-image: linear-gradient(0deg, rgba(4, 30, 47, .85) 0%, rgba(4, 30, 47, .5) 50%, rgba(4, 30, 47, 0) 85%), image-set(url('3-800.webp') type('image/webp'), url('3-800.jpg') type('image/jpeg'));
    }
}

@media (max-width: 575px) {
    .form input[type="text"],
    .form input[type="tel"],
    .form input[type="email"] {
        font-size: 22px;
        line-height: 44px;
    }
    
    .form .floating_label {
        bottom: 7px;
        font-size: 22px;
        line-height: 32px;
    }
    
    .form input:focus + .floating_label,
    .form input:not(:placeholder-shown) + .floating_label {
        bottom: 48px;
        font-size: 16px;
    }
}

/* Низкие экраны (телефон в альбомной ориентации): шапка не липнет и не закрывает пятую часть экрана */
@media (max-width: 991px) and (max-height: 500px) {
    :root {
        --header-h: 0px;
    }
    
    header {
        position: relative;
    }
}

/* 992–1239px: заголовки главной плавно растут до десктопных размеров, без переносов по одному слову */
@media (min-width: 992px) and (max-width: 1239px) {
    html.home h1 {
        font-size: 6.452vw;
        line-height: .875;
    }
    
    html.home h2,
    html.home .h2 {
        font-size: 4.516vw;
        line-height: .92857;
        letter-spacing: -.03em;
    }
    
    .slider .container {
        max-width: 1240px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 1239px) {
    html.home h1,
    html.home h2,
    html.home .h2 {
        text-wrap: balance;
    }
}

/* Кнопка «Заполнить бриф» в блоке «Создание сайтов» — по ширине текста, а не всей колонки */
.product_block .description .button {
    align-self: flex-start;
}
