/* Pi-Bolt documentation. The palette and type are the home page's (site/index.html), which are OpenSec's (opensec.in). */
:root {
  color-scheme: dark;
  --black: #050505;
  --black-2: #0a0b0a;
  --panel: #0e100e;
  --panel-2: #121512;
  --lime: #bafc6b;
  --lime-deep: #9fe04d;
  --lime-soft: rgba(186, 252, 107, 0.1);
  --on-lime: #10150d;
  --text: #f1f3ef;
  --text-soft: #b3b9b0;
  --text-dim: #7d8980;
  --rule: #1d211d;
  --rule-2: #2a302a;
  --warn: #f0b03a;
  --warn-soft: rgba(240, 176, 58, 0.09);
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header: 60px;
  accent-color: var(--lime);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--black); scroll-padding-top: calc(var(--header) + 20px); }
body { margin: 0; background: var(--black); color: var(--text); font: 400 1rem/1.7 var(--sans); }
::selection { background: rgba(186, 252, 107, 0.3); color: #fff; }
a { color: var(--lime); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 3px; }
code, kbd, pre { font-family: var(--mono); }
kbd { font-size: 0.75rem; padding: 1px 6px; border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 4px; color: var(--text-soft); background: var(--black-2); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--lime); color: var(--on-lime); padding: 8px 12px; border-radius: 3px; }
.skip:focus { left: 8px; }

/* Header */
header.site { position: sticky; top: 0; z-index: 30; height: var(--header); border-bottom: 1px solid var(--rule); background: rgba(8, 8, 8, 0.92); backdrop-filter: blur(8px); }
.bar { height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; }
.section-name { color: var(--text-soft); text-decoration: none; font-weight: 500; padding-left: 14px; border-left: 1px solid var(--rule-2); }
.section-name:hover { color: var(--text); }
.menu { display: none; border: 0; background: transparent; color: var(--text); padding: 6px; margin-left: -6px; cursor: pointer; border-radius: 4px; }
.search-open { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 7px 10px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--black-2); color: var(--text-dim); font: 400 0.9rem var(--sans); cursor: pointer; }
.search-open:hover { border-color: #3a423a; color: var(--text-soft); }
.search-open span { flex: 1; text-align: left; }
nav.top { display: flex; align-items: center; gap: 22px; font-size: 0.93rem; margin-left: 18px; }
nav.top a { color: var(--text-soft); text-decoration: none; }
nav.top a:hover { color: var(--text); }
nav.top a.gh { color: var(--on-lime); background: var(--lime); padding: 6px 13px; border-radius: 3px; font-weight: 600; }
nav.top a.gh:hover { background: var(--lime-deep); }

/* Three columns: navigation, the page, its contents. */
.layout { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: 264px minmax(0, 1fr) 232px; gap: 0 48px; padding: 0 24px; }
.sidebar { position: sticky; top: var(--header); align-self: start; height: calc(100vh - var(--header)); overflow-y: auto; padding: 28px 12px 40px 0; border-right: 1px solid var(--rule); scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 26px; }
.nav-title { margin: 0 0 8px; font: 500 0.72rem var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 5px 12px; margin: 1px 0; border-radius: 5px; color: var(--text-soft); text-decoration: none; font-size: 0.95rem; border-left: 2px solid transparent; }
.sidebar li a:hover { color: var(--text); background: var(--panel); }
.sidebar li a[aria-current="page"] { color: var(--lime); background: var(--lime-soft); font-weight: 500; }
.scrim { display: none; }

main { min-width: 0; padding: 44px 0 64px; }
.toc-col { position: sticky; top: var(--header); align-self: start; max-height: calc(100vh - var(--header)); overflow-y: auto; padding: 44px 0 40px; scrollbar-width: thin; }
.toc h2 { margin: 0 0 10px; font: 500 0.72rem var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--text-dim); text-decoration: none; font-size: 0.86rem; line-height: 1.45; }
.toc li.l3 a { padding-left: 26px; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--lime); border-left-color: var(--lime); }

/* The page */
.doc { max-width: 780px; }
.doc > :first-child { margin-top: 0; }
.eyebrow { margin: 0 0 10px; font: 500 0.78rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); }
.doc h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.028em; font-weight: 500; margin: 0 0 16px; text-wrap: balance; }
.doc .lede { font-size: 1.15rem; line-height: 1.6; color: var(--text-soft); margin: 0 0 36px; text-wrap: pretty; }
.doc h2 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.018em; font-weight: 500; margin: 56px 0 14px; padding-top: 28px; border-top: 1px solid var(--rule); }
.doc h3 { font-size: 1.15rem; line-height: 1.35; font-weight: 600; margin: 34px 0 10px; }
.doc h2 .anchor, .doc h3 .anchor { margin-left: 8px; color: var(--text-dim); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity 0.15s; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 1.3em; }
.doc li { margin: 5px 0; }
.doc li::marker { color: var(--text-dim); }
.doc strong { font-weight: 600; color: #fff; }
.doc :not(pre) > code { font-size: 0.86em; padding: 0.12em 0.38em; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--rule); color: #e6eae2; white-space: nowrap; }
.doc a code { color: var(--lime); }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

/* Code blocks, with a copy button added by docs.js. */
.code { position: relative; margin: 0 0 20px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--black-2); }
.code .label { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px 7px 14px; border-bottom: 1px solid var(--rule); font: 500 0.75rem var(--mono); color: var(--text-dim); letter-spacing: 0.02em; }
.doc pre { margin: 0 0 20px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--black-2); font-size: 0.86rem; line-height: 1.6; color: var(--text); scrollbar-width: thin; }
.code pre { margin: 0; border: 0; border-radius: 0 0 8px 8px; padding-right: 76px; }
.code:not(:has(.label)) pre { border-radius: 8px; }
.doc pre .c { color: var(--text-dim); }
.doc pre .p { color: var(--lime); user-select: none; }
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid var(--rule-2); background: var(--panel); color: var(--text-soft); border-radius: 5px; padding: 3px 9px; font: 500 0.75rem var(--sans); cursor: pointer; }
.code:has(.label) .copy { top: 4px; }
.copy:hover { color: var(--text); border-color: #3a423a; }
.copy.done { color: var(--lime); border-color: var(--lime); }

/* Tabs: one set of commands per platform. Every tab group on a page follows the platform chosen last. */
.tabs { margin: 0 0 22px; }
.tabs [role="tablist"] { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; overflow-x: auto; }
.tabs [role="tab"] { border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--text-dim); padding: 8px 12px; font: 500 0.92rem var(--sans); cursor: pointer; white-space: nowrap; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { color: var(--lime); border-bottom-color: var(--lime); }
.tabs [role="tabpanel"] > :last-child { margin-bottom: 0; }

/* Tables */
.table { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: 8px; scrollbar-width: thin; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.doc th { text-align: left; font-weight: 600; color: var(--text); background: var(--panel); padding: 10px 14px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.doc td { padding: 9px 14px; border-top: 1px solid var(--rule); color: var(--text-soft); vertical-align: top; }
.doc tr:first-child td { border-top: 0; }
.doc td strong { color: var(--text); }
.doc td.n, .doc th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc td.best { color: var(--lime); font-weight: 600; }
.doc .caption { margin: -12px 0 22px; font-size: 0.86rem; color: var(--text-dim); }

/* Callouts */
.callout { margin: 0 0 20px; padding: 14px 16px 14px 18px; border: 1px solid var(--rule-2); border-left: 3px solid var(--lime); border-radius: 6px; background: var(--black-2); color: var(--text-soft); font-size: 0.96rem; }
.callout > :last-child { margin-bottom: 0; }
.callout .title { display: block; margin-bottom: 4px; font-weight: 600; color: var(--text); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }

/* Cards (the overview) */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 28px; }
.card { display: block; padding: 18px 18px 16px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--black-2); color: var(--text); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.card:hover { border-color: var(--lime); background: var(--panel); }
.card strong { display: block; margin-bottom: 4px; font-size: 1.02rem; font-weight: 600; }
.card span { display: block; color: var(--text-soft); font-size: 0.92rem; line-height: 1.5; }
.card strong::after { content: " →"; color: var(--lime); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps > li { position: relative; padding: 0 0 8px 44px; margin: 0 0 18px; }
.steps > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--rule-2); background: var(--panel); color: var(--lime); font: 600 0.85rem/26px var(--mono); text-align: center; }
.steps > li > strong:first-child { display: block; margin-bottom: 6px; }

/* Definition-style rows for FAQ */
details.faq { border-bottom: 1px solid var(--rule); }
details.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--lime); font: 400 1.3rem/1 var(--mono); }
details.faq[open] summary::after { content: "−"; }
details.faq > div { padding: 0 0 16px; color: var(--text-soft); }
details.faq > div > :last-child { margin-bottom: 0; }

/* Bottom of the page */
.doc-foot { max-width: 780px; margin: 48px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.doc-foot .edit { color: var(--text-dim); text-decoration: none; }
.doc-foot .edit:hover { color: var(--lime); }
.pager { max-width: 780px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--rule-2); border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--lime); }
.pager a span { display: block; font: 500 0.75rem var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }

footer { border-top: 1px solid var(--rule); background: #080808; color: var(--text-dim); font-size: 0.88rem; }
.foot { max-width: 1480px; margin: 0 auto; padding: 28px 24px 36px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot a { color: var(--text-soft); }
.foot strong { color: var(--text); }

/* Search */
.search { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.search[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--black-2); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule); color: var(--text-dim); }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 1.02rem var(--sans); }
.search-field input::-webkit-search-cancel-button { display: none; }
.results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.results li a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none; }
.results li a .where { display: block; font-size: 0.78rem; color: var(--text-dim); font-family: var(--mono); }
.results li a .what { display: block; font-weight: 500; }
.results li a .snip { display: block; font-size: 0.86rem; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results li a mark { background: none; color: var(--lime); }
.results li[aria-selected="true"] a, .results li a:hover { background: var(--panel-2); }
.results .empty { padding: 18px 12px; color: var(--text-dim); }

@media (max-width: 1240px) {
  .layout { grid-template-columns: 248px minmax(0, 1fr); }
  .toc-col { display: none; }
}
@media (max-width: 900px) {
  :root { --header: 56px; }
  .bar { padding: 0 16px; gap: 10px; }
  .menu { display: inline-flex; }
  .section-name, nav.top a:not(.gh) { display: none; }
  nav.top { margin-left: 0; }
  .search-open { min-width: 0; margin-left: auto; }
  .search-open span, .search-open kbd { display: none; }
  .layout { display: block; padding: 0 16px; }
  .sidebar { position: fixed; z-index: 50; top: var(--header); left: 0; bottom: 0; width: min(300px, 84vw); height: auto; padding: 22px 16px 40px; background: var(--black); border-right: 1px solid var(--rule-2); transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: none; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: var(--header) 0 0 0; z-index: 40; background: rgba(0, 0, 0, 0.5); }
  main { padding-top: 32px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .doc :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .card, .doc .anchor { transition: none; } }
