/* Переменные и базовые настройки */
:root {
    --hero-bg: #5e5e5e;
    --hero-bg-light: #7c7c7c;
    --line-color: rgba(255, 255, 255, .40);
    --line-color-light: rgba(0, 0, 0, .18);
    --line-w: 1.5px;
    --frame-radius: 22px;
    --frame-pad: 1.5px;
    --frame-border: var(--line-w);
    --frame-maxw: 600px;

    /* Переменные для адаптивности */
    --header-height: 60px;
    --mobile-menu-height: 250px;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 640px) {
    :root {
        --frame-radius: 16px;
        --frame-maxw: 320px;
    }
}

/* Фоны и цвета */
.hero-bg {
    background: linear-gradient(90deg, var(--hero-bg-light) 0%, var(--hero-bg) 55%);
}

.services-bg {
    background-color: var(--hero-bg);
}

/* Границы и панели */
.ui-border-b {
    border-bottom: var(--line-w) solid var(--line-color);
}

.ui-panel {
    border: var(--line-w) solid var(--line-color);
}

.ui-panel-light {
    border: var(--line-w) solid var(--line-color-light);
}

.icon-stroke {
    stroke-width: var(--line-w);
    stroke: currentColor;
}

/* Фото и рамки */
.photo-frame {
    box-sizing: content-box;
    border: var(--frame-border) solid var(--line-color);
    border-radius: var(--frame-radius);
    padding: var(--frame-pad);
    background: transparent;
    overflow: hidden;
    max-width: var(--frame-maxw);
}

.photo-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: inherit;
}

.mirror-x {
    transform: scaleX(-1);
    transform-origin: center;
}

/* Сетка и заголовки */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 200px;
    align-items: start;
}

.h1-wrap {
    width: 100%;
}

.h1-line {
    display: block;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.02;
    color: #fff;
}

.h1-left {
    text-align: left;
}

.h1-right {
    text-align: right;
}

/* Карточки и эффекты */
.card-hover {
    position: relative;
    border: var(--line-w) solid var(--line-color-light);
    background: rgba(255,255,255,.80);
    border-radius: 1rem;
    transition:
            transform .35s ease,
            border-color .35s ease,
            background-color .35s ease,
            box-shadow .35s ease,
            color .35s ease;
    will-change: transform, box-shadow;
}

.card-hover:hover {
    transform: translateY(-4px);
    border-color: var(--line-color);
    background: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

/* Эффекты для карточек */
.card-reveal {
    opacity: .0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease, color .35s ease;
}
.card-hover:hover .card-reveal {
    opacity: 1;
    transform: translateY(0);
}

.card-cta {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .35s ease, transform .35s ease;
}
.card-hover:hover .card-cta {
    opacity: 1;
    transform: translateX(0);
}

.card-hover::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(180px 120px at 80% -20%, rgba(255,255,255,.20), transparent 60%);
    opacity: 0;
    transition: opacity .35s ease;
}
.card-hover:hover::after { opacity: 1; }

/* Контент и адаптивность */
.hero-content {
    min-height: auto;
    padding-bottom: 40px;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .h1-line {
        font-size: clamp(32px, 8vw, 42px);
        text-align: center !important;
    }

    .h1-left, .h1-right {
        text-align: center;
    }

    .min-h-mobile {
        min-height: auto;
        padding: 40px 0;
    }
}

/* Мобильное меню */
#mobileMenu {
    transition: max-height 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

#mobileMenu.open {
    max-height: 300px;
}

/* Отключение анимации карточек на мобильных */
@media (max-width: 768px) {
    /* Отключаем эффекты наведения для карточек */
    .card-hover:hover {
        transform: none;
        border-color: var(--line-color-light);
        background: rgba(255,255,255,.80);
        box-shadow: none;
    }

    /* Сразу показываем скрытый контент без анимации */
    .card-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    /* Сразу показываем стрелку без анимации */
    .card-cta {
        opacity: 1;
        transform: none;
        transition: none;
    }

    /* Отключаем эффект "глянца" */
    .card-hover::after {
        display: none;
    }
}

/* Стили для карусели в блоке "Подход и образование" */
.edu-carousel {
    width: 100%;
    margin: 0 auto;
}

.edu-slider {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.edu-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.edu-slide {
    min-width: 100%;
}

.carousel-nav {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-nav:hover {
    opacity: 1;
}

.indicator-active {
    width: 12px;
    transition: width 0.3s ease;
}

/* Стили для модального окна */
#imageModal {
    transition: opacity 0.3s ease;
}

#modalImage {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.main {
    opacity: 1;
    visibility: visible;
}

.main._hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}