/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-tertiary: #252d4a;
    --text-primary: #e0e6ff;
    --text-secondary: #a8afd9;
    --accent-1: #00d9ff;
    --accent-2: #ff006e;
    --accent-3: #8338ec;
    --accent-glow: #00d9ff;
    --border-color: #333d5c;
}

:root.light-mode {
    --bg-primary: #f5f7ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2ff;
    --text-primary: #1a1a2e;
    --text-secondary: #666699;
    --accent-1: #00d9ff;
    --accent-2: #ff006e;
    --accent-3: #8338ec;
    --accent-glow: #00d9ff;
    --border-color: #e0e6ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.8) 0%, rgba(42, 26, 74, 0.8) 100%);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
    transition: all 0.3s;
}

.logo-image:hover {
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.6);
    transform: scale(1.05);
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent-1);
    text-shadow: 0 0 10px var(--accent-1);
}

/* Переключатель темы */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(131, 56, 236, 0.1));
    border: 2px solid var(--accent-1);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
    font-weight: 600;
}

.theme-toggle:hover {
    border-color: var(--accent-2);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.5), 0 0 15px rgba(255, 0, 110, 0.3);
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(131, 56, 236, 0.15));
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle span {
    font-size: 1.2rem;
    animation: themeRotate 0.6s ease-out;
}

@keyframes themeRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Герой секция */
.hero {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    padding: 150px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(131, 56, 236, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(0, 217, 255, 0.3); }
    50% { text-shadow: 0 0 40px rgba(0, 217, 255, 0.6); }
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--accent-1);
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

.hero-description {
    font-size: 1.1rem;
    max-width: 600px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: var(--accent-1);
    color: var(--bg-primary);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    background: var(--accent-2);
}

.btn-primary:active {
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-1);
    border: 2.5px solid var(--accent-1);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2), inset 0 0 0 0 var(--accent-1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-secondary:hover {
    background: var(--accent-1);
    color: var(--bg-primary);
    box-shadow: 0 0 35px rgba(0, 217, 255, 0.6), inset 0 0 15px rgba(0, 217, 255, 0.2);
    transform: translateY(-4px) scale(1.02);
    letter-spacing: 1px;
    border-color: var(--accent-1);
}

.btn-secondary:active {
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 45px;
    font-size: 1.15rem;
    letter-spacing: 1px;
}

.uptime-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 217, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    border: 1px solid var(--accent-1);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

.uptime-icon {
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Секции */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Возможности */
.features {
    background: var(--bg-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 50%;
}

.feature-card:hover::before {
    opacity: 0.1;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-1);
    box-shadow: 0 15px 50px rgba(0, 217, 255, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Протоколы */
.protocols {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.protocol-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    position: relative;
}

.protocol-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.protocol-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-1);
    box-shadow: 0 15px 50px rgba(0, 217, 255, 0.3);
}

.protocol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.protocol-header h3 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.protocol-badge {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: var(--bg-primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
}

.protocol-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.protocol-features {
    list-style: none;
}

.protocol-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protocol-features li::before {
    content: '✓';
    color: var(--accent-1);
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-1);
}

/* Статус серверов */
.status-section {
    background: var(--bg-primary);
}

.status-box {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(131, 56, 236, 0.1) 100%);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--accent-1);
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.2);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.status-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #999;
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 0 20px var(--accent-1);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.status-info h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-1);
}

.status-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-1);
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

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

/* CTA секция */
.cta {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05) 0%, rgba(255, 0, 110, 0.05) 100%);
    color: var(--text-primary);
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.6s ease-out;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.cta .btn-primary {
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

/* Подвал */
.footer {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.footer-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transition: width 0.3s;
}

.footer-section a:hover::after {
    width: 100%;
}

.footer-section a:hover {
    color: var(--accent-1);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Адаптивность */
/* Оптимизация для планшетов */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .navbar {
        padding: 12px 16px;
    }
}

/* Оптимизация для мобильных устройств (max-width: 768px) */
@media (max-width: 768px) {
    /* Safe area поддержка для notch и других экранов */
    body {
        padding: max(0px, env(safe-area-inset-left)) 0 max(0px, env(safe-area-inset-right)) 0;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .navbar {
        padding: 12px 16px;
        gap: 8px;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.3;
        margin: 20px 0;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 24px;
    }

    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 24px;
    }

    .nav-links {
        gap: 0.8rem;
        font-size: 0.85rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    /* Touch-friendly размер кнопок: минимум 44x44px */
    .btn {
        width: 100%;
        padding: 14px 24px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        border-radius: 25px;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }

    .btn-large {
        padding: 16px 28px;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .features-grid,
    .protocols-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card,
    .protocol-card {
        padding: 20px 16px;
        margin: 0;
    }

    .status-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cta {
        padding: 40px 16px;
    }

    .cta h2 {
        font-size: 1.6rem;
        margin-bottom: 24px;
    }

    .logo-image {
        width: 32px;
        height: 32px;
    }

    /* Улучшенный spacing для мобильных */
    .hero {
        padding: 40px 0 60px;
    }

    /* Touch-friendly навигационные ссылки */
    .nav-links a {
        padding: 8px 12px;
        min-height: 40px;
        display: flex;
        align-items: center;
    }

    /* Оптимизация для долгого текста */
    p {
        word-break: break-word;
        hyphens: auto;
    }

    /* Улучшенная читаемость на мобильных */
    .feature-card h3,
    .protocol-card h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .feature-card p,
    .protocol-card p,
    .protocol-card li {
        font-size: 0.95rem;
        line-height: 1.5;
    }
}

/* Оптимизация для малых мобильных устройств (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .navbar {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .hero-title {
        font-size: 1.8rem;
        margin: 16px 0;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .section {
        padding: 32px 0;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .hero-buttons {
        gap: 10px;
    }

    .btn {
        padding: 13px 20px;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 0.9rem;
    }

    .feature-card,
    .protocol-card {
        padding: 16px 12px;
    }

    .cta {
        padding: 32px 12px;
    }

    .cta h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    /* Удобное управление на маленьких экранах */
    .logo-image {
        width: 28px;
        height: 28px;
    }
}

/* Анимации при загрузке */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 217, 255, 0.8);
    }
}

.feature-card,
.protocol-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Контрастность и доступность */
a {
    color: var(--accent-1);
}

a:hover {
    opacity: 0.8;
}

/* Формат для печати */
@media print {
    .navbar,
    .hero-buttons,
    .footer,
    .theme-toggle {
        display: none;
    }
}
