/* ========== ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ ========== */

:root {
    --bg-main: #020617;
    --bg-elevated: rgba(15, 23, 42, 0.96);
    --bg-soft: rgba(15, 23, 42, 0.86);
    --accent: #22d3ee;
    --accent-alt: #a855f7;
    --accent-soft: rgba(34, 211, 238, 0.18);
    --accent-border: rgba(56, 189, 248, 0.35);
    --danger: #fb7185;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --card-radius: 18px;
    --transition-fast: 200ms ease-out;
    --transition-slow: 420ms cubic-bezier(0.19, 1, 0.22, 1);
    --border-subtle: rgba(148, 163, 184, 0.25);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html { 
    font-size: 16px; 
    -webkit-text-size-adjust: 100%; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    background: radial-gradient(circle at 0% 0%, #0f172a 0, #020617 40%, #000 100%);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-width: 320px;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

a { 
    text-decoration: none; 
    color: inherit; 
}

/* Background */
.bg-layer { 
    position: fixed; 
    inset: 0; 
    pointer-events: none; 
    z-index: -1; 
    overflow: hidden; 
}

.bg-grid {
    position: absolute; 
    inset: -200px;
    background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 36px 36px;
    transform: perspective(900px) rotateX(58deg) translateY(40%);
    animation: gridPan 26s linear infinite;
    opacity: 0.55;
}

@keyframes gridPan {
    0% { transform: perspective(900px) rotateX(58deg) translate3d(0, 40%, 0); }
    100% { transform: perspective(900px) rotateX(58deg) translate3d(-120px, 60%, 0); }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed; 
    inset: 0;
    background: radial-gradient(circle at 0 0, #0f172a, #020617 50%, #020617 100%);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-direction: column;
    z-index: 9999; 
    color: #e5e7eb;
}

#loading-overlay.fade-out { 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 900ms ease-out; 
}

.loading-box {
    padding: 18px 20px; 
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 20px 70px rgba(15, 23, 42, 1), 0 0 40px rgba(56, 189, 248, 0.35);
    max-width: 360px; 
    width: 90%; 
    font-size: 13px;
}

.loading-title { 
    font-size: 13px; 
    text-transform: uppercase; 
    letter-spacing: 0.18em; 
    margin-bottom: 10px; 
}

.loading-line { 
    font-size: 12px; 
    color: #9ca3af; 
    margin-bottom: 4px; 
}

.loading-progress { 
    margin-top: 8px; 
    height: 3px; 
    border-radius: 999px; 
    background: rgba(15, 23, 42, 1); 
    overflow: hidden; 
}

.loading-progress-bar { 
    width: 0; 
    height: 100%; 
    background: linear-gradient(90deg, #22d3ee, #a855f7); 
    animation: loadingBar 1.8s ease-out forwards; 
}

@keyframes loadingBar { 
    0% { width: 0; } 
    100% { width: 100%; } 
}

/* Reveal animation */
.reveal { 
    opacity: 0; 
    transform: translateY(14px) scale(0.98);
    transition: opacity 700ms cubic-bezier(0.19, 1, 0.22, 1), transform 700ms cubic-bezier(0.19, 1, 0.22, 1); 
}

.reveal.visible { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
}

/* Utility */
.section { 
    max-width: 1120px; 
    margin: 0 auto; 
    padding: 32px 16px 26px; 
}

@media (min-width: 1024px) {
    .section {
        max-width: 1000px;
        padding: 40px 24px 32px;
    }
}

@media (min-width: 1400px) {
    .section {
        max-width: 1100px;
    }
}

@media (max-width: 640px) {
    .section {
        padding: 20px 12px 16px;
    }
}
