/* One header and one "next" footer for every dossier page, so the nine pages read as one sequence */
.sitebar {
  position: sticky;
  top: 0;
  z-index: 20;
  view-transition-name: sitebar;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #050505;
  color: oklch(0.96 0.004 80);
  border-bottom: 1px solid oklch(0.27 0.004 60);
  font:
    500 13px/1.2 "Geist",
    ui-sans-serif,
    system-ui,
    sans-serif;
  letter-spacing: normal;
}
.sitebar.is-tucked {
  transform: translateY(-100%);
}
/* reading progress: one hairline in the brand colour, driven by nav.js */
.sitebar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: oklch(0.62 0.19 40);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}
/* top, not transform: moving a sticky element's offset is the only way that keeps it in flow */
nav.toc,
nav.bar {
  top: var(--sb, 0px);
  transition: top 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sitebar .in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
}
.sitebar a {
  color: inherit;
  text-decoration: none;
}
.sitebar a:focus-visible {
  outline: 2px solid oklch(0.62 0.19 40);
  outline-offset: 3px;
  border-radius: 4px;
}
/* the nav scrolls sideways on phones, which clips an outer ring */
.sitebar nav a:focus-visible {
  outline-offset: -2px;
}
/* header returns on scroll-up; pages with their own index sit under it */
:where(main a, main button, main summary) {
  scroll-margin-top: 112px;
}
.sitebar .me {
  font-weight: 600;
  white-space: nowrap;
}
.sitebar .me small {
  display: block;
  margin-top: 3px;
  font:
    400 11px/1 "Chivo Mono",
    ui-monospace,
    monospace;
  color: oklch(0.6 0.008 60);
}
.sitebar nav {
  margin-left: auto;
}
.sitebar ol {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.sitebar ol a {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 4px;
  color: oklch(0.78 0.006 70);
  white-space: nowrap;
  transition:
    color 150ms ease-out,
    background-color 150ms ease-out;
}
.sitebar ol a span {
  font:
    400 11px/1 "Chivo Mono",
    ui-monospace,
    monospace;
  color: oklch(0.6 0.008 60);
}
.sitebar ol a:hover {
  color: oklch(0.96 0.004 80);
  background: oklch(0.19 0.004 60);
}
.sitebar ol a[aria-current="page"] {
  color: oklch(0.96 0.004 80);
  background: oklch(0.19 0.004 60);
}
.sitebar ol a[aria-current="page"] span {
  color: oklch(0.62 0.19 40);
}
.sitebar .book {
  padding: 9px 14px;
  border-radius: 4px;
  /* white on the brand orange is 3.96:1; one step deeper clears 4.5 */
  background: oklch(0.57 0.19 40);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms ease-out;
}
.sitebar .book {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* overflow:hidden drops the flex min-width; without this the header squeezes the label */
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.28);
}
/* light only, no gradient on the surface: a soft spot that follows the pointer (nav.js sets --mx/--my) */
.sitebar .book::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(90px circle at var(--mx, 50%) var(--my, 0%), oklch(1 0 0 / 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 200ms ease-out;
  pointer-events: none;
}
.sitebar .book:hover::before {
  opacity: 1;
}
/* nine items need ~1270px in one row */
@media (max-width: 1279px) {
  .sitebar .in {
    flex-wrap: wrap;
    gap: 0 16px;
    padding-top: 12px;
  }
  .sitebar .book {
    margin-left: auto;
  }
  .sitebar nav {
    order: 3;
    width: calc(100% + 2 * clamp(20px, 4vw, 48px));
    margin: 8px calc(-1 * clamp(20px, 4vw, 48px)) 0;
    padding: 0 clamp(20px, 4vw, 48px) 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .sitebar ol {
    margin-left: -10px;
  }
  .sitebar ol::-webkit-scrollbar {
    display: none;
  }
}

.next-step {
  background: #050505;
  color: oklch(0.96 0.004 80);
  font:
    400 15px/1.5 "Geist",
    ui-sans-serif,
    system-ui,
    sans-serif;
}
.next-step .in {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 48px;
  align-items: end;
}
.next-step a {
  color: inherit;
  text-decoration: none;
}
.next-step a:focus-visible {
  outline: 2px solid oklch(0.62 0.19 40);
  outline-offset: 4px;
  border-radius: 4px;
}
.next-step .go small {
  display: block;
  font:
    400 13px/1.4 "Chivo Mono",
    ui-monospace,
    monospace;
  color: oklch(0.6 0.008 60);
}
.next-step .go small b {
  font-weight: 500;
  color: oklch(0.62 0.19 40);
}
.next-step .go strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 600;
}
.next-step .go strong i {
  display: inline-block;
  font-style: normal;
  color: oklch(0.62 0.19 40);
  transition: transform 150ms ease-out;
}
.next-step .go:hover strong i {
  transform: translateX(6px);
}
.next-step .go span {
  display: block;
  margin-top: 10px;
  color: oklch(0.78 0.006 70);
  max-width: 52ch;
}
.next-step .aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  font-size: 14px;
  color: oklch(0.78 0.006 70);
}
.next-step .aside .prev small {
  font:
    400 12px/1 "Chivo Mono",
    ui-monospace,
    monospace;
  color: oklch(0.6 0.008 60);
  margin-right: 6px;
}
.next-step .aside .keys {
  display: none;
  font:
    400 12px/1 "Chivo Mono",
    ui-monospace,
    monospace;
  color: oklch(0.6 0.008 60);
}
.next-step .aside kbd {
  display: inline-block;
  min-width: 20px;
  padding: 3px 5px;
  margin-right: 2px;
  border: 1px solid oklch(0.27 0.004 60);
  border-radius: 4px;
  font: inherit;
  text-align: center;
  color: oklch(0.78 0.006 70);
}
@media (hover: hover) and (pointer: fine) {
  .next-step .aside .keys {
    display: block;
  }
}
.next-step .aside a:hover {
  color: oklch(0.96 0.004 80);
}
.next-step .aside .book {
  margin-bottom: 6px;
  padding: 11px 18px;
  border-radius: 4px;
  background: oklch(0.57 0.19 40);
  color: #fff;
  font-weight: 600;
  transition: background-color 150ms ease-out;
}
.next-step .aside .book:hover {
  background: oklch(0.52 0.18 40);
  color: #fff;
}
@media (max-width: 720px) {
  .next-step .in {
    grid-template-columns: 1fr;
  }
  .next-step .aside {
    align-items: flex-start;
  }
}
/* page to page: the content crossfades, the header stays put */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: ease-out;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  .sitebar,
  .sitebar *,
  nav.toc,
  nav.bar,
  .next-step * {
    transition: none !important;
  }
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: oklch(0.96 0.004 80);
  color: #050505;
  border-radius: 4px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}
@media print {
  .skip {
    display: none !important;
  }
}

/* the mono face fuses "ffi"/"ffl" into one cell ("traﬃc", "oﬄine"); headings don't strand a last word */
body {
  font-variant-ligatures: no-common-ligatures;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p,
li,
dd {
  text-wrap: pretty;
}

/* the next section draws its own rule 65px below; a closing row border there reads as a stutter */
section.wrap:has(+ section.wrap) > :last-child table:last-child > tbody > tr:last-child > *,
section.wrap:has(+ section.wrap) > table:last-child > tbody > tr:last-child > *,
section.wrap:has(+ section.wrap) > :is(ol, ul):last-child > li:last-child,
section.wrap:has(+ section.wrap) > :last-child > :is(ol, ul):last-child > li:last-child,
section.wrap:has(+ section.wrap) > :last-child > * > :is(ol, ul):last-child > li:last-child,
section.wrap:has(+ section.wrap) > :is(table, :last-child table):last-child > tbody > tr:last-child,
section.wrap:has(+ section.wrap) > :last-child > article:last-child {
  border-bottom: 0;
}

.nw {
  white-space: nowrap;
}
