/* CODE 8 NETWORK — documentation layout + markdown */
.dlay { display: grid; grid-template-columns: 280px minmax(0, 1fr) 220px; gap: 0; max-width: 1480px; margin: 0 auto; padding-top: 72px; min-height: 100vh; }
.dside { position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; border-right: 1px solid var(--line); padding: 1.4rem 1rem 2rem 1.4rem; scrollbar-width: thin; }
.dside__search { position: relative; margin-bottom: 1.2rem; }
.dside__search input { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); padding: .65rem 2.2rem .65rem .8rem; font: 400 var(--text-sm) var(--font-body); }
.dside__search input:focus { outline: 1px solid var(--cyan); }
.dside__search kbd { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); font: 500 11px var(--font-mono); color: var(--text-faint); border: 1px solid var(--line-strong); padding: .05rem .4rem; }
.dside__nav { display: grid; gap: .2rem; }
.dside__nav a { --c: var(--cyan); display: block; padding: .42rem .7rem; color: var(--text-dim); font-size: var(--text-sm); border-left: 2px solid transparent; transition: color .2s, background .2s, border-color .2s; }
.dside__nav a:hover { color: var(--text); background: rgba(255,255,255,.025); }
.dside__nav a.on { color: var(--text); border-left-color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); }
.dside__home { font-weight: 700; margin-bottom: .4rem; }
.dcat { margin-top: .9rem; }
.dcat__h { font: 500 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); padding: 0 .7rem .4rem; }
.dside__empty { color: var(--text-faint); font-size: var(--text-sm); padding: .4rem .7rem; }
.dtoggle { display: none; }
.dmain { min-width: 0; padding: clamp(2rem, 4vw, 3.2rem) clamp(1.2rem, 4vw, 3.6rem) 5rem; outline: none; }
.darticle { max-width: 800px; }
.dcrumb { display: flex; gap: .5rem; font: 500 var(--text-xs) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 1rem; }
.dcrumb a { color: var(--cyan); }
.dhead { padding-bottom: 1.4rem; margin-bottom: 1.8rem; border-bottom: 1px solid var(--line); }
.dhead h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.02; text-transform: uppercase; margin: .4rem 0 .7rem; }
.dlead { color: var(--text-dim); font-size: 1.12rem; max-width: 62ch; }
.dmeta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1rem; font: 500 var(--text-xs) var(--font-mono); letter-spacing: .08em; color: var(--text-faint); }
.dmeta__div { color: var(--c); }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.dcard { background: var(--surface); border: 1px solid var(--line); padding: 1.2rem 1.2rem 1.1rem; }
.dcard h2 { font-family: var(--font-display); text-transform: uppercase; font-size: 1.15rem; margin-bottom: .8rem; color: var(--cyan); }
.dcard ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.dcard a { color: var(--text); font-weight: 500; }
.dcard a:hover { color: var(--cyan); }
.dcard small { display: block; color: var(--text-faint); font-size: var(--text-xs); margin-top: .15rem; }
.dcard__more { color: var(--text-faint); font-size: var(--text-xs); margin-top: .8rem; }
.dtoc { position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto; padding: 2.6rem 1.2rem 2rem; border-left: 1px solid var(--line); }
.dtoc:empty { border-left-color: transparent; }
.dtoc__h { font: 500 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); margin-bottom: .7rem; }
.dtoc a { display: block; padding: .3rem 0 .3rem .7rem; border-left: 1px solid var(--line); color: var(--text-dim); font-size: var(--text-xs); line-height: 1.4; }
.dtoc a.l3 { padding-left: 1.4rem; }
.dtoc a:hover { color: var(--text); }
.dtoc a.on { color: var(--cyan); border-left-color: var(--cyan); }
.dpn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.dpn__a { display: grid; gap: .25rem; padding: 1rem 1.1rem; border: 1px solid var(--line); transition: border-color .2s; }
.dpn__a:hover { border-color: var(--cyan); }
.dpn__a small { font: 500 10px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
.dpn__a--next { text-align: right; grid-column: 2; }
.dhelp { margin-top: 1.6rem; color: var(--text-faint); font-size: var(--text-sm); }
.dhelp a { color: var(--cyan); }
.dskel { display: grid; gap: .9rem; }
.dskel i { display: block; height: 18px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shim 1.2s linear infinite; }
.dskel i:first-child { height: 42px; width: 60%; }
@keyframes shim { to { background-position: -200% 0; } }

/* markdown */
.md { color: var(--text-dim); font-size: 1.02rem; line-height: 1.75; }
.md > * + * { margin-top: 1.05rem; }
.md h2, .md h3, .md h4 { position: relative; color: var(--text); font-family: var(--font-display); text-transform: uppercase; line-height: 1.15; scroll-margin-top: 92px; }
.md h2 { font-size: 1.65rem; margin-top: 2.6rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 1.25rem; margin-top: 2rem; }
.md h4 { font-size: 1.05rem; margin-top: 1.6rem; }
.md-anchor { position: absolute; left: -1.1em; color: var(--text-faint); opacity: 0; transition: opacity .2s; }
.md h2:hover .md-anchor, .md h3:hover .md-anchor { opacity: 1; }
.md a:not(.md-anchor) { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(0,240,255,.35); }
.md strong { color: var(--text); }
.md ul, .md ol { padding-left: 1.4rem; }
.md li + li { margin-top: .35rem; }
.md li::marker { color: var(--cyan); }
.md-task { list-style: none; margin-left: -1.4rem; }
.md-task input { accent-color: var(--cyan); margin-right: .4rem; }
.md code { font: 400 .88em var(--font-mono); background: var(--surface-2); border: 1px solid var(--line); padding: .08rem .35rem; color: var(--text); }
.md-code { border: 1px solid var(--line-strong); background: #070910; }
.md-code__h { display: flex; justify-content: space-between; align-items: center; padding: .4rem .8rem; border-bottom: 1px solid var(--line); font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.md-copy { font: inherit; color: var(--cyan); letter-spacing: .12em; text-transform: uppercase; }
.md-code pre { margin: 0; padding: 1rem; overflow-x: auto; }
.md-code code { background: none; border: 0; padding: 0; font-size: .86rem; line-height: 1.6; color: #cfe7ff; }
.md blockquote { border-left: 2px solid var(--line-strong); padding-left: 1rem; color: var(--text-dim); }
.md-callout { --c: var(--cyan); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 7%, transparent); padding: .9rem 1.1rem; }
.md-callout > b { display: block; font: 500 11px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--c); margin-bottom: .3rem; }
.md-callout > :not(b) { margin: 0; }
.md-callout--tip { --c: var(--lime); } .md-callout--warning { --c: var(--amber); } .md-callout--danger { --c: var(--red); }
.md-table { overflow-x: auto; border: 1px solid var(--line); }
.md table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.md th { text-align: left; color: var(--text); background: var(--surface); font: 500 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.md th, .md td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.md img { max-width: 100%; border: 1px solid var(--line); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

@media (max-width: 1180px) { .dlay { grid-template-columns: 260px minmax(0, 1fr); } .dtoc { display: none; } }
@media (max-width: 860px) {
  .dlay { grid-template-columns: 1fr; }
  .dside { position: fixed; z-index: 60; left: 0; top: 72px; width: min(320px, 86vw); background: #070910; transform: translateX(-100%); transition: transform .35s var(--ease); box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .dside.open { transform: none; }
  .dtoggle { display: inline-flex; position: sticky; top: 72px; z-index: 30; margin: 0; padding: .8rem 1.2rem; width: 100%; background: rgba(5,6,10,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); font: 500 var(--text-xs) var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
  .dtoggle::before { content: '☰'; margin-right: .6rem; }
  .dpn { grid-template-columns: 1fr; } .dpn__a--next { grid-column: 1; }
}
