/* =========================================
   1. VARIABLES & CONFIGURATION
   ========================================= */
:root {
    /* Colors */
    --bg-deep: #121214;       
    --bg-surface: rgba(24, 24, 27, 0.65);
    --accent-primary: #3b82f6; 
    --accent-glow: rgba(59, 130, 246, 0.4); 
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    /* Brand Colors */
    --color-discord: #5865F2;
    --color-youtube: #FF0000;
    --color-x: #ffffff;
    
    /* Dimensions & Fonts */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 6px;
    --font-main: 'Outfit', sans-serif; 
}

/* =========================================
   2. BASE STYLES
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
    background: linear-gradient(135deg, #0f0f11 0%, #18181b 50%, #131316 100%);
    background-size: 200% 200%;
    animation: bgBreathing 15s ease infinite;
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   3. ANIMATIONS
   ========================================= */
@keyframes bgBreathing { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(0, -50px); } }

.reveal-on-scroll { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* =========================================
   4. LAYOUT
   ========================================= */
main { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

section {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; padding: 70px 0;
    border-bottom: 1px solid var(--border-light);
}
section:last-of-type { min-height: auto; border-bottom: none; }
#home { min-height: 85vh; }

/* Уменьшенный отступ для Правил и Установки */
#rules .section-header,
#install .section-header { margin-bottom: 24px; }
#install { padding-bottom: 0; }

/* =========================================
   5. BACKGROUND & TYPOGRAPHY
   ========================================= */
.ambient-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cube-blur {
    position: absolute; width: 600px; height: 600px;
    background: var(--accent-primary); filter: blur(120px); opacity: 0.08;
    border-radius: 50%; animation: float 20s ease-in-out infinite alternate;
}
.cb-1 { top: -20%; left: 10%; }
.cb-2 { bottom: -20%; right: -10%; background: #6366f1; animation-delay: -10s; }

.grid-overlay {
    position: absolute; inset: 0; opacity: 0.6;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.hero-title { font-size: clamp(2.5rem, 5vw, 4.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 24px; letter-spacing: -1px; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.section-header { font-size: 2.5rem; font-weight: 700; margin-bottom: 60px; color: #fff; position: relative; }
.section-header::after { content: ''; display: block; width: 40px; height: 4px; background: var(--accent-primary); margin: 15px auto 0; border-radius: 2px; }
.subtitle { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 32px; }

/* =========================================
   6. UI COMPONENTS (Nav, Badges, Buttons)
   ========================================= */
/* Language Switcher */
.lang-switch-container { position: fixed; top: 40px; right: 80px; z-index: 1000; }
.lang-switch { position: relative; display: flex; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); border: 1px solid var(--border-light); border-radius: var(--radius-pill); padding: 4px; cursor: pointer; width: 100px; height: 36px; }
.lang-slider { position: absolute; top: 4px; left: 4px; width: 44px; height: 26px; background: var(--accent-primary); border-radius: 4px; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 0 10px var(--accent-glow); z-index: 1; }
.lang-switch.en-mode .lang-slider { transform: translateX(46px); }
.lang-btn { flex: 1; background: none; border: none; color: var(--text-muted); font-size: 0.75rem; font-weight: 800; z-index: 2; cursor: pointer; transition: color 0.3s; text-align: center; line-height: 28px; }
.lang-switch:not(.en-mode) .lang-btn[data-lang="ru"], .lang-switch.en-mode .lang-btn[data-lang="en"] { color: #fff; }

/* Navigation Dots */
.nav-right { position: fixed; right: 30px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 20px; z-index: 100; }
.nav-track { position: absolute; inset: 0 auto; width: 1px; background: linear-gradient(to bottom, transparent, var(--border-light), transparent); z-index: -1; }
.nav-dot { width: 10px; height: 10px; background: var(--bg-deep); border: 1px solid var(--text-muted); border-radius: 2px; cursor: pointer; transition: all 0.3s ease; position: relative; }
.nav-dot.active { background: var(--accent-primary); border-color: var(--accent-primary); box-shadow: 0 0 10px var(--accent-glow); transform: scale(1.3); }
.nav-dot::before { content: attr(data-label); position: absolute; right: 25px; top: 50%; transform: translateY(-50%) translateX(10px); background: rgba(10,10,12,0.9); border: 1px solid var(--border-light); padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: 0.25s; color: #fff; }
.nav-dot:hover::before { opacity: 1; transform: translateX(0); }

/* Badges & Pills */
.badge { display: inline-block; margin-bottom: 24px; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px; border: 1px solid var(--accent-primary); color: var(--accent-primary); background: rgba(59, 130, 246, 0.1); border-radius: var(--radius-sm); box-shadow: 0 0 15px rgba(59, 130, 246, 0.15); }
.info-pills { display: flex; gap: 12px; justify-content: center; margin-bottom: 40px; }
.pill { padding: 8px 16px; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); font-size: 0.9rem; color: var(--text-muted); backdrop-filter: blur(8px); }
.pill span { color: #fff; font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 28px; border-radius: var(--radius-pill); font-weight: 600; text-decoration: none; transition: all 0.3s ease; cursor: pointer; border: 1px solid transparent; gap: 10px; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; transition: fill 0.3s ease; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--accent-primary); color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }

.btn-secondary { background: rgba(255,255,255,0.03); border: 1px solid var(--border-light); color: var(--text-muted); }
.btn-secondary:hover { border-color: var(--text-main); color: var(--text-main); background: rgba(255,255,255,0.08); }
.btn-lg { padding: 16px 40px; font-size: 1.1rem; letter-spacing: 1px; }

/* Social Buttons Colors */
.btn-discord .btn-icon { color: var(--color-discord); }
.btn-discord:hover { background: var(--color-discord) !important; border-color: var(--color-discord) !important; color: #fff !important; box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4); }
.btn-discord:hover .btn-icon, .btn-youtube:hover .btn-icon, .btn-x:hover .btn-icon { color: #fff; }

.btn-youtube .btn-icon { color: var(--color-youtube); }
.btn-youtube:hover { background: var(--color-youtube) !important; border-color: var(--color-youtube) !important; color: #fff !important; box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4); }

.btn-x .btn-icon { color: var(--text-muted); }
.btn-x:hover { background: rgba(255,255,255,0.1) !important; border-color: var(--color-x) !important; color: var(--color-x) !important; box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2); }

/* =========================================
   7. FEATURES
   ========================================= */
.features-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; width: 100%; }
.feature-panel { display: flex; flex-direction: column; background: var(--bg-surface); backdrop-filter: blur(12px); border: 1px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; text-align: left; height: 100%; }
.feature-panel:hover { transform: translateY(-5px); border-color: var(--border-hover); box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.feature-media { width: 100%; position: relative; background: #000; border-bottom: 1px solid var(--border-light); overflow: hidden; aspect-ratio: 16/9; max-height: 300px; }
.feature-media::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: var(--bg-image); background-size: cover; background-position: center; filter: blur(30px) brightness(0.6); transform: scale(1.2); z-index: 0; }
.feature-media img, .feature-media video { width: 100%; height: 100%; object-fit: contain; object-position: center center; transition: transform 0.5s ease; display: block; position: relative; z-index: 1; }
.feature-panel:hover .feature-media img, .feature-panel:hover .feature-media video { transform: scale(1.05); }
.feature-content { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.feature-title { font-size: 1.25rem; margin-bottom: 12px; color: #fff; font-weight: 700; }
.feature-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
@media (max-width: 900px) { .features-list { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; } }

/* =========================================
   8. RULES
   ========================================= */
#rules { padding-top: 140px; padding-bottom: 140px; }
.license-info { margin-bottom: 3rem; font-size: 1.1rem; color: rgba(255, 255, 255, 0.8); }
.license-link { color: inherit; font-weight: bold; text-decoration: underline; text-underline-offset: 3px; transition: opacity 0.2s; }
.license-link:hover { opacity: 0.7; }

.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 900px; margin-bottom: 30px; }
.rule-column { background: var(--bg-surface); backdrop-filter: blur(12px); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 24px; text-align: left; display: flex; flex-direction: column; gap: 16px; transition: transform 0.3s; }
.rule-column:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.rule-column-header { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); }

.col-allowed .rule-column-header { color: #4ade80; }
.col-restricted .rule-column-header { color: #fbbf24; }
.rule-item { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--text-muted); }
.rule-check { font-weight: bold; min-width: 16px; }
.col-allowed .rule-check { color: #4ade80; }
.col-restricted .rule-check { color: #fbbf24; }
.social-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* =========================================
   9. CAROUSEL & INSTALLATION
   ========================================= */
#download .cta-box { max-width: 700px; padding: 20px 0; }
.install-carousel-container { width: 100%; max-width: 1080px; position: relative; overflow: hidden; padding: 20px 0; }
.install-track { display: flex; width: 100%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.install-step { flex: 0 0 100%; min-width: 100%; padding: 0 10px; display: flex; flex-direction: column; align-items: center; opacity: 0.3; transform: scale(0.95); transition: all 0.6s ease; }
.install-track .install-step.active-step { opacity: 1; transform: scale(1); }

.step-header { margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.step-badge { font-size: 0.75rem; font-weight: 800; letter-spacing: 2px; color: var(--accent-primary); background: rgba(59, 130, 246, 0.1); padding: 4px 10px; border-radius: var(--radius-sm); }
.install-step h3 { font-size: 2rem; margin: 0; color: #fff; }
.step-media { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 24px; display: flex; align-items: center; justify-content: center; }
.step-media video, .step-media img { width: 100%; height: 100%; object-fit: cover; }
.step-desc { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin-bottom: 30px; min-height: 3.2em; }

.carousel-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; padding: 0 20px; }
.step-indicators { display: flex; gap: 10px; }
.dot { width: 10px; height: 10px; background: var(--border-light); border-radius: 2px; transition: 0.3s; cursor: pointer; }
.dot.active { background: var(--accent-primary); transform: scale(1.2); box-shadow: 0 0 8px var(--accent-glow); }

/* =========================================
   10. FOOTER & RESPONSIVE
   ========================================= */
.site-credits { margin-top: auto; padding: 80px 0 30px; width: 100%; max-width: 600px; border-top: 1px solid var(--border-light); margin-inline: auto; }
.site-credits p { font-size: 0.85rem; color: var(--text-muted); opacity: 0.5; transition: opacity 0.3s; }
.site-credits p:hover { opacity: 1; }

@media (max-width: 900px) {
    .feature-panel, .feature-panel.reverse { flex-direction: column; text-align: center; }
    .feature-media { width: 100%; }
    .nav-right { right: 12px; }
    .lang-switch-container { right: 16px; }
    .hero-title { font-size: 2.8rem; }
}
@media (max-width: 768px) { .rules-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) {
    main { padding: 0 16px; }
    .install-step h3 { font-size: 1.5rem; }
    .btn-lg { width: 100%; }
    .carousel-controls { flex-direction: column-reverse; gap: 20px; }
}