/* Control Deck docs. Shared styles for every layout option.
   Colours, type, top bar and footer match the home page (docs/pages/redesign/2b/styles.css). */

:root {
  --paper: #dfe2e3;
  --ink: #0d0d12;
  --purple: #3c08b4;
  --white: #ffffff;
  --display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --bar: 58px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
p { margin: 0; }
a { color: inherit; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 40px; }

.sprite { position: absolute; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ico {
  width: 1em; height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
}
.skip:focus { top: 8px; }

/* ---------- top bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar);
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.bar-in { display: flex; align-items: center; justify-content: space-between; height: 100%; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 19px/1 var(--display);
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand-tile { display: grid; place-items: center; width: 34px; height: 34px; background: var(--ink); }
.brand-tile svg { width: 24px; height: 24px; }

.bar-nav { display: flex; align-items: center; gap: 26px; }
.bar-link { font-weight: 700; font-size: 15px; text-decoration: none; }
.bar-link:hover, .bar-link[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.bar-price {
  padding: 7px 12px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: 800 15px/1 var(--display);
  text-decoration: none;
}
.bar-price:hover { background: var(--purple); color: var(--white); }

/* ---------- the words of a docs page ---------- */

.doc h1 {
  margin: 0;
  font: 800 clamp(36px, 5vw, 64px)/.98 var(--display);
  font-stretch: 112%;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.doc .lede { margin-top: 20px; max-width: 40em; font-size: 20px; line-height: 1.5; font-weight: 600; }

.doc h2 {
  margin: 0;
  font: 800 32px/1.05 var(--display);
  font-stretch: 108%;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.doc h3 { margin: 30px 0 0; font: 800 21px/1.15 var(--display); letter-spacing: -.015em; }

.sec-body > * + * { margin-top: 16px; }
.sec-body > h3 + * { margin-top: 10px; }
.sec-body { max-width: 46em; }

.sec-body ul { margin: 0; padding: 0 0 0 1.25em; }
.sec-body ul li { padding-left: 4px; }
.sec-body ul li + li { margin-top: 6px; }
.sec-body ul li::marker { content: "\25A0"; font-size: .62em; }

.doc b, .doc strong { font-weight: 800; }
.sec-body a { color: var(--purple); font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sec-body a:hover { background: var(--purple); color: var(--white); text-decoration: none; }

.doc code {
  padding: 1px 5px 2px;
  background: var(--white);
  border: 1px solid var(--ink);
  font: 500 .86em/1.3 var(--mono);
  overflow-wrap: anywhere;
}
.doc pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--white);
  font: 500 14.5px/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.doc pre code { padding: 0; background: none; border: 0; font: inherit; color: inherit; }

.doc kbd {
  display: inline-block;
  padding: 3px 7px 4px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font: 700 .78em/1 var(--mono);
  vertical-align: 2px;
  white-space: nowrap;
}

/* numbered steps */
.doc ol.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.doc ol.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.doc ol.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  background: var(--white);
  border: 2px solid var(--ink);
  font: 700 15px/1 var(--mono);
}
.doc ol.steps > li > div > * + * { margin-top: 10px; }
.doc ol.steps > li > div { padding-top: 2px; min-width: 0; }

/* a box for something the reader must not miss */
.note {
  padding: 14px 18px 16px;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--purple);
  margin-right: 5px;
  font-weight: 600;
}
.note > * + * { margin-top: 8px; }

/* a list that follows a paragraph keeps a gap above it */
.sec-body > * + ul, .sec-body > * + ol.steps { margin-top: 12px; }
.sec-body > h3 + ul, .sec-body > h3 + ol.steps { margin-top: 10px; }

/* tables */
.table-scroll { overflow-x: auto; padding: 0 5px 5px 0; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 16px;
  line-height: 1.45;
}
.doc th, .doc td { padding: 10px 14px; border: 2px solid var(--ink); text-align: left; vertical-align: top; }
.doc thead th { background: var(--ink); color: var(--white); font: 800 15px/1.2 var(--display); }
.doc tbody th { font-weight: 800; }
.doc td img, .doc th img { display: inline-block; margin-right: 8px; vertical-align: -3px; }

/* a commander and its workers, drawn the way the home page draws them */
.tree {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: 76px;
  align-items: center;
  max-width: 660px;
  padding: 0 7px 7px 0;
}
.sec-body > .tree { margin-top: 24px; }
.sec-body > .tree + * { margin-top: 28px; }
.cc { position: relative; background: var(--white); border: 2px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); }
.cc-prov {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px 8px 8px;
  border-bottom: 2px solid var(--ink);
  font: 800 22px/1 var(--display);
  letter-spacing: -.03em;
}
.cc-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; background: var(--white); border: 2px solid var(--ink); }
.cc-ico img { object-fit: contain; }
.cc-body { padding: 9px 12px 11px; }
.cc-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 9px; font-size: 17px; line-height: 1.2; }
.cc-who b { font-weight: 800; }
.cc-who span { font: 700 12px/1 var(--mono); }
.cc-task { margin-top: 3px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.cc-cmd { box-shadow: 7px 7px 0 var(--purple); }
.cc-cmd .cc-prov { background: var(--purple); color: var(--white); }
.sec-body ul.tree-kids { position: relative; display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.sec-body ul.tree-kids li { display: block; margin: 0; padding: 0; }
.tree-kids::before {
  content: "";
  position: absolute;
  left: -76px; top: calc(50% - 2px);
  width: 40px; height: 4px;
  background: var(--purple);
}
.tree-kids li::before {
  content: "";
  position: absolute;
  left: -40px; top: calc(50% - 8px);
  width: 38px; height: 16px;
  background: var(--purple);
  clip-path: polygon(0 6px, calc(100% - 13px) 6px, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, calc(100% - 13px) 10px, 0 10px);
}
.tree-kids li::after {
  content: "";
  position: absolute;
  left: -40px;
  width: 4px; height: calc(50% + 15px);
  background: var(--purple);
}
.tree-kids li:first-child::after { top: calc(50% - 2px); }
.tree-kids li:last-child::after { bottom: calc(50% - 2px); }

/* previous and next page */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 0 7px 7px 0; }
.pager a {
  display: block;
  padding: 14px 18px 16px;
  background: var(--white);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
  font: 800 21px/1.15 var(--display);
  letter-spacing: -.015em;
  text-decoration: none;
  transition: transform .06s linear, box-shadow .06s linear;
}
.pager a span { display: block; margin-bottom: 5px; font: 700 13px/1 var(--mono); letter-spacing: 0; }
.pager a:hover { background: var(--purple); color: var(--white); }
.pager a:active { transform: translate(7px, 7px); box-shadow: 0 0 0 var(--ink); }
.pager .next { grid-column: 2; text-align: right; }

/* ---------- footer ---------- */

.foot { padding: 26px 0; background: var(--ink); color: var(--white); }
.foot :focus-visible { outline-color: var(--white); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot .brand-tile { background: #23232c; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot nav a { font-size: 15px; font-weight: 700; text-decoration: none; }
.foot nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- narrower screens ---------- */

@media (max-width: 700px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .bar-link { display: none; }
  .bar-link[aria-current] { display: inline; }

  .doc .lede { font-size: 18px; }
  .doc h2 { font-size: 27px; }
  .doc h3 { font-size: 19px; }
  .doc table { font-size: 15px; }
  .doc th, .doc td { padding: 8px 9px; }
  .doc pre { font-size: 13.5px; }

  .tree { grid-template-columns: minmax(0, 1fr); }
  .sec-body ul.tree-kids { margin-left: 20px; padding: 24px 0 0 30px; gap: 20px; border-left: 4px solid var(--purple); }
  .tree-kids::before { content: none; }
  .tree-kids li::before { left: -32px; width: 30px; }
  .tree-kids li:first-child::after { content: none; }
  .tree-kids li:last-child::after { left: -36px; top: calc(50% + 2px); bottom: -2px; height: auto; background: var(--paper); }

  .pager { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pager .next { grid-column: 1; text-align: left; }
  .pager a { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- layout A: page list on the left, the page in the middle, its sections on the right ---------- */

.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 208px;
  column-gap: 48px;
  align-items: start;
  padding-top: 0;
}

.side { align-self: stretch; border-right: 2px solid var(--ink); }
.side-nav {
  position: sticky;
  top: var(--bar);
  max-height: calc(100vh - var(--bar));
  overflow-y: auto;
  padding: 30px 14px 40px 0;
}
.menu-btn { display: none; }

.nav-group + .nav-group { margin-top: 22px; }
.nav-title { margin: 0 0 6px; font: 700 12.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.nav-list { margin: 0; padding: 0; list-style: none; }
.nav-list li + li { margin-top: 2px; }
.nav-item {
  display: block;
  padding: 7px 10px;
  border: 2px solid transparent;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
a.nav-item:hover { border-color: var(--ink); background: var(--white); }
.nav-item[aria-current] { background: var(--purple); color: var(--white); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }

.doc { min-width: 0; padding: 40px 0 72px; }
.doc-kicker { margin-bottom: 14px; font: 700 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.sec { margin-top: 52px; }
.sec h2 { margin-bottom: 16px; }
.pager { margin-top: 64px; }

.toc {
  position: sticky;
  top: var(--bar);
  padding: 46px 0 40px;
}
.toc-title { margin: 0 0 10px; font: 700 12.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.toc ul { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--ink); }
.toc a {
  display: block;
  margin-left: -2px;
  padding: 5px 0 5px 12px;
  border-left: 6px solid transparent;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.toc a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.toc a.is-current { border-left-color: var(--purple); color: var(--purple); }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); column-gap: 36px; }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { padding: 16px 5px 0 0; border-right: 0; }
  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    background: var(--white);
    color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
    font: 800 17px/1.2 var(--display);
    text-align: left;
    cursor: pointer;
  }
  .menu-btn .ico { width: 20px; height: 20px; }
  .menu-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
  .js .side-nav { display: none; }
  .js .side-nav.is-open { display: block; }
  .side-nav { position: static; max-height: none; overflow: visible; margin-top: 16px; padding: 14px 12px 16px; background: var(--white); border: 2px solid var(--ink); }
  .doc { padding: 30px 0 60px; }
  .sec { margin-top: 44px; }
}
