/* ============================================================
   ГЛАВНАЯ СТРАНИЦА
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #f8fafc; color: #0f172a; padding: 32px 24px; overflow-x: hidden; }
.container { max-width: 1500px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
a { text-decoration: none; color: inherit; }

/* ===== ПЛАВАЮЩИЕ ЭМОДЗИ ===== */
.floating-emojis { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 0; 
    overflow: hidden; 
}
@keyframes float { 
    0% { opacity: 0; transform: translateY(0px) scale(0.8) rotate(0deg); } 
    15% { opacity: 0.6; } 
    30% { opacity: 0.8; } 
    70% { opacity: 0.9; transform: translateY(-80px) scale(1.1) rotate(10deg); } 
    100% { opacity: 0; transform: translateY(-160px) scale(0.9) rotate(20deg); } 
}
.emoji { 
    position: absolute; 
    font-size: 40px; 
    opacity: 0; 
    animation: float 8s ease-in-out infinite; 
}
.e1 { left: 5%; bottom: 10%; animation-delay: 0s; }
.e2 { left: 20%; bottom: 30%; animation-delay: 1.5s; font-size: 32px; }
.e3 { right: 15%; bottom: 20%; animation-delay: 3s; font-size: 48px; }
.e4 { right: 30%; bottom: 40%; animation-delay: 4.5s; font-size: 36px; }
.e5 { left: 45%; bottom: 5%; animation-delay: 6s; font-size: 44px; }

/* ===== ХЕДЕР ===== */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #e9edf2; 
    margin-bottom: 40px; 
    flex-wrap: wrap; 
    gap: 16px; 
    position: relative; 
    z-index: 9990; 
}
.logo { 
    font-size: 26px; 
    font-weight: 800; 
    letter-spacing: -0.3px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer; 
}
.logo span { 
    color: #1e3a8a; 
    background: #eef2ff; 
    padding: 2px 12px; 
    border-radius: 40px; 
    font-size: 16px; 
}

/* ===== ПОИСК ===== */
.search-wrapper { 
    position: relative; 
    z-index: 9998 !important; 
    display: flex; 
    align-items: center; 
    background: white; 
    border-radius: 60px; 
    padding: 4px 4px 4px 18px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.02); 
    transition: all 0.2s; 
    max-width: 340px; 
    width: 100%; 
}
.search-wrapper:focus-within { 
    border-color: #1e3a8a; 
    box-shadow: 0 0 0 3px rgba(30,58,138,0.08); 
}
.search-wrapper input { 
    border: none; 
    background: transparent; 
    padding: 10px 12px 10px 0; 
    font-size: 14px; 
    font-weight: 400; 
    color: #0f172a; 
    flex: 1; 
    outline: none; 
    min-width: 120px; 
}
.search-wrapper input::placeholder { color: #94a3b8; }
.search-wrapper button { 
    background: #1e3a8a; 
    border: none; 
    color: white; 
    padding: 8px 18px; 
    border-radius: 40px; 
    font-weight: 600; 
    font-size: 13px; 
    cursor: pointer; 
    transition: background 0.15s; 
    white-space: nowrap; 
}
.search-wrapper button:hover { background: #2563eb; }

#search-results { 
    position: absolute; 
    top: calc(100% + 8px); 
    left: 0; 
    right: 0; 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); 
    padding: 8px 0; 
    max-height: 400px; 
    overflow-y: auto; 
    display: none; 
    z-index: 9999 !important; 
    border: 1px solid #e2e8f0; 
    pointer-events: auto; 
}
#search-results a { 
    display: block; 
    padding: 10px 16px; 
    text-decoration: none; 
    color: #0f172a; 
    transition: background 0.15s; 
    border-bottom: 1px solid #f1f4f9; 
    pointer-events: auto; 
    cursor: pointer; 
}
#search-results a:last-child { border-bottom: none; }
#search-results a:hover { background: #f8fafc; }
#search-results .result-title { font-weight:600; font-size:15px; }
#search-results .result-desc { font-size:13px; color:#64748b; }
#search-results .result-meta { font-size:11px; color:#94a3b8; margin-top:4px; }

/* ===== ГАМБУРГЕР (СКРЫТ НА ПК) ===== */
.hamburger { display: none; }
.mobile-menu { display: none; }
.mobile-overlay { display: none; }

/* ===== ГЕРОЙ ===== */
.hero { margin-bottom: 44px; position: relative; z-index: 2; }
.hero h1 { 
    font-size: clamp(40px, 6vw, 64px); 
    font-weight: 800; 
    letter-spacing: -0.03em; 
    line-height: 1.1; 
    margin-bottom: 12px; 
    opacity: 0; 
    transform: translateY(20px); 
    animation: fadeUp 0.8s ease forwards; 
}
.hero h1 .highlight { 
    background: linear-gradient(135deg, #1e3a8a, #3b82f6); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    background-clip: text; 
}
.hero p { 
    font-size: 18px; 
    color: #475569; 
    max-width: 540px; 
    opacity: 0; 
    transform: translateY(15px); 
    animation: fadeUp 0.8s ease 0.2s forwards; 
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ===== СЕТКА ===== */
.grid { 
    display: grid; 
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px; 
    margin-top: 12px; 
    position: relative; 
    z-index: 2; 
}

/* ===== КАРТОЧКИ ===== */
.card { 
    background: #ffffff; 
    border-radius: 20px; 
    padding: 24px 20px 28px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04); 
    border: 1px solid #f1f4f9; 
    transition: all 0.2s ease; 
    text-decoration: none; 
    color: inherit; 
    display: flex; 
    flex-direction: column; 
    opacity: 0; 
    animation: cardIn 0.7s ease forwards; 
}
.card:nth-child(1) { animation-delay: 0.1s; transform-origin: left; }
.card:nth-child(2) { animation-delay: 0.15s; transform-origin: left; }
.card:nth-child(3) { animation-delay: 0.2s; transform-origin: left; }
.card:nth-child(4) { animation-delay: 0.25s; transform-origin: left; }
.card:nth-child(5) { animation-delay: 0.3s; transform-origin: left; }
.card:nth-child(6) { animation-delay: 0.35s; transform-origin: right; }
.card:nth-child(7) { animation-delay: 0.4s; transform-origin: right; }
.card:nth-child(8) { animation-delay: 0.45s; transform-origin: right; }
.card:nth-child(9) { animation-delay: 0.5s; transform-origin: right; }
.card:nth-child(10){ animation-delay: 0.55s; transform-origin: right; }

@keyframes cardIn { 
    0% { opacity: 0; transform: scale(0.92) translateX(30px); } 
    100% { opacity: 1; transform: scale(1) translateX(0); } 
}
.card:nth-child(n+6) { animation-name: cardInRight; }
@keyframes cardInRight { 
    0% { opacity: 0; transform: scale(0.92) translateX(-30px); } 
    100% { opacity: 1; transform: scale(1) translateX(0); } 
}

.card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 20px 40px -12px rgba(30, 58, 138, 0.12); 
    border-color: #dbe2ed; 
}
.card-icon { font-size: 32px; margin-bottom: 12px; line-height: 1; }
.card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; color: #0f172a; }
.card p { font-size: 14px; color: #64748b; line-height: 1.4; margin-bottom: 16px; flex: 1; }
.card .meta { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 13px; 
    color: #94a3b8; 
    border-top: 1px solid #f1f4f9; 
    padding-top: 14px; 
    margin-top: auto; 
}
.card .arrow { color: #1e3a8a; font-weight: 600; transition: transform 0.2s; }
.card:hover .arrow { transform: translateX(4px); }

/* ===== ФУТЕР ===== */
.footer { 
    margin-top: 56px; 
    padding-top: 24px; 
    border-top: 1px solid #e9edf2; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 14px; 
    color: #94a3b8; 
    flex-wrap: wrap; 
    gap: 16px; 
    position: relative; 
    z-index: 2; 
}
.footer .socials { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
}
.footer .socials a { 
    color: #1e293b; 
    text-decoration: none; 
    transition: color 0.2s, transform 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.footer .socials a:hover { 
    color: #1e3a8a; 
    transform: scale(1.1); 
}
.footer .socials svg { width: 22px; height: 22px; fill: currentColor; }
.footer .socials .label { font-size: 13px; color: #94a3b8; font-weight: 500; margin-right: 4px; }

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    body { padding: 20px 16px; }
    .container { padding: 0 8px; }
    
    /* ХЕДЕР */
    .header { 
        flex-wrap: wrap;
        padding-bottom: 14px;
        margin-bottom: 24px;
        gap: 10px;
    }
    .logo { font-size: 20px; gap: 6px; }
    .logo span { font-size: 12px; padding: 2px 10px; }
    
    /* ПОИСК РАСТЯГИВАЕМ */
    .search-wrapper { 
        max-width: 100%; 
        padding: 2px 2px 2px 12px; 
        flex: 1;
        order: 3;
        width: 100%;
    }
    .search-wrapper input { 
        font-size: 13px; 
        padding: 8px 10px 8px 0; 
        min-width: 80px;
    }
    .search-wrapper button { 
        padding: 6px 14px; 
        font-size: 12px; 
    }
    
    /* ГАМБУРГЕР */
    .hamburger { 
        display: flex; 
        flex-direction: column; 
        gap: 5px; 
        cursor: pointer; 
        padding: 8px 4px;
        background: transparent;
        border: none;
        order: 2;
        z-index: 10001;
    }
    .hamburger span { 
        display: block; 
        width: 26px; 
        height: 3px; 
        background: #0f172a; 
        border-radius: 3px; 
        transition: all 0.3s ease; 
    }
    .hamburger.active span:nth-child(1) { 
        transform: rotate(45deg) translate(5px, 6px); 
    }
    .hamburger.active span:nth-child(2) { 
        opacity: 0; 
    }
    .hamburger.active span:nth-child(3) { 
        transform: rotate(-45deg) translate(5px, -6px); 
    }
    
    /* ОВЕРЛЕЙ */
    .mobile-overlay { 
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 9999;
    }
    .mobile-overlay.active { display: block; }
    
    /* МОБИЛЬНОЕ МЕНЮ */
    .mobile-menu { 
        display: none;
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100%;
        background: white;
        padding: 60px 24px 30px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        z-index: 10000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .mobile-menu.active { 
        right: 0;
        display: block;
    }
    .mobile-menu .close-btn { 
        position: absolute;
        top: 16px;
        right: 16px;
        font-size: 28px;
        background: none;
        border: none;
        cursor: pointer;
        color: #0f172a;
        padding: 4px 8px;
    }
    .mobile-menu .menu-title { 
        font-size: 18px; 
        font-weight: 700; 
        margin-bottom: 20px; 
        color: #0f172a; 
        padding-bottom: 12px;
        border-bottom: 2px solid #eef2ff;
    }
    .mobile-menu a { 
        display: block; 
        padding: 14px 16px; 
        font-size: 16px; 
        font-weight: 600; 
        color: #1e293b; 
        border-radius: 12px; 
        transition: background 0.15s; 
        margin-bottom: 4px;
    }
    .mobile-menu a:active { background: #f1f4f9; }
    .mobile-menu a .icon { margin-right: 12px; }
    
    /* ГЕРОЙ */
    .hero { margin-bottom: 24px; }
    .hero h1 { font-size: 28px; margin-bottom: 6px; }
    .hero p { font-size: 15px; }
    
    /* СЕТКА - 2 КОЛОНКИ */
    .grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 12px; 
        margin-top: 8px; 
    }
    
    /* КАРТОЧКИ */
    .card { 
        padding: 16px 14px 18px; 
        border-radius: 16px; 
        animation-duration: 0.5s;
    }
    .card:nth-child(1) { animation-delay: 0.05s; }
    .card:nth-child(2) { animation-delay: 0.1s; }
    .card:nth-child(3) { animation-delay: 0.15s; }
    .card:nth-child(4) { animation-delay: 0.2s; }
    .card:nth-child(5) { animation-delay: 0.25s; }
    .card:nth-child(6) { animation-delay: 0.3s; }
    .card:nth-child(7) { animation-delay: 0.35s; }
    .card:nth-child(8) { animation-delay: 0.4s; }
    .card:nth-child(9) { animation-delay: 0.45s; }
    .card:nth-child(10){ animation-delay: 0.5s; }
    
    .card:nth-child(n+6) { animation-name: cardIn; }
    @keyframes cardIn { 
        0% { opacity: 0; transform: scale(0.96) translateY(8px); } 
        100% { opacity: 1; transform: scale(1) translateY(0); } 
    }
    
    .card:hover { 
        transform: none; 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02); 
        border-color: #f1f4f9; 
    }
    .card:active { 
        transform: scale(0.96); 
        background: #f8fafc; 
        transition: transform 0.1s;
    }
    .card-icon { font-size: 24px; margin-bottom: 6px; }
    .card h3 { font-size: 14px; margin-bottom: 2px; }
    .card p { font-size: 12px; margin-bottom: 10px; }
    .card .meta { font-size: 11px; padding-top: 10px; }
    .card .arrow { transition: none; }
    .card:hover .arrow { transform: none; }
    
    /* ФУТЕР */
    .footer { 
        margin-top: 32px; 
        padding-top: 16px; 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
        gap: 10px; 
        font-size: 12px;
    }
    .footer .socials { gap: 16px; }
    .footer .socials svg { width: 20px; height: 20px; }
    .footer .socials .label { font-size: 12px; }
    
    /* ОТКЛЮЧАЕМ ЭМОДЗИ */
    .floating-emojis { display: none; }
    .emoji { display: none; }
}

@media (max-width: 400px) {
    body { padding: 12px 8px; }
    .grid { gap: 8px; }
    .card { padding: 12px 10px 14px; }
    .card-icon { font-size: 20px; }
    .card h3 { font-size: 13px; }
    .card p { font-size: 11px; margin-bottom: 8px; }
    .card .meta { font-size: 10px; padding-top: 8px; }
    .hero h1 { font-size: 24px; }
    .logo { font-size: 17px; }
    .logo span { font-size: 10px; padding: 1px 8px; }
    .search-wrapper input { font-size: 12px; padding: 6px 6px 6px 0; }
    .search-wrapper button { font-size: 11px; padding: 4px 10px; }
    .mobile-menu { width: 260px; }
}
