/* xodo.dev — dark network/terminal theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent: #20f9ff;
    --accent-dim: rgba(32, 249, 255, 0.10);
    --green: #3ddc97;
    --amber: #fbbf24;
    --orange: #fb923c;
    --red: #ff5d5d;
    --violet: #b48cff;
    --bg: #070b10;
    --bg-raised: #0b1118;
    --bg-card: #0e1620;
    --bg-card-hi: #12202d;
    --text: #dbe7ef;
    --text-muted: #7d8fa0;
    --border: #1b2836;
    --border-hi: #2a3d52;
    --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 10px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.1em 0.4em;
    border-radius: 5px;
    border: 1px solid rgba(32, 249, 255, 0.15);
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- background mesh ---------- */
#net-bg {
    position: fixed; inset: 0; z-index: 0;
    overflow: hidden; pointer-events: none;
    opacity: 0.55;
    mask-image: linear-gradient(180deg, transparent 0%, black 10%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 10%, black 88%, transparent 100%);
}
nav, main, footer { position: relative; z-index: 1; }
body::after {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(ellipse 120% 90% at 50% 0%, rgba(7,11,16,0.2) 0%, transparent 45%, rgba(7,11,16,0.65) 100%);
}
#net-bg canvas { display: block; }

/* subtle scanline/grid texture */
body::before {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(32,249,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32,249,255,0.018) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 0%, transparent 75%);
}

/* ---------- chrome ---------- */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--accent); color: #04141a; padding: 0.6rem 1rem;
    font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
}
.skip-link:focus { left: 0; }

#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    z-index: 150; box-shadow: 0 0 12px rgba(32,249,255,.5);
}

nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.85rem 2rem;
    background: rgba(7, 11, 16, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.logo img { height: 34px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 0.3rem; }
.nav-links a {
    color: var(--text-muted); text-decoration: none;
    font-family: var(--mono);
    font-size: 0.78rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.8px;
    padding: 0.45rem 0.85rem; border-radius: 7px;
    transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }
.nav-links a.nav-gh {
    border: 1px solid var(--border-hi); margin-left: 0.4rem;
}
.nav-links a.nav-gh:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(32,249,255,.15); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1.1rem; padding: 0.3rem 0.7rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
    padding: 5.5rem 0 3.5rem;
    position: relative;
}
.hero .prompt {
    font-family: var(--mono); font-size: 0.9rem; color: var(--green);
    margin-bottom: 1.2rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.hero .prompt .cursor { display: inline-block; width: 9px; height: 1.15em; background: var(--green); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
    font-family: var(--mono);
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
    color: var(--text);
}
.hero h1 .tld { color: var(--accent); text-shadow: 0 0 30px rgba(32,249,255,.35); }
.hero .sub {
    margin-top: 1.3rem; max-width: 620px;
    color: var(--text-muted); font-size: 1.08rem;
}
.hero .sub strong { color: var(--text); font-weight: 600; }

.hero-stats {
    margin-top: 2.4rem;
    display: flex; flex-wrap: wrap; gap: 0.8rem;
    font-family: var(--mono); font-size: 0.8rem;
}
.hstat {
    border: 1px solid var(--border); border-radius: 8px;
    background: rgba(14,22,32,.7); padding: 0.55rem 0.95rem;
    display: flex; gap: 0.55rem; align-items: baseline;
}
.hstat b { color: var(--accent); font-size: 1rem; }
.hstat span { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; font-size: 0.68rem; }

/* ---------- sections ---------- */
section.cat { padding: 2.8rem 0 0.6rem; }
.cat-head { margin-bottom: 1.6rem; }
.cat-head .cat-comment {
    font-family: var(--mono); font-size: 0.78rem; color: var(--green);
    letter-spacing: 0.4px;
}
.cat-head h2 {
    font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
    color: var(--text); margin-top: 0.25rem;
    display: flex; align-items: baseline; gap: 0.8rem;
}
.cat-head h2 .count {
    font-size: 0.75rem; color: var(--text-muted); font-weight: 400;
    border: 1px solid var(--border); border-radius: 20px; padding: 0.1rem 0.6rem;
}
.cat-head p { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.4rem; max-width: 640px; }

/* ---------- project cards ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-raised) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem 1.2rem;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
.pcard::before {
    content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0; transition: opacity .25s ease;
}
.pcard:hover {
    border-color: var(--border-hi);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(32,249,255,.08);
}
.pcard:hover::before { opacity: 0.8; }

.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; }
.pcard-name {
    font-family: var(--mono); font-size: 1.18rem; font-weight: 700;
    color: var(--text); display: flex; align-items: center; gap: 0.55rem;
}
.pcard-name .featured-star { color: var(--amber); font-size: 0.9rem; }
.pcard-logo { margin-bottom: 0.7rem; min-height: 48px; display: flex; align-items: center; }
.pcard-logo img { height: 48px; width: auto; max-width: 180px; object-fit: contain; }
.pcard-name a { color: inherit; position: static; }
.pcard-name a:hover { color: var(--accent); text-decoration: none; }
/* stretched link — whole card navigates to the project page */
.pcard-name a::after {
    content: ''; position: absolute; inset: 0;
    border-radius: var(--radius); z-index: 1;
}
.pcard-tag { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.45rem; min-height: 2.4em; }

.pcard-foot {
    margin-top: auto; padding-top: 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
}
.stack-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip {
    font-family: var(--mono); font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.7px; text-transform: uppercase;
    padding: 0.22rem 0.55rem; border-radius: 20px;
    border: 1px solid var(--border-hi); color: var(--text-muted);
    background: rgba(255,255,255,.02); white-space: nowrap;
}
.chip-green  { color: var(--green);  border-color: rgba(61,220,151,.35); background: rgba(61,220,151,.07); }
.chip-cyan   { color: var(--accent); border-color: rgba(32,249,255,.35); background: var(--accent-dim); }
.chip-amber  { color: var(--amber);  border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.07); }
.chip-orange { color: var(--orange); border-color: rgba(251,146,60,.35); background: rgba(251,146,60,.08); }
.chip-violet { color: var(--violet); border-color: rgba(180,140,255,.35); background: rgba(180,140,255,.08); }
.chip-slate  { color: #9fb0bf; }
.chip-status { flex-shrink: 0; }

.pcard-more {
    font-family: var(--mono); font-size: 0.78rem; color: var(--accent);
    white-space: nowrap;
}
.pcard:hover .pcard-more { text-decoration: underline; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
    padding: 0.55rem 1rem; border-radius: 8px;
    border: 1px solid var(--border-hi);
    color: var(--text); background: var(--bg-card);
    transition: border-color .15s, box-shadow .15s, transform .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); box-shadow: 0 0 16px rgba(32,249,255,.12); }
.btn-ghost { background: transparent; }
.btn-ic { display: inline-flex; width: 15px; height: 15px; }
.btn-ic svg { width: 100%; height: 100%; }

/* ---------- project detail ---------- */
.crumb {
    font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted);
    padding: 2.2rem 0 0;
    display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--border-hi); }
.crumb .here { color: var(--accent); }

.pj-hero { padding: 1.4rem 0 2.2rem; }
.pj-logo {
    display: block; height: 140px; width: auto; max-width: 420px;
    margin-bottom: 1rem; object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(32,249,255,.18));
}
.pj-hero h1 {
    font-family: var(--mono); font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.pj-tagline {
    margin-top: 0.7rem; font-size: 1.12rem; color: var(--text-muted);
    max-width: 720px;
}
.pj-chips { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.pj-chips .dot-sep { color: var(--border-hi); }

.pj-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.2rem; padding-bottom: 4rem; align-items: start;
}
.pj-main h2 {
    font-family: var(--mono); font-size: 0.95rem; font-weight: 700;
    color: var(--green); letter-spacing: 0.5px; text-transform: uppercase;
    margin: 2.2rem 0 0.9rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.pj-main h2::before { content: '//'; color: var(--text-muted); font-weight: 400; }
.pj-main > p, .pj-main .desc { color: #b9c9d6; font-size: 1rem; margin-bottom: 0.9rem; max-width: 720px; }
.pj-main .desc a { border-bottom: 1px solid rgba(32,249,255,.3); }

.feature-list { list-style: none; display: grid; gap: 0.55rem; max-width: 760px; }
.feature-list li {
    display: flex; gap: 0.7rem; align-items: flex-start;
    color: #b9c9d6; font-size: 0.95rem;
    padding: 0.55rem 0.9rem;
    background: rgba(14,22,32,.55);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.feature-list .fl-tick { color: var(--green); font-family: var(--mono); flex-shrink: 0; }

.stack-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* terminal block */
.term {
    background: #05080c; border: 1px solid var(--border-hi);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: 0 10px 34px rgba(0,0,0,.4);
    max-width: 760px;
}
.term-bar {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    background: #0a1219; border-bottom: 1px solid var(--border);
}
.term-dots { display: flex; gap: 5px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; }
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.5px; }
.term-body {
    font-family: var(--mono); font-size: 0.83rem; line-height: 1.75;
    padding: 1rem 1.1rem; overflow-x: auto; color: #a9d7ff;
    white-space: pre;
}
.t-prompt { color: var(--green); user-select: none; }
.t-cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }

/* sidebar */
.pj-side { position: sticky; top: 90px; display: grid; gap: 1rem; }
.side-card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-raised));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
}
.side-card h3 {
    font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 0.8rem;
}
.side-links { display: grid; gap: 0.5rem; }
.side-links .btn { justify-content: flex-start; width: 100%; }

.endpoint {
    font-family: var(--mono); font-size: 0.76rem;
    display: flex; justify-content: space-between; gap: 0.8rem;
    padding: 0.5rem 0.7rem; border-radius: 7px;
    background: rgba(7,11,16,.7); border: 1px solid var(--border);
    margin-bottom: 0.45rem;
}
.endpoint:last-child { margin-bottom: 0; }
.endpoint .ep-label { color: var(--text-muted); flex-shrink: 0; }
.endpoint .ep-val { color: var(--accent); text-align: right; word-break: break-all; }

.note {
    border: 1px solid rgba(251,191,36,.3); background: rgba(251,191,36,.06);
    border-radius: 8px; padding: 0.8rem 1rem;
    font-size: 0.88rem; color: #e8d9b0;
}
.note::before { content: '// note — '; font-family: var(--mono); font-size: 0.75rem; color: var(--amber); }

.related { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related a {
    font-family: var(--mono); font-size: 0.78rem;
    border: 1px solid var(--border); border-radius: 20px;
    padding: 0.35rem 0.85rem; color: var(--text-muted);
    transition: all .15s;
}
.related a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- footer ---------- */
footer {
    border-top: 1px solid var(--border);
    background: rgba(7,11,16,.9);
    margin-top: 3rem;
}
.footer-inner {
    max-width: 1160px; margin: 0 auto; padding: 3rem 1.5rem 2rem;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
}
.footer-brand img { height: 30px; width: auto; margin-bottom: 0.8rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; max-width: 280px; }
.footer-col h4 {
    font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 0.8rem;
}
.footer-col a {
    display: block; color: var(--text-muted); font-size: 0.88rem;
    padding: 0.22rem 0; text-decoration: none;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 1.2rem 1.5rem; text-align: center;
    font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted);
}
.footer-bottom .t-prompt { color: var(--green); }

#to-top {
    position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90;
    width: 42px; height: 42px; border-radius: 10px;
    border: 1px solid var(--border-hi); background: rgba(14,22,32,.9);
    color: var(--accent); font-size: 1rem; cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity .2s, border-color .2s;
    backdrop-filter: blur(8px);
}
#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { border-color: var(--accent); box-shadow: 0 0 16px rgba(32,249,255,.2); }

/* 404 */
.err { padding: 6rem 0; text-align: center; }
.err h1 { font-family: var(--mono); font-size: 3rem; color: var(--accent); }
.err p { color: var(--text-muted); margin: 1rem 0 2rem; font-family: var(--mono); font-size: 0.9rem; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
    .pj-layout { grid-template-columns: 1fr; }
    .pj-side { position: static; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    nav { padding: 0.75rem 1rem; }
    .nav-links {
        position: absolute; top: 100%; right: 0; left: 0;
        flex-direction: column; align-items: stretch;
        background: rgba(7,11,16,.97); border-bottom: 1px solid var(--border);
        padding: 0.6rem 1rem 1rem; gap: 0.2rem;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .hero { padding: 3.5rem 0 2.5rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ================= documentation ================= */
.docs-crumb { padding-top: 1.6rem; }
.docs-wrap { padding-bottom: 4rem; }

.docs-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 210px;
    gap: 2rem;
    margin-top: 1.4rem;
    align-items: start;
}

/* sidebar tree */
.docs-side {
    position: sticky; top: 84px;
    max-height: calc(100vh - 100px); overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-right: 1rem;
    font-size: 0.85rem;
}
.dtree, .dtree ul { list-style: none; margin: 0; padding: 0; }
.dtree li { margin: 0.1rem 0; }
.dtree a {
    display: block; color: var(--text-muted); text-decoration: none;
    padding: 0.28rem 0.55rem; border-radius: 6px;
    border-left: 2px solid transparent;
    transition: color .12s, background .12s;
}
.dtree a:hover { color: var(--accent); background: var(--accent-dim); text-decoration: none; }
.dtree a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-dim); }
.dt-dir > summary {
    cursor: pointer; list-style: none;
    padding: 0.4rem 0.55rem; border-radius: 6px;
    color: var(--text); font-family: var(--mono); font-size: 0.78rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
    display: flex; align-items: center; gap: 0.45rem;
    user-select: none;
}
.dt-dir > summary::before { content: '▸'; color: var(--text-muted); font-size: 0.7rem; transition: transform .15s; }
.dt-dir[open] > summary::before { transform: rotate(90deg); }
.dt-dir > summary:hover { background: var(--accent-dim); }
.dt-dir ul { margin-left: 0.6rem; padding-left: 0.5rem; border-left: 1px solid var(--border); }

/* doc body typography */
.doc-body {
    min-width: 0;
    font-size: 0.97rem; color: #b9c9d6;
    overflow-wrap: break-word;
}
.doc-body h1 {
    font-family: var(--mono); font-size: 1.7rem; font-weight: 800;
    color: var(--text); letter-spacing: -0.02em; margin: 0 0 1.1rem;
    padding-bottom: 0.7rem; border-bottom: 1px solid var(--border);
}
.doc-body h2 {
    font-family: var(--mono); font-size: 1.2rem; font-weight: 700;
    color: var(--text); margin: 2.2rem 0 0.8rem;
    padding-top: 0.6rem;
}
.doc-body h2::before { content: '// '; color: var(--green); font-weight: 400; }
.doc-body h3 { font-family: var(--mono); font-size: 1.02rem; font-weight: 700; color: var(--accent); margin: 1.7rem 0 0.6rem; }
.doc-body h4 { font-family: var(--mono); font-size: 0.92rem; font-weight: 700; color: var(--text); margin: 1.4rem 0 0.5rem; }
.doc-body p { margin: 0.8rem 0; }
.doc-body a { border-bottom: 1px solid rgba(32,249,255,.3); }
.doc-body ul, .doc-body ol { margin: 0.7rem 0; padding-left: 1.5rem; }
.doc-body li { margin: 0.3rem 0; }
.doc-body li::marker { color: var(--green); }
.doc-body blockquote {
    margin: 1rem 0; padding: 0.2rem 1rem;
    border-left: 3px solid var(--border-hi); color: var(--text-muted);
}
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.doc-body img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); margin: 0.8rem 0; }
.doc-body table {
    width: 100%; border-collapse: collapse; margin: 1.1rem 0;
    font-size: 0.86rem; display: block; overflow-x: auto;
}
.doc-body th, .doc-body td {
    border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left;
    vertical-align: top;
}
.doc-body th { background: var(--bg-card); font-family: var(--mono); font-size: 0.78rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }
.doc-body tr:nth-child(even) td { background: rgba(14,22,32,.4); }
.doc-body pre {
    background: #05080c; border: 1px solid var(--border-hi); border-radius: 8px;
    padding: 0.9rem 1.1rem; overflow-x: auto; margin: 1rem 0;
    font-family: var(--mono); font-size: 0.82rem; line-height: 1.6;
}
.doc-body code {
    font-family: var(--mono); font-size: 0.85em;
    background: var(--accent-dim); color: var(--accent);
    padding: 0.12em 0.4em; border-radius: 5px;
    border: 1px solid rgba(32,249,255,.15);
}
.doc-body pre code { background: none; border: none; padding: 0; color: #a9d7ff; font-size: inherit; }
.doc-body pre code .c, .doc-body pre code .cm, .doc-body pre code .c1 { color: #5d7a8c; }

/* admonitions (:::note etc → [!NOTE] blockquotes) */
.admonition {
    margin: 1.1rem 0; padding: 0.8rem 1.1rem;
    border: 1px solid var(--border-hi); border-left-width: 3px;
    border-radius: 0 8px 8px 0; background: rgba(14,22,32,.6);
    font-size: 0.92rem;
}
.admonition .adm-label {
    font-family: var(--mono); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 0.4rem;
}
.admonition p { margin: 0.4rem 0; }
.adm-note     { border-left-color: var(--accent); } .adm-note .adm-label     { color: var(--accent); }
.adm-tip      { border-left-color: var(--green); }  .adm-tip .adm-label      { color: var(--green); }
.adm-info     { border-left-color: var(--accent); } .adm-info .adm-label     { color: var(--accent); }
.adm-important{ border-left-color: var(--violet); } .adm-important .adm-label{ color: var(--violet); }
.adm-warning  { border-left-color: var(--amber); }  .adm-warning .adm-label  { color: var(--amber); }
.adm-caution,
.adm-danger   { border-left-color: var(--red); }    .adm-caution .adm-label,
.adm-danger .adm-label { color: var(--red); }
.adm-success  { border-left-color: var(--green); }  .adm-success .adm-label  { color: var(--green); }

/* mermaid */
.mermaid {
    margin: 1.2rem 0; padding: 1rem; text-align: center;
    background: #05080c; border: 1px solid var(--border-hi); border-radius: 8px;
    overflow-x: auto;
}
.mermaid svg { max-width: 100%; height: auto; }

/* right-hand TOC */
.doc-toc {
    position: sticky; top: 84px;
    font-size: 0.8rem;
    border-left: 1px solid var(--border); padding-left: 1rem;
    max-height: calc(100vh - 100px); overflow-y: auto;
}
.doc-toc h4 {
    font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 0.6rem;
}
.doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin: 0.15rem 0; }
.doc-toc a { color: var(--text-muted); text-decoration: none; display: block; padding: 0.15rem 0.3rem; border-radius: 4px; }
.doc-toc a:hover { color: var(--accent); }
.doc-toc .toc-3 a { padding-left: 0.9rem; font-size: 0.76rem; }
.doc-toc .toc-2 a { font-weight: 600; }

.doc-toc-mobile { display: none; }

/* doc index page */
.doc-index-sub { color: var(--text-muted); margin: -0.4rem 0 1.2rem; }
.doc-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.6rem; }
.doc-index-item {
    display: flex; flex-direction: column; gap: 0.15rem;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.7rem 0.9rem; background: var(--bg-card);
    transition: border-color .15s;
}
.doc-index-item:hover { border-color: var(--accent); text-decoration: none; }
.di-title { color: var(--text); font-weight: 600; font-size: 0.9rem; }
.di-path { color: var(--text-muted); font-family: var(--mono); font-size: 0.7rem; }
.doc-index-item:hover .di-title { color: var(--accent); }

.doc-foot {
    margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--border);
    display: flex; gap: 0.7rem; flex-wrap: wrap;
}
.doc-404 { padding: 4rem 0; text-align: center; }
.doc-404 h1 { font-family: var(--mono); color: var(--accent); font-size: 2.4rem; }
.doc-404 p { color: var(--text-muted); font-family: var(--mono); margin: 1rem 0 2rem; }

/* docs responsive */
@media (max-width: 1100px) {
    .docs-grid { grid-template-columns: 220px minmax(0,1fr); }
    .doc-toc { display: none; }
    .doc-toc-mobile {
        display: block; margin-bottom: 1.4rem;
        border: 1px solid var(--border); border-radius: 8px;
        padding: 0.6rem 0.9rem; background: var(--bg-card);
    }
    .doc-toc-mobile summary { cursor: pointer; font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
    .doc-toc-mobile ul { margin: 0.6rem 0 0.2rem; padding-left: 1.1rem; }
    .doc-toc-mobile a { color: var(--text-muted); font-size: 0.85rem; }
}
@media (max-width: 760px) {
    .docs-grid { grid-template-columns: 1fr; }
    .docs-side {
        position: static; max-height: none;
        border-right: none; border-bottom: 1px solid var(--border);
        padding: 0 0 1rem; margin-bottom: 1.4rem;
    }
}

/* ---- project screenshots ---- */
.shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
    margin: 0.4rem 0 1.4rem;
}
.shot {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
    transition: border-color .15s, transform .15s;
}
.shot:hover { border-color: var(--accent); transform: translateY(-2px); }
.shot img {
    display: block; width: 100%; height: auto;
    border-bottom: 1px solid var(--border);
}
.shot figcaption {
    padding: 0.55rem 0.85rem;
    font-family: var(--mono); font-size: 0.72rem;
    color: var(--text-muted); line-height: 1.5;
}
