@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

#home {
    position: relative;
    min-height: clamp(360px, 70vh, 680px);
    min-height: clamp(360px, 70svh, 680px);
    overflow: hidden;
    --carousel-ink: #0b1324;
    --carousel-ink-soft: rgba(11, 19, 36, 0.6);
    --carousel-accent: #22c55e;
    --carousel-accent-cool: #38bdf8;
    background: radial-gradient(circle at 12% 20%, rgba(56, 189, 248, 0.18), transparent 55%),
        radial-gradient(circle at 85% 15%, rgba(34, 197, 94, 0.2), transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
}

.carousel-ambient {
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at 15% 30%, rgba(56, 189, 248, 0.35), transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(34, 197, 94, 0.3), transparent 40%),
        radial-gradient(circle at 70% 80%, rgba(94, 234, 212, 0.18), transparent 45%);
    mix-blend-mode: screen;
    opacity: 0;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    position: relative;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Основной контейнер карусели */
#carousel {
    position: relative;
    z-index: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
    cursor: grab;
}

#carousel::-webkit-scrollbar {
    display: none;
}

#carousel.is-dragging {
    cursor: grabbing;
}

.carousel-viewport {
    touch-action: pan-x pan-y;
}

/* Изображения карусели */
#carousel .carousel-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

#carousel .carousel-picture {
    display: block;
    width: 100%;
    height: 100%;
}

#carousel img {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease-out, filter 0.8s ease-out;
    filter: none;
    object-fit: cover;
    object-position: center;
    transform: none;
}

/* Эффект при смене слайда */
#carousel.transitioning img {
    transform: none;
}

/* Градиентный оверлей */
.carousel-overlay {
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        125deg,
        rgba(2, 6, 23, 0.65) 0%,
        rgba(15, 23, 42, 0.55) 30%,
        rgba(30, 41, 59, 0.45) 55%,
        rgba(2, 6, 23, 0.7) 100%
    );
    opacity: 0;
}

.carousel-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.06), transparent 60%);
}

/* Стильные кнопки навигации со стрелками */
#prev-btn, #next-btn {
    background: transparent;
    backdrop-filter: none;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prev-btn::after, #next-btn::after {
    content: none;
}

#prev-btn:hover, #next-btn:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.45);
}

#prev-btn:active, #next-btn:active {
    transform: translateY(0) scale(0.98);
}

#prev-btn i, #next-btn i {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    text-shadow: 0 2px 6px rgba(2, 6, 23, 0.45);
}

/* Стильные индикаторы (точки) */
.dot {
    width: 10px !important;
    height: 10px !important;
    background: transparent !important;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    backdrop-filter: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.dot:hover {
    transform: scale(1.25);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.25);
    border-color: rgba(255, 255, 255, 0.95);
}

.dot:hover::before {
    width: 4px;
    height: 4px;
}

.dot.active {
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.35);
    box-shadow: 
        0 10px 20px rgba(34, 197, 94, 0.35),
        0 0 0 4px rgba(56, 189, 248, 0.2);
}

.dot.active::before {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.95);
}

.hero-title {
    animation: slideInFromTop 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translateY(-60px) rotateX(90deg);
    transform-origin: center bottom;
    perspective: 1000px;
}

.hero-subtitle {
    animation: slideInFromTop 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
    opacity: 0;
    transform: translateY(-40px) rotateX(45deg);
    transform-origin: center bottom;
    perspective: 1000px;
}

@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-60px) rotateX(90deg);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-20px) rotateX(30deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Дополнительные эффекты для заголовка */
.hero-title {
    position: relative;
    z-index: 1;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.9) 20%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.9) 80%,
        transparent 100%
    );
    border-radius: 2px;
    animation: underlineGrow 1.5s ease-out 1s forwards;
    transform-origin: center;
    scale: 0 1;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes underlineGrow {
    to {
        scale: 1 1;
    }
}

.hero-subtitle {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.hero-panel {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: clamp(1.5rem, 3vw, 2.5rem);
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(18px);
    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.45),
        inset 0 0 30px rgba(255, 255, 255, 0.05);
}

.hero-content {
    transform: translateZ(0);
    will-change: transform;
}

.hero-title {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
    #prev-btn, #next-btn {
        width: 46px;
        height: 46px;
    }
    
    #prev-btn i, #next-btn i {
        font-size: 1.05rem;
    }
    
    .dot {
        width: 9px !important;
        height: 9px !important;
    }
    
    .dot.active {
        transform: scale(1.2);
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 100%;
    }

    .hero-panel {
        padding: 1.25rem 1.25rem 1.5rem;
        border-radius: 1.25rem;
    }
}

@media (max-width: 480px) {
    #prev-btn, #next-btn {
        width: 42px;
        height: 42px;
    }
    
    #prev-btn {
        left: 8px;
    }
    
    #next-btn {
        right: 8px;
    }
    
    #prev-btn i, #next-btn i {
        font-size: 0.95rem;
    }
    
    .dot {
        width: 8px !important;
        height: 8px !important;
        margin: 0 3px;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero-title::after {
        width: 60px;
        height: 2px;
        bottom: -6px;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        line-height: 1.4;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 100%;
    }

    .hero-panel {
        padding: 1rem;
        border-radius: 1rem;
    }
}

@media (min-width: 1024px) {
    #prev-btn, #next-btn {
        width: 56px;
        height: 56px;
    }
    
    #prev-btn i, #next-btn i {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 3.5rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
        line-height: 1.6;
    }
}

@media (min-width: 1280px) {
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.375rem;
    }
}

#carousel img {
    opacity: 0;
    animation: fadeInImage 0.8s ease-out forwards;
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

.glow-effect {
    box-shadow: 
        0 0 20px rgba(22, 163, 74, 0.3),
        0 0 40px rgba(22, 163, 74, 0.2),
        0 0 60px rgba(22, 163, 74, 0.1);
}

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: clamp(14px, 3vw, 28px);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(12px);
    max-width: calc(100% - 32px);
}

@media (max-width: 768px) {
    .carousel-dots {
        gap: 8px;
        padding: 8px 14px;
        bottom: 14px;
    }
}

#home:hover #carousel img {
    filter: brightness(1) contrast(1.05) saturate(1.08);
}

#prev-btn:focus, #next-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.5), 0 4px 15px rgba(0, 0, 0, 0.15);
}

.dot:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(135, 206, 235, 0.4),
        0 6px 16px rgba(135, 206, 235, 0.4);
    animation: dotFocusPulse 2s ease-in-out infinite;
}

@keyframes dotFocusPulse {
    0%, 100% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.4);
    }
}

@media (max-width: 640px) {
    #carousel {
        gap: 0;
    }

    #carousel .carousel-slide {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    #carousel .carousel-picture {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    #carousel img {
        transition: none;
        animation: none;
        filter: none;
        transform: none;
        opacity: 1;
    }

    #home:hover #carousel img {
        filter: none;
    }

    .carousel-ambient,
    .carousel-overlay,
    #home::before,
    .slide-transition::after {
        display: none;
    }

    #prev-btn,
    #next-btn {
        box-shadow: none;
        filter: none;
        border-color: rgba(255, 255, 255, 0.5);
        transition: none;
    }

    #prev-btn:hover,
    #next-btn:hover {
        box-shadow: none;
        filter: none;
        transform: none;
    }

    .carousel-dots {
        animation: none;
        background: rgba(15, 23, 42, 0.45);
        border-color: rgba(255, 255, 255, 0.25);
        box-shadow: none;
        backdrop-filter: none;
    }

    .dot,
    .dot.active {
        transition: none;
        box-shadow: none;
        transform: none;
    }

    .dot::before {
        display: none;
    }

    .hero-title,
    .hero-subtitle {
        animation: none;
        opacity: 1;
        transform: none;
        text-shadow: none;
        white-space: normal !important;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: auto;
        text-align: left;
        margin-left: 0;
        margin-right: 0;
        width: auto;
        max-width: 100%;
    }

    .hero-title {
        font-size: clamp(1.15rem, 5.2vw, 1.7rem) !important;
        line-height: 1.1;
        display: block;
        overflow: visible;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3.6vw, 1.05rem) !important;
        line-height: 1.45;
        display: block;
        overflow: visible;
    }

    .hero-title::after {
        display: none;
    }
}

.hero-section {
    position: relative;
    height: clamp(360px, 70vh, 680px);
    height: clamp(360px, 70svh, 680px);
    min-height: clamp(360px, 70vh, 680px);
    min-height: clamp(360px, 70svh, 680px);
    overflow: hidden;
    --hero-nav-offset: 88px;
    margin-top: calc(var(--hero-nav-offset) * -1);
    padding-top: 0;
    padding-bottom: 0;
}

.hero-swiper {
    width: 100%;
    height: 100%;
}

.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide {
    height: 100%;
}

.hero-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.hero-slide picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: none;
    background-color: #ffffff;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.2));
    pointer-events: none;
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    z-index: 2;
}

.hero-content-inner {
    width: min(1200px, 92vw);
    margin: 0 auto;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: clamp(1rem, 4vw, 3rem);
    height: 100%;
    padding-top: calc(clamp(2rem, 6vw, 4rem) + var(--hero-nav-offset));
    padding-bottom: clamp(1.5rem, 6vw, 3.5rem);
}

.hero-subtitle {
    margin-top: 0.75rem;
    max-width: 640px;
    margin-left: auto;
}

.hero-actions {
    position: absolute;
    left: 0;
    bottom: clamp(1.5rem, 6vw, 3.5rem);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-btn.primary {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.3);
}

.hero-btn.secondary {
    background: #16a34a;
    border: none;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.3);
}

.hero-btn:hover {
    transform: translateY(-2px);
}

.hero-btn.primary:hover,
.hero-btn.secondary:hover {
    background: #15803d;
}

.hero-text {
    justify-self: start;
    align-self: center;
    text-align: left;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    grid-column: 2;
    grid-row: 1;
}

.hero-title,
.hero-subtitle {
    font-family: 'Montserrat', sans-serif;
}

.hero-title {
    font-weight: 700;
    font-size: clamp(1.9rem, 3vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    max-width: min(720px, calc(var(--hero-title-width, var(--hero-text-width, 55)) * 1%));
    white-space: normal;
}

.hero-subtitle {
    font-weight: 500;
    margin-left: 0;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    line-height: 1.6;
    max-width: min(720px, calc(var(--hero-desc-width, var(--hero-text-width, 55)) * 1%));
    white-space: normal;
}

.hero-slide[data-theme="light"] .hero-title,
.hero-slide[data-theme="light"] .hero-subtitle {
    color: #0f172a;
    text-shadow: none;
}

.hero-overlay {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.08));
}

.hero-slide[data-theme="light"] .hero-overlay {
    background: transparent;
}

#home::before {
    display: none;
}

.hero-slide[data-theme="light"] .hero-btn.secondary {
    background: #16a34a;
    color: #ffffff;
}

.hero-slide[data-theme="light"] .hero-btn.primary {
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.25);
}

@media (max-width: 900px) {
    .hero-content {
        align-items: flex-end;
        padding-bottom: 2rem;
    }

    .hero-content-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        text-align: left;
    }

    .hero-text {
        justify-self: start;
        text-align: left;
        grid-column: auto;
        max-width: 100%;
    }

    .hero-subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 100%;
    }

    .hero-actions {
        justify-content: flex-start;
        align-self: flex-start;
        margin-top: 1.5rem;
        position: static;
        width: 100%;
        bottom: 1.25rem;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    #home.hero-section {
        height: clamp(180px, 55svh, 340px);
        min-height: clamp(180px, 55svh, 340px);
    }

    .hero-section {
        --hero-nav-offset: 72px;
        margin-top: calc(var(--hero-nav-offset) * -1);
        padding-bottom: 0;
    }

    .hero-text {
        order: 1;
        width: min(42vw, 15rem);
        max-width: min(42vw, 15rem);
        margin-bottom: 0.55rem;
        text-align: left;
        align-items: flex-start;
        margin-left: 0;
        margin-right: auto;
    }

    .hero-content {
        align-items: stretch;
    }

    .hero-content-inner {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 0.25rem;
        height: 100%;
        padding-top: calc(var(--hero-nav-offset) + 0.45rem);
        padding-bottom: 0.75rem;
    }

    .hero-title {
        max-width: 100%;
        text-align: left;
        white-space: normal;
    }

    .hero-subtitle {
        max-width: 100%;
        text-align: left;
        white-space: normal;
        margin-top: 0.5rem;
    }
    
    .hero-actions {
        display: none !important;
    }

    .hero-btn {
        width: 100%;
        min-height: 44px;
        padding: 0.65rem 0.9rem;
        font-size: 0.9rem;
        text-align: center;
    }
}

.hero-section .swiper-lazy-preloader {
    display: none;
}

.swiper-button-prev,
.swiper-button-next {
    color: #ffffff;
}

.hero-slide[data-theme="light"] .swiper-button-prev,
.hero-slide[data-theme="light"] .swiper-button-next {
    color: #0f172a;
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: #22c55e;
}

.hero-slide-content {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
}

.hero-layout {
    width: min(1200px, 92vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
}

.hero-text {
    color: #fff;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(22, 163, 74, 0.4);
}

.hero-media {
    display: flex;
    justify-content: center;
}

.hero-media img {
    width: min(520px, 88%);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(2, 6, 23, 0.4));
}

@media (max-width: 900px) {
    .hero-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-media {
        order: -1;
    }

    .hero-cta {
        justify-content: center;
    }
}
