/* Lunarpad docs: same deep-space palette as the app, one quiet reading column and a sticky contents rail. */
:root {
  --bg: #060607; --bg2: #0f0f10; --text: #eef3ff; --muted: #9aa8cb; --dim: #6a7697;
  --line: rgba(206, 212, 224,.12); --glass: rgba(17, 17, 18,.62); --field: rgba(255,255,255,.04);
  --brand: #c4cad6; --brand2: #eceff4; --accent: #dfe3ea; --live: #9fe3c9; --danger: #ff8f80;
  --ease: cubic-bezier(.2,.8,.2,1); --bar: 64px; color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font: 400 16px/1.7 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 78% -5%, rgba(206, 212, 224,.14), transparent 70%),
    radial-gradient(70vmax 50vmax at 0% 110%, rgba(206, 212, 224,.08), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.bar {
  position: sticky; top: 0; z-index: 20; height: var(--bar); display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(16px, 3vw, 32px); background: rgba(8, 8, 8,.78); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 17px 'Unbounded', sans-serif; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.bar nav { margin-left: auto; display: flex; gap: 4px; }
.bar nav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: color .2s, background .2s; }
.bar nav a:hover { color: var(--text); background: var(--field); text-decoration: none; }
.bar nav a[aria-current] { color: var(--text); background: rgba(206, 212, 224,.14); }
.launch {
  color: #0f0f10; background: linear-gradient(180deg, var(--brand2), var(--brand)); font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; transition: transform .2s var(--ease), box-shadow .2s;
}
.launch:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(206, 212, 224,.32); }

.wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); max-width: 1160px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.side { position: sticky; top: calc(var(--bar) + 24px); align-self: start; max-height: calc(100vh - var(--bar) - 48px); overflow: auto; padding: 32px 0 24px; scrollbar-width: thin; }
.search { display: block; position: relative; margin-bottom: 18px; }
.search input {
  width: 100%; height: 40px; padding: 0 12px 0 36px; color: var(--text); background: var(--field); border: 1px solid var(--line);
  border-radius: 12px; font: inherit; font-size: 14px; transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: none; border-color: rgba(206, 212, 224,.5); background: rgba(255,255,255,.06); }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; pointer-events: none; fill: none; stroke: var(--dim); stroke-width: 1.8; stroke-linecap: round; }
.toc { list-style: none; margin: 0; padding: 0; position: relative; }
.toc::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: var(--line); }
.toc a { display: block; position: relative; padding: 6px 0 6px 16px; color: var(--muted); font-size: 14px; line-height: 1.4; transition: color .2s, transform .25s var(--ease); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--text); font-weight: 500; }
.toc a.on::before { content: ''; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.toc li.hide { display: none; }
.toc .grp { margin: 16px 0 4px; padding-left: 16px; color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }

main { padding: 48px 0 96px; min-width: 0; }
.hero { padding: 8px 0 36px; }
.eyebrow { color: var(--brand2); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; margin: 0 0 14px; }
h1 { font: 700 clamp(30px, 4.6vw, 46px)/1.08 'Unbounded', sans-serif; letter-spacing: -.01em; margin: 0 0 18px; text-wrap: balance; }
.lede { color: var(--muted); font-size: clamp(17px, 2vw, 19px); max-width: 60ch; margin: 0; }
section { padding: 40px 0 8px; border-top: 1px solid var(--line); margin-top: 24px; }
section:first-of-type { margin-top: 0; }
h2 { font: 600 clamp(22px, 2.6vw, 28px)/1.2 'Unbounded', sans-serif; margin: 0 0 16px; text-wrap: balance; letter-spacing: -.005em; }
h3 { font-size: 17px; margin: 28px 0 8px; font-weight: 600; }
p { margin: 0 0 14px; max-width: 68ch; color: #cdd7ee; }
ul, ol { padding-left: 22px; margin: 0 0 16px; max-width: 68ch; color: #cdd7ee; }
li { margin: 6px 0; }
li::marker { color: var(--brand); }
strong { color: var(--text); font-weight: 600; }
:not(pre) > code { font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--field); border: 1px solid var(--line); color: var(--brand2); overflow-wrap: anywhere; }
pre {
  margin: 8px 0 18px; padding: 16px 18px; overflow-x: auto; border-radius: 14px; background: rgba(10, 10, 10,.8);
  border: 1px solid var(--line); font-size: 13px; line-height: 1.65; color: #cfe0ff; max-width: 100%;
}
.card { padding: 18px 20px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); margin: 16px 0; max-width: 68ch; }
.card p:last-child { margin: 0; }
.note { border-left: 2px solid var(--accent); }
.warn { border-left: 2px solid var(--danger); }
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 12px; max-width: none; }
.steps li { counter-increment: s; position: relative; margin: 0; padding: 16px 18px 16px 62px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); transition: border-color .25s, transform .3s var(--ease); }
.steps li:hover { border-color: rgba(206, 212, 224,.35); transform: translateY(-2px); }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(206, 212, 224,.14); color: var(--brand2); font: 600 14px 'Unbounded', sans-serif;
}
.steps b { display: block; color: var(--text); margin-bottom: 2px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.tier { padding: 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); position: relative; overflow: hidden; }
.tier::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--c); box-shadow: 0 0 18px var(--c); }
.tier h4 { margin: 4px 0 4px; font-size: 15px; color: var(--c); }
.tier p { margin: 0; font-size: 14px; color: var(--muted); }
.tier em { font-style: normal; display: block; margin-top: 8px; color: var(--dim); font-size: 12px; }
.tbl { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 460px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; background: rgba(255,255,255,.025); }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--text); white-space: nowrap; }
details { border: 1px solid var(--line); border-radius: 14px; background: var(--glass); margin: 10px 0; max-width: 68ch; transition: border-color .2s; }
details[open] { border-color: rgba(206, 212, 224,.3); }
summary { cursor: pointer; padding: 14px 18px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--brand2); font-size: 20px; line-height: 1; transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 18px 4px; }
dl { margin: 0; max-width: 68ch; }
dt { color: var(--text); font-weight: 600; margin-top: 16px; }
dd { margin: 2px 0 0; color: var(--muted); }
.copy { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 56px; }
.pager a { padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font-weight: 500; transition: border-color .2s, transform .25s var(--ease); }
.pager a:hover { text-decoration: none; border-color: rgba(206, 212, 224,.4); transform: translateY(-2px); }
.empty { color: var(--dim); font-size: 14px; padding-left: 16px; display: none; }
footer { border-top: 1px solid var(--line); padding: 28px clamp(16px, 3vw, 32px) 40px; color: var(--dim); font-size: 13px; text-align: center; }
footer p { margin: 4px auto; max-width: 70ch; color: var(--dim); }
.menu-btn { display: none; }

/* sections ease in as they are scrolled to; only opacity and transform, so it stays smooth */
.js section { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js section.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; max-height: none; padding: 20px 0 0; }
  .toc { display: none; } .toc.open { display: block; margin-bottom: 8px; }
  .menu-btn { display: flex; width: 100%; margin: 0 0 8px; height: 40px; align-items: center; justify-content: space-between; padding: 0 14px; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 14px; }
  .bar nav a:not([aria-current]):not(.keep) { display: none; }
  main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js section { opacity: 1; transform: none; }
}
