/* The user guide. Every page of the guide links this file. The cell and
 * the control plane both serve it, so the text uses system fonts. The
 * header has the font of the landing page, from /guide/brand/. Both
 * themes follow the system setting:
 * the page has no script, so it has no theme toggle. Every text colour
 * passes 4.5:1 on its background in both themes. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --fg: #1f2328;
  --fg-muted: #57606a;
  --line: #d0d7de;
  --link: #0a5bb5;
  --focus: #0a5bb5;
  --code-bg: #eff1f3;
  --code-fg: #1f2328;
  --note-bg: #eef5ff;
  --note-line: #3d7ad6;
  --warn-bg: #fff6e5;
  --warn-line: #b36b00;
  --accent: #0a5bb5;
  --mark: #c2255c;
  --head-bg: #081c2e;
  --head-blue: #359cf3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-soft: #161a20;
    --fg: #e6e8eb;
    --fg-muted: #a3aab4;
    --line: #2d333b;
    --link: #6cb6ff;
    --focus: #6cb6ff;
    /* Lighter than the page, so a word of code stands out from the text. */
    --code-bg: #2b313b;
    --code-fg: #f0f3f6;
    --note-bg: #13233a;
    --note-line: #4d8fe0;
    --warn-bg: #2b2111;
    --warn-line: #d29922;
    --accent: #6cb6ff;
  }
}

@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/guide/brand/league-spartan.woff2) format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }

/* A section that a link opens starts under the bar of the page links. */
html { scroll-padding-top: 4.25rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

/* The header is the header of the landing page (internal/controlplane/
 * assets/site.css): the logo, the product name, and the navy bar. It has
 * the same colours in both themes, as the landing page has one theme.
 * White on --head-bg is 17:1, and --head-blue on it is 5.9:1. */
.topbar { background: var(--head-bg); color: #fff; font-family: "League Spartan", system-ui, -apple-system, "Segoe UI", sans-serif; }
.topbar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 4.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.1rem;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand-logo { height: 34px; width: auto; }
.brand-divider { width: 1px; height: 26px; background: rgba(255, 255, 255, 0.25); }
.brand-product { font-size: 21px; font-weight: 600; letter-spacing: 0.01em; padding-top: 4px; }
.brand-doc {
  margin: 0;
  padding: 4px 0 0 1.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--head-blue);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 26px;
}

/* The links to the pages of the guide, in the middle of the bar. The bar
 * stays at the top of the window while the page scrolls. The current
 * page is white and bold with a line under it: the colour is not the
 * only cue. On a narrow window the links take two lines, so the link of
 * the current page is always in view. */
.pages {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--head-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  font-family: "League Spartan", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
}
.pages ul {
  list-style: none;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.9rem;
}
.pages li { margin: 0; }
.pages a {
  display: block;
  padding: 0.8rem 0 0.55rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.pages a:hover { color: #fff; }
.pages a[aria-current="page"] { color: #fff; font-weight: 700; border-bottom-color: var(--head-blue); }
.topbar :focus-visible, .pages :focus-visible { outline-color: #fff; }

@media (max-width: 30rem) {
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }
  .brand-divider { height: 20px; }
  .brand-product, .brand-doc { font-size: 17px; }
  .brand-doc { padding-left: 0.75rem; line-height: 20px; }
  .topbar-inner { min-height: 3.75rem; gap: 0.25rem 0.75rem; padding: 0.4rem 1rem; }
  .pages { font-size: 16px; }
  .pages ul { gap: 0 1.25rem; }
  .pages a { padding: 0.5rem 0 0.3rem; }
  /* Two lines of page links. */
  html { scroll-padding-top: 6rem; }
}

/* The narrowest windows: "User guide" goes under the logo, with no line
 * at its left. */
@media (max-width: 24rem) {
  .brand-doc { flex-basis: 100%; border-left: 0; padding-left: 0; }
}

.layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 64rem) {
  .layout { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc { position: sticky; top: 4.25rem; align-self: start; max-height: calc(100vh - 5.25rem); overflow-y: auto; }
}

.toc { font-size: 0.9rem; }
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin: 0 0 0.5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.2rem 0; }
.toc a { display: inline-block; padding: 0.15rem 0; text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* The text keeps a line of 48rem. A picture can be wider: it shows a
 * page of the portal, and its text must stay readable. */
main { min-width: 0; max-width: 56rem; }
main > * { max-width: 48rem; }
main > .shot { max-width: none; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 2.75rem 0 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
h2, h3 { position: relative; }

/* The "#" link of a heading: the link of the section, which guide.js
 * copies on a click. After the text on a narrow window; left of the
 * heading, in the gap before the text, on a wide one. */
.anchor { margin-left: 0.4rem; color: var(--fg-muted); font-weight: 400; text-decoration: none; }
.anchor:hover, .anchor:focus-visible { color: var(--link); }
.anchor.copied { position: relative; }
.anchor.copied::after {
  content: "Link copied";
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}
@media (min-width: 64rem) {
  .anchor { position: absolute; left: -1.5rem; margin: 0; }
  h2 .anchor { top: 0.5rem; }
  h3 .anchor { top: 0; }
  .anchor.copied { position: absolute; }
}

/* Text for a screen reader only. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lead { font-size: 1.1rem; color: var(--fg-muted); margin-top: 0; }

p, ul, ol, dl, table, pre { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li { margin: 0.25rem 0; }
dt { font-weight: 600; margin-top: 0.75rem; }
dd { margin: 0.1rem 0 0 1.25rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--code-fg);
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  /* Wrap long lines: a code block never makes the page scroll sideways. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
pre code { background: none; padding: 0; font-size: 0.85rem; }

kbd, .ui {
  font-weight: 600;
}

.note, .warn {
  border-left: 4px solid var(--note-line);
  background: var(--note-bg);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0 0 1rem;
}
.warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.note strong:first-child, .warn strong:first-child { display: block; }

.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; margin: 0; }
th, td { border: 1px solid var(--line); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); }

.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.25rem; margin: 0.6rem 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--fg);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.3rem;
}

/* The diagram of the overview. Its colours are the tokens above, so it
 * follows the theme. On a narrow screen it keeps a width at which its
 * text is readable, and scrolls inside its frame. */
.diagram {
  overflow-x: auto;
  margin: 0 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
}
.diagram svg { display: block; width: 100%; min-width: 36rem; height: auto; }
.diagram text { fill: var(--fg); font-size: 14px; }
.diagram .name { font-size: 15px; font-weight: 700; }
.diagram .sub { fill: var(--fg-muted); font-size: 13px; }
.diagram .box { fill: var(--bg); stroke: var(--fg-muted); stroke-width: 1.5; }
.diagram .life { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 4 5; }
.diagram .arrow { stroke: var(--accent); stroke-width: 2; }
.diagram .head { fill: var(--accent); }

/* A picture of the portal (tools/guide-shots). The numbers of the
 * caption are the numbers that the picture has, in the same colour:
 * white on --mark is 5.6:1. */
.shot { margin: 1.25rem 0 1.5rem; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.shot figcaption { margin-top: 0.5rem; font-size: 0.93rem; color: var(--fg-muted); }
.marks { list-style: none; counter-reset: mark; margin: 0.4rem 0 0; padding: 0; color: var(--fg); }
.marks li { counter-increment: mark; position: relative; padding-left: 2rem; margin: 0.35rem 0; }
.marks li::before {
  content: counter(mark);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--mark);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4rem;
}

/* A choice of one panel among several, for example the ways to install
 * the CLI. The buttons are radio buttons that look like tabs, so the
 * keyboard works as for any radio group. No script: :has() shows the
 * panel of the checked button. A browser without :has() shows every
 * panel, one under the other. */
.choice { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 6px; }
.choice-tabs {
  /* A fieldset is at least as wide as its content: with that, the row
   * would widen the page in place of scrolling. */
  min-inline-size: 0;
  margin: 0;
  padding: 0.6rem 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: var(--bg-soft);
}
.choice-tabs legend { padding: 0 0 0.4rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg); }
/* The buttons stay on one line. When the line is wider than the page,
 * it scrolls sideways; the focused button scrolls into view. */
.choice-row { display: flex; flex-wrap: nowrap; gap: 0.3rem; min-width: 0; overflow-x: auto; scrollbar-width: thin; padding-bottom: 0.4rem; }
.choice-tabs input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.choice-tabs label {
  flex: 0 0 auto;
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 0.93rem;
  white-space: nowrap;
  cursor: pointer;
}
.choice-tabs label:hover { color: var(--fg); }
.choice-tabs input:checked + label { color: var(--fg); font-weight: 600; background: var(--bg); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.choice-tabs input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-panel { padding: 0.9rem 1rem 0; }
.choice-panel > :last-child { margin-bottom: 1rem; }
@supports selector(:has(*)) {
  .choice-panel { display: none; }
  .choice:has(#im-script:checked) #panel-im-script,
  .choice:has(#im-brew:checked) #panel-im-brew,
  .choice:has(#im-npm:checked) #panel-im-npm,
  .choice:has(#im-python:checked) #panel-im-python,
  .choice:has(#im-docker:checked) #panel-im-docker,
  .choice:has(#im-apt:checked) #panel-im-apt,
  .choice:has(#im-dnf:checked) #panel-im-dnf,
  .choice:has(#im-maven:checked) #panel-im-maven,
  .choice:has(#im-gradle:checked) #panel-im-gradle,
  .choice:has(#im-manual:checked) #panel-im-manual,
  .choice:has(#os-script:checked) #panel-os-script,
  .choice:has(#os-brew:checked) #panel-os-brew,
  .choice:has(#os-npm:checked) #panel-os-npm,
  .choice:has(#os-pipx:checked) #panel-os-pipx { display: block; }
}

.topics > li { margin: 0.6rem 0; }
.topics > li > a { font-weight: 600; }

.next { margin: 3rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 600; }

.footer { border-top: 1px solid var(--line); color: var(--fg-muted); font-size: 0.9rem; }
.footer p { max-width: 72rem; margin: 0 auto; padding: 1rem; }
