/* ===== ОСНОВНЫЕ СТИЛИ ===== */
:root {
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --primary: #8a2be2;
    --primary-dark: #6a0dad;
    --primary-glow: rgba(138, 43, 226, 0.3);
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --text-dark: #aaaaaa;
    --border-color: rgba(138, 43, 226, 0.2);
    --card-bg: rgba(20, 20, 20, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ===== ТЕРМИНАЛЬНАЯ ЗАГРУЗКА ===== */
.boot-sequence {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.98);
    color: #8a2be2;
    font-family: 'Rajdhani', monospace;
    padding: 40px;
    border: 2px solid #8a2be2;
    border-radius: 10px;
    z-index: 9999;
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.5);
    animation: bootFade 0.5s ease;
    pointer-events: none;
    min-width: 400px;
    text-align: left;
    font-size: 16px;
    line-height: 2;
    letter-spacing: 1px;
}

@keyframes bootFade {
    from { 
        opacity: 0; 
        transform: translate(-50%, -30%); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%); 
    }
}

/* ===== ИНДИКАТОР ПРОГРЕССА ===== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #8a2be2, #ff00ff, #00ffff, #8a2be2);
    background-size: 200% 100%;
    animation: progressGradient 2s linear infinite;
    z-index: 10001;
    transition: width 0.2s, opacity 0.5s;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.8);
}

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

/* ===== СЧЕТЧИК ПОСЕТИТЕЛЕЙ ===== */
.visitor-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid #8a2be2;
    padding: 12px 25px;
    border-radius: 30px;
    font-family: 'Rajdhani', monospace;
    color: #8a2be2;
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
    animation: counterPulse 2s infinite;
    font-size: 16px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes counterPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
        border-color: #8a2be2;
    }
    50% { 
        box-shadow: 0 0 40px rgba(138, 43, 226, 0.7);
        border-color: #ff00ff;
    }
}

.counter-label {
    color: #ffffff;
    opacity: 0.8;
}

.counter-value {
    font-weight: bold;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #8a2be2, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 18px;
}

/* ===== АНИМИРОВАННЫЙ ФОН ===== */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(106, 13, 173, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(106, 13, 173, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -2;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-sphere {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 30%, var(--primary-glow), transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: -1;
    animation: floatSphere 15s ease-in-out infinite;
}

.sphere-1 {
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.sphere-2 {
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    animation-delay: -5s;
}

@keyframes floatSphere {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ===== НАВИГАЦИЯ ===== */
nav {
    padding: 30px 0;
    animation: fadeInDown 1s ease-out;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 50px;
    list-style: none;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    padding: 5px 10px;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.nav-link:hover::before {
    width: 100%;
}

/* ===== HERO СЕКЦИЯ ===== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.hero-content h1 {
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 5px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 3s ease-in-out infinite;
    position: relative;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 20px var(--primary-glow)); }
    50% { filter: drop-shadow(0 0 40px var(--primary)); }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-gray);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-light);
    border-radius: 50px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #8a2be2, #ff00ff, #00ffff, #8a2be2);
    background-size: 400%;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.6);
}

.btn:hover::before {
    opacity: 1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

/* ===== СЕКЦИИ ===== */
.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.services, .about, .contacts {
    padding: 100px 0;
}

/* ===== 3D КАРТОЧКИ УСЛУГ ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    opacity: 0;
    animation: cardAppear 0.5s ease-out forwards;
    position: relative;
    cursor: pointer;
}

.service-card:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(2deg) translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px var(--primary-glow);
}

.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(138, 43, 226, 0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 15px;
}

.service-card:hover::after {
    opacity: 1;
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary);
    transform: translateZ(20px);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-light);
    transform: translateZ(15px);
}

.service-card p {
    color: var(--text-dark);
    line-height: 1.8;
    transform: translateZ(10px);
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: perspective(1000px) rotateX(0) rotateY(0) translateY(0);
    }
}

/* ===== ОБО МНЕ ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text p {
    color: var(--text-gray);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item {
    padding: 30px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    color: var(--text-dark);
    font-size: 1rem;
}

/* ===== КОНТАКТЫ ===== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: center;
}

.contact-item {
    padding: 40px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-light);
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: cardAppear 0.5s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.contact-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.contact-item:hover {
    border-color: var(--primary);
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 30px var(--primary-glow);
}

.contact-item:hover::before {
    opacity: 1;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.contact-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.contact-value {
    color: var(--text-dark);
}

/* ===== ФУТЕР ===== */
footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: #666666;
}

/* ===== АНИМАЦИИ ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 3rem;
    }

    .nav-links {
        gap: 20px;
        flex-wrap: wrap;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .boot-sequence {
        min-width: 300px;
        padding: 30px;
        font-size: 14px;
    }
    
    .visitor-counter {
        bottom: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .btn {
        padding: 12px 30px;
    }
    
    .boot-sequence {
        min-width: 280px;
        padding: 20px;
        font-size: 12px;
    }
}

/* ===== ДЛЯ УСТРОЙСТВ С ПРЕДПОЧТЕНИЕМ УМЕНЬШЕННОЙ АНИМАЦИИ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Специально для времени работы */
.stat-item:last-child .stat-number {
    font-size: 2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #8a2be2, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-item:last-child .stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}