/* The OMEGA docs (docs.omega.so), in the same look as the app and omega.so
   (design "E"): the black bar with the wordmark and a glowing blue line, the
   deep blue darker in the middle and bluer at the edges with drifting stars,
   and a black footer under the same line. Built for reading: a calm column
   of text, a sidebar of pages, and "on this page" on wide screens. */

:root {
  --bg: #0B1122;
  --ink: #F2F5FB;
  --ink-2: #C3CCDD;
  --muted: #9AA6BF;
  --label: #7FA6F7;
  --link: #8EB2FA;
  --panel: rgba(8, 13, 28, .62);
  --line: rgba(140, 170, 230, .18);
  --line-2: rgba(140, 170, 230, .32);
  --green: #4CC38A;
  --amber: #E9B44C;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #B9CFFC; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--label); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.inner { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 700px) { .inner { padding-left: 24px; padding-right: 24px; } }
.wordmark { display: block; background: #fff; -webkit-mask: url("/omega-wordmark.png") left center / contain no-repeat; mask: url("/omega-wordmark.png") left center / contain no-repeat; }

/* The blue behind everything, fixed while the page scrolls, and the stars over it. */
.backdrop {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 55% 70% at 50% 45%, rgba(8,13,28,.94) 0%, rgba(10,17,36,.66) 45%, rgba(10,17,36,0) 80%),
    linear-gradient(90deg, #2C4A80 0%, #1B2F57 30%, #14244A 50%, #1B2F57 70%, #2C4A80 100%);
}
.stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* The bar at the top: exactly the app's height, so moving between them never jumps. */
.top { background: #03050B; position: relative; z-index: 3; }
.top .inner { padding-top: 28px; padding-bottom: 28px; min-height: calc(56px + 14px * 1.45 + 20px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (max-width: 1260px) { .top .inner { min-height: 104px; } }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .wordmark { height: 26px; width: 138px; flex: none; }
.docs-label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #A9C3FA; border: 1px solid #2B3A60; border-radius: 999px; padding: 5px 11px; }
.top-links { display: flex; align-items: center; gap: 22px; }
.top-link { color: var(--ink-2); font-size: 14px; }
.top-link:hover { color: #fff; }
.btn { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #5B8DEF, #3F6FD8); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 9px 18px; box-shadow: 0 6px 22px rgba(63,111,216,.35); white-space: nowrap; }
.btn:hover { color: #fff; filter: brightness(1.08); }
.menu { display: none; width: 48px; height: 48px; align-items: center; justify-content: center; color: var(--ink); background: transparent; border: 1px solid #2B3A60; border-radius: 12px; cursor: pointer; }
.menu svg { width: 22px; height: 22px; }
.glow, footer::before { height: 2px; background: linear-gradient(90deg, rgba(91,141,239,.35) 0%, #6F98EE 30%, #8FB0F8 50%, #6F98EE 70%, rgba(91,141,239,.35) 100%); box-shadow: 0 0 6px 0 rgba(127,166,247,.75), 0 0 18px 2px rgba(91,141,239,.45), 0 0 44px 6px rgba(91,141,239,.18); }
.glow { position: relative; z-index: 3; }

/* Sidebar · page · on this page. */
.layout { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0, 1fr) 230px; gap: 0 48px; padding: 0 24px; }
.sidebar { position: sticky; top: 0; align-self: start; max-height: 100svh; overflow-y: auto; padding: 32px 0 48px; scrollbar-width: thin; scrollbar-color: #2B3A60 transparent; }
.nav-group { margin-top: 26px; }
.nav-group h2 { margin: 0 0 8px; padding-left: 14px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--label); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { position: relative; display: block; padding: 7px 14px; border-radius: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.nav-group a:hover { color: #fff; background: rgba(127,166,247,.07); }
.nav-group a[aria-current="page"] { color: #fff; font-weight: 600; background: rgba(91,141,239,.14); }
.nav-group a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: #8FB0F8; box-shadow: 0 0 8px rgba(127,166,247,.8); }

.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 40px 11px 40px; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--label); box-shadow: 0 0 0 3px rgba(127,166,247,.18); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-icon { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 11px; top: 50%; translate: 0 -50%; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; pointer-events: none; }
.search:focus-within kbd { display: none; }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); max-height: 60svh; overflow-y: auto; background: #0A1022; border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.results a:hover, .results a[aria-selected="true"] { background: rgba(91,141,239,.16); }
.results .r-group { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--label); }
.results .r-title { display: block; font-weight: 600; font-size: 14px; }
.results .r-text { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.results mark { background: none; color: #B9CFFC; font-weight: 600; }
.results .none { padding: 12px; font-size: 14px; color: var(--muted); }

main { min-width: 0; padding: 56px 0 72px; }
article { max-width: 760px; }
.toc { position: sticky; top: 0; align-self: start; padding: 64px 0 48px; }
.toc h2 { margin: 0 0 12px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--label); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 1px solid transparent; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a.active { color: #fff; border-left-color: #8FB0F8; }

/* The writing. */
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--label); }
.eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .8; }
h1 { margin: 14px 0 0; font-size: clamp(34px, 5vw, 46px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; }
.lead { margin: 16px 0 0; font-size: 19px; line-height: 1.6; color: var(--ink-2); font-weight: 300; }
article > .lead + * { margin-top: 36px; }
article h2 { margin: 52px 0 0; padding-top: 28px; border-top: 1px solid var(--line); font-size: 25px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
article h3 { margin: 32px 0 0; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; font-weight: 600; }
article h2, article h3 { position: relative; }
.anchor { position: absolute; left: -26px; padding-right: 8px; color: var(--label); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: .8; }
article p { margin: 14px 0 0; color: var(--ink-2); }
article strong { color: var(--ink); font-weight: 600; }
article ul, article ol { margin: 14px 0 0; padding-left: 22px; color: var(--ink-2); }
article li { margin-top: 8px; padding-left: 4px; }
article li::marker { color: var(--label); }
article code { font-family: var(--mono); font-size: .86em; color: #DDE5F5; background: rgba(127,166,247,.1); border: 1px solid rgba(127,166,247,.14); border-radius: 6px; padding: 1px 6px; }
article pre { margin: 18px 0 0; padding: 16px 18px; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
article pre code { background: none; border: 0; padding: 0; font-size: 13.5px; }
article blockquote { margin: 18px 0 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--line-2); color: var(--muted); }
article hr { margin: 40px 0 0; border: 0; border-top: 1px solid var(--line); }

/* Tables: quiet rows, labels in the mono face. */
.table { margin: 20px 0 0; overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--label); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; color: var(--ink-2); border-bottom: 1px solid rgba(140,170,230,.1); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td strong { color: var(--ink); }

/* Callouts. */
.callout { display: flex; gap: 14px; margin: 22px 0 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--label); border-radius: 14px; }
.callout > div > p:first-child { margin-top: 0; }
.callout p { font-size: 15.5px; }
.callout-icon { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--label); }
.callout-icon svg { display: block; width: 100%; height: 100%; }
.callout.tip { border-left-color: var(--green); }
.callout.tip .callout-icon { color: var(--green); }
.callout.warning { border-left-color: var(--amber); }
.callout.warning .callout-icon { color: var(--amber); }

/* Link cards. */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: rgba(143,176,248,.55); box-shadow: 0 0 0 1px rgba(143,176,248,.15), 0 10px 30px rgba(36,72,150,.28); transform: translateY(-1px); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-weight: 600; font-size: 16px; }
.card-text { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.arrow { width: 16px; height: 16px; flex: none; color: var(--label); transition: translate .15s; }
.card:hover .arrow { translate: 3px 0; }

/* Previous · next. */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin-top: 64px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: rgba(143,176,248,.55); }
.pager span { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--label); }
.pager .next { grid-column: 2; text-align: right; }

/* The footer, under the same glowing line. */
footer { position: relative; background: #03050B; margin-top: auto; }
footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; z-index: 1; }
footer .inner { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; font-size: 13px; color: var(--muted); }
.foot-brand { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-brand .wordmark { height: 18px; width: 96px; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.foot-links a { color: var(--ink-2); }

/* Narrower screens: no "on this page"; then the sidebar becomes a drawer. */
@media (max-width: 1200px) {
  .layout { grid-template-columns: 270px minmax(0, 1fr); gap: 0 40px; }
  .toc { display: none; }
}
@media (max-width: 960px) {
  .top-link { display: none; }
  .menu { display: inline-flex; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .sidebar { position: fixed; z-index: 4; top: 0; bottom: 0; left: 0; width: min(86vw, 330px); max-height: none; padding: 24px 18px 40px; background: #070C1A; border-right: 1px solid var(--line-2); box-shadow: 20px 0 60px rgba(0,0,0,.5); translate: -105% 0; transition: translate .22s ease; }
  body.nav-open .sidebar { translate: 0 0; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 3; background: rgba(2,4,10,.6); }
  main { padding-top: 40px; }
  .anchor { display: none; }
}
@media (max-width: 560px) {
  .btn { padding: 8px 14px; font-size: 13px; }
  .docs-label { display: none; }
  .brand .wordmark { width: 118px; height: 22px; }
  .top-links { gap: 12px; }
  .cards, .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .lead { font-size: 18px; }
  article h2 { font-size: 22px; }
  table { font-size: 14px; }
  th, td { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .card, .arrow { transition: none; }
}
