:root {
    --gold: #d4af37;
    --gold-br: #ffed8a;
    --gold-dr: #7a5d0b;
    --bg: #050507;
    --bg-sec: rgba(10, 10, 14, .85);
    --txt: #b1b1b1;
    --tr: all 0.8s cubic-bezier(.23, 1, .32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body, html {
    background: var(--bg);
    color: var(--txt);
    font-family: 'Lora', serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

@media (hover: hover) and (pointer: fine) {
    * { cursor: none !important; }
    #cursor, #cursor-f { display: block; }
}

@media (hover: none) or (pointer: coarse) {
    * { cursor: auto !important; }
    #cursor, #cursor-f { display: none !important; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-dr); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

body::after {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url(../image/stardust.png);
    opacity: .15; pointer-events: none; z-index: 9999;
}

.vignette {
    position: fixed; inset: 0;
    background: radial-gradient(circle, transparent 10%, rgba(0, 0, 0, .85) 100%);
    pointer-events: none; z-index: 998;
}

.embers-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1; overflow: hidden;
}

.ember {
    position: absolute; background: var(--gold); border-radius: 50%;
    opacity: 0; filter: blur(1px); animation: floatUp var(--duration) ease-in-out infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(.5); opacity: 0; }
    25% { opacity: .8; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

#cursor, #cursor-f {
    position: fixed; border-radius: 50%; pointer-events: none;
    transform: translate(-50%, -50%); z-index: 10000; will-change: left, top;
}
#cursor {
    width: 30px; height: 30px; border: 1px solid rgba(212, 175, 55, .5);
    transition: transform 0.15s, width 0.3s, height 0.3s, background 0.3s;
}
#cursor-f {
    width: 6px; height: 6px; background: var(--gold);
    box-shadow: 0 0 10px var(--gold); transition: width 0.3s, height 0.3s;
}

h1, h2, h3, h4 { font-family: 'Cinzel', serif; font-weight: 400; margin: 0; }

.section-tag {
    font-family: 'Montserrat'; font-size: .7rem; letter-spacing: 6px;
    color: var(--gold-dr); text-transform: uppercase; margin-bottom: 20px;
    display: block; text-align: center;
}

.section-title {
    font-size: clamp(2rem, 5vw, 4rem); color: #fff; text-align: center;
    margin-bottom: 60px; text-transform: uppercase; letter-spacing: 4px;
    position: relative; z-index: 5;
}
.section-title span { color: var(--gold); }

.beta-badge {
    font-family: 'Montserrat'; font-size: .6rem; font-weight: 800;
    background: rgba(212, 175, 55, .15); border: 1px solid var(--gold);
    color: var(--gold); padding: 3px 8px; border-radius: 3px;
    vertical-align: top; margin-left: 10px; letter-spacing: 2px;
    text-shadow: none; display: inline-block;
}

nav {
    position: fixed; top: 0; width: 100%; padding: 25px 60px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; transition: background 0.5s; border-bottom: 1px solid transparent;
}
nav.scrolled {
    background: rgba(5, 5, 7, .95); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, .1); padding: 15px 60px;
}

.logo {
    font-family: 'Cinzel'; color: var(--gold); font-size: 1.8rem;
    font-weight: 900; letter-spacing: 6px; text-shadow: 0 0 20px rgba(212, 175, 55, .3);
    display: flex; align-items: center;
}

.nav-links a {
    color: #fff; text-decoration: none; margin-left: 40px; font-size: .7rem;
    font-family: 'Montserrat'; letter-spacing: 3px; text-transform: uppercase;
    transition: 0.4s; opacity: .6; font-weight: 600;
}
.nav-links a:hover { opacity: 1; color: var(--gold); text-shadow: 0 0 10px var(--gold); }

.hero {
    min-height: 100svh; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.video-bg {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%; width: auto; height: auto;
    object-fit: cover; filter: brightness(.3) contrast(1.2) grayscale(.2); z-index: 1;
}
.hero::after {
    content: ""; position: absolute; bottom: 0; left: 0; width: 100%;
    height: 30vh; background: linear-gradient(to top, var(--bg), transparent); z-index: 5;
}
.hero-content {
    z-index: 10; text-align: center; position: relative;
    display: flex; flex-direction: column; align-items: center; padding: 0 15px;
}
.hero-content h1 {
    font-size: clamp(3rem, 12vw, 9rem); letter-spacing: clamp(5px, 2vw, 15px);
    background: linear-gradient(to bottom, #fff 20%, var(--gold) 80%, var(--gold-dr));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .8)); line-height: 1.1;
}
.hero-content p {
    letter-spacing: clamp(4px, 2vw, 12px); text-transform: uppercase;
    font-size: clamp(0.7rem, 2vw, 1rem); color: var(--gold);
    margin-top: 20px; font-family: 'Montserrat'; opacity: .8; text-align: center;
}

.hero-btn {
    margin-top: 50px; padding: 20px 50px; background: rgba(212, 175, 55, .1);
    border: 1px solid var(--gold); color: var(--gold); font-family: 'Cinzel';
    font-size: 1.1rem; letter-spacing: 4px; font-weight: 700; transition: var(--tr);
    position: relative; overflow: hidden; backdrop-filter: blur(5px); cursor: pointer;
}
.hero-btn:hover { background: var(--gold); color: #000; box-shadow: 0 0 40px rgba(212, 175, 55, .4); transform: translateY(-5px); }

section {
    position: relative; z-index: 5; padding: 120px 10%;
    border-bottom: 1px solid rgba(212, 175, 55, .05);
}
.bg-alt { background: var(--bg-sec); backdrop-filter: blur(5px); }

.lore-slider-container {
    position: relative; width: 100%; min-height: 70vh;
    display: flex; flex-direction: column; justify-content: center;
}
.lore-slide {
    position: absolute; inset: 0; display: flex; gap: 80px; align-items: center;
    opacity: 0; visibility: hidden; transition: var(--tr); z-index: 1;
}
.lore-slide.active { opacity: 1; visibility: visible; z-index: 2; }
.lore-text { flex: 1; border-left: 2px solid var(--gold-dr); padding-left: 50px; }

/* БЛОК ИЗМЕНЕНИЯ: Основные десктопные стили для картинки лора */
.lore-image {
    flex: 1.2; 
    width: 100%; 
    aspect-ratio: 16 / 9; 
    background-size: cover;
    background-position: center; 
    filter: sepia(.3) brightness(.6) contrast(1.2);
    border: 1px solid rgba(212, 175, 55, .2); 
    transform: scale(1.05) translateX(30px);
    transition: 1.5s cubic-bezier(.16, 1, .3, 1); 
    box-shadow: 0 20px 50px rgba(0, 0, 0, .9);
}
.lore-slide.active .lore-image { transform: scale(1) translateX(0); }
.lore-slide h2 { font-size: clamp(2rem, 4vw, 3.5rem); color: #fff; margin: 0 0 30px 0; line-height: 1.2; }
.lore-slide p { font-size: 1.15rem; line-height: 1.8; color: var(--txt); }
 
.slider-dots { position: absolute; bottom: -40px; left: 50px; display: flex; gap: 20px; }
.dot { width: 50px; height: 2px; background: rgba(212, 175, 55, .2); transition: 0.6s; position: relative; cursor: pointer; }
.dot::after { content: ''; position: absolute; top: -10px; bottom: -10px; left: 0; right: 0; }
.dot.active { background: var(--gold); box-shadow: 0 0 15px var(--gold); }

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px; margin-top: 60px; position: relative; z-index: 5;
}
.feature-card {
    padding: 40px; background: linear-gradient(180deg, rgba(20, 20, 25, .7) 0%, rgba(5, 5, 7, .4) 100%);
    border-top: 1px solid rgba(212, 175, 55, .2); transition: var(--tr); backdrop-filter: blur(5px);
}
.feature-card:hover {
    transform: translateY(-10px); background: linear-gradient(180deg, rgba(212, 175, 55, .08) 0%, rgba(5, 5, 7, .6) 100%);
    border-top-color: var(--gold); box-shadow: 0 15px 30px rgba(0, 0, 0, .5);
}
.feature-card h3 { font-size: 1.6rem; color: #fff; margin-bottom: 15px; }
.feature-card p { font-size: .95rem; line-height: 1.7; opacity: .8; }
 
.f-image-container {
    width: 100%; height: 180px; margin-bottom: 25px; overflow: hidden;
    border: 1px solid rgba(212, 175, 55, .2); position: relative;
}
.f-feature-img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.7) brightness(.6); transition: var(--tr); }
.feature-card:hover .f-feature-img { filter: grayscale(0) brightness(1); transform: scale(1.1); }
.f-image-container::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 30px rgba(0, 0, 0, .8); pointer-events: none; }

.quote-section {
    padding: 150px 10%; background: url(../image/bbak.jpeg) center/cover fixed;
    position: relative; text-align: center; border-bottom: none;
}
.quote-section::before { content: ""; position: absolute; inset: 0; background: rgba(5, 5, 7, .85); }
.quote-content { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.quote-content h2 { font-size: clamp(1.5rem, 4vw, 3.5rem); line-height: 1.4; color: var(--gold-br); text-shadow: 0 5px 15px rgba(0, 0, 0, .9); }
.quote-content p { margin-top: 30px; font-family: 'Montserrat'; font-size: 1rem; letter-spacing: 3px; color: #fff; opacity: .6; text-transform: uppercase; }

.classes-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
    margin-top: 40px; position: relative; z-index: 5;
}
.class-card {
    height: 600px; background: #000; border: 1px solid #1a1a1c;
    overflow: hidden; position: relative; transition: 0.6s;
}
.class-card::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, #000 10%, transparent 70%); z-index: 2; transition: 0.6s;
}
.class-card img { width: 100%; height: 100%; object-fit: cover; opacity: .5; transition: 1.2s cubic-bezier(.23, 1, .32, 1); filter: grayscale(1) contrast(1.2); }
.class-card:hover { border-color: var(--gold); transform: translateY(-15px); box-shadow: 0 20px 40px rgba(0, 0, 0, .8); }
.class-card:hover::before { background: linear-gradient(to top, rgba(212, 175, 55, .4) 0%, #000 60%, transparent); }
.class-card:hover img { opacity: .8; filter: grayscale(0); transform: scale(1.1); }
.class-info { position: absolute; bottom: 40px; left: 40px; right: 40px; z-index: 3; }
.class-info h3 { font-size: 2.2rem; color: var(--gold); margin-bottom: 10px; letter-spacing: 3px; text-transform: uppercase; }
.class-desc { font-size: .95rem; opacity: 0; transform: translateY(20px); transition: 0.4s; line-height: 1.6; color: #ddd; }
.class-card:hover .class-desc { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }

.editions-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
    margin-top: 50px; position: relative; z-index: 5;
}
.edition-card {
    background: rgba(255, 255, 255, .02); border: 1px solid rgba(255, 255, 255, .05);
    padding: 50px 40px; text-align: center; transition: var(--tr);
    display: flex; flex-direction: column; backdrop-filter: blur(10px);
}
.edition-card.premium {
    border-color: var(--gold-dr); background: linear-gradient(180deg, rgba(212, 175, 55, .08), rgba(0, 0, 0, .5));
    position: relative; transform: scale(1.05); z-index: 10; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.edition-card.premium::before {
    content: "РЕКОМЕНДУЕМЫЙ НАБОР"; position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: #000; font-family: 'Montserrat'; font-size: .7rem; font-weight: 800;
    padding: 5px 15px; letter-spacing: 2px; width: max-content;
}
.edition-card:hover { border-color: var(--gold); background: rgba(255, 255, 255, .04); }
.edition-card.premium:hover { box-shadow: 0 15px 50px rgba(212, 175, 55, .2); }
.edition-card h3 { font-size: 1.8rem; color: #fff; margin-bottom: 10px; }
.price { font-family: 'Montserrat'; font-size: 2.5rem; color: var(--gold); font-weight: 300; margin-bottom: 30px; }
.edition-features { list-style: none; margin-bottom: 40px; flex-grow: 1; }
.edition-features li { padding: 15px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: .9rem; opacity: .8; }
 
.buy-btn {
    width: 100%; padding: 18px; border: 1px solid var(--txt); background: transparent; color: #fff;
    font-family: 'Cinzel'; letter-spacing: 2px; transition: 0.4s; font-weight: 700; cursor: pointer;
}
.premium .buy-btn { border-color: var(--gold); color: var(--gold); }
.buy-btn:hover { background: var(--gold); color: #000; border-color: var(--gold); }

.ritual-form {
    max-width: 800px; margin: 0 auto; padding: 80px;
    background: linear-gradient(145deg, rgba(10, 10, 12, .9), rgba(5, 5, 7, .9));
    border: 1px solid rgba(212, 175, 55, .15); position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .8); backdrop-filter: blur(10px);
}
.ritual-form::after {
    content: ""; position: absolute; inset: -2px; border: 1px solid var(--gold-dr);
    opacity: .3; pointer-events: none;
}
.ritual-form input {
    width: 100%; background: transparent; border: 0; border-bottom: 1px solid #333;
    color: #fff; padding: 20px 10px; margin-bottom: 40px; outline: 0; font-family: 'Montserrat';
    font-size: .9rem; letter-spacing: 3px; transition: 0.4s; text-transform: uppercase;
}
.ritual-form input:focus { border-bottom-color: var(--gold); box-shadow: 0 10px 10px -10px rgba(212, 175, 55, .3); }
 
.submit-btn {
    width: 100%; padding: 25px; background: rgba(212, 175, 55, .05);
    border: 1px solid var(--gold); color: var(--gold); font-family: 'Cinzel';
    letter-spacing: 6px; font-size: 1.2rem; transition: 0.5s; font-weight: 900; cursor: pointer;
}
.submit-btn:hover { background: var(--gold); color: #000; box-shadow: 0 0 40px rgba(212, 175, 55, .5); }
 
.ritual-form input:disabled, .submit-btn:disabled { opacity: .5; pointer-events: none; border-bottom-color: #333; }
.submit-btn:disabled { background: transparent; color: #555; border-color: #333; }

footer {
    text-align: center; padding: 100px 20px 50px; border-top: 1px solid rgba(255, 255, 255, .05);
    background: #020202; position: relative; z-index: 5;
}
.footer-logo { font-family: 'Cinzel'; font-size: 2rem; color: var(--gold); margin-bottom: 30px; opacity: .5; }
.footer-links {
    display: flex; justify-content: center; gap: 30px; margin-bottom: 50px;
    font-family: 'Montserrat'; font-size: .7rem; letter-spacing: 3px; text-transform: uppercase; flex-wrap: wrap;
}
.footer-links a { color: var(--txt); text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: var(--gold); }
.copyright { font-size: .6rem; color: #444; letter-spacing: 5px; text-transform: uppercase; font-family: 'Montserrat'; line-height: 1.5; }

.fade-in { opacity: 0; transform: translateY(50px); transition: 1.2s cubic-bezier(.22, 1, .36, 1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }

/* ========= АДАПТИВНОСТЬ ========= */
 
@media (max-width: 1024px) {
    .classes-grid, .editions-grid { grid-template-columns: 1fr; }
    .edition-card.premium { transform: scale(1); }
    .lore-slide { flex-direction: column; text-align: center; gap: 40px; }
    .lore-text { border-left: none; padding-left: 0; border-top: 2px solid var(--gold-dr); padding-top: 30px; }

    /* БЛОК ИЗМЕНЕНИЯ: Исправленное мобильное отображение картинки */
    .lore-image { 
        flex: none;                 /* Полностью выключаем десктопные пропорции */
        width: 100% !important;     /* Заставляем картинку встать на 100% ширины экрана */
        max-width: 100%;
        aspect-ratio: 16 / 9;       /* Гарантируем идеальный формат 16:9 без сужений */
        transform: none !important; /* Намертво убираем десктопный сдвиг translateX(30px) */
        height: auto; 
        min-height: auto; 
    }

    /* БЛОК ИЗМЕНЕНИЯ: Запрещаем анимации сдвигать картинку в активном состоянии слайда */
    .lore-slide.active .lore-image { transform: none !important; }
    .slider-dots { left: 50%; transform: translateX(-50%); bottom: -60px; }
}

@media (max-width: 768px) {
    nav { padding: 15px 20px; justify-content: center; flex-direction: column; gap: 10px; }
    nav.scrolled { padding: 10px 20px; }
    .nav-links { margin-top: 10px; display: flex; justify-content: center; flex-wrap: wrap; width: 100%; gap: 15px; }
    .nav-links a { margin: 0; font-size: .65rem; letter-spacing: 2px; }
     
    section { padding: 80px 5%; }
     
    .hero-content h1 { letter-spacing: 6px; }
     
    .hero-btn { padding: 15px 30px; font-size: 0.9rem; letter-spacing: 2px; width: 100%; max-width: 320px; }
    .buy-btn { padding: 14px; font-size: 0.9rem; letter-spacing: 1px; }
    .submit-btn { padding: 16px; font-size: 1rem; letter-spacing: 3px; }
     
    #ritualTitle { font-size: 1.8rem !important; letter-spacing: 3px !important; margin-bottom: 30px !important; }
    .ritual-form { padding: 40px 20px; }
    .ritual-form input { padding: 15px 5px; font-size: 0.8rem; margin-bottom: 25px; }
     
    .class-info h3 { font-size: 1.8rem; }
    .quote-content p { letter-spacing: 2px; }
    .lore-slide h2 { font-size: 2.2rem; }
}
 
@media (max-width: 480px) {
    section { padding: 60px 5%; }
    .feature-card { padding: 25px; }
    .class-card { height: 450px; }
    .class-info { bottom: 20px; left: 20px; right: 20px; }
    .edition-card { padding: 40px 20px; }
    .footer-links { gap: 15px; flex-direction: column; }
}

/* ========= СТИЛИ МОДАЛЬНОГО ОКНА ========= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 7, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Выше навигации */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(.23, 1, .32, 1);
}

/* Активное состояние окна */
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(145deg, rgba(12, 12, 16, 0.98), rgba(5, 5, 7, 0.98));
    border: 1px solid var(--gold-dr);
    padding: 60px 40px;
    max-width: 550px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 40px rgba(212, 175, 55, 0.03);
    transform: translateY(40px) scale(0.95);
    transition: transform 0.6s cubic-bezier(.23, 1, .32, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

/* Кнопка закрытия (крестик) */
.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: var(--txt);
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    opacity: 0.6;
}
.modal-close:hover {
    color: var(--gold);
    transform: rotate(90deg);
    opacity: 1;
}

.modal-title {
    font-size: 2.2rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 25px;
}
.modal-title span {
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.modal-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--txt);
    font-family: 'Lora', serif;
}

/* Декоративные линии в стиле игровых интерфейсов */
.modal-decor-top, .modal-decor-bottom {
    height: 1px;
    width: 60%;
    margin: 20px auto;
    background: linear-gradient(to right, transparent, var(--gold-dr), transparent);
    position: relative;
}
.modal-decor-top::after, .modal-decor-bottom::after {
    content: '♦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #070709;
    color: var(--gold);
    padding: 0 10px;
    font-size: 0.7rem;
}

/* Адаптивность для мобилок */
@media (max-width: 768px) {
    .modal-content {
        padding: 45px 25px;
    }
    .modal-title {
        font-size: 1.8rem;
    }
    .modal-text {
        font-size: 0.95rem;
    }
}