*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #080b14;
  --bg2:         #0d1120;
  --bg3:         #121828;
  --border:      #1e2840;
  --indigo:      #6366f1;
  --indigo-soft: rgba(99,102,241,0.12);
  --green:       #10b981;
  --pink:        #f472b6;
  --text:        #e2e8f0;
  --dim:         #94a3b8;
  --dimmer:      #475569;
  --mono: ui-monospace,'Cascadia Code','Source Code Pro','Fira Code',monospace;
  --sans: -apple-system,BlinkMacSystemFont,'Inter','Segoe UI',system-ui,sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh; }
a { color: var(--indigo); text-decoration: none; }
a:hover { color: #818cf8; text-decoration: underline; }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,11,20,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}
.nav-inner {
  max-width: 900px; margin: 0 auto;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: var(--mono); font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.logo em { color: var(--indigo); font-style: normal; }
.nav-links { display: flex; gap: 1.5rem; font-size: .875rem; }
.nav-links a { color: var(--dim); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* LAYOUT */
.doc-wrap {
  max-width: 900px; margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 700px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* SIDEBAR */
.sidebar { position: sticky; top: 80px; }
.sidebar-label {
  font-size: .7rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dimmer); margin-bottom: .75rem;
}
.sidebar ul { list-style: none; }
.sidebar ul li { margin: .1rem 0; }
.sidebar ul li a {
  display: block; padding: .35rem .6rem;
  font-size: .8rem; color: var(--dim);
  border-left: 2px solid transparent; border-radius: 0 4px 4px 0;
  transition: all .12s;
}
.sidebar ul li a:hover, .sidebar ul li a.active {
  color: var(--indigo); border-left-color: var(--indigo);
  background: var(--indigo-soft); text-decoration: none;
}
.sidebar ul li.sub a { padding-left: 1.2rem; font-size: .78rem; }

/* CONTENT */
.doc-content { min-width: 0; }

.breadcrumb {
  font-size: .78rem; color: var(--dimmer); margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: .4rem;
}
.breadcrumb a { color: var(--dimmer); }
.breadcrumb a:hover { color: var(--dim); text-decoration: none; }
.breadcrumb span { opacity: .5; }

.doc-tag {
  display: inline-block;
  background: var(--indigo-soft); color: var(--indigo);
  border: 1px solid rgba(99,102,241,.25);
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; margin-bottom: .75rem;
}

h1 {
  font-size: 2rem; font-weight: 700; letter-spacing: -.03em;
  color: var(--text); margin-bottom: .5rem; line-height: 1.2;
}
.doc-lead {
  font-size: 1.05rem; color: var(--dim); margin-bottom: 2rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1.25rem; font-weight: 600; color: var(--text);
  margin: 2.5rem 0 .75rem; padding-top: .5rem;
  scroll-margin-top: 80px;
}
h3 {
  font-size: 1rem; font-weight: 600; color: var(--text);
  margin: 1.75rem 0 .5rem; scroll-margin-top: 80px;
}
p { margin-bottom: 1rem; color: var(--dim); }
strong { color: var(--text); font-weight: 600; }
em { color: var(--pink); font-style: normal; }

ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; color: var(--dim); }
li { margin-bottom: .35rem; }

/* CODE */
pre {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.1rem 1.2rem;
  overflow-x: auto; margin: 1rem 0 1.5rem;
  font-family: var(--mono); font-size: .82rem; line-height: 1.6;
  color: #a5f3fc;
}
code:not(pre code) {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
  font-family: var(--mono); font-size: .82em; color: #a5f3fc;
}

/* CALLOUT */
.callout {
  background: var(--bg2); border: 1px solid var(--border);
  border-left: 3px solid var(--indigo);
  border-radius: 0 8px 8px 0; padding: 1rem 1.2rem;
  margin: 1.25rem 0; color: var(--dim); font-size: .9rem;
}
.callout.green { border-left-color: var(--green); }
.callout.pink { border-left-color: var(--pink); }
.callout strong { display: block; margin-bottom: .25rem; }

/* TABLE */
table {
  width: 100%; border-collapse: collapse;
  margin: 1rem 0 1.5rem; font-size: .87rem;
}
th {
  text-align: left; padding: .6rem .8rem;
  background: var(--bg2); color: var(--dim);
  font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
td {
  padding: .6rem .8rem; color: var(--dim);
  border-bottom: 1px solid var(--border);
}
td:first-child { color: var(--text); font-weight: 500; }
tr:hover td { background: var(--bg2); }

/* STEP */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: flex; gap: 1rem; margin-bottom: 1.5rem;
}
.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--indigo-soft); border: 1px solid rgba(99,102,241,.3);
  color: var(--indigo); border-radius: 50%;
  font-size: .8rem; font-weight: 700; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center;
  margin-top: .15rem;
}
.steps li > div { flex: 1; }

/* FOOTER */
footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 2rem; text-align: center;
  font-size: .8rem; color: var(--dimmer);
}
footer a { color: var(--dimmer); }
footer a:hover { color: var(--dim); }
