:root {
  color-scheme: dark;
  --bg: #07090a;
  --bg-raised: #0b0f10;
  --surface: #0f1314;
  --surface-strong: #131819;
  --line: #303637;
  --line-soft: #202526;
  --text: #f2ede5;
  --muted: #aaa9a4;
  --muted-strong: #ccc8c0;
  --accent: #ffb000;
  --accent-rgb: 255, 176, 0;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-hover: #ffc44d;
  --accent-code: #ffe0a3;
  --accent-glow-rgb: 180, 114, 0;
  --accent-band-rgb: 104, 68, 0;
  --amber: #ffb000;
  --amber-soft: rgba(255, 176, 0, 0.09);
  --danger: #ff7169;
  --radius: 14px;
  --page: 1240px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 76% 7%, rgba(var(--accent-glow-rgb), 0.09), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
code {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.page-width { width: min(var(--page), calc(100% - 56px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(48, 54, 55, 0.72);
  background: rgba(7, 9, 10, 0.9);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1370px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
}
.brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 25px;
  font-weight: 740;
  letter-spacing: -0.04em;
}
.brand-mark {
  width: 23px;
  height: 23px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}
.site-header nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 31px;
}
.site-header nav a, .header-link {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
  transition: color 160ms ease;
}
.site-header nav a:hover, .site-header nav a:focus-visible, .header-link:hover, .header-link:focus-visible { color: var(--accent); }
.site-header nav a[aria-current] { color: var(--accent); }
section[id] { scroll-margin-top: 92px; }
.header-link { display: inline-flex; align-items: center; gap: 8px; }
.header-link svg { width: 19px; height: 19px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 17px; }
.language-link { color: var(--accent); font-size: 13px; font-weight: 650; text-decoration: none; }
.language-link:hover, .language-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* Section index inspired by editorial page navigation, shared with DialCaptain.
   It only appears when there is a real desktop gutter beside long-form pages. */
.chapter-rail { display: none; }
@media (min-width: 1440px) and (min-height: 680px) {
  .has-chapter-rail .page-width {
    /* Keep the original content width and borrow only the outer desktop gutter. */
    margin-left: max(28px, min(calc((100% - var(--page)) / 2), calc(100% - var(--page) - 172px)));
    margin-right: auto;
  }
  .chapter-rail {
    display: block;
    position: fixed;
    z-index: 35;
    inset: 83px 0 0 auto;
    width: 172px;
    /* A continuous hover area prevents moving labels from closing the rail. */
    pointer-events: auto;
  }
  .chapter-rail-ruler {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 24px;
    width: 60px;
    border-right: 1px solid var(--line);
    background: linear-gradient(90deg, transparent, rgba(15, 19, 20, .54));
    cursor: ns-resize;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
  }
  .chapter-rail-ruler:focus-visible { box-shadow: inset 2px 0 0 var(--accent); }
  .chapter-rail-scale {
    position: absolute;
    inset: -8px 0;
    overflow: hidden;
    pointer-events: none;
  }
  .chapter-rail-ticks {
    position: absolute;
    top: 8px;
    right: 0;
    width: 60px;
    pointer-events: none;
    will-change: transform;
  }
  .chapter-rail-window {
    position: absolute;
    right: 0;
    width: 60px;
    border-block: 1px solid rgba(var(--accent-rgb), .4);
    background: rgba(var(--accent-rgb), .1);
    opacity: 0;
    pointer-events: none;
    will-change: transform;
  }
  .chapter-rail-tick {
    position: absolute;
    right: 0;
    top: var(--percent);
    width: 60px;
    height: 1px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: var(--muted);
    opacity: .56;
    transform: translateY(-50%);
    pointer-events: none;
  }
  .chapter-rail-tick-line {
    width: 10px;
    height: 1px;
    background: currentColor;
  }
  .chapter-rail-tick.is-major { opacity: .78; }
  .chapter-rail-tick.is-major .chapter-rail-tick-line { width: 19px; }
  .chapter-rail-tick-number {
    position: absolute;
    right: 24px;
    color: var(--muted);
    font: italic 11px/1 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: -.02em;
  }
  .chapter-rail-scrubber {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 0;
    pointer-events: none;
    will-change: transform;
  }
  .chapter-rail-scrubber::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), .28);
  }
  .chapter-rail-scrubber-value {
    position: absolute;
    top: 4px;
    right: 3px;
    padding: 1px 2px;
    background: var(--bg-raised);
    color: var(--accent);
    font: 700 9px/1 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    transition: opacity 180ms ease;
  }
  .chapter-rail.at-endpoint .chapter-rail-scrubber-value { opacity: 0; }
  .chapter-rail.is-expanded .chapter-rail-scrubber-value { background: var(--surface); }
  .chapter-rail-link {
    position: absolute;
    top: 0;
    right: 70px;
    width: 102px;
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 690;
    line-height: 1.2;
    letter-spacing: .015em;
    text-align: right;
    text-decoration: none;
    text-transform: uppercase;
    opacity: .58;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: color 240ms ease, opacity 280ms ease;
    --title-scale: .92;
    will-change: transform;
  }
  .guide-page .chapter-rail-link { font-size: 11px; }
  .chapter-rail-link::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -14px;
    width: 10px;
    height: 1px;
    background: currentColor;
  }
  .chapter-rail-link:hover, .chapter-rail-link:focus-visible {
    color: var(--text);
    opacity: 1;
  }
  .chapter-rail-link[aria-current] {
    color: var(--accent);
    opacity: 1;
    --title-scale: 1.14;
  }
  .chapter-rail-link[aria-current]::after { width: 14px; height: 2px; }
  .chapter-rail.is-expanded .chapter-rail-link { opacity: .88; --title-scale: 1; }
  .chapter-rail.is-expanded .chapter-rail-link[aria-current] { color: var(--text); opacity: 1; --title-scale: 1.04; }
  .chapter-rail-number { display: none; }
  .chapter-rail-title {
    display: block;
    min-width: 0;
    transform-origin: right center;
    transform: scale(var(--title-scale));
    transition: transform 300ms cubic-bezier(.22, 1, .36, 1);
  }
  @media (prefers-reduced-motion: reduce) {
    .chapter-rail-link, .chapter-rail-title, .chapter-rail-scrubber-value { transition: none; }
  }
}
