html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.navbar--static {
    opacity: 1;
    background: rgba(0, 0, 0, 0.95);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.blog-header {
    padding: 144px 0 72px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(133, 88, 237, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(133, 88, 237, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, black 20%, transparent 70%);
    animation: gridPulse 8s ease-in-out infinite;
    pointer-events: none;
}

.blog-header::after {
    content: '';
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(133, 88, 237, 0.15) 0%, rgba(74, 158, 255, 0.06) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.blog-header .container {
    position: relative;
    z-index: 1;
}

.blog-title {
    font-family: 'Space Mono', monospace;
    font-size: clamp(28px, 4vw + 16px, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    display: inline-block;
    position: relative;
}


.blog-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.blog-search-wrapper {
    max-width: 480px;
    margin: 32px auto 0;
    padding: 0;
}

.blog-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px 12px 48px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent-blue);
    background: rgba(74, 158, 255, 0.04);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.search-kbd {
    position: absolute;
    right: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.search-input:focus ~ .search-kbd {
    opacity: 0;
}

.blog-filters-section {
    padding: 0 0 8px;
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.filter-btn:hover {
    border-color: rgba(74, 158, 255, 0.4);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(74, 158, 255, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding: 48px 0 80px;
}

.blog-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        border-color 0.3s ease,
        background-color 0.3s ease,
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
    opacity: 1;
}

.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.01) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card:hover {
    border-color: rgba(74, 158, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(74, 158, 255, 0.08);
}

article[data-category="ai-biznes"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), transparent);
    pointer-events: none;
}

article[data-category="glasov-ai"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #c084fc, transparent);
    pointer-events: none;
}

article[data-category="chatbot"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), transparent);
    pointer-events: none;
}

article[data-category="ecommerce"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #fb923c, transparent);
    pointer-events: none;
}

article[data-category="avtomatizatsia"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4bffc0, transparent);
    pointer-events: none;
}

article[data-category="tseni"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
    pointer-events: none;
}

article[data-category="ai-biznes"]:hover {
    border-color: rgba(133, 88, 237, 0.5);
    box-shadow: 0 12px 40px rgba(133, 88, 237, 0.1);
}

article[data-category="glasov-ai"]:hover {
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 12px 40px rgba(192, 132, 252, 0.1);
}

article[data-category="chatbot"]:hover {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 12px 40px rgba(34, 211, 238, 0.1);
}

article[data-category="ecommerce"]:hover {
    border-color: rgba(251, 146, 60, 0.5);
    box-shadow: 0 12px 40px rgba(251, 146, 60, 0.1);
}

article[data-category="avtomatizatsia"]:hover {
    border-color: rgba(75, 255, 192, 0.5);
    box-shadow: 0 12px 40px rgba(75, 255, 192, 0.1);
}

article[data-category="tseni"]:hover {
    border-color: rgba(74, 158, 255, 0.5);
    box-shadow: 0 12px 40px rgba(74, 158, 255, 0.1);
}

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

.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.1s; }
.blog-card:nth-child(3) { animation-delay: 0.15s; }
.blog-card:nth-child(4) { animation-delay: 0.2s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }

.blog-card.blog-hiding {
    opacity: 0;
    transform: scale(0.95);
}

.blog-hidden {
    display: none;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.blog-date,
.blog-readtime {
    font-size: 13px;
    color: var(--text-secondary);
}

.blog-readtime::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: var(--text-secondary);
    border-radius: 50%;
    margin-right: 12px;
    vertical-align: middle;
}

.blog-card-title {
    font-family: 'Space Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.3px;
    position: relative;
    z-index: 1;
}

.blog-card-excerpt {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.blog-card-link svg {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-card-link:hover svg {
    transform: translateX(4px);
}

.blog-card-link:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

.blog-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.3);
    color: var(--accent-blue);
    position: relative;
    z-index: 1;
}

.blog-badge.ai-biznes {
    background: rgba(133, 88, 237, 0.15);
    border-color: rgba(133, 88, 237, 0.3);
    color: var(--accent-purple);
}

.blog-badge.glasov-ai {
    background: rgba(192, 132, 252, 0.15);
    border-color: rgba(192, 132, 252, 0.3);
    color: #c084fc;
}

.blog-badge.chatbot {
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.3);
    color: var(--accent-cyan);
}

.blog-badge.ecommerce {
    background: rgba(251, 146, 60, 0.15);
    border-color: rgba(251, 146, 60, 0.3);
    color: #fb923c;
}

.blog-badge.avtomatizatsia {
    background: rgba(75, 255, 192, 0.15);
    border-color: rgba(75, 255, 192, 0.3);
    color: #4bffc0;
}

.blog-badge.tseni {
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.3);
    color: var(--accent-blue);
}

@media (prefers-reduced-motion: reduce) {
    .blog-card {
        animation: none;
        opacity: 1;
    }

    .blog-header::before {
        animation: none;
        opacity: 0.7;
    }


    .blog-card.blog-hiding {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 768px) {
    .blog-header {
        padding: 120px 0 24px;
    }

    .blog-subtitle {
        font-size: 16px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 24px 0 60px;
    }

    .blog-filters-section {
        padding: 8px 0;
    }

    .blog-filters {
        gap: 6px;
        padding: 0 12px;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .blog-search-wrapper {
        padding: 0 16px;
        margin-bottom: 16px;
    }

    /* Mobile menu — slide-in panel */
    .nav-links.active {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        background: #0a0a0a !important;
        z-index: 9998 !important;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        padding: 100px 32px 40px;
        margin: 0;
        list-style: none;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
        animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideIn {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    .nav-links.active li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-links.active li:last-child {
        border-bottom: none;
    }

    .nav-links.active a {
        font-size: 18px;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        display: block;
        padding: 16px 0;
        transition: color 0.2s ease, padding-left 0.2s ease;
    }

    .nav-links.active a:hover,
    .nav-links.active a.active {
        color: #fff;
        padding-left: 8px;
    }

    .mobile-menu-toggle {
        z-index: 9999 !important;
        position: relative;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .language-toggle {
        top: 85px !important;
        right: 16px !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }

    .blog-search-wrapper {
        margin-top: 24px;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 100px 0 32px;
    }

    .blog-card {
        padding: 20px;
    }

    .blog-card-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .language-toggle {
        top: 85px !important;
        right: 16px !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
}
