/*
 * YVI SWEETS — единый стиль сайта
 * Подключение на любой странице (путь поправьте под папку):
 *   <link rel="stylesheet" href="common-styles.css">
 * Внутри уже есть @import «yvi-theme.css» (изумруд · светлая лаванда · золото).
 * Главную при желании дублируйте: <link rel="stylesheet" href="yvi-theme.css">
 */
@import url('yvi-theme.css');
@import url('yvi-performance.css');
@import url('yvi-masterclass-popup.css?v=20260717b');

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Parisienne&family=Cinzel:wght@400;500;600;700&display=swap');

* {
    font-family: 'Lora', serif;
    color: #f5e6d3;
}

h1 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #6fd48a;
    text-shadow:
        0 1px 0 rgba(12, 40, 28, 0.75),
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 24px rgba(80, 180, 120, 0.28);
    filter: none;
}

h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #f5e6d3;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.48),
        0 0 26px rgba(200, 185, 235, 0.22),
        0 0 22px rgba(50, 120, 98, 0.1);
    filter: none;
}

p, span, div, li, a {
    font-family: 'Lora', serif;
    font-weight: 400;
    line-height: 1.7;
    color: #f5e6d3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
    filter: none;
}

a {
    color: #f5e6d3;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42);
    filter: none;
}

a:hover {
    color: #f0dcb8;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.5),
        0 0 22px rgba(212, 176, 90, 0.4),
        0 0 28px rgba(210, 200, 245, 0.28);
    filter: none;
}

/* Фон задаётся в yvi-theme.css (изумруд / лаванда / золото) — не переопределять здесь */

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Свет: золото · светлая лаванда · изумруд */
html::before, body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 16% 26%, rgba(212, 176, 90, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 84% 72%, rgba(230, 215, 250, 0.2) 0%, transparent 52%),
        radial-gradient(circle at 48% 44%, rgba(130, 100, 175, 0.1) 0%, transparent 56%),
        radial-gradient(circle at 50% 6%, rgba(255, 252, 245, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 42% 88%, rgba(24, 95, 75, 0.2) 0%, transparent 48%),
        radial-gradient(circle at 72% 18%, rgba(50, 130, 105, 0.12) 0%, transparent 46%);
    pointer-events: none;
    z-index: 0;
    animation: gentleGlow 14s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 22% 35%, rgba(220, 190, 110, 0.48), transparent),
        radial-gradient(2px 2px at 58% 68%, rgba(215, 200, 245, 0.45), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 250, 240, 0.3), transparent),
        radial-gradient(1px 1px at 78% 22%, rgba(212, 176, 90, 0.42), transparent),
        radial-gradient(2px 2px at 88% 78%, rgba(190, 170, 225, 0.35), transparent),
        radial-gradient(1px 1px at 32% 82%, rgba(60, 150, 120, 0.38), transparent);
    background-size: 200% 200%;
    background-position: 50% 50%;
    /* Только opacity-анимация (дёшево для GPU). Анимацию background-position
       (gentleMove) убрали — она заставляла перерисовывать весь экран. */
    animation: twinkle 9s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.52;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes gentleMove {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

@keyframes gentleGlow {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Отключаем лишний html::after; body::after оставляем для искр */
html::after {
    display: none !important;
    content: none !important;
}

/* Фоновая музыка */
.background-music {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(36, 28, 52, 0.45);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 50px;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.music-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8e24aa 0%, #ab47bc 100%);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 36, 170, 0.4);
}

.music-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(142, 36, 170, 0.6);
}

.music-volume-control {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.music-volume-slider {
    width: 60%;
    height: 100%;
    background: linear-gradient(135deg, #8e24aa 0%, #ab47bc 100%);
    border-radius: 2px;
    transition: width 0.2s ease;
}

@media (max-width: 768px) {
    .background-music {
        bottom: 70px;
        left: 10px;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .music-control-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .music-volume-control {
        width: 70px;
    }
}


@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Оптимизация производительности */
* {
    will-change: auto;
}

/* Оптимизация изображений */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Оптимизация рендеринга */
body::before,
body::after {
    will-change: opacity;
    transform: translateZ(0); /* Аппаратное ускорение */
}

/* Оптимизация анимаций для лучшей производительности */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* На мобильных слегка снижаем радиус backdrop-filter (с 20px): при прокрутке
   он пересчитывается на каждом кадре. blur(12px) сохраняет насыщенный
   «стеклянный» премиум-вид, но заметно дешевле. !important перекрывает
   и инлайновые стили. */
@media (max-width: 768px) {
    .navbar,
    .nav-btn,
    .card,
    .content-card,
    .background-music,
    .back-button,
    .home-button,
    #main-nav a,
    [style*="backdrop-filter"] {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Оптимизация для плавности прокрутки — см. html выше */

.main-content {
    position: relative;
    z-index: 1;
    padding: 20px 15px;
}

/* Компактные отступы */
.navbar {
    padding: 15px 20px !important;
    margin-bottom: 20px !important;
}

.hero-main {
    padding: 60px 20px 40px !important;
    margin: 20px auto !important;
}

/* Навигационные кнопки */
.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: rgba(36, 28, 52, 0.78);
    border: 1px solid rgba(201, 168, 76, 0.22);
    border-radius: 20px;
    text-decoration: none;
    color: #f5e6d3;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28), 0 0 18px rgba(148, 124, 180, 0.15);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.nav-btn:hover::before {
    width: 300px;
    height: 300px;
}

.nav-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(48, 38, 72, 0.55);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35), 0 0 28px rgba(201, 168, 76, 0.2);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(58, 48, 78, 0.75) 0%, rgba(30, 70, 58, 0.55) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 26px rgba(148, 124, 180, 0.25);
}

.nav-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.nav-btn:hover .nav-icon {
    transform: scale(1.2) rotate(5deg);
}

.nav-text {
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Мобильная адаптация для всех размеров экранов */

/* Очень маленькие телефоны (320px - 374px) */
@media (max-width: 374px) {
    .nav-buttons {
        gap: 8px;
        margin: 15px 0;
    }
    .nav-btn {
        padding: 12px 15px;
        min-width: 90px;
        font-size: 0.75rem;
    }
    .nav-icon {
        font-size: 1.5rem;
    }
    .nav-text {
        font-size: 0.7rem;
    }
    
    .helper-character {
        width: 70px;
        height: 70px;
        bottom: 80px;
        right: 10px;
    }
    
    .helper-bubble {
        bottom: 95px;
        right: -10px;
        padding: 12px 16px;
        max-width: 200px;
        font-size: 0.75rem;
    }
    
    .scroll-to-top {
        bottom: 150px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .card, .content-card {
        padding: 15px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
}

/* Маленькие телефоны (375px - 413px) */
@media (min-width: 375px) and (max-width: 413px) {
    .nav-buttons {
        gap: 10px;
        margin: 20px 0;
    }
    .nav-btn {
        padding: 14px 18px;
        min-width: 100px;
        font-size: 0.85rem;
    }
    .nav-icon {
        font-size: 1.8rem;
    }
    
    .helper-character {
        width: 80px;
        height: 80px;
        bottom: 90px;
        right: 15px;
    }
    
    .helper-bubble {
        bottom: 105px;
        right: -5px;
        padding: 16px 20px;
        max-width: 240px;
    }
    
    .scroll-to-top {
        bottom: 160px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Средние телефоны (414px - 767px) */
@media (min-width: 414px) and (max-width: 767px) {
    .nav-buttons {
        gap: 12px;
        margin: 25px 0;
    }
    .nav-btn {
        padding: 15px 20px;
        min-width: 110px;
        font-size: 0.9rem;
    }
    .nav-icon {
        font-size: 2rem;
    }
    
    .helper-character {
        width: 90px;
        height: 90px;
        bottom: 95px;
        right: 18px;
    }
    
    .helper-bubble {
        bottom: 110px;
        right: 0;
        max-width: 260px;
    }
}

/* Планшеты и маленькие экраны (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .nav-buttons {
        gap: 15px;
    }
    .nav-btn {
        min-width: 120px;
        font-size: 0.95rem;
    }
}

/* Для всех мобильных устройств (до 768px) */
@media (max-width: 768px) {
    .nav-buttons {
        gap: 12px;
        margin: 20px 0;
    }
    .nav-btn {
        padding: 15px 20px;
        min-width: 110px;
        font-size: 0.9rem;
    }
    .nav-icon {
        font-size: 2rem;
    }
    
    body {
        padding: 10px;
    }
    
    .main-content {
        padding: 0 10px;
    }
    
    .card, .content-card {
        padding: 20px;
        margin: 15px 10px;
    }
    
    h1 {
        font-size: 2rem !important;
        margin-bottom: 15px !important;
    }
    
    h2 {
        font-size: 1.6rem !important;
        margin-bottom: 12px !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .helper-character {
        width: 80px;
        height: 80px;
        bottom: 90px;
        right: 15px;
    }
    
    .helper-bubble {
        bottom: 105px;
        right: -5px;
        padding: 16px 20px;
        max-width: 240px;
        font-size: 0.85rem;
    }
    
    .helper-bubble p {
        font-size: 0.8rem !important;
    }
    
    .scroll-to-top {
        bottom: 160px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Анимация котов и цветов убрана */
.helper-character {
    display: none !important;
}

.helper-bubble {
    display: none !important;
}

/* Кнопка "Наверх" */
.scroll-to-top {
    position: fixed;
    bottom: 180px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, #3a3048 0%, #2a4a40 48%, #c9a84c 100%);
    color: #140c18;
    border: 1px solid rgba(201, 168, 76, 0.45);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 98;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 22px rgba(201, 168, 76, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 32px rgba(148, 124, 180, 0.3);
    background: linear-gradient(145deg, #4a4060 0%, #1e5545 50%, #dfc07a 100%);
    color: #faf7f1;
}

/* Элегантные карточки — стекло, изумруд и лаванда */
.card, .content-card {
    background: rgba(36, 28, 52, 0.42) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 168, 76, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 
                0 0 28px rgba(148, 124, 180, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 15px;
}

.card:hover, .content-card:hover {
    background: rgba(42, 34, 62, 0.52) !important;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.52), 
                0 0 36px rgba(201, 168, 76, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card h2, .content-card h2 {
    color: #f5e6d3 !important;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 24px rgba(148, 124, 180, 0.18) !important;
    font-family: 'Cormorant Garamond', serif;
    filter: none;
}

.card h3, .content-card h3 {
    color: #f5e6d3 !important;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.48),
        0 0 20px rgba(124, 107, 154, 0.16) !important;
    font-family: 'Cormorant Garamond', serif;
    filter: none;
}

.card p, .content-card p {
    color: #f5e6d3 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42) !important;
    filter: none;
}

.card a, .content-card a {
    color: #f5e6d3 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.42) !important;
    filter: none;
}

.card a:hover, .content-card a:hover {
    color: #e8d4a8 !important;
    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(201, 168, 76, 0.35) !important;
    filter: none;
}

/* Плавающие кнопки мессенджеров */
.floating-messengers {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-messengers a {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    text-align: center;
    line-height: 56px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(147, 51, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-messengers a:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 30px rgba(147, 51, 234, 0.6);
}

/* Мобильная адаптация для плавающих кнопок */
@media (max-width: 374px) {
    .floating-messengers {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .floating-messengers a {
        width: 45px;
        height: 45px;
        font-size: 18px;
        line-height: 45px;
    }
    
    .scroll-to-top {
        bottom: 120px;
    }
    
    .helper-character {
        bottom: 70px;
    }
}

@media (min-width: 375px) and (max-width: 413px) {
    .floating-messengers {
        bottom: 12px;
        right: 12px;
        gap: 9px;
    }
    
    .floating-messengers a {
        width: 50px;
        height: 50px;
        font-size: 20px;
        line-height: 50px;
    }
    
    .scroll-to-top {
        bottom: 140px;
    }
    
    .helper-character {
        bottom: 80px;
    }
}

@media (min-width: 414px) and (max-width: 767px) {
    .floating-messengers {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-messengers a {
        width: 52px;
        height: 52px;
        font-size: 22px;
        line-height: 52px;
    }
    
    .scroll-to-top {
        bottom: 150px;
    }
}

@media (max-width: 768px) {
    .floating-messengers {
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .floating-messengers a {
        width: 50px;
        height: 50px;
        font-size: 20px;
        line-height: 50px;
    }
    
    .scroll-to-top {
        bottom: 140px;
    }
    
    .helper-character {
        bottom: 80px;
    }
}
