/* Wiki (blog.html) - Desktop-first */

:root {
    --wiki-bg: #070808;
    --wiki-surface: rgba(255, 255, 255, 0.03);
    --wiki-surface-2: rgba(255, 255, 255, 0.05);
    --wiki-border: rgba(255, 255, 255, 0.10);
    --wiki-border-soft: rgba(255, 255, 255, 0.08);
    --wiki-text: rgba(255, 255, 255, 0.92);
    --wiki-muted: rgba(255, 255, 255, 0.64);
    --wiki-dim: rgba(255, 255, 255, 0.42);
    --wiki-primary: #00e676;
    --wiki-primary-glow: rgba(0, 230, 118, 0.35);
    --wiki-max: 1200px;
    --wiki-sidebar: 330px;
    --wiki-rail: 280px;
    --wiki-radius: 18px;
}

body {
    margin: 0;
    background: radial-gradient(1200px 800px at 10% -10%, rgba(0, 230, 118, 0.22), transparent 60%),
        radial-gradient(1000px 700px at 110% 20%, rgba(255, 211, 107, 0.10), transparent 55%),
        radial-gradient(900px 650px at 30% 110%, rgba(120, 96, 255, 0.08), transparent 55%),
        var(--wiki-bg);
    color: var(--wiki-text);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Layout */
.wiki-shell {
    max-width: calc(var(--wiki-max) + var(--wiki-sidebar) + var(--wiki-rail) + 80px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--wiki-sidebar) minmax(0, 1fr) var(--wiki-rail);
    gap: 22px;
    padding: 20px 20px 80px;
    align-items: start;
}

@media (max-width: 1180px) {
    .wiki-shell {
        grid-template-columns: var(--wiki-sidebar) minmax(0, 1fr);
    }

    .wiki-rail {
        display: none;
    }
}

@media (max-width: 900px) {
    .wiki-shell {
        grid-template-columns: 1fr;
        padding: 14px 14px 80px;
    }
}

/* Reading progress bar */
.wiki-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--wiki-primary), rgba(0, 230, 118, 0.25));
    box-shadow: 0 0 18px var(--wiki-primary-glow);
    z-index: 10003;
}

/* Sidebar */
.wiki-sidebar {
    position: sticky;
    top: 84px;
    align-self: start;
    border-radius: var(--wiki-radius);
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.78), rgba(10, 10, 10, 0.58));
    border: 1px solid var(--wiki-border-soft);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: rgba(0, 230, 118, 0.95);
    background: radial-gradient(12px 12px at 30% 30%, rgba(255, 255, 255, 0.12), transparent 70%),
        rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.06) inset;
}

.brand-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--wiki-text);
    line-height: 1.1;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--wiki-dim);
}

.sidebar-search {
    padding: 14px 18px 10px;
}

.sidebar-search input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--wiki-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.40);
}

.sidebar-search input:focus-visible {
    border-color: rgba(0, 230, 118, 0.38);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, 0.14);
    background: rgba(255, 255, 255, 0.05);
}

.search-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.38);
}

kbd {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.82em;
    padding: 0.15rem 0.35rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-nav {
    padding: 4px 10px 16px;
    max-height: calc(100vh - 84px - 190px);
    overflow: auto;
}

.sidebar-loading {
    padding: 18px 10px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.95rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 10px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.14);
    background-clip: padding-box;
}

.category-group {
    margin-top: 14px;
}

.category-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(0, 230, 118, 0.75);
    font-weight: 800;
    padding: 10px 10px 8px;
}

.article-link {
    display: block;
    padding: 10px 12px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
    position: relative;
    line-height: 1.15;
}

.article-link:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    transform: translateX(2px);
}

.article-link.active {
    background: rgba(0, 230, 118, 0.08);
    border-color: rgba(0, 230, 118, 0.18);
    color: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.06) inset;
}

.sidebar-footer {
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 10px;
}

.sidebar-pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 650;
    font-family: 'Space Grotesk', sans-serif;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.sidebar-pill:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}

/* Main */
.wiki-main {
    min-width: 0;
}

.wiki-hero {
    border-radius: var(--wiki-radius);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: radial-gradient(600px 340px at 18% 20%, rgba(0, 230, 118, 0.18), transparent 55%),
        radial-gradient(500px 330px at 90% 40%, rgba(255, 211, 107, 0.10), transparent 60%),
        rgba(255, 255, 255, 0.02);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.hero-inner {
    padding: 26px 26px 22px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.70);
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.22);
}

.hero-title {
    margin: 14px 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1.04;
    font-size: 2.55rem;
    color: rgba(255, 255, 255, 0.98);
}

.hero-subtitle {
    margin: 0;
    color: rgba(255, 255, 255, 0.70);
    font-size: 1.08rem;
    line-height: 1.55;
    max-width: 62ch;
}

.hero-subtitle code {
    background: rgba(0, 230, 118, 0.10);
    border: 1px solid rgba(0, 230, 118, 0.16);
    border-radius: 10px;
    padding: 0.2rem 0.45rem;
    font-family: 'Fira Code', ui-monospace, monospace;
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.90);
}

.hero-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 750;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
    white-space: nowrap;
}

.hero-btn--primary {
    color: #041008;
    border-color: rgba(0, 230, 118, 0.32);
    background: linear-gradient(135deg, rgba(0, 230, 118, 1), rgba(0, 200, 83, 1));
    box-shadow: 0 18px 60px rgba(0, 230, 118, 0.22);
}

.hero-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 80px rgba(0, 230, 118, 0.30);
}

.hero-btn--ghost {
    color: rgba(255, 255, 255, 0.90);
    background: rgba(255, 255, 255, 0.04);
}

.hero-btn--ghost:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
}

.hero-kpis {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kpi {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    padding: 12px 12px;
}

.kpi-label {
    font-size: 0.78rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.50);
    font-weight: 800;
}

.kpi-value {
    margin-top: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 820;
    letter-spacing: -0.4px;
    color: rgba(255, 255, 255, 0.92);
}

/* Article */
.wiki-article {
    margin-top: 22px;
    border-radius: var(--wiki-radius);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.article-head {
    padding: 18px 22px 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.86rem;
}

.markdown-body {
    padding: 22px 22px 30px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.85;
    font-size: 1.07rem;
}

.empty-state {
    padding: 26px 8px 40px;
    text-align: left;
}

.empty-state h2 {
    margin: 0 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: rgba(255, 255, 255, 0.96);
}

.empty-state p {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
}

.markdown-body h1 {
    margin: 0 0 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.75rem;
    line-height: 1.06;
    letter-spacing: -1px;
    font-weight: 950;
    color: rgba(255, 255, 255, 0.98);
}

.markdown-body h2 {
    margin-top: 2.6rem;
    margin-bottom: 0.9rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    letter-spacing: -0.6px;
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.95);
}

.markdown-body h3 {
    margin-top: 2.1rem;
    margin-bottom: 0.7rem;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 850;
    letter-spacing: -0.4px;
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.92);
}

.markdown-body p {
    margin-bottom: 1.2rem;
    color: rgba(255, 255, 255, 0.78);
}

.markdown-body a {
    color: rgba(0, 230, 118, 0.95);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 230, 118, 0.28);
}

.markdown-body a:hover {
    border-bottom-color: rgba(0, 230, 118, 0.55);
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 1.2rem;
    padding-left: 1.25rem;
}

.markdown-body li {
    margin-bottom: 0.55rem;
    color: rgba(255, 255, 255, 0.78);
}

.markdown-body code {
    background: rgba(0, 230, 118, 0.10);
    padding: 0.18rem 0.42rem;
    border-radius: 10px;
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.92em;
    color: rgba(255, 255, 255, 0.90);
    border: 1px solid rgba(0, 230, 118, 0.18);
}

.markdown-body pre {
    position: relative;
    background: rgba(0, 0, 0, 0.35);
    padding: 16px 16px;
    border-radius: 16px;
    overflow-x: auto;
    margin: 1.6rem 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: rgba(255, 255, 255, 0.90);
    border: none;
    font-size: 0.92rem;
}

.code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 12px;
    padding: 7px 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 750;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.code-copy:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.markdown-body blockquote {
    border-left: 3px solid rgba(0, 230, 118, 0.55);
    background: rgba(0, 230, 118, 0.06);
    padding: 14px 16px;
    margin: 1.6rem 0;
    border-radius: 0 16px 16px 0;
    color: rgba(255, 255, 255, 0.86);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    margin: 2.4rem 0;
}

/* Right rail */
.wiki-rail {
    position: sticky;
    top: 84px;
    align-self: start;
    display: grid;
    gap: 16px;
}

.rail-card {
    border-radius: var(--wiki-radius);
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 16px 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.rail-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    letter-spacing: -0.6px;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 10px;
}

.rail-muted {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.95rem;
}

.rail-toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
    line-height: 1.2;
}

.rail-toc a:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.rail-toc a.is-active {
    background: rgba(0, 230, 118, 0.08);
    border-color: rgba(0, 230, 118, 0.18);
    color: rgba(255, 255, 255, 0.94);
}

.rail-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rail-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.84);
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.rail-links a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.rail-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.55;
}

.rail-card--hint {
    border-color: rgba(0, 230, 118, 0.14);
    background: radial-gradient(260px 160px at 20% 30%, rgba(0, 230, 118, 0.12), transparent 60%),
        rgba(0, 0, 0, 0.18);
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 18px;
    left: 18px;
    background: linear-gradient(135deg, rgba(0, 230, 118, 1), rgba(0, 200, 83, 1));
    color: #041008;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    box-shadow: 0 18px 60px rgba(0, 230, 118, 0.22);
    border: 1px solid rgba(0, 230, 118, 0.28);
    cursor: pointer;
}

.sidebar-toggle:active {
    transform: scale(0.98);
}

@media (max-width: 900px) {
    .wiki-sidebar {
        position: fixed;
        top: 80px;
        left: 14px;
        right: 14px;
        bottom: 88px;
        transform: translateY(calc(-100% - 40px));
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 10002;
    }

    .wiki-sidebar.open {
        transform: translateY(0);
    }

    .sidebar-toggle {
        display: flex;
    }

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

    .hero-kpis {
        grid-template-columns: 1fr;
    }

    .markdown-body {
        padding: 18px 16px 28px;
    }

    .article-head {
        padding: 14px 16px 0;
    }
}

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

/* Footer (local) */
.footer-simple {
    margin-top: 36px;
    padding: 26px 18px;
    color: rgba(255, 255, 255, 0.60);
}

.footer-simple .footer-content {
    max-width: calc(var(--wiki-max) + 80px);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-simple .footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.footer-simple a {
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-simple a:hover {
    color: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(0, 230, 118, 0.45);
}
