/* ============================================================
   Site Docs - ASCII Block Shading Greyscale Theme
   with defended.net site chrome (header / subnav / footer)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f0f0f0;
    --color-bg-alt: #eaeaea;
    --color-bg-sidebar: #e8e8e8;
    --color-text: #111111;
    --color-text-secondary: #333333;
    --color-text-muted: #666666;
    --color-border: #999999;
    --color-border-light: #bbbbbb;
    --color-primary: #333333;
    --color-primary-light: #e0e0e0;
    --color-primary-dark: #111111;
    --color-accent: #222222;
    --color-accent-light: #dddddd;
    --color-code-bg: #f8f8f8;
    --color-code-text: #333333;
    --color-inline-code-bg: #dcdcdc;
    --color-inline-code-text: #111111;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    --sidebar-width: 280px;
    --content-max-width: 1400px;
}

/* ============================================================
   defended. site chrome - design tokens ported from the main
   site. Used by the header, docs subnav and footer so those
   match defended.net exactly. The docs content area below keeps
   its own greyscale theme.
   ============================================================ */

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: url('/fonts/jetbrains-mono-700.woff2') format('woff2');
}

:root {
    --paper: #ffffff;
    --paper-2: #e6f6fc;
    --ink: #17171e;
    --ink-60: rgba(23, 23, 30, 0.6);
    --ink-40: rgba(23, 23, 30, 0.4);
    --blue: #eefbff;
    --blue-2: #d9f1fa;
    --sky: #2fafe3;
    --sky-dark: #1b87b5;
    --line: #17171e;
    --hairline: rgba(23, 23, 30, 0.18);
    --footer-rule: rgba(23, 23, 30, 0.14);
    --shade-hover: #d9f1fa;
    --font-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    /* Large-viewport scale unit: exactly 1px at <= 1920px, grows above. */
    --su: clamp(1px, calc(100vw / 1920), 1.9px);
    --nav-h: calc(62 * var(--su));
    --maxw: calc(1392 * var(--su));
    --slant: clamp(56px, 8vw, calc(120 * var(--su)));
}

[data-theme="dark"] {
    --paper: #17171c;
    --paper-2: #232329;
    --ink: #edeef0;
    --ink-60: rgba(237, 238, 240, 0.62);
    --ink-40: rgba(237, 238, 240, 0.4);
    --blue: #202028;
    --blue-2: #262630;
    --sky-dark: #6fcff2;
    --line: #4a4a57;
    --hairline: rgba(237, 238, 240, 0.16);
    --footer-rule: rgba(237, 238, 240, 0.14);
    --shade-hover: #262630;
}

:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
    font-family: var(--font-mono);
    color: var(--color-text);
    /* Page background matches defended.net (--paper); content blocks keep
       their own greyscale backgrounds via --color-bg and friends. */
    background: var(--paper);
    line-height: 1.8;
}

/* --- Site Header (ported from defended.net) --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: var(--blue-2);
    border-bottom: 2px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: calc(24 * var(--su));
    width: auto;
    display: block;
}

[data-theme="dark"] .brand-logo {
    filter: invert(1);
}

.site-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 26px;
}

.site-nav > a,
.nav-dropdown-trigger {
    font-family: var(--font-mono);
    font-size: calc(11.5 * var(--su));
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    transition: color 0.2s var(--ease);
    white-space: nowrap;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-nav > a[aria-current="page"] {
    cursor: default;
}

.site-nav > a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--sky);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.site-nav > a:hover::after,
.site-nav > a[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav-dropdown {
    position: relative;
}
.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
}
.nav-dropdown-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    opacity: 0;
    pointer-events: none;
    min-width: calc(210 * var(--su));
    padding: calc(6 * var(--su));
    background: var(--paper);
    border: 2px solid var(--line);
    box-shadow: 5px 5px 0 var(--line);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
    z-index: 40;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.nav-dropdown-item {
    display: block;
    padding: calc(8 * var(--su)) calc(14 * var(--su));
    font-family: var(--font-body);
    font-size: calc(14 * var(--su));
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-dropdown-item:hover {
    color: var(--ink);
    background: var(--shade-hover);
}
.nav-dropdown-item--heading {
    font-weight: 600;
    color: var(--ink);
}
.nav-dropdown-item--heading:not(:last-of-type) {
    border-bottom: 2px solid var(--line);
    margin-bottom: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Header chips - bordered, hard-shadow switch style. */
.cta-pill,
.theme-toggle,
.nav-burger {
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--line);
    color: var(--ink);
    transition: transform 0.14s ease, box-shadow 0.14s ease, color 0.2s ease;
}

.cta-pill:hover,
.theme-toggle:hover,
.nav-burger:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--line);
}
.cta-pill:active,
.theme-toggle:active,
.nav-burger:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--line);
}

.cta-pill {
    font-family: var(--font-mono);
    font-size: calc(10 * var(--su));
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: calc(8 * var(--su)) calc(14 * var(--su));
    display: inline-block;
}
.cta-pill:hover {
    color: var(--ink);
}

.theme-toggle,
.nav-burger {
    width: calc(36 * var(--su));
    height: calc(36 * var(--su));
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    cursor: pointer;
}

.nav-burger {
    display: none;
}

.theme-icon {
    width: calc(16 * var(--su));
    height: calc(16 * var(--su));
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.theme-icon--sun {
    display: none;
}
[data-theme="dark"] .theme-icon--sun {
    display: block;
}
[data-theme="dark"] .theme-icon--moon {
    display: none;
}

/* Burger open/close icon swap */
.nav-burger .burger-close {
    display: none;
}
.nav-burger.active .burger-close {
    display: block;
}
.nav-burger.active .burger-open {
    display: none;
}

/* Mobile menu panel */
.mobile-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 49;
    background: var(--paper);
    border-bottom: 2px solid var(--line);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
    padding: 18px 24px 24px;
    display: none;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
}
.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    padding: 10px 4px;
    border-bottom: 1px solid var(--hairline);
}
.mobile-menu a[aria-current="page"] {
    color: var(--sky-dark);
}
.mobile-menu .mobile-group {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sky-dark);
    padding: 14px 4px 2px;
}

/* --- Docs sub-navigation strip (project doc sections) --- */
.docs-subnav {
    background: var(--paper);
    border-bottom: 2px solid var(--line);
}

.docs-subnav-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 48px;
    display: flex;
    align-items: center;
    gap: 26px;
    min-height: calc(44 * var(--su));
}

/* On doc pages, align the strip with the content column (right of the
   sidebar), mirroring .content + .content-inner geometry. */
.page-post .docs-subnav-inner {
    margin: 0 auto 0 calc(var(--sidebar-width) + max(0px, (100% - var(--sidebar-width) - var(--content-max-width)) / 2));
}

.docs-subnav-home {
    font-family: var(--font-mono);
    font-size: calc(11 * var(--su));
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid var(--sky);
    flex: none;
}

.docs-subnav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}
.docs-subnav-links::-webkit-scrollbar {
    display: none;
}

.docs-subnav-links a {
    font-family: var(--font-mono);
    font-size: calc(10.5 * var(--su));
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-60);
    text-decoration: none;
    padding: 4px 0;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s var(--ease);
}
.docs-subnav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--sky);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease);
}
.docs-subnav-links a:hover {
    color: var(--ink);
}
.docs-subnav-links a:hover::after,
.docs-subnav-links a.active::after {
    transform: scaleX(1);
}
.docs-subnav-links a.active {
    color: var(--ink);
}

.docs-subnav-repo {
    flex: none;
    font-family: var(--font-mono);
    font-size: calc(10 * var(--su));
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;
    border: 2px solid var(--line);
    background: var(--paper);
    box-shadow: 3px 3px 0 var(--line);
    padding: calc(5 * var(--su)) calc(10 * var(--su));
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.docs-subnav-repo:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--line);
}
.docs-subnav-repo:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--line);
}

/* --- Page Layout --- */
.page-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

/* --- Sidebar --- */
/* The sidebar column itself stretches to the full height of .page-layout
   (flex align-stretch), then continues var(--slant) further down behind the
   footer's transparent slant triangle, so the slanted blue band cuts across
   the column instead of the column stopping flush at the footer.
   The inner content is what sticks under the header. */
.sidebar {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    margin-bottom: calc(-1 * var(--slant));
    background: var(--color-bg-sidebar);
    border-right: 3px solid var(--color-border);
}

.sidebar-inner {
    position: sticky;
    top: var(--nav-h);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    padding: 24px 16px;
}

.toc-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.toc-title::before {
    content: "▓ ";
}

.toc {
    display: flex;
    flex-direction: column;
}

.toc-link {
    display: block;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 4px 10px;
    border-left: 3px solid transparent;
    font-family: var(--font-mono);
}

.toc-link:hover {
    color: var(--color-text);
    background: var(--color-bg-alt);
    border-left-color: #888;
}

.toc-link.active {
    color: #000;
    border-left-color: #333;
    background: #ddd;
    font-weight: 700;
}

.toc-level-1 { padding-left: 10px; font-weight: 700; }
.toc-level-2 { padding-left: 10px; }
.toc-level-3 { padding-left: 24px; font-size: 0.8rem; }
.toc-level-4 { padding-left: 38px; font-size: 0.78rem; }

.sidebar-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--color-border);
}

.sidebar-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sidebar-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 2px solid var(--color-border);
    font-family: var(--font-mono);
}

.category-tag {
    display: inline-block;
    font-size: 0.78rem;
    padding: 2px 8px;
    background: #ddd;
    color: #222;
    border: 2px solid #888;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* --- Main Content --- */
.content {
    flex: 1;
    min-width: 0;
}

.content-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 40px 48px 80px;
}

/* --- Page Meta --- */
.page-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    background: var(--color-bg-alt);
}

.meta-categories {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 1rem;
}

.meta-category {
    font-size: 0.82rem;
    font-weight: 700;
    color: #222;
    background: #ccc;
    padding: 2px 10px;
    border: 2px solid #888;
    font-family: var(--font-mono);
}

.meta-dates {
    display: flex;
    gap: 16px;
}

.meta-date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.meta-date.updated {
    color: var(--color-text-secondary);
    font-weight: 700;
}

/* --- Article Content Typography --- */
.article {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.article h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 24px;
    color: #000;
    padding: 16px 20px;
    background: #ddd;
    border: 3px solid #555;
    position: relative;
}

.article h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 48px 0 20px;
    padding: 12px 16px;
    border: 2px solid #777;
    background: #e4e4e4;
    color: #111;
}

.article h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 36px 0 16px;
    padding: 8px 14px;
    border: 2px solid #999;
    border-left: 6px solid #666;
    background: #ececec;
    color: #222;
}

.article h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 28px 0 12px;
    padding: 6px 12px;
    border-left: 6px solid #999;
    background: #f0f0f0;
    color: #333;
}

.article p {
    margin: 0 0 24px;
    padding: 14px 18px;
    border: 2px solid #bbb;
    background: #fafafa;
    font-size: 1rem;
    line-height: 1.9;
}

.article a {
    color: #222;
    text-decoration: underline;
    text-decoration-color: #888;
    text-underline-offset: 3px;
    font-weight: 700;
}

.article a:hover {
    color: #000;
    text-decoration-color: #333;
    background: #ddd;
}

.article strong {
    font-weight: 700;
    color: #000;
}

.article ul, .article ol {
    margin: 0 0 24px;
    padding: 14px 18px 14px 42px;
    border: 2px solid #bbb;
    background: #fafafa;
}

.article li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.article li::marker {
    color: #555;
    font-weight: 700;
}

.article img {
    max-width: 100%;
    height: auto;
    border: 3px solid #888;
    margin: 24px 0;
    filter: grayscale(100%);
}

.article hr {
    border: none;
    height: auto;
    margin: 40px 0;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    letter-spacing: 0.1em;
    overflow: hidden;
}

.article hr::after {
    content: "░▒▓████████████████████████████████████████▓▒░";
    display: block;
}

/* --- Inline Code --- */
.article code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: #ddd;
    color: #111;
    padding: 2px 7px;
    border: 1px solid #999;
    font-weight: 700;
}

/* --- Code Blocks --- */
.article pre {
    margin: 20px 0 24px;
    overflow: hidden;
    border: 3px solid #666;
    position: relative;
}

.article pre code {
    display: block;
    background: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 18px 22px;
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
    border: none;
    font-weight: 400;
}

/* Chroma syntax highlighting overrides */
.article pre .chroma {
    background: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 18px 22px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.7;
    margin: 0;
}

/* --- Tables --- */
.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 24px;
    font-size: 0.9rem;
    border: 3px solid #888;
}

.article thead {
    background: #d0d0d0;
}

.article th {
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 3px solid #888;
    color: #111;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: top;
}

.article td {
    padding: 8px 14px;
    border-bottom: 1px solid #bbb;
    color: var(--color-text-secondary);
    vertical-align: top;
}

.article tbody tr:hover {
    background: #e8e8e8;
}

.article tbody tr:last-child td {
    border-bottom: none;
}

/* --- Blockquotes --- */
.article blockquote {
    margin: 20px 0 24px;
    padding: 16px 20px;
    border: 2px solid #999;
    border-left: 8px solid #555;
    background: #eee;
    color: var(--color-text-secondary);
    font-style: italic;
}

.article blockquote::before {
    content: "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░";
    display: block;
    color: #bbb;
    font-size: 0.65rem;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    font-style: normal;
    overflow: hidden;
    white-space: nowrap;
}

.article blockquote p:last-child {
    margin-bottom: 0;
    border: none;
    padding: 0;
    background: transparent;
}

.article blockquote p {
    border: none;
    padding: 0;
    background: transparent;
}

/* --- Callout Boxes --- */
.callout {
    margin: 24px 0;
    padding: 16px 20px;
    border: 2px solid #888;
    border-left: 8px solid #555;
    background: #efefef;
    position: relative;
}


.callout-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.callout-icon {
    font-size: 1.1rem;
}

.callout-content p {
    margin: 0;
    font-size: 0.95rem;
    border: none;
    padding: 0;
    background: transparent;
}

.callout-note { background: #efefef; border-color: #888; border-left-color: #555; }
.callout-note .callout-title { color: #222; }
.callout-tip { background: #f2f2f2; border-color: #999; border-left-color: #666; }
.callout-tip .callout-title { color: #333; }
.callout-warning { background: #e8e8e8; border-color: #777; border-left-color: #444; }
.callout-warning .callout-title { color: #111; }
.callout-important { background: #e0e0e0; border-color: #666; border-left-color: #333; }
.callout-important .callout-title { color: #000; }
.callout-caution { background: #eaeaea; border-color: #888; border-left-color: #555; }
.callout-caution .callout-title { color: #222; }
.callout-info { background: #f0f0f0; border-color: #999; border-left-color: #666; }
.callout-info .callout-title { color: #333; }

/* --- Article Tags --- */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
    padding-top: 20px;
    position: relative;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    background: #e0e0e0;
    color: #333;
    border: 2px solid #999;
    text-decoration: none;
    font-family: var(--font-mono);
}

.article-tag:hover {
    background: #ccc;
    color: #000;
    border-color: #555;
}

/* --- Index Page --- */
.index-layout {
    min-height: calc(100vh - var(--nav-h));
}

.index-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 60px 48px 80px;
}

.index-hero {
    text-align: center;
    margin-bottom: 48px;
    padding: 32px 24px;
    border: 3px solid #888;
    background: #e8e8e8;
    position: relative;
}

.index-hero::before {
    content: none;
}

.index-hero::after {
    content: none;
}

.index-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #555;
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.page-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #f0f0f0;
    border: 3px solid #999;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.page-card::before {
    content: "░▒▓█";
    position: absolute;
    top: 8px;
    right: 10px;
    color: #bbb;
    font-size: 0.7rem;
}

.page-card:hover {
    border-color: #555;
    background: #e8e8e8;
}

.card-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #222;
    background: #ddd;
    padding: 2px 8px;
    border: 2px solid #999;
    font-family: var(--font-mono);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    color: #111;
}

.card-description {
    font-size: 0.88rem;
    color: #444;
    line-height: 1.7;
    flex: 1;
    margin-bottom: 16px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 2px solid #bbb;
}

.card-date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.72rem;
    padding: 1px 6px;
    background: #e0e0e0;
    color: #555;
    border: 1px solid #aaa;
    font-family: var(--font-mono);
}

/* --- Projects Landing (root index) --- */
.landing-hero {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px 24px;
    border: 3px solid #888;
    background: #e8e8e8;
    position: relative;
}

.landing-hero::before {
    content: "░▒▓█";
    position: absolute;
    top: 8px;
    right: 10px;
    color: #bbb;
    font-size: 0.7rem;
}

.landing-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.landing-hero p {
    font-size: 1.05rem;
    color: #555;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 24px;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 32px 28px;
    background: #f0f0f0;
    border: 3px solid #999;
    position: relative;
}

.project-card:hover {
    border-color: #555;
    background: #e8e8e8;
}

.project-logo {
    max-height: 64px;
    width: auto;
    height: auto;
    display: block;
    margin-bottom: 20px;
    align-self: flex-start;
    max-width: 100%;
}

.project-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.project-tagline {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.project-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.project-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.project-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-block {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 10px 20px;
    border: 2px solid #555;
    background: #444;
    color: #e0e0e0;
}

.btn-block:hover {
    background: #555;
    color: #fff;
}

.btn-block--ghost {
    background: transparent;
    color: #333;
}

.btn-block--ghost:hover {
    background: #ddd;
    color: #111;
}

/* --- To-be-announced placeholder project card --- */
.project-tba {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: transparent;
    border: 3px dashed #999;
    min-height: 320px;
    cursor: default;
}

.project-tba:hover {
    border-color: #999;
    background: transparent;
}

.project-tba-glyph {
    color: #aaa;
    font-size: 1.4rem;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
}

.project-tba-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.project-tba-text {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.7;
    max-width: 280px;
}

/* --- Scrollbar Styling --- */
.sidebar-inner::-webkit-scrollbar {
    width: 6px;
}

.sidebar-inner::-webkit-scrollbar-track {
    background: #ddd;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background: #999;
}

/* --- Code Block Copy Button --- */
.code-block-wrapper {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #444;
    color: #ccc;
    border: 2px solid #777;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font-mono);
}

.copy-button:hover {
    background: #666;
    color: #fff;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    /* Sidebar hidden: content column is centered, so center the strip too. */
    .page-post .docs-subnav-inner {
        margin-left: auto;
    }
}

@media (max-width: 720px) {
    .site-nav {
        display: none;
    }
    .nav-burger {
        display: inline-grid;
    }
}

@media (max-width: 768px) {
    .docs-subnav-inner {
        padding: 0 16px;
        gap: 16px;
    }
    .content-inner {
        padding: 24px 16px 60px;
    }
    .index-content {
        padding: 32px 16px 60px;
    }
    .index-hero h1 {
        font-size: 1.8rem;
    }
    .landing-hero h1 {
        font-size: 1.8rem;
    }
    .article h1 {
        font-size: 1.5rem;
    }
    .article h2 {
        font-size: 1.2rem;
    }
    .article p {
        padding: 12px 14px;
    }
    .page-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 0 18px;
    }
    .cta-pill {
        padding: 7px 11px;
        font-size: 9.5px;
    }
    .theme-toggle,
    .nav-burger {
        width: 33px;
        height: 33px;
    }
    .docs-subnav-repo {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .page-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Selection Color --- */
::selection {
    background: #999;
    color: #fff;
}

/* --- Tab component for content switching --- */
.tab-container {
    margin: 20px 0 24px;
    border: 3px solid #888;
    overflow: hidden;
}

.tab-header {
    display: flex;
    background: #ddd;
    border-bottom: 2px solid #888;
}

.tab-button {
    padding: 10px 24px;
    background: none;
    border: none;
    border-right: 2px solid #bbb;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
}

.tab-button:hover {
    color: #111;
    background: #e0e0e0;
}

.tab-button.active {
    color: #000;
    background: #f5f5f5;
    font-weight: 700;
    border-bottom: 3px solid #333;
}

.tab-content {
    padding: 20px;
}

/* --- Terminal-style inline references --- */
.terminal-ref {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    background: #ddd;
    border: 2px solid #999;
    font-size: 0.85em;
    font-weight: 700;
    color: #222;
}

/* --- Kbd (keyboard key) styling --- */
.article kbd {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: #ddd;
    border: 2px solid #999;
    border-bottom-width: 3px;
    color: #222;
}

/* --- Site Footer (ported from defended.net - slanted blue band) --- */
.site-footer {
    position: relative;
    background: var(--blue);
    color: var(--ink);
    padding: calc(46px + var(--slant)) 24px 26px;
    clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%);
}
.footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: calc(40 * var(--su));
    align-items: start;
}
.footer-nav:first-of-type {
    grid-column: 2;
}
.footer-tagline {
    margin-top: calc(14 * var(--su));
    font-family: var(--font-mono);
    font-size: calc(10 * var(--su));
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-60);
    line-height: 1.8;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-heading {
    font-family: var(--font-mono);
    font-size: calc(10 * var(--su));
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sky-dark);
    margin: 0 0 4px;
}
.footer-nav a {
    font-family: var(--font-mono);
    font-size: calc(11 * var(--su));
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-60);
    padding: 3px 0;
    border-bottom: 2px solid transparent;
    align-self: flex-start;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.footer-nav a:hover {
    color: var(--ink);
    border-bottom-color: var(--sky);
}
.status-strip {
    max-width: var(--maxw);
    margin: calc(34 * var(--su)) auto 0;
    padding-top: calc(18 * var(--su));
    border-top: 1px solid var(--footer-rule);
    font-family: var(--font-mono);
    font-size: calc(10 * var(--su));
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-40);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Footer responsive (kept after the footer rules so they win the cascade) */
@media (max-width: 860px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-nav:first-of-type {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --color-bg: #1a1a1a;
    --color-bg-alt: #222222;
    --color-bg-sidebar: #1e1e1e;
    --color-text: #d4d4d4;
    --color-text-secondary: #bbbbbb;
    --color-text-muted: #888888;
    --color-border: #444444;
    --color-border-light: #333333;
    --color-primary: #cccccc;
    --color-primary-light: #2a2a2a;
    --color-primary-dark: #e0e0e0;
    --color-accent: #dddddd;
    --color-accent-light: #2a2a2a;
    --color-code-bg: #2a2a2a;
    --color-code-text: #d4d4d4;
    --color-inline-code-bg: #2a2a2a;
    --color-inline-code-text: #d4d4d4;
}

/* Dark mode - Projects landing */
[data-theme="dark"] .project-logo,
[data-theme="dark"] .hero-logo {
    filter: invert(1);
}

[data-theme="dark"] .landing-hero {
    background: #1e1e1e;
    border-color: #555;
}

[data-theme="dark"] .landing-hero::before {
    color: #555;
}

[data-theme="dark"] .landing-hero h1 {
    color: #e0e0e0;
}

[data-theme="dark"] .landing-hero p {
    color: #999;
}

[data-theme="dark"] .project-card {
    background: #1e1e1e;
    border-color: #555;
}

[data-theme="dark"] .project-card:hover {
    background: #252525;
    border-color: #777;
}

[data-theme="dark"] .project-tba {
    background: transparent;
    border-color: #555;
}

[data-theme="dark"] .project-tba:hover {
    background: transparent;
    border-color: #555;
}

[data-theme="dark"] .project-tba-glyph {
    color: #666;
}

[data-theme="dark"] .project-tba-title {
    color: #999;
}

[data-theme="dark"] .project-tba-text {
    color: #777;
}

[data-theme="dark"] .project-name {
    color: #e0e0e0;
}

[data-theme="dark"] .project-tagline {
    color: #bbb;
}

[data-theme="dark"] .project-description {
    color: #999;
}

[data-theme="dark"] .btn-block {
    background: #333;
    border-color: #666;
    color: #ddd;
}

[data-theme="dark"] .btn-block:hover {
    background: #444;
    color: #fff;
}

[data-theme="dark"] .btn-block--ghost {
    background: transparent;
    color: #bbb;
}

[data-theme="dark"] .btn-block--ghost:hover {
    background: #2a2a2a;
    color: #eee;
}

/* Dark mode - Sidebar */
[data-theme="dark"] .toc-link.active {
    color: #fff;
    border-left-color: #aaa;
    background: #2a2a2a;
}

[data-theme="dark"] .toc-link:hover {
    border-left-color: #666;
}

[data-theme="dark"] .category-tag {
    background: #2a2a2a;
    color: #ccc;
    border-color: #555;
}

/* Dark mode - Article headings */
[data-theme="dark"] .article h1 {
    color: #e0e0e0;
    background: #252525;
    border-color: #555;
}

[data-theme="dark"] .article h2 {
    background: #222;
    border-color: #555;
    color: #d4d4d4;
}

[data-theme="dark"] .article h3 {
    background: #222;
    border-color: #555;
    border-left-color: #666;
    color: #ccc;
}

[data-theme="dark"] .article h4 {
    background: #1e1e1e;
    border-left-color: #555;
    color: #bbb;
}

/* Dark mode - Article content */
[data-theme="dark"] .article p {
    border-color: #333;
    background: #1e1e1e;
}

[data-theme="dark"] .article a {
    color: #ccc;
    text-decoration-color: #666;
}

[data-theme="dark"] .article a:hover {
    color: #fff;
    text-decoration-color: #999;
    background: #2a2a2a;
}

[data-theme="dark"] .article strong {
    color: #e0e0e0;
}

[data-theme="dark"] .article ul,
[data-theme="dark"] .article ol {
    border-color: #333;
    background: #1e1e1e;
}

[data-theme="dark"] .article li::marker {
    color: #888;
}

[data-theme="dark"] .article img {
    border-color: #555;
}

[data-theme="dark"] .article hr::after {
    color: #555;
}

/* Dark mode - Inline code */
[data-theme="dark"] .article code {
    background: var(--color-inline-code-bg);
    color: var(--color-inline-code-text);
    border-color: #555;
}

/* Dark mode - Code blocks */
[data-theme="dark"] .article pre {
    border-color: #444;
}

/* Dark mode - Tables */
[data-theme="dark"] .article table {
    border-color: #444;
}

[data-theme="dark"] .article thead {
    background: #2a2a2a;
}

[data-theme="dark"] .article th {
    border-bottom-color: #444;
    color: #d4d4d4;
}

[data-theme="dark"] .article td {
    border-bottom-color: #333;
}

[data-theme="dark"] .article tbody tr:hover {
    background: #252525;
}

/* Dark mode - Blockquotes */
[data-theme="dark"] .article blockquote {
    border-color: #444;
    border-left-color: #666;
    background: #222;
}

[data-theme="dark"] .article blockquote::before {
    color: #444;
}

/* Dark mode - Callouts */
[data-theme="dark"] .callout {
    background: #222;
    border-color: #555;
    border-left-color: #666;
}

[data-theme="dark"] .callout-title {
    color: #ccc;
}

[data-theme="dark"] .callout-note { background: #222; border-color: #555; border-left-color: #666; }
[data-theme="dark"] .callout-tip { background: #1e2a1e; border-color: #555; border-left-color: #4a7; }
[data-theme="dark"] .callout-warning { background: #2a2a1e; border-color: #555; border-left-color: #a84; }
[data-theme="dark"] .callout-important { background: #2a1e1e; border-color: #555; border-left-color: #a44; }
[data-theme="dark"] .callout-caution { background: #2a221e; border-color: #555; border-left-color: #a64; }
[data-theme="dark"] .callout-info { background: #1e222a; border-color: #555; border-left-color: #48a; }

/* Dark mode - Article tags */
[data-theme="dark"] .article-tag {
    background: #2a2a2a;
    color: #bbb;
    border-color: #555;
}

[data-theme="dark"] .article-tag:hover {
    background: #333;
    color: #fff;
    border-color: #777;
}

/* Dark mode - Page meta */
[data-theme="dark"] .meta-category {
    color: #ccc;
    background: #2a2a2a;
    border-color: #555;
}

/* Dark mode - Index page */
[data-theme="dark"] .index-hero {
    border-color: #444;
    background: #222;
}

[data-theme="dark"] .index-hero h1 {
    color: #e0e0e0;
}

[data-theme="dark"] .hero-subtitle {
    color: #888;
}

[data-theme="dark"] .page-card {
    background: #222;
    border-color: #444;
}

[data-theme="dark"] .page-card::before {
    color: #444;
}

[data-theme="dark"] .page-card:hover {
    border-color: #666;
    background: #2a2a2a;
}

[data-theme="dark"] .card-category {
    color: #ccc;
    background: #2a2a2a;
    border-color: #555;
}

[data-theme="dark"] .card-title {
    color: #d4d4d4;
}

[data-theme="dark"] .card-description {
    color: #999;
}

[data-theme="dark"] .card-footer {
    border-top-color: #444;
}

[data-theme="dark"] .card-tag {
    background: #2a2a2a;
    color: #888;
    border-color: #444;
}

/* Dark mode - Tab component */
[data-theme="dark"] .tab-container {
    border-color: #444;
}

[data-theme="dark"] .tab-header {
    background: #222;
    border-bottom-color: #444;
}

[data-theme="dark"] .tab-button {
    color: #888;
    border-right-color: #333;
}

[data-theme="dark"] .tab-button:hover {
    color: #d4d4d4;
    background: #2a2a2a;
}

[data-theme="dark"] .tab-button.active {
    color: #e0e0e0;
    background: #1a1a1a;
    border-bottom-color: #ccc;
}

/* Dark mode - Other elements */
[data-theme="dark"] .terminal-ref {
    background: #2a2a2a;
    border-color: #555;
    color: #ccc;
}

[data-theme="dark"] .article kbd {
    background: #2a2a2a;
    border-color: #555;
    color: #ccc;
}

/* Dark mode - Scrollbar */
[data-theme="dark"] .sidebar-inner::-webkit-scrollbar-track {
    background: #222;
}

[data-theme="dark"] .sidebar-inner::-webkit-scrollbar-thumb {
    background: #555;
}

/* Dark mode - Copy button */
[data-theme="dark"] .copy-button {
    background: #333;
    color: #aaa;
    border-color: #555;
}

[data-theme="dark"] .copy-button:hover {
    background: #444;
    color: #fff;
}

/* Dark mode - Selection */
[data-theme="dark"] ::selection {
    background: #555;
    color: #fff;
}
