:root {
  --bg: #090B14; --bg-2: #0F1322; --card: #111628; --text: #ECEBF4;
  --muted: rgba(236,235,244,.66); --faint: rgba(236,235,244,.38);
  --line: rgba(236,235,244,.09); --line-2: rgba(183,168,255,.22);
  --purple: #8065F5; --lav: #B7A8FF; --lime: #C7F36B; --red: #FF8FA3; --amber: #FFD27A;
  --f-sans: "Inter Tight", system-ui, sans-serif; --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --bar-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(45% 30% at 80% 0%, rgba(128,101,245,.14), transparent 70%), var(--bg); color: var(--text); font: 16px/1.65 var(--f-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--lime); outline-offset: 3px; }
.mono { font-family: var(--f-mono); font-size: 12px; letter-spacing: .03em; }
.skip { position: fixed; left: 8px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--lime); color: var(--bg); transform: translateY(-150%); }
.skip:focus { transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* bar */
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(16px, 3vw, 32px); background: rgba(9,11,20,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; display: grid; place-items: center; background: var(--purple); border-radius: 3px; color: #F6F5F0; }
.brand__mark svg { width: 19px; height: 19px; }
.brand__word { font-weight: 500; font-size: 13px; letter-spacing: .32em; }
.brand__tag { padding: 3px 8px; border: 1px solid var(--line-2); color: var(--lime); text-transform: uppercase; font-size: 10px; }
.bar__links { display: flex; align-items: center; gap: 18px; }
.bar__links > a:not(.btn) { color: var(--muted); font-size: 14px; }
.bar__links > a:not(.btn):hover { color: var(--text); text-decoration: none; }
.btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.btn--lime { background: var(--lime); border-color: var(--lime); color: var(--bg); }
.btn--lime:hover { background: #DAFF8F; text-decoration: none; }
.toc-toggle { display: none; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); font-size: 13px; }

/* layout */
.layout { display: grid; grid-template-columns: 240px minmax(0, 760px); gap: clamp(32px, 5vw, 72px); max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.toc { position: sticky; top: var(--bar-h); align-self: start; max-height: calc(100vh - var(--bar-h)); overflow: auto; padding: 32px 0 40px; display: grid; gap: 2px; }
.toc__title { margin: 18px 0 6px; color: var(--faint); text-transform: uppercase; letter-spacing: .16em; font-size: 10.5px; }
.toc__title:first-child { margin-top: 0; }
.toc a { display: block; padding: 6px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 14.5px; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--lime); border-left-color: var(--lime); }

.content { padding: 40px 0 80px; min-width: 0; }
.content section { padding: 36px 0; border-bottom: 1px solid var(--line); display: grid; gap: 16px; }
.content section:first-child { padding-top: 8px; }
.eyebrow { color: var(--lime); text-transform: uppercase; letter-spacing: .22em; font-size: 11px; }
h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 300; letter-spacing: -.04em; line-height: 1.05; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 300; letter-spacing: -.03em; line-height: 1.15; display: flex; align-items: baseline; gap: 12px; }
h2 .mono { color: var(--lime); font-size: 12px; }
h3 { font-size: 17px; font-weight: 500; margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
p { color: var(--muted); }
p b, li b, td b { color: var(--text); font-weight: 500; }
em { color: var(--text); font-style: normal; border-bottom: 1px dashed var(--line-2); }
.lead { font-size: 18.5px; line-height: 1.6; color: var(--muted); }
.muted { color: var(--faint); font-size: 14.5px; }
code { font-family: var(--f-mono); font-size: 13px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; overflow-wrap: anywhere; }
.kbd { display: inline-block; font-size: 13px; color: var(--text); padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--card); line-height: 1.6; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.facts div { padding: 12px 14px; display: grid; gap: 2px; }
.facts div + div { border-left: 1px solid var(--line); }
.facts span { color: var(--faint); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; }
.facts b { font-weight: 500; }

.callout { position: relative; padding: 14px 16px 14px 18px; border: 1px solid var(--line-2); background: rgba(128,101,245,.07); color: var(--muted); font-size: 15px; }
.callout::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--lav); }
.callout b { color: var(--text); font-weight: 500; }
.callout--tip { background: rgba(199,243,107,.06); border-color: rgba(199,243,107,.25); }
.callout--tip::before { background: var(--lime); }

.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 52px; border: 1px solid var(--line); color: var(--muted); }
.steps li::before { content: "0" counter(s); position: absolute; left: 14px; top: 13px; font-family: var(--f-mono); font-size: 12px; color: var(--lime); }
.list { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.list li { position: relative; padding-left: 20px; color: var(--muted); }
.list li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border: 1px solid var(--lime); }

.table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.table tbody, .table thead { display: table; width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--faint); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.table tbody th { width: 34%; }
.table td { color: var(--muted); }
.table thead th { border-bottom-color: var(--line-2); }
.table--cmd td:first-child { width: 42%; }

.stages { display: grid; border: 1px solid var(--line); }
.stages div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 14px; }
.stages div + div { border-top: 1px solid var(--line); }
.stages dt { color: var(--lime); padding-top: 2px; }
.stages dd { color: var(--muted); font-size: 15px; }

.ca { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--bg-2); }
.ca code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; font-size: 13.5px; }
.copy { color: var(--lime); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; flex: none; }
.copy:hover { color: #DAFF8F; }

.code { border: 1px solid var(--line); background: var(--bg-2); }
.code__bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--faint); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; }
.code pre { margin: 0; padding: 14px; overflow-x: auto; }
.code pre code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 1.7; white-space: pre; overflow-wrap: normal; color: #D9D6EC; }
.method { padding: 2px 7px; background: var(--lime); color: var(--bg); font-size: 11px; }

details { border: 1px solid var(--line); }
details + details { margin-top: -9px; }
summary { cursor: pointer; padding: 12px 14px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--lime); font-family: var(--f-mono); }
details[open] summary::after { content: "−"; }
details p { padding: 0 14px 14px; font-size: 15px; }

.st { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--line); }
.st--pending { color: var(--amber); border-color: rgba(255,210,122,.35); }
.st--success { color: var(--bg); background: var(--lime); border-color: var(--lime); }
.st--failed { color: var(--red); border-color: rgba(255,143,163,.4); }

.foot { display: flex; justify-content: space-between; padding-top: 28px; color: var(--faint); }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: fixed; top: var(--bar-h); left: 0; right: 0; bottom: 0; z-index: 25; max-height: none; padding: 20px clamp(16px, 3vw, 32px) 40px; background: var(--bg); display: none; }
  .toc.is-open { display: grid; align-content: start; }
  .toc-toggle { display: inline-flex; align-items: center; }
  .bar__links > a:not(.btn) { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .brand__word { display: none; }
  .stages div { grid-template-columns: 1fr; gap: 4px; }
  .table--cmd td:first-child { width: auto; }
  .lead { font-size: 17px; }
}
