/* =============================================
   ГЛАВНАЯ СТРАНИЦА ПОРТАЛА - ДИАГОНАЛЬНЫЙ ЛУЧ
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #eef2ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(0,200,255,0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255,170,0,0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1600px;
    width: 90%;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* Анимированные частицы */
.particle {
    position: fixed;
    bottom: 0;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    animation: floatUp linear infinite;
    z-index: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 60px;
}

.header h1 {
    font-size: clamp(32px, 8vw, 56px);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #a0b4d8, #00ccff, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 15px;
}

.header h1 i {
    background: linear-gradient(135deg, #ffffff, #a0b4d8, #00ccff, #ffaa00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header p {
    font-size: 18px;
    color: #a0b4d8;
    margin-bottom: 20px;
}

.glow-text {
    display: inline-block;
    background: rgba(0,200,255,0.08);
    border: 1px solid rgba(0,200,255,0.25);
    border-radius: 60px;
    padding: 12px 28px;
    font-size: 13px;
    color: #a0b4d8;
    backdrop-filter: blur(8px);
}

.glow-text i {
    color: #00ccff;
    margin: 0 5px;
}

/* =============================================
   ЗАГОЛОВКИ СЕКЦИЙ
   ============================================= */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 40px 0 25px;
}

.title-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,200,255,0.1);
    border-radius: 12px;
    color: #00ccff;
}

.title-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #eef2ff;
}

.title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,200,255,0.3), transparent);
}

/* =============================================
   ОБЩИЕ СТИЛИ ДЛЯ КАРТОЧЕК
   ============================================= */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.menu-card {
    position: relative;
    border-radius: 20px;
    padding: 28px 20px;
    text-decoration: none;
    color: #eef2ff;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Диагональный бегущий луч (слева сверху -> справа снизу) */
.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        transparent 0%, 
        transparent 40%,
        rgba(255,255,255,0.15) 45%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.15) 55%,
        transparent 60%,
        transparent 100%
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.menu-card:hover::before {
    left: 100%;
}

.menu-icon {
    font-size: 42px;
    margin-bottom: 20px;
    transition: none;
}

.menu-card:hover .menu-icon {
    transform: none;
}

.menu-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.menu-card p {
    font-size: 13px;
    color: #a0b4d8;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    color: #a0b4d8;
}

.card-arrow {
    font-size: 14px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.menu-card:hover .card-arrow {
    transform: translateX(5px);
    opacity: 1;
}

/* =============================================
   ПЕРВЫЙ РЯД - ОСНОВНЫЕ МОДУЛИ (синий)
   ============================================= */
.first-row .menu-card {
    background: linear-gradient(135deg, rgba(20,25,45,0.9), rgba(10,12,25,0.8));
    border: 1px solid rgba(0,200,255,0.2);
}

.first-row .menu-card::before {
    background: linear-gradient(135deg, 
        transparent 0%, 
        transparent 40%,
        rgba(0,200,255,0.3) 45%,
        rgba(0,200,255,0.4) 50%,
        rgba(0,200,255,0.3) 55%,
        transparent 60%,
        transparent 100%
    );
}

.first-row .menu-card:hover {
    border-color: rgba(0,200,255,0.5);
    box-shadow: 0 10px 30px rgba(0,200,255,0.1);
    transform: translateY(-3px);
}

.first-row .menu-icon {
    color: #00ccff;
}

.first-row .card-badge {
    background: rgba(0,200,255,0.1);
    color: #00ccff;
}

.first-row .card-arrow {
    color: #00ccff;
}

/* =============================================
   ВТОРОЙ РЯД - ВНЕШНИЕ ИНСТРУМЕНТЫ (золотистый)
   ============================================= */
.second-row .menu-card {
    background: linear-gradient(135deg, rgba(45,35,20,0.9), rgba(30,25,15,0.8));
    border: 1px solid rgba(255,170,0,0.3);
}

.second-row .menu-card::before {
    background: linear-gradient(135deg, 
        transparent 0%, 
        transparent 40%,
        rgba(255,170,0,0.35) 45%,
        rgba(255,170,0,0.45) 50%,
        rgba(255,170,0,0.35) 55%,
        transparent 60%,
        transparent 100%
    );
}

.second-row .menu-card:hover {
    border-color: rgba(255,170,0,0.7);
    box-shadow: 0 10px 30px rgba(255,170,0,0.15);
    transform: translateY(-3px);
}

.second-row .menu-icon {
    color: #ffaa00;
}

.second-row .card-badge.external-badge {
    background: rgba(255,170,0,0.1);
    color: #ffaa00;
}

.second-row .card-arrow {
    color: #ffaa00;
}

/* Тег "external" в углу карточки */
.external-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255,170,0,0.15);
    color: #ffaa00;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* =============================================
   АДАПТИВНОСТЬ
   ============================================= */
@media (max-width: 1200px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px;
        min-height: auto;
    }
    
    body {
        display: block;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .menu-card {
        padding: 22px 18px;
    }
    
    .menu-icon {
        font-size: 36px;
    }
    
    .menu-card h2 {
        font-size: 18px;
    }
    
    .glow-text {
        font-size: 10px;
        padding: 8px 16px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .header {
        margin-bottom: 40px;
    }
    
    .external-tag {
        font-size: 9px;
        padding: 2px 6px;
        top: 8px;
        right: 8px;
    }
    
    .section-title {
        margin: 30px 0 20px;
    }
    
    .title-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .title-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .menu-card p {
        font-size: 12px;
    }
    
    .menu-card h2 {
        font-size: 16px;
    }
}