/* =================================================
   HERO SECTION – ПОЛНОСТЬЮ ОПТИМИЗИРОВАННЫЙ
   ================================================= */

/* ------------------------------------------------
   1. ПЕРЕМЕННЫЕ
------------------------------------------------ */
:root {
    --hero-padding-top: clamp(60px, 10vh, 120px);
    --hero-padding-bottom: clamp(30px, 5vh, 80px);
    --hero-margin-bottom: clamp(30px, 6vh, 100px);
}

/* ------------------------------------------------
   2. ОСНОВНЫЕ СТИЛИ (тёмная тема по умолчанию)
------------------------------------------------ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--hero-padding-top) 0 var(--hero-padding-bottom);
    text-align: center;
    width: 100%;
    margin: 0 0 var(--hero-margin-bottom) 0;
    isolation: isolate;
}

/* Обёртка для фона */
.hero-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-bg-wrapper picture,
.hero-bg-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
}

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

/* Fallback */
.hero-bg-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: -1;
}

/* Оверлей (тёмная тема) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 13, 13, 0.85) 0%, rgba(26, 26, 26, 0.8) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Контент */
.hero_content {
    position: relative;
    z-index: 2;
    max-width: min(1400px, 95%);
    width: 100%;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

.head {
    margin-bottom: clamp(24px, 5vh, 50px);
}

.title {
    font-size: clamp(28px, 6vw, 56px);
    margin-bottom: clamp(12px, 2vh, 20px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: white;
}

.title_line {
    display: block;
}

.title_highlight {
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}

.title_highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    border-radius: 2px;
    transform: scaleX(0.7);
    transition: transform 0.3s ease;
}

.hero:hover .title_highlight::after {
    transform: scaleX(1);
}

.subtitle {
    font-size: clamp(14px, 2.5vw, 20px);
    max-width: min(800px, 95%);
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.6;
    color: white;
}

.subtitle_highlight {
    font-weight: 600;
    color: var(--accent-light);
}

/* ------------------------------------------------
   3. КАРТОЧКИ
------------------------------------------------ */
.grid_container {
    display: grid;
    gap: clamp(16px, 2vw, 24px);
    margin-bottom: clamp(32px, 5vh, 60px);
}

@media (min-width: 1200px) {
    .grid_container {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .grid_container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .grid_container {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: clamp(20px, 4vw, 28px);
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-8px);
        border-color: var(--accent-color);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        background: rgba(255, 255, 255, 0.08);
    }
}

.card .icons {
    font-size: clamp(28px, 5vw, 40px);
    color: var(--accent-color);
    margin-bottom: clamp(12px, 2vh, 20px);
    display: inline-block;
}

.card h3 {
    font-size: clamp(16px, 2.5vw, 18px);
    margin-bottom: 8px;
    font-weight: 600;
    color: white;
}

.card p {
    font-size: clamp(12px, 2vw, 14px);
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
    color: white;
}

/* ------------------------------------------------
   4. БЛОК ДОВЕРИЯ
------------------------------------------------ */
.trust {
    display: grid;
    gap: clamp(16px, 3vw, 24px);
    margin-bottom: 32px;
    padding: clamp(20px, 4vw, 32px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 992px) {
    .trust {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .trust {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 575px) {
    .trust {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

.trust_item {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (min-width: 576px) and (max-width: 991px) {
    .trust_item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

@media (max-width: 575px) {
    .trust_item {
        flex-direction: row;
        text-align: left;
        gap: 16px;
        justify-content: flex-start;
    }
}

.trust_icon {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(16px, 3vw, 20px);
    color: white;
    flex-shrink: 0;
}

.trust_info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (min-width: 576px) and (max-width: 991px) {
    .trust_info {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .trust_info {
        align-items: flex-start;
        text-align: left;
    }
}

.trust_number {
    font-size: clamp(20px, 5vw, 28px);
    font-weight: 800;
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.trust_label {
    font-size: clamp(11px, 2.5vw, 14px);
    opacity: 0.8;
    font-weight: 500;
    color: white;
}

/* ------------------------------------------------
   5. СКРОЛЛ ИНДИКАТОР
------------------------------------------------ */
.scroll_link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.scroll_indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-top: clamp(30px, 5vh, 60px);
    transition: opacity 0.3s ease;
}

.scroll_indicator:hover {
    opacity: 0.8;
}

.scroll_arrow {
    display: flex;
    flex-direction: column;
    gap: 5px;
    animation: bounce 2s ease-in-out infinite;
}

.icons2 {
    font-size: 20px;
    opacity: 0.8;
    color: var(--accent-color);
}

.scroll_text {
    font-size: clamp(12px, 2vw, 14px);
    opacity: 0.8;
    letter-spacing: 0.5px;
    color: white;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-12px);
    }

    60% {
        transform: translateY(-6px);
    }
}

/* ------------------------------------------------
   6. СВЕТЛАЯ ТЕМА
------------------------------------------------ */
[data-theme="light"] .hero {
    color: var(--text-color);
}

[data-theme="light"] .title {
    color: var(--text-color);
}

[data-theme="light"] .subtitle {
    color: var(--text-secondary);
}

[data-theme="light"] .subtitle_highlight {
    color: var(--accent-color);
}

[data-theme="light"] .hero-overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(245, 245, 245, 0.8) 100%);
}

[data-theme="light"] .hero-bg-wrapper::after {
    background: linear-gradient(135deg, #e8e8e8 0%, #d4d4d4 100%);
}

[data-theme="light"] .card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card h3 {
    color: var(--text-color);
}

[data-theme="light"] .card p {
    color: var(--text-secondary);
}

[data-theme="light"] .trust {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .trust_label {
    color: var(--text-secondary);
}

[data-theme="light"] .trust_icon {
    background: linear-gradient(45deg, var(--accent-color), var(--accent-light));
    color: white;
}

[data-theme="light"] .scroll_text {
    color: var(--text-secondary);
}

[data-theme="light"] .icons2 {
    color: var(--accent-color);
}

/* ------------------------------------------------
   7. МОБИЛЬНАЯ АДАПТАЦИЯ
------------------------------------------------ */
@media (max-width: 991px) {
    .hero {
        min-height: auto;
        padding: 60px 0 40px;
    }

    .title {
        letter-spacing: -0.01em;
    }

    .subtitle {
        padding: 0 20px;
    }
}

@media (max-width: 767px) {
    .hero {
        padding: 50px 0 30px;
        margin-bottom: 40px;
    }

    .hero_content {
        padding: 0 20px;
    }

    .title {
        font-size: 32px;
        line-height: 1.3;
    }

    .title_highlight::after {
        bottom: -3px;
        height: 2px;
    }

    .subtitle {
        font-size: 14px;
        line-height: 1.5;
        padding: 0;
    }

    .card {
        padding: 20px;
    }

    .card .icons {
        font-size: 32px;
        margin-bottom: 12px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 12px;
    }

    .trust {
        padding: 20px;
    }

    .trust_item {
        gap: 14px;
    }

    .trust_icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .trust_number {
        font-size: 24px;
    }

    .trust_label {
        font-size: 12px;
    }

    .scroll_text {
        max-width: 220px;
        white-space: normal;
        text-align: center;
        font-size: 11px;
    }

    .scroll_arrow .icons2 {
        font-size: 16px;
    }

    .hero-bg-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .hero-background-img {
        object-fit: cover;
        object-position: center 30%;
        min-height: 100%;
        min-width: 100%;
    }

    .hero-bg-wrapper::after {
        background: linear-gradient(135deg, #0a0a0a 0%, #1f1f1f 100%);
    }

    [data-theme="light"] .hero-bg-wrapper::after {
        background: linear-gradient(135deg, #e0e0e0 0%, #cccccc 100%);
    }
}

@media (max-width: 575px) {
    .hero {
        padding: 40px 0 25px;
        margin-bottom: 30px;
    }

    .hero_content {
        padding: 0 16px;
    }

    .title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .subtitle {
        font-size: 13px;
    }

    .grid_container {
        gap: 14px;
        max-width: 100%;
    }

    .card {
        padding: 18px;
    }

    .card .icons {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .card h3 {
        font-size: 15px;
    }

    .card p {
        font-size: 11px;
    }

    .trust {
        padding: 16px;
        gap: 16px;
    }

    .trust_item {
        gap: 12px;
    }

    .trust_icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .trust_number {
        font-size: 22px;
    }

    .trust_label {
        font-size: 11px;
    }

    .scroll_indicator {
        margin-top: 25px;
        gap: 8px;
    }

    .scroll_text {
        font-size: 10px;
        max-width: 180px;
    }

    .hero-bg-wrapper {
        background: linear-gradient(135deg, #0a0a0a 0%, #1f1f1f 100%);
    }

    .hero-background-img {
        opacity: 0.9;
    }

    [data-theme="light"] .hero-bg-wrapper {
        background: linear-gradient(135deg, #e0e0e0 0%, #cccccc 100%);
    }
}

@media (max-width: 374px) {
    .hero {
        padding: 30px 0 20px;
    }

    .title {
        font-size: 24px;
    }

    .subtitle {
        font-size: 12px;
    }

    .card {
        padding: 15px;
    }

    .card .icons {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .card h3 {
        font-size: 14px;
    }

    .card p {
        font-size: 10px;
    }

    .trust_icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .trust_number {
        font-size: 20px;
    }

    .trust_label {
        font-size: 10px;
    }

    .scroll_text {
        font-size: 9px;
        max-width: 160px;
    }
}

/* ------------------------------------------------
   8. ОПТИМИЗАЦИЯ
------------------------------------------------ */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .hero-background-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

@media (prefers-reduced-motion: reduce) {

    .card,
    .scroll_arrow,
    .title_highlight::after {
        transition: none;
    }

    .scroll_arrow {
        animation: none;
    }

    .card:hover {
        transform: none;
    }
}

/* ------------------------------------------------
   9. ПЕЧАТЬ
------------------------------------------------ */
@media print {
    .hero {
        min-height: auto;
        padding: 20px 0;
        color: black;
    }

    .hero-bg-wrapper,
    .hero-overlay,
    .scroll_indicator {
        display: none;
    }

    .hero_content {
        position: static;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ccc;
        background: white;
    }

    .card h3,
    .card p,
    .title,
    .subtitle {
        color: black !important;
    }
}