/* ===== Основные стили и сброс ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Oswald', sans-serif;
}
body {
    background-color: #fefefe;
    color: #343A40;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(to right, #4A6FA5, #6B8CBC);
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-right: 15px;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(74, 111, 165, 0.25);
    color: white;
}

.cta-button.secondary:hover {
    box-shadow: 0 15px 35px rgba(255, 159, 74, 0.25);
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 60vh;
    background: linear-gradient(135deg, #f4f1ec 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    padding: 40px 5%;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.hero-container {
    max-width: 1700px;
    margin: 0 auto;
    display: grid;
    /* 2/5 на контент, 3/5 на изображения */
    grid-template-columns: 2fr 3fr;
    gap: 50px;
    width: 100%;
}

.hero-content {
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    color: #2E5E7E;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #2E5E7E;
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 12px;
    padding: 8px 16px;
    display: inline-block;
}

.hero-description {
    font-size: 1.2rem;
    color: #6C757D;
    margin-bottom: 1.5rem;
    max-width: 500px;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== Hero spiral mosaic =====
   Сетка 8×5, фибоначчиева раскладка квадратов:
   4 (3×3)  •  3 (2×2)  •  1 (1×1)  •  2 (1×1)  •  5 (5×5)

   col→  1   2   3   4   5   6   7   8
   row1 [ 4   4   4 ][         5         ]
   row2 [ 4   4   4 ][         5         ]
   row3 [ 4   4   4 ][         5         ]
   row4 [ 3   3 ][1 ][         5         ]
   row5 [ 3   3 ][2 ][         5         ]
*/
.hero-images {
    position: relative;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
    aspect-ratio: 8 /5;
    width: 100%;
}

.hero-image {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
    transition: transform 0.08s ease-out,
                box-shadow 0.08s ease,
                z-index 0s linear 0.08s;
    z-index: 1;
    will-change: transform;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image:hover {
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
    z-index: 10;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.45s ease,
                z-index 0s linear 0s;
}

.hero-image-1:hover { transform: scale(1.55); }
.hero-image-2:hover { transform: scale(1.55); }
.hero-image-3:hover { transform: scale(1.32); }
.hero-image-4:hover { transform: scale(1.11); }
.hero-image-5:hover { transform: scale(1.04); }

.hero-image-1 { grid-column: 3 / 4; grid-row: 4 / 5; }
.hero-image-2 { grid-column: 3 / 4; grid-row: 5 / 6; }
.hero-image-3 { grid-column: 1 / 3; grid-row: 4 / 6; }
.hero-image-4 { grid-column: 1 / 4; grid-row: 1 / 4; }
.hero-image-5 { grid-column: 4 / 9; grid-row: 1 / 6; }

/* Адаптив hero и остальных секций — в блоке «АДАПТИВ» в конце файла */

/* ===== Секция "О нас" ===== */
.about-section {
    padding: 15px 5% 70px;
    background: linear-gradient(135deg, #f4f1ec 0%, #ffffff 100%);
    border-radius: 15px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2E5E7E;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #FF9F4A;
    margin: 15px auto 30px;
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-heading {
    color: #4A6FA5;
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 12px;
    padding: 12px 24px;
    display: inline-block;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: #6C757D;
    font-size: 1.1rem;
}

.highlight-box {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-left: 5px solid #FF9F4A;
    padding: 25px;
    border-radius: 0 16px 16px 0;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.feature-item {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid transparent;
}

.feature-item:hover {
    transform: translateY(-10px);
    border-top-color: #4A6FA5;
}

.feature-item i {
    font-size: 2.5rem;
    color: #4A6FA5;
    margin-bottom: 15px;
    display: block;
}

.feature-item h4 {
    color: #343A40;
    margin-bottom: 10px;
}

/* ===== Секция направлений ===== */
.directions-section {
    padding: 15px 5% 70px;
    background-color: #F8F9FA;
}

.directions-grid {
    display: grid;
    /* min(300px, 100%) — иначе на узком экране колонка шире контейнера
       и появляется горизонтальный скролл */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 30px;
}

.direction-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.direction-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 25px 25px 15px;
    background-color: #4A6FA5;
    color: white;
}

.card-header h3 {
    font-size: 1.5rem;
}

.card-body {
    padding: 25px;
}

.card-body ul {
    list-style: none;
    padding-left: 0;
}

.card-body li {
    padding: 8px 0;
    border-bottom: 1px dashed #E9ECEF;
    position: relative;
    padding-left: 25px;
}

.card-body li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28A745;
    font-weight: bold;
}

/* ===== Баннер с призывом ===== */
.cta-banner {
    padding: 80px 5%;
    background: linear-gradient(135deg, #4A6FA5 0%, #2E5E7E 100%);
    color: white;
    text-align: center;
    border-radius: 16px;
    margin: 0 5% 100px;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 50%;
}

.cta-banner::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.cta-banner h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.cta-banner p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.cta-banner .cta-button {
    background: white;
    color: #4A6FA5;
    position: relative;
    z-index: 2;
}

.cta-banner .cta-button + .cta-button {
    margin-left: 15px;
}

.channels-fan {
    position: relative;
    display: inline-block;
    z-index: 5;                 /* веер всплывает над соседним контентом */
}

/* Главная кнопка — переиспользует ваш .cta-button, добавляем только flex и иконки */
.channels-fan__trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.channels-fan__chevron {
    font-size: 0.85rem;
    transition: transform 0.4s ease;
}

.channels-fan.is-open .channels-fan__chevron {
    transform: rotate(135deg);   /* «+» превращается в «×» */
}

/* Точка привязки веера — верх-центр кнопки */
.channels-fan__items {
    position: absolute;
    left: 50%;
    top: 0;
    width: 0;
    height: 0;
    z-index: 6;
}

.channels-fan__item {
    position: absolute;
    left: -27px;                 /* центрирует круг 54px на точке привязки */
    top: -27px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translate(0, 0) scale(0.3);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    pointer-events: none;        /* пока закрыто — кликов не ловит */
}

.channels-fan.is-open .channels-fan__item {
    opacity: 1;
    pointer-events: auto;
}

.channels-fan__item {
    z-index: 1;
}

.channels-fan__item:hover {
    filter: brightness(1.08);
    z-index: 10;
}

/* Фирменные цвета каналов */
.channels-fan__item--tg  { background: transparent; }
.channels-fan__item--max { background: #6E4BFF; }
.channels-fan__item--wa  { background: transparent; }
.channels-fan__item--owl {
    background: linear-gradient(to right, #FF9F4A, #FFB87C);
    color: #343A40;              /* сова — в акцентном оранжевом, как «пасхалка» */
}

.channels-fan__icon {
    width: 1.4em;
    height: 1.4em;
}

.channels-fan__item--tg .channels-fan__icon,
.channels-fan__item--wa .channels-fan__icon {
    width: 2.6em;
    height: 2.6em;
    border-radius: 50%;
}

.channels-fan__item--owl .channels-fan__icon {
    width: 2em;
    height: 2em;
}

/* Подпись канала при наведении */
.channels-fan__label {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #343A40;
    font-size: 0.78rem;
    padding: 4px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.channels-fan__item:hover .channels-fan__label {
    opacity: 1;
}

/* ===== Шуточный тост «Отправить сову» ===== */
.owl-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(140px);
    background: linear-gradient(135deg, #FF9F4A, #FFB87C);
    color: #343A40;
    padding: 16px 26px;
    border-radius: 50px;
    font-size: 1.05rem;
    box-shadow: 0 16px 40px rgba(255, 159, 74, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.owl-toast.is-shown {
    transform: translateX(-50%) translateY(0);
}

.owl-toast__fly {
    font-size: 1.4rem;
    animation: owlFlap 0.5s ease-in-out infinite;
}

@keyframes owlFlap {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-4px) rotate(6deg); }
}

/* ============================================================
   АДАПТИВ
   ============================================================
   Точки: 1100 / 900 / 700 / 560 px.
   900px — не 768: левая колонка hero содержит мини-новости
   (фото 140px + текст), при 2fr/3fr она становится нечитаемой раньше.
   ============================================================ */

@media (max-width: 1100px) {
    .hero-container { gap: 30px; }
    .hero-title { font-size: 2rem; }
    .about-content { gap: 40px; }
}

/* ---- Планшет / стек в одну колонку ---- */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-images {
        max-width: 520px;
        margin: 0 auto;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-features {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .cta-banner {
        margin: 0 3% 80px;
        padding: 60px 5%;
    }

    .cta-banner h2 { font-size: 2rem; }
}

/* ---- Крупные телефоны ---- */
@media (max-width: 700px) {
    .hero-section {
        padding: 28px 5%;
        border-radius: 12px;
        min-height: 0;
    }

    .about-section,
    .directions-section {
        padding: 12px 5% 50px;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .directions-grid { gap: 22px; }
}

/* ---- Телефоны ---- */
@media (max-width: 560px) {
    .hero-title { font-size: 1.75rem; }
    /* Основной текст не мельчим ниже ~1.05rem — базовый 1rem пользователю мелковат */
    .hero-description {
        font-size: 1.08rem;
        max-width: none;
    }

    .cta-button {
        padding: 12px 26px;
        font-size: 1.05rem;
    }

    /* Кнопки hero — в столбик на всю ширину.
       Побочный эффект нужный: веер каналов оказывается по центру,
       и дуга иконок (radius 96px) больше не уходит за левый край */
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .cta-button {
        width: 100%;
        text-align: center;
        margin-right: 0;
    }

    .channels-fan { display: block; }

    .channels-fan__trigger {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .section-title::after {
        width: 60px;
        margin: 12px auto 20px;
    }

    .about-heading {
        font-size: 1.2rem;
        padding: 10px 16px;
        margin-bottom: 1.2rem;
    }

    .highlight-box {
        padding: 18px;
        border-left-width: 4px;
        border-radius: 0 12px 12px 0;
        margin-top: 24px;
    }

    .feature-item {
        padding: 20px;
        border-radius: 14px;
    }

    .feature-item i {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .direction-card { border-radius: 14px; }
    .card-header { padding: 18px 18px 14px; }
    .card-header h3 { font-size: 1.25rem; }
    .card-body { padding: 18px; }
    .card-body li { padding-left: 22px; }

    .cta-banner {
        margin: 0 3% 60px;
        padding: 44px 6%;
        border-radius: 14px;
    }

    .cta-banner h2 { font-size: 1.6rem; }

    .cta-banner p {
        font-size: 1.08rem;
        margin-bottom: 26px;
    }

    /* Две кнопки в баннере — в столбик, иначе переносятся вкривь */
    .cta-banner .cta-button {
        display: block;
        width: 100%;
        margin-right: 0;
    }

    .cta-banner .cta-button + .cta-button {
        margin-left: 0;
        margin-top: 14px;
    }

    .cta-banner::before { width: 100px; height: 100px; }
    .cta-banner::after  { width: 130px; height: 130px; }

    .owl-toast {
        left: 16px;
        right: 16px;
        max-width: none;
        transform: translateY(140px);
        font-size: 0.98rem;
        padding: 14px 20px;
    }

    .owl-toast.is-shown { transform: translateY(0); }
}

/* ---- Hero-мозаика на телефоне ----
   Ландшафтная сетка 8×5 на 320px даёт ячейки ~35px — тайлы 1×1 не читаются.
   Поэтому спираль не ломаем, а разворачиваем на 90° против часовой:
   тот же набор квадратов 5-3-2-1-1, но прямоугольник встаёт «портретом»
   5×8, и ячейка вырастает до ~60px.

   col→   1     2     3     4     5
   row1 [                             ]
   row2 [                             ]
   row3 [           5   5×5           ]
   row4 [                             ]
   row5 [                             ]
   row6 [     4   3×3     ][ 1  ][ 2  ]
   row7 [     4   3×3     ][   3  2×2 ]
   row8 [     4   3×3     ][   3  2×2 ]

   Ширину НЕ режем по svh: в эмуляторе браузера svh = высота окна (~900px+),
   а на реальном телефоне svh = высота за вычетом адресной строки (~700px),
   из-за чего мозаика оказывалась уже соседних блоков. Ширину задаёт контейнер,
   потолок 480px бьёт только у верхнего края брейкпоинта (~520-560px). */
@media (max-width: 560px) {
    .hero-images {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(8, 1fr);
        aspect-ratio: 5 / 8;
        gap: 7px;
        width: 100%;
        max-width: 480px;
    }

    .hero-image { border-radius: 11px; }

    .hero-image-5 { grid-column: 1 / 6; grid-row: 1 / 6; }
    .hero-image-4 { grid-column: 1 / 4; grid-row: 6 / 9; }
    .hero-image-1 { grid-column: 4 / 5; grid-row: 6 / 7; }
    .hero-image-2 { grid-column: 5 / 6; grid-row: 6 / 7; }
    .hero-image-3 { grid-column: 4 / 6; grid-row: 7 / 9; }
}

/* ---- Небольшие телефоны (≤400px) ----
   390px (iPhone 17E/16e), 375px (SE), 360px (бюджетный Android).
   Под контент остаётся 320px, под текст секции — 288px.
   Режем паддинги и заголовки; кегль основного текста не трогаем. */
@media (max-width: 400px) {
    .hero-section {
        padding: 22px 4%;
    }

    .hero-title { font-size: 1.55rem; }

    /* «Записаться на встречу» с иконкой в 26px паддингов не влезало в строку */
    .cta-button {
        padding: 12px 18px;
        font-size: 1rem;
    }

    .hero-images { gap: 6px; }
    .hero-image  { border-radius: 9px; }

    .about-section,
    .directions-section {
        padding: 10px 4% 40px;
    }

    .section-title { font-size: 1.45rem; }

    .section-title::after {
        width: 50px;
        margin: 10px auto 16px;
    }

    .about-heading {
        font-size: 1.12rem;
        padding: 9px 13px;
    }

    .highlight-box { padding: 15px 16px; }

    .feature-item { padding: 16px; }

    .feature-item i { font-size: 1.8rem; }

    .card-header { padding: 15px 15px 12px; }
    .card-header h3 { font-size: 1.15rem; }
    .card-body { padding: 15px; }
    .card-body li { padding-left: 20px; }

    .directions-grid { gap: 18px; }

    .cta-banner {
        margin: 0 2% 48px;
        padding: 36px 5%;
    }

    .cta-banner h2 { font-size: 1.4rem; }
    .cta-banner::before { width: 78px;  height: 78px; }
    .cta-banner::after  { width: 100px; height: 100px; }
}

/* ---- Тач-устройства ----
   :hover на тапе «залипает»: карточка уезжает вверх и остаётся так,
   а scale(1.55) у плиток hero вылезает за экран */
/* ---- «О нас» внутри hero (телефон) ----
   Переносом узла занимается public/js/about-in-hero.js, он же вешает класс.
   Здесь снимаем с секции «карточность»: свой градиент, радиус и боковые 5%
   ей больше не нужны — их уже даёт .hero-section, вложенные дали бы полосу
   другого тона и двойной отступ.

   Блок идёт последним в файле намеренно: у .about-section--in-hero и
   .about-section одинаковая специфичность (0,1,0), поэтому перебить паддинги
   из блоков ≤700px и ≤400px можно только порядком в файле. */
@media (max-width: 700px) {
    .about-section--in-hero {
        padding: 0;
        margin-top: 30px;
        background: none;
        border-radius: 0;
    }

    /* Внутри hero это уже не шапка отдельного экрана, а подзаголовок блока */
    .about-section--in-hero .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.4rem;
    }

    .about-section--in-hero .section-title::after {
        margin: 12px auto 20px;
    }
}

@media (max-width: 400px) {
    .about-section--in-hero {
        margin-top: 24px;
    }

    .about-section--in-hero .section-title {
        font-size: 1.45rem;
    }
}

@media (hover: none) {
    .cta-button:hover { transform: none; }

    .hero-image:hover {
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
        z-index: 1;
    }

    .hero-image-1:hover,
    .hero-image-2:hover,
    .hero-image-3:hover,
    .hero-image-4:hover,
    .hero-image-5:hover { transform: none; }

    .feature-item:hover,
    .direction-card:hover { transform: none; }
}
