/* ===== HERO ===== */

.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
    padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 80px);
}

    /* фоновое изображение */
    .hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background: url("/assets/images/Page_index/dental-hero-banner.jpg") center / cover no-repeat;
        z-index: 0;
        animation: heroZoom 18s ease-in-out infinite alternate;
    }

@keyframes heroZoom {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

/* затемняющий оверлей — усиленный для читаемости текста */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient( 120deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.50) 55%, rgba(19, 179, 155, 0.18) 100% );
    z-index: 1;
}

/* плавающие декоративные частицы */
.hero .hero-orb {
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
    animation: orbFloat 10s ease-in-out infinite;
}

    .hero .hero-orb:nth-child(1) {
        width: 14px;
        height: 14px;
        top: 22%;
        left: 12%;
        background: rgba(19, 179, 155, 0.55);
        animation-delay: 0s;
    }

    .hero .hero-orb:nth-child(2) {
        width: 22px;
        height: 22px;
        top: 55%;
        left: 30%;
        background: rgba(255, 182, 114, 0.5);
        animation-delay: 2s;
    }

    .hero .hero-orb:nth-child(3) {
        width: 10px;
        height: 10px;
        top: 35%;
        left: 55%;
        background: rgba(255, 255, 255, 0.55);
        animation-delay: 4s;
    }

@keyframes orbFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: .5;
    }

    50% {
        transform: translateY(-30px) translateX(14px);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .hero .hero-orb {
        display: none;
    }
}

/* ===== КОНТЕНТ ===== */

.hero-content {
    position: relative;
    z-index: 2;
    max-width: clamp(320px, 60vw, 720px);
    /* Above-the-fold content must be visually stable immediately after refresh.
       The old opacity/translate entrance animation made text look grey, outlined
       and temporarily duplicated while the browser composited the first frame. */
    opacity: 1;
    transform: none;
}

    .hero-content h1 {
        font-family: var(--font-heading);
        font-size: clamp(1.9rem, 5vw, 4rem);
        font-weight: 800;
        line-height: 1.08;
        letter-spacing: -1.5px;
        color: var(--white);
        margin-bottom: clamp(14px, 2.5vw, 28px);
        text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    }

    .hero-content > p {
        font-size: clamp(1rem, 2vw, 1.3rem);
        line-height: 1.8;
        color: var(--white);
        max-width: 540px;
        margin-bottom: clamp(28px, 4vw, 50px);
        text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
    }

/* ===== STATS ===== */

.stats {
    position: absolute;
    z-index: 3;
    right: clamp(20px, 5vw, 80px);
    bottom: clamp(20px, 5vw, 60px);
    display: flex;
    gap: clamp(12px, 2vw, 28px);
}

.stat {
    min-width: clamp(100px, 14vw, 180px);
    padding: clamp(14px, 2vw, 28px) clamp(16px, 2.5vw, 36px);
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    text-align: center;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    /* Do not fade/translate the KPI cards on first paint. Their staggered
       animation produced partially transparent numbers during refresh. */
    opacity: 1;
    transform: none;
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

    .stat:hover {
        background: rgba(255, 255, 255, 0.16);
        transform: translateY(-12px) scale(1.04);
        box-shadow: 0 20px 60px rgba(19, 179, 155, 0.35);
    }

    .stat h3 {
        font-size: clamp(1.3rem, 3.5vw, 2.4rem);
        font-weight: 900;
        color: var(--white);
        letter-spacing: -0.5px;
        margin-bottom: 4px;
    }

    .stat p {
        font-size: clamp(0.7rem, 1.4vw, 0.95rem);
        color: rgba(255, 255, 255, 0.88);
        font-weight: 600;
        line-height: 1.5;
    }

/* ===== АДАПТИВ ===== */

/* Планшет — stats уходят под контент */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: clamp(100px, 12vw, 140px) 24px clamp(40px, 6vw, 80px);
    }

    .hero-content {
        max-width: 90%;
    }

        .hero-content > p {
            max-width: 100%;
        }

    .stats {
        position: static;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: clamp(28px, 5vw, 48px);
        right: auto;
        bottom: auto;
    }

    .stat {
        flex: 0 1 calc(50% - 8px);
        min-width: 130px;
    }
}

/* Мобильный */
@media (max-width: 600px) {
    .stat {
        flex: 0 1 calc(50% - 6px);
    }
}

/* ===== ИСПРАВЛЕНИЕ ДЛЯ RTL (АРАБСКИЙ) =====
   justify-content: flex-start в .hero завязан на направление текста,
   поэтому при dir="rtl" контент (и кнопка "Записаться") уезжал вправо
   и прятался под .stats. Возвращаем его на физически левую сторону.
   Только для десктопа: на планшете/мобильном (до 1024px) .hero — колонка,
   и там justify-content отвечает за вертикальное позиционирование —
   без этого ограничения контент на арабском мобильном прижимался к
   низу экрана, оставляя пустое место сверху. */
@media (min-width: 1025px) {
    [dir="rtl"] .hero {
        justify-content: flex-end;
    }
}
