:root {
    --bg: #f2f4f8;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border: #d8dee7;
    --text: #0f172a;
    --text-muted: #475569;
    --accent: #1e40af;
    --accent-soft: #e7efff;
    --focus: #2563eb;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

.loading-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.loading-card {
    width: min(100%, 540px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 2rem 1.75rem;
    text-align: center;
}

.loading-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #cfdcf8;
}

.loading-card h1 {
    font-size: clamp(1.55rem, 2.2vw, 2rem);
    margin-bottom: 0.45rem;
}

.loading-subtitle {
    margin: 0 auto;
    max-width: 40ch;
    color: var(--text-muted);
}

.loading-progress {
    margin-top: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
}

.loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #d5deeb;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3 {
    margin-top: 0;
    margin-bottom: 0.65rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

p {
    margin-top: 0;
}

ul {
    margin-top: 0.6rem;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-container {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 0 1.35rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    min-height: 4.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #cfdcf8;
}

.brand-text {
    display: grid;
    line-height: 1.15;
}

.brand-name {
    font-size: 1.02rem;
    font-weight: 700;
}

.brand-tagline {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-links a {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 0.45rem;
    color: var(--text-muted);
    font-weight: 600;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--accent-soft);
    color: var(--accent);
    text-decoration: none;
}

.site-main {
    flex: 1;
    padding: 2.25rem 0 3.5rem;
}

.page-intro {
    margin-bottom: 1.5rem;
}

.intro-kicker {
    margin-bottom: 0.42rem;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

.page-intro h1 {
    font-size: clamp(2rem, 2.8vw, 2.45rem);
    margin-bottom: 0.55rem;
}

.page-intro p {
    color: var(--text-muted);
    max-width: 780px;
    margin-bottom: 0;
}

.blog-layout {
    display: grid;
    grid-template-columns: 275px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.blog-sidebar {
    position: sticky;
    top: 5.4rem;
}

.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-card h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.sidebar-caption {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.category-button {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--surface);
    color: var(--text);
    padding: 0.48rem 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    text-align: left;
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.category-button:hover {
    border-color: #bcc8d9;
    background: var(--surface-subtle);
}

.category-button.active {
    border-color: #9eb6eb;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.category-count {
    display: inline-block;
    min-width: 1.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #e9eef5;
    color: #334155;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.2;
}

.blog-content {
    min-width: 0;
}

.blog-results-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.8rem;
    padding: 0.25rem 0;
}

.results-count,
.results-filter {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.results-filter {
    color: var(--accent);
    font-weight: 600;
}

.posts-list {
    display: grid;
    gap: 0.95rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.2rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    border-color: #bfcce0;
    box-shadow: var(--shadow-md);
}

.blog-card-title {
    margin-bottom: 0.4rem;
    font-size: 1.25rem;
}

.blog-card-title a {
    color: var(--text);
}

.blog-card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.blog-card-description {
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    max-width: 78ch;
}

.card-tags,
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
}

.tag {
    display: inline-block;
    background: #eef2f7;
    color: #334155;
    border: 1px solid #dbe2eb;
    border-radius: 999px;
    padding: 0.17rem 0.52rem;
    font-size: 0.76rem;
    font-weight: 600;
}

.blog-card-link {
    display: inline-block;
    margin-top: 0.78rem;
    font-weight: 600;
    font-size: 0.93rem;
}

.blog-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.55rem;
    box-shadow: var(--shadow-md);
}

.article-shell {
    max-width: 860px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.back-link:hover {
    color: var(--accent);
    text-decoration: none;
}

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

.post-header h1 {
    font-size: clamp(1.95rem, 3vw, 2.55rem);
    margin-bottom: 0.62rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.post-content {
    font-size: 1.02rem;
}

.post-content h2,
.post-content h3 {
    margin-top: 1.4rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 0.6rem;
    border: 1px solid #e2e8f0;
}

.post-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.95rem;
    border-radius: 0.65rem;
    overflow-x: auto;
}

.post-content blockquote {
    margin: 1rem 0;
    padding: 0.35rem 1rem;
    border-left: 3px solid #bfd0f5;
    color: #334155;
    background: #f8faff;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.status-panel {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.content-card h2 {
    margin-bottom: 0.65rem;
}

.status-message {
    color: var(--text-muted);
    margin: 1rem 0 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: #ffffff;
    padding: 1.05rem 0;
}

.site-footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem 1rem;
    color: var(--text-muted);
    font-size: 0.86rem;
}

.footer-block {
    display: grid;
    gap: 0.15rem;
}

.footer-title,
.footer-subtitle,
.footer-tech {
    margin: 0;
}

.footer-title {
    color: var(--text);
    font-weight: 600;
}

.footer-tech {
    font-weight: 600;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 0.35rem;
}

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .site-main {
        padding-top: 1.7rem;
    }

    .nav-toggle {
        display: inline-block;
    }

    .nav-container {
        position: relative;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.25rem);
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        min-width: 12rem;
        background: #ffffff;
        border: 1px solid var(--border);
        border-radius: 0.7rem;
        padding: 0.45rem;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .brand-tagline {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
