:root {
    /* Main Palette */
    --bg-color: #263238;
    --text-color: #EEFFFF;
    --muted-text: #B0BEC5;
    
    /* Accents */
    --accent-blue: #82AAFF;
    --accent-cyan: #89DDFF;
    --accent-teal: #80CBC4;
    --accent-green: #C3E88D;
    --accent-yellow: #FFCB6B;
    --accent-orange: #F78C6C;
    --accent-red: #F07178;
    --accent-purple: #C792EA;

    /* Component Colors */
    --card-bg: #2e3c43;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-color: #37474F;
    --sticky-bg: rgba(38, 50, 56, 0.9);
}

/* Local Fonts */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/static/fonts/roboto-light-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/static/fonts/roboto-light-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/roboto-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/static/fonts/firacode-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Fira Code';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/static/fonts/firacode-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--muted-text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: 1rem;
}

h1 { font-weight: 500; color: var(--text-color); }
h2 { font-weight: 300 !important; color: var(--accent-teal) !important; }
.article-title a { color: var(--accent-teal) !important; font-weight: 300 !important; }
h3 { font-weight: 400; color: var(--text-color); }

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Unified Header / App Bar - Narrow Floating Version */
.sticky-nav-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 960px;
    height: 54px; /* Уменьшенная высота */
    z-index: 1000;
    background: rgba(38, 50, 56, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sticky-nav-wrapper.scrolled {
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 64px;
    background: rgba(38, 50, 56, 0.98);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
}

/* Custom Burger Button Animation */
.custom-burger-btn {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px;
    background: transparent !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.burger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--accent-cyan);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

.custom-burger-btn.is-active .burger-icon span:nth-child(1) {
    transform: rotate(45deg);
    width: 110%;
    top: -1px;
}

.custom-burger-btn.is-active .burger-icon span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.custom-burger-btn.is-active .burger-icon span:nth-child(3) {
    transform: rotate(-45deg);
    width: 110%;
    top: 1px;
}

.custom-burger-btn:hover .burger-icon span {
    background-color: var(--accent-blue);
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .sticky-nav-wrapper {
        top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 54px;
        transform: none !important;
        left: 0 !important;
    }

    .sticky-nav-wrapper .container {
        flex-wrap: wrap; /* Allow menu to drop to next line */
    }
    
    .navbar {
        width: auto;
    }

    .navbar-collapse {
        background: rgb(38, 50, 56) !important; /* Solid background */
        width: 100% !important;
        margin: 0 -1rem;
        padding: 1rem;
        position: relative;
        z-index: 1001;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }
    
    .navbar-nav .nav-link {
        border-bottom: none !important;
        padding: 0.8rem 1rem !important;
        color: var(--text-color) !important;
    }
}

/* Adjustments for fixed header */
body {
    padding-top: 100px;
}

/* New Logo: ZERO [Shield] DAY */
.nav-brand-container {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.nav-logo-text-prefix {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 1.4rem;
    letter-spacing: 0;
    color: #80cbc4; /* Teal ZERO */
}

.nav-logo-text-suffix {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 1.4rem;
    letter-spacing: 0;
    color: #eeffff; /* White DAY */
}

.nav-logo-shield {
    width: 32px;
    height: 32px;
    fill: #B71C1C; /* Тёмно-красный по умолчанию */
    animation: shield-pulse-color 2s infinite ease-in-out;
}

@keyframes shield-pulse-color {
    0% { transform: scale(1); fill: #B71C1C; filter: drop-shadow(0 0 2px rgba(183, 28, 28, 0.4)); }
    50% { transform: scale(1.1); fill: #FF1744; filter: drop-shadow(0 0 8px rgba(255, 23, 68, 0.6)); }
    100% { transform: scale(1); fill: #B71C1C; filter: drop-shadow(0 0 2px rgba(183, 28, 28, 0.4)); }
}

.nav-logo-text {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    color: var(--text-color);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.navbar-nav .nav-link {
    color: var(--muted-text) !important;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem !important;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.navbar-nav .nav-link:hover {
    color: var(--text-color) !important;
    background: rgba(255, 255, 255, 0.05);
}

.navbar-nav .nav-link.active {
    color: var(--accent-cyan) !important;
    background: rgba(137, 221, 255, 0.1);
    border-bottom: 3px solid var(--accent-cyan);
}

/* Material Cards */
.card-article {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.article-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.article-snippet {
    font-size: 1.05rem;
    color: var(--muted-text);
}

.meta-info {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-green);
}

/* Sidebar */
.sidebar-primary {
    border-left: 1px solid var(--border-color);
    padding-left: 2rem;
}

.sidebar-title {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--accent-purple);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-material-primary {
    background-color: var(--accent-blue);
    color: var(--bg-color);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

.btn-material-primary:hover {
    background-color: var(--accent-cyan);
    transform: scale(1.02);
}

.btn-material-outline {
    background: transparent;
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-material-outline:hover {
    background: rgba(137, 221, 255, 0.1);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Code Blocks */
code, pre {
    font-family: 'Fira Code', monospace;
    background-color: #1e272c;
    color: var(--accent-cyan);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

pre {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

/* Tags */
.tag-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: 'Fira Code', monospace;
    margin-right: 0.5rem;
    background-color: var(--border-color);
    color: var(--text-color);
}

.tag-green { background-color: var(--accent-green); color: var(--bg-color); }
.tag-yellow { background-color: var(--accent-yellow); color: var(--bg-color); }
.tag-purple { background-color: var(--accent-purple); color: var(--bg-color); }
