/* Mobile-first, system font stack */
@font-face {
    font-family: "TeX Gyre Heros";
    src: url("fonts/TeXGyreHeros-Regular.woff2") format("woff2"),
         url("fonts/TeXGyreHeros-Regular.woff") format("woff"),
         url("fonts/texgyreheros-regular.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --content-max: 422px;
    --btn-bg: rgb(220, 189, 125);
    --btn-hover: rgb(254, 226, 153);
}

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

html {
    font-size: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Helvetica Neue", "TeX Gyre Heros", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #fff;
    overflow-x: hidden;
}

.page-wrap {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1rem;
    padding-top: 0.5rem;
}

/* Background layer: full viewport, cover; center on mobile, center right on desktop */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: #1a1d24;
    background-image: url("img/background.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: bgZoom 45s ease-in-out infinite alternate;
}

@keyframes bgZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-layer {
        animation: none;
    }
}

/* Dark overlay: только для контраста фона, без плашки под текстом */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.5) 45%,
        rgba(0, 0, 0, 0.25) 70%,
        transparent 100%
    );
}

/* Левый блок: логотип, место под доп. изображение, текстовый контент; мин. ширина 360px; padding-bottom — место под фиксированный копирайт */
.left-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 360px;
    padding-bottom: 3rem;
}

/* Контейнер логотипа: выровнен по левому краю, без сдвига вправо */
.header {
    align-self: flex-start;
    margin-bottom: 0;
    margin-left: 0;
    padding-left: 0;
}

.logo-wrapper {
    display: block;
    text-align: left;
    margin-left: 0;
    padding-left: 0;
}

.logo-wrapper img,
.logo {
    display: block;
    margin-left: 0;
    max-width: 140px;
    height: auto;
    padding: 0.25rem 0;
}

/* Место под дополнительное изображение под логотипом; пустой по умолчанию */
.logo-sub-image {
    display: block;
    width: 100%;
    min-height: 0;
}

.logo-sub-image img {
    display: block;
    max-width: 100%;
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Текстовый блок: выровнен по левому краю контейнера (0), без сдвига вправо */
.content-text {
    margin-left: 0;
    padding-left: 0;
}

.content-text .card__title,
.content-text .card__subtitle,
.content-text .card__section,
.content-text .card__contacts {
    margin-left: 0;
}

/* Main: контент прижат к левому краю на всех размерах экрана */
.main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0;
}

/* Карточка: левый край совпадает с левым краем логотипа, без центрирования */
.card {
    width: 100%;
    max-width: 90%;
    margin-left: 0;
    margin-right: auto;
    position: relative;
    left: 0;
    padding: 1.5rem 1.5rem 1.5rem 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* Читаемость без плашки: лёгкий text-shadow для заголовка и текста */
/* Заголовок h1 в одну строку: запрет переноса, масштабируемый размер (мин. 14px на мобильном) */
.card__title,
h1.card__title {
    margin: 0 0 0.75rem;
    white-space: nowrap;
    font-size: clamp(18px, 2vw, 36px);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.6);
}

.card__subtitle {
    margin: 0 0 1.25rem;
    font-size: 1.2rem;
    line-height: 1.5;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 16px rgba(0, 0, 0, 0.5);
}

.card__section {
    margin-bottom: 1.25rem;
}

.card__section:last-of-type {
    margin-bottom: 0;
}

.card__section-title {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.5);
}

.card__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card__links li {
    margin: 0;
    display: flex;
    flex: 1 1 0;
    min-width: 8rem;
}

/* Ссылки: цвет кнопок из --btn-bg / при наведении --btn-hover, одного размера */
.card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 0.5rem 0.9rem;
    color: #000;
    background: var(--btn-bg);
    border: 1px solid var(--btn-bg);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.card__link:hover {
    background: var(--btn-hover);
    color: #000;
    border-color: var(--btn-hover);
}

.card__link:focus {
    outline: 2px solid var(--btn-hover);
    outline-offset: 2px;
}

.card__contacts {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 1.2rem;
    line-height: 1.5;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.5);
}

.card__contact-item {
    white-space: nowrap;
}

/* Ссылки-телефоны: белый цвет (в т.ч. на iOS Safari), без подчёркивания */
.card__contacts a[href^="tel:"],
.card__contacts .card__contact-item {
    color: #fff;
    text-decoration: none;
}

.card__contacts a[href^="tel:"]:hover,
.card__contacts a[href^="tel:"]:focus,
.card__contacts a[href^="tel:"]:visited {
    color: #fff;
    text-decoration: none;
}

/* Копирайт внизу страницы (viewport): ссылка на profine-group.ru */
.copyright-area {
    position: fixed;
    bottom: 10px;
    left: 1rem;
    z-index: 1;
}

.copyright {
    margin: 0;
    padding: 0;
    max-width: 90%;
    font-size: 10px;
    line-height: 1.4;
}

.copyright a {
    color: #fff;
    opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.copyright a:hover,
.copyright a:focus {
    color: #fff;
    opacity: 1;
    text-decoration: none;
}

/* Значки в нижнем правом углу (не перекрывают копирайт слева) */
.corner-badge {
    position: fixed;
    bottom: 10px;
    right: 1rem;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.corner-badge img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Мобильный (до 926px): центрирование карточки, фон со смещением */
@media (max-width: 926px) {
    .bg-layer {
        background-position: -100px center;
    }

    .page-wrap {
        justify-content: flex-start;
        align-items: center;
    }

    .left-panel {
        align-items: center;
    }

    .header {
        align-self: center;
    }

    .header-main-wrap .logo-wrapper {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .header-main-wrap .logo-wrapper img,
    .header-main-wrap .logo {
        margin-left: auto;
        margin-right: auto;
    }

    .main {
        justify-content: flex-start;
        align-items: center;
    }

    .card {
        margin-left: auto;
        margin-right: auto;
        position: relative;
        left: 0;
        padding-left: 1.5rem;
    }

    .card.content-text,
    .content-text {
        text-align: center;
    }

    .content-text .card__title,
    .content-text .card__subtitle,
    .content-text .card__section,
    .content-text .card__section-title {
        text-align: center;
    }

    .card__links {
        justify-content: center;
    }

    .card__contacts {
        justify-content: center;
    }

    .copyright-area {
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: var(--content-max);
        box-sizing: border-box;
    }
}

/* Tablet: блок в свободной зоне слева, ограничена ширина (от 927px) */
@media (min-width: 927px) {
    .bg-layer {
        background-position: center right;
    }

    .overlay {
        background: linear-gradient(
            to right,
            rgba(0, 0, 0, 0.7) 0%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.15) 80%,
            transparent 100%
        );
    }

    .page-wrap {
        padding: 1.5rem;
        padding-top: 0.75rem;
    }

    .logo-wrapper img,
    .logo {
        width: 180px;
        max-width: 100%;
        height: auto;
    }

    .left-panel {
        max-width: var(--content-max);
    }

    .card {
        max-width: var(--content-max);
        margin-left: 0;
        padding: 2rem 2rem 2rem 0;
    }

    .copyright-area {
        left: 1.5rem;
    }

    .copyright {
        max-width: var(--content-max);
    }

    .card__title {
        margin-bottom: 0.9rem;
    }

    .card__subtitle {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
}

/* Вертикальный экран (портрет): фон background_mob_v3.jpg, левый верхний блок; лого до 250px; блок внизу с отступом 100px */
@media (orientation: portrait) {
    .bg-layer {
        background-image: url("img/background_mob_v3.jpg");
        background-position: -100px top;
        filter: blur(0.5px);
    }

    .logo-wrapper {
        width: 100%;
        max-width: 300px;
    }

    .logo-wrapper img,
    .logo {
        width: 100%;
        max-width: 250px;
        height: auto;
    }

    .left-panel {
        flex: 1;
        min-height: 0;
    }

    .main {
        flex-direction: column;
        min-height: 0;
    }

    .card {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

    .card__bottom {
        margin-top: auto;
        margin-bottom: 80px;
    }
}

/* Desktop: левая панель с лого и текстом, единый левый край, текст с отступом 10px */
@media (min-width: 1200px) {
    .page-wrap {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 1.5rem 2rem;
        padding-top: 1rem;
    }

    .left-panel {
        max-width: var(--content-max);
        margin-left: 2rem;
        margin-right: auto;
    }

    .header {
        position: static;
    }

    .logo-wrapper img,
    .logo {
        max-width: 400px;
        width: 400px;
        margin-left: 0;
    }

    .main {
        align-items: flex-start;
        justify-content: flex-start;
        padding-left: 0;
        padding-top: 1rem;
        max-width: var(--content-max);
        width: fit-content;
        z-index: 1;
    }

    .card {
        max-width: none;
        width: fit-content;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    .card__subtitle,
    .card__section-title {
        text-align: center;
    }

    .card__section#contacts .card__section-title,
    .card__section#contacts .card__contacts {
        text-align: center;
    }

    .card__section#contacts .card__contacts {
        justify-content: center;
    }

    .copyright-area {
        left: 2rem;
    }

    .copyright {
        max-width: var(--content-max);
    }

    .overlay {
        background: linear-gradient(
            to right,
            rgba(0, 0, 0, 0.65) 0%,
            rgba(0, 0, 0, 0.35) 40%,
            rgba(0, 0, 0, 0.1) 70%,
            transparent 100%
        );
    }
}

/* Очень узкий экран: сильнее оверлей для читаемости, блок не закрывает лицо — узкая ширина и отступы */
@media (max-width: 380px) {
    .overlay {
        background: linear-gradient(
            to right,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.55) 60%,
            rgba(0, 0, 0, 0.3) 100%
        );
    }

    .card {
        max-width: 92%;
    }

    .copyright-area {
        max-width: 92%;
    }

    .card__links {
        flex-direction: column;
    }

    .card__link {
        min-height: 2.5rem;
    }
}
