:root {
    --bg: #050711;
    --bg-alt: #101322;
    --card: #151827;
    --accent: #f9a825;
    --accent-soft: rgba(249, 168, 37, 0.2);
    --text: #f5f5f5;
    --text-muted: #b0b3c0;
    --border: #252945;
    --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.55);
    --radius-lg: 14px;
    --radius-sm: 8px;
    --transition-fast: 0.18s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Светлая тема */
body[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-alt: #ffffff;
    --card: #ffffff;
    --text: #111827;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.12);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    background: linear-gradient(90deg,
        rgba(5, 7, 17, 0.93),
        rgba(13, 15, 32, 0.93));
}

body[data-theme="light"] .site-header {
    background: linear-gradient(90deg,
        rgba(249, 250, 251, 0.97),
        rgba(243, 244, 246, 0.97));
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.logo-icon {
    filter: drop-shadow(0 0 8px rgba(249, 168, 37, 0.5));
}

.logo-text {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.25rem;
    font-size: 0.9rem;
    position: relative;
    padding-bottom: 0.2rem;
    transition: color var(--transition-fast);
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f9a825, #ff6f00);
    transition: width var(--transition-fast);
}

.main-nav a:hover {
    color: #ffffff;
}

body[data-theme="light"] .main-nav a:hover {
    color: #111827;
}

.main-nav a:hover::after {
    width: 100%;
}

/* Theme toggle */

.theme-toggle {
    border: none;
    background: rgba(0, 0, 0, 0.15);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 1rem;
    transition: background var(--transition-fast), transform var(--transition-fast);
    font-size: 1rem;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

body[data-theme="light"] .theme-toggle {
    background: rgba(17, 24, 39, 0.06);
}

/* Layout */

.container {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
    flex: 1 0 auto;
}

/* Hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 2rem;
    align-items: center;
    margin: 1.5rem 0 2rem;
}

.hero-text h1 {
    font-size: clamp(2rem, 3vw, 2.6rem);
    margin: 0 0 0.75rem;
}

.hero-text p {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    max-width: 32rem;
}

.hero-ascii {
    background: radial-gradient(circle at top, rgba(249, 168, 37, 0.1), var(--bg-alt));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(249, 168, 37, 0.25);
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.25rem;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.75rem;
    color: #ffe082;
    overflow: auto;
}

/* Buttons */

.btn-primary,
.btn-secondary {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.6rem 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-fast),
                background var(--transition-fast),
                color var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, #f9a825, #ff6f00);
    color: #050711;
    box-shadow: 0 6px 18px rgba(249, 168, 37, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(249, 168, 37, 0.45);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Content layout */

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(260px, 1fr);
    gap: 2rem;
    align-items: flex-start;
}

/* Posts */

.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tag-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tag-filter select {
    background: #080b1a;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

body[data-theme="light"] .tag-filter select {
    background: #f9fafb;
}

.content-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
    padding: 1.1rem 1.3rem 1.2rem;
    position: relative;
    overflow: hidden;
}

.post-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.post-card p {
    margin: 0 0 0.6rem;
    color: #d0d3e6;
    font-size: 0.9rem;
}

body[data-theme="light"] .post-card p {
    color: #111827;
}

.read-more {
    font-size: 0.85rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffc947;
    position: relative;
    padding-bottom: 0.15rem;
}

.read-more::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, #ffc947, transparent);
    transition: width var(--transition-fast);
}

.read-more:hover::after {
    width: 100%;
}

/* Sidebar */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-block {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1rem 1.1rem;
}

.sidebar-block h3 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffe082;
}

.sidebar-block p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0.2rem 0 0;
}

.sidebar-list li {
    margin-bottom: 0.4rem;
}

.sidebar-list a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 0.9rem;
}

body[data-theme="light"] .sidebar-list a {
    color: #111827;
}

.sidebar-list a:hover {
    color: #ffc947;
}

/* Full post view */

.post-view {
    max-width: 740px;
    margin: 2rem auto 3rem;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem 1.8rem;
}

.post-view h1 {
    margin: 0 0 0.6rem;
    font-size: 1.6rem;
}

.post-view-content p {
    margin: 0 0 0.8rem;
    font-size: 0.98rem;
    line-height: 1.6;
}

/* Footer */

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.9rem 1.5rem 1.3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-ascii {
        order: -1;
    }
    .content-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    .main-nav a {
        margin-left: 0.6rem;
        font-size: 0.85rem;
    }
    .container {
        padding-inline: 1rem;
    }
    .site-footer {
        flex-direction: column;
        gap: 0.6rem;
        align-items: flex-start;
    }
}
