/*
Theme Name: Darkware
Theme URI: https://2nights.tech
Author: 2nights.tech
Author URI: https://2nights.tech
Description: Уютная тема для вечернего чтения в стиле thecode.media
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: darkware
*/

:root {
    --accent: #00ff88;
    --accent-soft: #00cc6e;
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-card: #1a1a1a;
    --fg: #e8e8e8;
    --fg-muted: #b8b8b8;
    --gray: #888888;
    --gray-dark: #525252;
    --glow: rgba(0, 255, 136, 0.15);
}

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

::selection {
    background: var(--accent);
    color: #000;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
}

header.site-header:hover {
    background: rgba(10, 10, 10, 0.95);
    border-bottom-color: rgba(0, 255, 136, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.site-title {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    gap: 0.25rem;
    transition: transform 0.3s ease;
}

.site-title:hover {
    transform: translateX(4px);
}

.site-title .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

.site-title .tagline {
    font-size: 0.625rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.site-title:hover .logo {
    color: var(--accent);
}

.site-title:hover .tagline {
    color: var(--accent-soft);
}

/* Navigation Menu */
.site-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.9rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    display: block;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: var(--accent);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--glow);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
    width: 100%;
}

/* Search Button */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
}

.search-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fg-muted);
    cursor: pointer;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.search-toggle:hover {
    color: var(--accent);
    background: rgba(0, 255, 136, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-2px);
}

/* Search Modal */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    background: var(--bg-card);
    border-radius: 1.25rem;
    padding: 2.5rem;
    max-width: 640px;
    width: 90%;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--glow);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: scale(1);
}

.search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--gray);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.search-close:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.search-modal form {
    margin: 0;
}

.search-modal input[type="search"] {
    width: 100%;
    background: var(--bg);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.25rem 1.75rem;
    font-size: 1.125rem;
    color: var(--fg);
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-modal input[type="search"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--glow), 0 0 30px var(--glow);
}

.search-modal input[type="search"]::placeholder {
    color: var(--gray);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 60;
}

.mobile-menu-toggle span {
    display: block;
    width: 1.5rem;
    height: 2px;
    background: var(--fg);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(0.5rem) rotate(45deg);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-0.5rem) rotate(-45deg);
}

/* Main */
main {
    min-height: 100vh;
    padding-top: 6rem;
    padding-bottom: 4rem;
}

/* Featured Post */
.featured-post {
    margin-bottom: 5rem;
}

.featured-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    border-radius: 1.5rem;
    overflow: hidden;
    height: 640px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-link:hover {
    border-color: rgba(0, 255, 136, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 60px var(--glow);
    transform: translateY(-8px);
}

.featured-image {
    position: absolute;
    inset: 0;
    background: var(--bg-card);
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-link:hover .featured-image img {
    transform: scale(1.08);
}

.featured-image .no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    color: var(--gray-dark);
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
    transition: opacity 0.5s ease;
}

.featured-link:hover .featured-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.4) 40%, transparent 100%);
}

.featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3.5rem;
    z-index: 1;
    transition: transform 0.5s ease;
}

.featured-link:hover .featured-content {
    transform: translateY(-8px);
}

.featured-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.featured-link:hover .featured-title {
    color: var(--accent);
}

.featured-excerpt {
    font-size: 1.125rem;
    color: #d4d4d4;
    max-width: 640px;
    line-height: 1.8;
}

/* Section Title */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    letter-spacing: -0.01em;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 2.25rem;
    background: linear-gradient(180deg, var(--accent), var(--accent-soft));
    border-radius: 2px;
    box-shadow: 0 0 10px var(--glow);
}

/* Posts List */
.posts-list {
    display: grid;
    gap: 3rem;
}

.post-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 3rem;
    transition: border-color 0.3s ease;
}

.post-item:hover {
    border-bottom-color: rgba(0, 255, 136, 0.2);
}

.post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.post-link {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.post-link:hover {
    transform: translateX(8px);
}

.post-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.4s ease;
}

.post-link:hover .post-thumbnail {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--glow);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-link:hover .post-thumbnail img {
    transform: scale(1.1);
}

.post-thumbnail .no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: var(--gray-dark);
}

.post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.post-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.post-category {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    background: rgba(0, 255, 136, 0.12);
    color: var(--accent);
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.post-category:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 15px var(--glow);
}

.post-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.post-link:hover .post-title {
    color: var(--accent);
}

.post-excerpt {
    font-size: 1.05rem;
    color: var(--fg-muted);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-date {
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 500;
}

/* Single Post */
/* .single-post {
    max-width: 1100px;
    margin: 0 auto;
} */

.breadcrumbs {
    margin-bottom: 2.5rem;
    font-size: 0.875rem;
    color: var(--gray);
    font-weight: 500;
}

.breadcrumbs a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.post-header {
    margin-bottom: 3.5rem;
}

.post-header .post-categories {
    margin-bottom: 1.5rem;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.post-header .post-meta {
    color: var(--gray);
    margin-bottom: 2.5rem;
}

.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--fg-muted);
}

.post-content p {
    margin-bottom: 1.75rem;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--fg);
}

.post-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
}

.post-content a:hover {
    border-bottom-color: var(--accent);
    box-shadow: 0 2px 0 0 var(--glow);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-content ul,
.post-content ol {
    margin-left: 1.75rem;
    margin-bottom: 1.75rem;
}

.post-content li {
    margin-bottom: 0.75rem;
}

.post-content code {
    background: var(--bg-card);
    padding: 0.25rem 0.6rem;
    border-radius: 0.375rem;
    color: var(--accent);
    font-size: 0.95em;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.post-content pre {
    background: var(--bg-card);
    padding: 1.75rem;
    border-radius: 1rem;
    overflow-x: auto;
    margin-bottom: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.post-content pre code {
    background: none;
    padding: 0;
    border: none;
}

.post-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 1.75rem;
    font-style: italic;
    margin: 2.5rem 0;
    color: var(--gray);
    font-size: 1.15rem;
    background: rgba(0, 255, 136, 0.03);
    padding: 1.5rem 1.75rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.back-link {
    margin-top: 5rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    transition: all 0.3s ease;
}

.back-link a:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 20px var(--glow);
    transform: translateX(-4px);
}

/* Footer */
footer.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 8rem;
    background: var(--bg-elevated);
}

footer.site-footer .container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

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

.footer-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section p,
.footer-section li {
    font-size: 0.9rem;
    color: var(--fg-muted);
    line-height: 1.7;
}

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

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

.footer-section a {
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-section a.accent {
    color: var(--accent);
    font-weight: 600;
}

.footer-section a.accent:hover {
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray);
}

/* Pagination */
.pagination {
    margin-top: 5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.pagination .nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 20px var(--glow);
}

.pagination .dots {
    border: none;
    background: none;
}

/* Archive & Search Headers */
.archive-header,
.search-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 2.5rem;
}

/* Responsive */
@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .site-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 2rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        overflow-y: auto;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .site-nav.active {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

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

    .nav-menu a {
        padding: 1.25rem 0;
        font-size: 1.125rem;
    }

    .nav-actions {
        margin-left: 0;
        width: 100%;
        padding-top: 1rem;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .featured-link {
        height: 500px;
    }

    .featured-content {
        padding: 2.5rem;
    }

    .post-link {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-title .logo {
        font-size: 1.35rem;
    }

    .site-title .tagline {
        font-size: 0.55rem;
    }

    main {
        padding-top: 7rem;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Smooth animations on scroll */
@media (prefers-reduced-motion: no-preference) {

    .post-item,
    .featured-post,
    .section-title {
        opacity: 0;
        animation: fadeInUp 0.6s ease forwards;
    }

    .post-item:nth-child(1) {
        animation-delay: 0.1s;
    }

    .post-item:nth-child(2) {
        animation-delay: 0.2s;
    }

    .post-item:nth-child(3) {
        animation-delay: 0.3s;
    }

    .post-item:nth-child(4) {
        animation-delay: 0.4s;
    }

    .post-item:nth-child(5) {
        animation-delay: 0.5s;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cozy reading mode enhancements */
.post-content {
    text-rendering: optimizeLegibility;
}

.post-content p:first-of-type {
    font-size: 1.25rem;
    color: var(--fg);
}

/* Subtle glow effects */
.featured-link:hover,
.post-link:hover .post-thumbnail,
.search-toggle:hover,
.back-link a:hover {
    animation: subtleGlow 2s ease-in-out infinite;
}

@keyframes subtleGlow {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.05);
    }
}

/* ============================================
   НОВАЯ ГЛАВНАЯ СТРАНИЦА
   ============================================ */

/* Hero Section */
.hero-post {
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    border-radius: 1.5rem;
    overflow: hidden;
    height: 700px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-card);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-link:hover {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 80px var(--glow);
    transform: translateY(-12px) scale(1.01);
}

.hero-image {
    position: absolute;
    inset: 0;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-link:hover .hero-image img {
    transform: scale(1.1) rotate(1deg);
}

.hero-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-dark);
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4rem;
    z-index: 2;
    transition: transform 0.6s ease;
}

.hero-link:hover .hero-content {
    transform: translateY(-12px);
}

.hero-categories {
    margin-bottom: 1.25rem;
}

.hero-category {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent);
    border-radius: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid rgba(0, 255, 136, 0.3);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    transition: color 0.3s ease;
}

.hero-link:hover .hero-title {
    color: var(--accent);
}

.hero-excerpt {
    font-size: 1.35rem;
    line-height: 1.6;
    color: #d4d4d4;
    max-width: 720px;
    margin-bottom: 1.5rem;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--gray);
    font-weight: 600;
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Categories Tabs */
.categories-section {
    margin-bottom: 3.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s 0.2s ease forwards;
}

.categories-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0.5rem 0 1rem 0;
    scrollbar-width: none;
}

.categories-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3rem;
    color: var(--fg-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--fg);
    transform: translateY(-2px);
}

.category-tab.active {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 255, 136, 0.08));
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 25px var(--glow);
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-count {
    padding: 0.15rem 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.category-tab.active .tab-count {
    background: rgba(0, 255, 136, 0.2);
}

/* Grid Sections */
.posts-grid-section {
    margin-bottom: 4rem;
}

.posts-featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.posts-main-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-post-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.grid-post-card:nth-child(1) {
    animation-delay: 0.1s;
}

.grid-post-card:nth-child(2) {
    animation-delay: 0.15s;
}

.grid-post-card:nth-child(3) {
    animation-delay: 0.2s;
}

.grid-post-card:nth-child(4) {
    animation-delay: 0.25s;
}

.grid-post-card:nth-child(5) {
    animation-delay: 0.3s;
}

.grid-post-card:nth-child(6) {
    animation-delay: 0.35s;
}

.grid-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border-radius: 1.25rem;
    /* overflow: visible; */
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.grid-card-link:hover {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 40px var(--glow);
    transform: translateY(-8px);
}

.grid-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 1.25rem 1.25rem 0 0;
    overflow: hidden;
}

.featured-card .grid-card-image {
    aspect-ratio: 21 / 9;
}

.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 1.25rem 1.25rem 0 0;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-card-link:hover .grid-card-image img {
    transform: scale(1.12) rotate(1deg);
}

.card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.25rem 1.25rem 0 0;
    font-size: 4rem;
    color: var(--gray-dark);
}

.card-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.5rem;
    z-index: 2;
}

.grid-card-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.grid-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card .grid-card-title {
    font-size: 1.75rem;
    -webkit-line-clamp: 3;
}

.grid-card-link:hover .grid-card-title {
    color: var(--accent);
}

.grid-card-excerpt {
    font-size: 1rem;
    color: var(--fg-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.grid-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 600;
    margin-top: auto;
}

/* Load More */
.load-more-section {
    margin: 4rem 0;
    text-align: center;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3rem;
    color: var(--fg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s ease;
    font-family: inherit;
}

.load-more-btn:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 30px var(--glow);
    transform: translateY(-4px);
}

.load-more-btn svg {
    transition: transform 0.3s ease;
}

.load-more-btn:hover svg {
    transform: translateY(4px);
}

/* Popular Tags */
.popular-tags-section {
    margin: 5rem 0;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

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

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2rem;
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tag-pill:hover {
    background: rgba(0, 255, 136, 0.12);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 20px var(--glow);
    transform: translateY(-3px);
}

.tag-count {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.tag-pill:hover .tag-count {
    background: rgba(0, 255, 136, 0.2);
}

/* Responsive для новой главной */
@media (max-width: 1024px) {
    .posts-main-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-link {
        height: 600px;
    }
}

@media (max-width: 768px) {

    .posts-featured-grid,
    .posts-main-grid {
        grid-template-columns: 1fr;
    }

    .hero-link {
        height: 500px;
    }

    .hero-content {
        padding: 2.5rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-excerpt {
        font-size: 1.1rem;
    }

    .categories-tabs {
        gap: 0.5rem;
    }

    .category-tab {
        padding: 0.7rem 1.25rem;
        font-size: 0.85rem;
    }

    .grid-card-content {
        padding: 1.5rem;
    }

    .grid-card-title {
        font-size: 1.25rem;
        -webkit-line-clamp: 3;
    }

    .featured-card .grid-card-title {
        font-size: 1.5rem;
        -webkit-line-clamp: 4;
    }

    .popular-tags-section {
        padding: 2rem;
    }
}
/* ============================================
   УЛУЧШЕННАЯ МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================ */

/* Общие улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем минимальный размер кликабельных элементов для touch */
    a, button, .category-tab, .tag-pill, .load-more-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Убираем hover-эффекты на touch-устройствах */
    .hero-link:hover,
    .grid-card-link:hover,
    .post-link:hover {
        transform: none;
    }
    
    /* Делаем нажатия более отзывчивыми */
    a, button {
        -webkit-tap-highlight-color: rgba(0, 255, 136, 0.2);
    }
}

/* Планшеты и небольшие ноутбуки (до 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 1.75rem;
    }
    
    .hero-link {
        height: 650px;
    }
    
    .hero-content {
        padding: 3.5rem;
    }
    
    .hero-title {
        font-size: clamp(2.25rem, 4.5vw, 4rem);
    }
    
    .posts-main-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }
}

/* Планшеты портретная ориентация (до 1024px) */
@media (max-width: 1024px) {
    body {
        font-size: 15px;
    }
    
    .hero-link {
        height: 580px;
    }
    
    .hero-content {
        padding: 3rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3.5rem);
        margin-bottom: 1.25rem;
    }
    
    .hero-excerpt {
        font-size: 1.2rem;
    }
    
    .posts-featured-grid {
        gap: 1.5rem;
    }
    
    .posts-main-grid {
        gap: 1.5rem;
    }
    
    .grid-card-content {
        padding: 1.6rem;
    }
    
    .popular-tags-section {
        padding: 2.5rem;
    }
    
    .section-heading {
        font-size: 1.5rem;
    }
}

/* Мобильные устройства и малые планшеты (до 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 1.25rem;
    }
    
    /* Хедер */
    .header-content {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .site-title .logo {
        font-size: 1.25rem;
    }
    
    .site-title .tagline {
        font-size: 0.65rem;
    }
    
    main {
        padding-top: 6rem;
        padding-bottom: 3rem;
    }
    
    /* Hero секция */
    .hero-link {
        height: 520px;
        border-radius: 1.25rem;
    }
    
    .hero-content {
        padding: 2.25rem;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .hero-excerpt {
        font-size: 1.05rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-meta {
        font-size: 0.85rem;
        gap: 1rem;
    }
    
    .hero-category {
        font-size: 0.7rem;
        padding: 0.4rem 1rem;
    }
    
    /* Категории */
    .categories-section {
        margin-bottom: 2.5rem;
    }
    
    .categories-tabs {
        gap: 0.6rem;
        padding: 0.35rem 0 0.85rem 0;
    }
    
    .category-tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .tab-icon {
        font-size: 1.1rem;
    }
    
    /* Сетки */
    .posts-featured-grid,
    .posts-main-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .posts-grid-section {
        margin-bottom: 3rem;
    }
    
    .grid-card-link {
        border-radius: 1rem;
    }
    
    .grid-card-image {
        border-radius: 1rem 1rem 0 0;
        aspect-ratio: 16 / 10;
    }
    
    .featured-card .grid-card-image {
        aspect-ratio: 16 / 10;
    }
    
    .card-placeholder {
        font-size: 3rem;
    }
    
    .card-category-badge {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.35rem 0.85rem;
        font-size: 0.7rem;
    }
    
    .grid-card-content {
        padding: 1.4rem;
        gap: 0.65rem;
    }
    
    .grid-card-title {
        font-size: 1.2rem;
        -webkit-line-clamp: 3;
    }
    
    .featured-card .grid-card-title {
        font-size: 1.4rem;
        -webkit-line-clamp: 4;
    }
    .grid-card-excerpt {
        font-size: 0.95rem;
    }
    
    .grid-card-meta {
        font-size: 0.8rem;
    }
    
    /* Кнопка загрузки */
    .load-more-section {
        margin: 3rem 0;
    }
    
    .load-more-btn {
        padding: 1rem 2.25rem;
        font-size: 0.95rem;
    }
    
    /* Теги */
    .popular-tags-section {
        margin: 4rem 0;
        padding: 2rem;
        border-radius: 1.25rem;
    }
    
    .section-heading {
        font-size: 1.35rem;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .heading-icon {
        font-size: 1.5rem;
    }
    
    .tags-cloud {
        gap: 0.6rem;
    }
    
    .tag-pill {
        padding: 0.6rem 1.15rem;
        font-size: 0.85rem;
    }
    
    /* Футер */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    footer.site-footer .container {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Пост */
    .post-header h1 {
        font-size: clamp(1.75rem, 5vw, 2.75rem);
        margin-bottom: 1.25rem;
    }
    
    .post-content {
        font-size: 1.05rem;
    }
    
    .post-content p:first-of-type {
        font-size: 1.15rem;
    }
    
    .post-content h2 {
        font-size: 1.65rem;
        margin-top: 2.5rem;
        margin-bottom: 1.25rem;
    }
    
    .post-content h3 {
        font-size: 1.35rem;
        margin-top: 2rem;
        margin-bottom: 0.85rem;
    }
    
    .post-content img {
        margin: 2rem 0;
        border-radius: 0.75rem;
    }
    
    .post-content pre {
        padding: 1.35rem;
        border-radius: 0.75rem;
        font-size: 0.9rem;
    }
    
    .post-content blockquote {
        padding: 1.25rem 1.5rem;
        margin: 2rem 0;
        font-size: 1.05rem;
        border-radius: 0 0.4rem 0.4rem 0;
    }
    
    .back-link {
        margin-top: 3.5rem;
        padding-top: 2rem;
    }
    
    /* Пагинация */
    .pagination {
        margin-top: 3.5rem;
    }
    
    .pagination a,
    .pagination span {
        min-width: 2.5rem;
        height: 2.5rem;
        padding: 0 1rem;
        font-size: 0.8rem;
    }
    
    /* Поиск */
    .search-modal-content {
        width: 95%;
        max-width: none;
        padding: 2rem;
    }
}

/* Малые мобильные устройства (до 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    main {
        padding-top: 5.5rem;
        padding-bottom: 2.5rem;
    }
    
    /* Хедер */
    .header-content {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
    
    .site-title .logo {
        font-size: 1.1rem;
    }
    
    .site-title .tagline {
        font-size: 0.6rem;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
    }
    
    /* Hero */
    .hero-link {
        height: 450px;
        border-radius: 1rem;
    }
    
    .hero-content {
        padding: 1.75rem;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.25rem);
        line-height: 1.15;
    }
    
    .hero-excerpt {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .hero-meta {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    .hero-category {
        font-size: 0.65rem;
        padding: 0.35rem 0.85rem;
    }
    
    /* Категории */
    .category-tab {
        padding: 0.65rem 1.1em;
        font-size: 0.8rem;
    }
    
    .tab-count {
        padding: 0.1rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Карточки */
    .grid-card-link {
        border-radius: 0.85rem;
    }
    
    .grid-card-image {
        border-radius: 0.85rem 0.85rem 0 0;
    }
    
    .grid-card-content {
        padding: 1.25rem;
    }
    
    .grid-card-title {
        font-size: 1.1rem;
        -webkit-line-clamp: 3;
    }
    
    .featured-card .grid-card-title {
        font-size: 1.3rem;
        -webkit-line-clamp: 4;
    }
    
    .grid-card-excerpt {
        font-size: 0.9rem;
    }
    
    /* Теги */
    .popular-tags-section {
        padding: 1.5rem;
        margin: 3rem 0;
    }
    
    .section-heading {
        font-size: 1.2rem;
        flex-wrap: wrap;
    }
    
    .tag-pill {
        padding: 0.55rem 1rem;
        font-size: 0.8rem;
    }
    
    /* Футер */
    footer.site-footer .container {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
    }
    
    /* Пост */
    .post-header h1 {
        font-size: clamp(1.5rem, 6vw, 2.25rem);
        line-height: 1.2;
    }
    
    .post-content {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .post-content p:first-of-type {
        font-size: 1.1rem;
    }
    
    .post-content h2 {
        font-size: 1.45rem;
        margin-top: 2rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
        margin-top: 1.75rem;
    }
    
    .post-content pre {
        padding: 1.15rem;
        font-size: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .post-content img {
        border-radius: 0.65rem;
        margin: 1.5rem 0;
    }
    
    .post-content blockquote {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
    
    .back-link a {
        padding: 0.65rem 1.35rem;
        font-size: 0.9rem;
    }
}

/* Очень малые экраны (до 360px) */
@media (max-width: 360px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 0 0.85rem;
    }
    
    .hero-link {
        height: 400px;
    }
    
    .hero-content {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.35rem;
    }
    
    .hero-excerpt {
        font-size: 0.9rem;
    }
    
    .grid-card-content {
        padding: 1.1rem;
    }
    
    .grid-card-title {
        font-size: 1.05rem;
        -webkit-line-clamp: 3;
    }
    
    .post-content {
        font-size: 0.95rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-link {
        height: 400px;
    }
    
    .hero-content {
        padding: 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-excerpt {
        font-size: 0.95rem;
    }
    
    main {
        padding-top: 5rem;
    }
}

/* Улучшения для iOS Safari */
@supports (-webkit-touch-callout: none) {
    /* Убираем баунс-эффект */
    body {
        position: fixed;
        width: 100%;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Улучшаем сглаживание шрифтов */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Улучшения производительности на мобильных */
@media (max-width: 768px) {
    /* Используем transform вместо позиционирования для анимаций */
    .hero-link,
    .grid-card-link,
    .category-tab,
    .tag-pill {
        will-change: transform;
    }
    
    /* Оптимизируем backdrop-filter для производительности */
    header.site-header {
        backdrop-filter: blur(10px);
    }
    
    /* Упрощаем тени на слабых устройствах */
    .hero-link:hover,
    .grid-card-link:hover {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

/* Accessibility улучшения для мобильных */
@media (max-width: 768px) {
    /* Увеличиваем размер фокуса для клавиатурной навигации */
    a:focus,
    button:focus {
        outline: 2px solid var(--accent);
        outline-offset: 3px;
    }
    
    /* Улучшаем читаемость для skip-links */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 0;
        background: var(--accent);
        color: #000;
        padding: 0.75rem 1.5rem;
        z-index: 100;
        font-weight: 700;
    }
    
    .skip-link:focus {
        top: 0;
    }
}

/* Dark mode оптимизации для OLED экранов */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --bg-elevated: #0f0f0f;
        --bg-card: #141414;
    }
}


/* ============================================
   УЛУЧШЕННОЕ МОБИЛЬНОЕ МЕНЮ
   ============================================ */

/* Базовые стили для мобильного меню-кнопки */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
    position: relative;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--fg);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-menu-toggle span:not(:last-child) {
    margin-bottom: 6px;
}

/* Анимация гамбургер меню */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
    background: var(--accent);
}

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

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
    background: var(--accent);
}

/* Оверлей для мобильного меню */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 40;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Модальное окно поиска */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    pointer-events: all;
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: scale(1);
}

.search-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fg);
    font-size: 1.75rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.search-close:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.4);
    transform: rotate(90deg);
}

.search-modal form {
    margin: 0;
}

.search-modal input[type="search"] {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: var(--fg);
    font-size: 1.125rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-modal input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.search-modal input[type="search"]::placeholder {
    color: var(--gray);
}

/* Улучшенные стили для поиска на мобильных */
@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        padding: 2rem;
        border-radius: 1.25rem;
    }
    
    .search-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
    
    .search-modal input[type="search"] {
        padding: 1.1rem 1.35rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .search-modal-content {
        padding: 1.75rem;
        border-radius: 1rem;
    }
    
    .search-modal input[type="search"] {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Touch-friendly элементы управления */
@media (hover: none) and (pointer: coarse) {
    .mobile-menu-toggle,
    .search-toggle,
    .search-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    .nav-menu a {
        padding: 1rem 0;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Скрытие элементов навигации на маленьких экранах */
@media (max-width: 968px) {
    .site-nav {
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
    }
    
    /* Плавное появление пунктов меню */
    .site-nav.active .nav-menu li {
        animation: slideInRight 0.4s ease forwards;
        opacity: 0;
    }
    
    .site-nav.active .nav-menu li:nth-child(1) {
        animation-delay: 0.1s;
    }
    
    .site-nav.active .nav-menu li:nth-child(2) {
        animation-delay: 0.15s;
    }
    
    .site-nav.active .nav-menu li:nth-child(3) {
        animation-delay: 0.2s;
    }
    
    .site-nav.active .nav-menu li:nth-child(4) {
        animation-delay: 0.25s;
    }
    
    .site-nav.active .nav-menu li:nth-child(5) {
        animation-delay: 0.3s;
    }
}

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

/* Предотвращение скролла при открытом меню */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

