/* Scarnox docs: three-column reading layout (nav · article · on this page) */
:root {
  --bg: #0f0406; --surface: #170709; --surface-2: #1d0a0d; --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12);
  --text: #f6ecee; --muted: #c7b2b6; --dim: #8f777c; --red: #ff3346; --red-2: #e3122c; --gold: #ffc83d; --green: #3ddc84; --blue: #7aa2ff;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(255,51,70,.35); }

/* header */
.dh { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 24px;
  background: rgba(15,4,6,.82); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); border-bottom: 1px solid var(--line); }
.dh-logo { display: flex; align-items: center; gap: 10px; flex: none; }
.dh-logo img { height: 30px; }
.dh-logo span { font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px; }
.dh-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 380px; height: 38px; margin: 0 auto; padding: 0 10px 0 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--dim); font: 14px var(--font); cursor: pointer; transition: border-color .15s; }
.dh-search:hover { border-color: rgba(255,255,255,.22); }
.dh-search svg { width: 16px; height: 16px; flex: none; } .dh-search span { flex: 1; text-align: left; }
kbd { font: 11px var(--mono); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--muted); }
.dh-links { display: flex; align-items: center; gap: 18px; flex: none; font-size: 14px; color: var(--muted); }
.dh-links a:hover { color: var(--text); }
.dh-store { padding: 7px 14px; border-radius: 8px; background: linear-gradient(180deg, #ff4a5a, #d1162e); color: #fff !important; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.dh-menu { display: none; width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: none; color: var(--text); }
.dh-menu svg { width: 18px; height: 18px; }

/* layout */
.dwrap { display: grid; grid-template-columns: 272px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.dside { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; padding: 28px 20px 40px 24px; border-right: 1px solid var(--line); }
.sg { margin-bottom: 22px; }
.sg span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--text); margin: 0 0 6px 10px; }
.sg a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--muted); line-height: 1.45; transition: color .15s, background .15s; }
.sg a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.sg a.on { color: #fff; font-weight: 500; background: rgba(255,51,70,.12); box-shadow: inset 2px 0 0 var(--red); }
.dmain { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 56px; justify-content: center; padding: 44px 40px 80px; }

/* article */
.eyebrow { font-size: 14px; font-weight: 600; color: var(--red); margin-bottom: 8px; }
.doc h1 { font-size: 36px; line-height: 1.15; letter-spacing: -.025em; margin: 0; font-weight: 700; }
.lede { font-size: 18px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.prose { margin-top: 34px; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 18px; color: #e4d6d9; }
.prose h2 { font-size: 24px; letter-spacing: -.015em; margin: 44px 0 14px; line-height: 1.3; position: relative; }
.prose h3 { font-size: 18px; margin: 30px 0 10px; position: relative; }
.prose h2 .anchor, .prose h3 .anchor { position: absolute; left: -22px; color: var(--dim); opacity: 0; font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose a { color: #ff8692; text-decoration: underline; text-decoration-color: rgba(255,134,146,.35); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: #fff; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; color: #e4d6d9; }
.prose li { margin: 6px 0; } .prose li::marker { color: var(--dim); }
.prose code { font: 13.5px var(--mono); padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #ffd6db; }
.prose pre { position: relative; margin: 0 0 20px; padding: 16px 18px; border-radius: 10px; background: #0b0304; border: 1px solid var(--line-2); overflow-x: auto; }
.prose pre code { padding: 0; border: 0; background: none; color: #f3e7e9; font-size: 14px; line-height: 1.6; }
.prose pre .copy { position: absolute; top: 8px; right: 8px; font: 12px var(--font); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer; }
.prose pre .copy:hover { color: var(--text); }
.prose img { display: block; max-width: 100%; height: auto; margin: 6px 0 22px; border-radius: 12px; border: 1px solid var(--line-2); box-shadow: 0 20px 50px -24px rgba(0,0,0,.8); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose blockquote { margin: 0 0 18px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line-2); color: var(--muted); }
kbd { white-space: nowrap; }

/* callouts */
.call { display: flex; gap: 12px; padding: 14px 16px; margin: 0 0 20px; border-radius: 10px; border: 1px solid; font-size: 15px; }
.call > svg { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.call b { display: block; margin-bottom: 2px; color: #fff; }
.call p:last-child, .call ul:last-child { margin-bottom: 0; }
.call-note { border-color: rgba(122,162,255,.3); background: rgba(122,162,255,.07); } .call-note > svg { color: var(--blue); }
.call-tip { border-color: rgba(61,220,132,.3); background: rgba(61,220,132,.06); } .call-tip > svg { color: var(--green); }
.call-warning { border-color: rgba(255,200,61,.35); background: rgba(255,200,61,.07); } .call-warning > svg { color: var(--gold); }
.call-check { border-color: rgba(61,220,132,.35); background: rgba(61,220,132,.08); } .call-check > svg { color: var(--green); }

/* steps */
.steps { list-style: none; counter-reset: st; padding: 0 !important; margin: 4px 0 24px; }
.steps > li { position: relative; counter-increment: st; padding: 0 0 6px 46px; margin: 0 !important; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 600 13px var(--font); color: #fff; background: var(--surface-2); border: 1px solid var(--line-2); }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: 4px; width: 1px; background: var(--line-2); }
.steps h4 { font-size: 16px; margin: 2px 0 8px; }

/* faq */
.faq { border: 1px solid var(--line-2); border-radius: 10px; margin: 0 0 22px; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--dim); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 4px; color: var(--muted); }

/* cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 26px; }
.dcard { position: relative; display: grid; gap: 4px; padding: 18px 40px 18px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); text-decoration: none !important; transition: border-color .15s, transform .15s, background .15s; }
.dcard:hover { border-color: rgba(255,51,70,.45); background: var(--surface-2); transform: translateY(-1px); }
.dcard b { color: #fff; font-size: 15px; } .dcard span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.dcard i { position: absolute; right: 16px; top: 18px; font-style: normal; color: var(--dim); transition: transform .15s, color .15s; }
.dcard:hover i { transform: translateX(3px); color: var(--red); }

/* tables */
.tbl { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line-2); border-radius: 10px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 600; background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line); color: #e4d6d9; vertical-align: top; }

/* feedback + prev/next */
.helpful { display: flex; align-items: center; gap: 10px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.helpful button { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--text); font: 13px var(--font); cursor: pointer; }
.helpful button:hover { border-color: rgba(255,255,255,.3); }
.helpful.done button { display: none; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.pn a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-2); transition: border-color .15s; }
.pn a:hover { border-color: rgba(255,51,70,.45); }
.pn span { font-size: 12px; color: var(--dim); } .pn b { font-weight: 600; }
.pn .next { text-align: right; grid-column: 2; }
.dfoot { margin-top: 44px; font-size: 13px; color: var(--dim); }
.dfoot a:hover { color: var(--text); }

/* on this page */
.dtoc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 13px; }
.dtoc span { display: block; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.dtoc a { display: block; padding: 4px 0 4px 12px; color: var(--dim); border-left: 1px solid var(--line-2); line-height: 1.45; transition: color .15s, border-color .15s; }
.dtoc a.l3 { padding-left: 24px; }
.dtoc a:hover { color: var(--text); } .dtoc a.on { color: #fff; border-left-color: var(--red); }

/* search */
.dsearch { position: fixed; inset: 0; z-index: 60; background: rgba(5,1,2,.6); backdrop-filter: blur(6px); display: flex; justify-content: center; padding: 12vh 16px 16px; }
.dsearch[hidden] { display: none; }
.dsearch-box { width: 100%; max-width: 620px; max-height: 70vh; display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 40px 90px -20px #000; overflow: hidden; }
.dsearch-box input { height: 54px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: 16px var(--font); outline: none; }
#dres { overflow-y: auto; padding: 8px; }
#dres a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; }
#dres a:hover, #dres a.sel { background: rgba(255,51,70,.1); }
#dres b { font-size: 14px; } #dres span { font-size: 12px; color: var(--dim); } #dres p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
#dres mark { background: rgba(255,200,61,.25); color: #fff; border-radius: 2px; }
#dres .none { padding: 26px; text-align: center; color: var(--dim); font-size: 14px; }

/* responsive */
@media (max-width: 1180px) { .dmain { grid-template-columns: minmax(0, 760px); } .dtoc { display: none; } }
@media (max-width: 900px) {
  .dwrap { grid-template-columns: 1fr; }
  .dside { position: fixed; top: 64px; left: 0; bottom: 0; width: 290px; z-index: 25; background: var(--bg); transform: translateX(-100%); transition: transform .25s ease; height: auto; }
  body.side-open .dside { transform: none; box-shadow: 30px 0 60px rgba(0,0,0,.6); }
  .dh-menu { display: grid; place-items: center; flex: none; }
  .dmain { padding: 30px 20px 60px; }
  .dh-links a:not(.dh-store) { display: none; }
}
@media (max-width: 600px) {
  .dh { gap: 10px; padding: 0 14px; } .dh-logo span { display: none; } .dh-logo img { height: 26px; }
  .dh-search span, .dh-search kbd { display: none; } .dh-search { width: 38px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .dh-store { padding: 7px 10px; font-size: 13px; }
  .doc h1 { font-size: 29px; } .lede { font-size: 16px; }
  .cards, .pn { grid-template-columns: 1fr; } .pn .next { grid-column: 1; }
}
