/* hup's manual, /hup/docs/ (made by planning/hup-docs/build.mjs). It loads after hup.css.

   The manual wears the app's own look, as the stage on the hup page does: the navy ground
   and the mint accent of Themes.swift's Expanse, lists and tables in darker wells with a
   hairline edge, keys as keycaps. Three columns share the page's two edges (.wrap--wide,
   as every hup page): the list of pages, the page, and what is on the page. */

body.docs {
  --navy: #0b1625;
  --navy-in: #08111e;
  --navy-up: #14243a;
  --navy-rim: #2b3d57;
  --navy-line: rgba(150, 163, 179, 0.2);
  --navy-ink: #e6ecf3;
  --navy-text: #a9b5c4;
  --navy-dim: #7f8c9d;
  /* the iPad's and iPhone's badges; the Mac's are mint */
  --sky: #8ab4ff;
  --sky-rgb: 138, 180, 255;
  /* hup.css's names, so the bar and the foot it draws take the manual's colors */
  --bg: var(--navy);
  --ink: var(--navy-ink);
  --ink-2: var(--navy-text);
  --muted: var(--navy-dim);
  --hair: var(--navy-line);
  --accent: var(--mint);
  background: var(--navy) radial-gradient(90% 520px at 50% -180px, rgba(var(--mint-rgb), 0.1), transparent 70%) no-repeat;
  color: var(--navy-text);
  font-size: 16px;
  line-height: 1.6;
}

.docs .top { background: rgba(11, 22, 37, 0.82); }
.docs .top__nav .top__get { background: var(--mint); color: #06241f; font-weight: 600; }
.docs .top__nav .top__get:hover { background: #74dccb; color: #06241f; }
.docs :focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 6px; }

/* The three columns */

.docs__shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr) 190px;
  gap: 0 56px;
  align-items: start;
  padding: 34px 0 72px;
}

.docs__side, .docs__toc { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: none; }
.docs__side::-webkit-scrollbar, .docs__toc::-webkit-scrollbar { display: none; }

.docs__home { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--navy-ink); text-decoration: none; font: 600 16px/1 var(--display); letter-spacing: -0.01em; }
.docs__home img { width: 30px; height: 30px; border-radius: 7px; }
.docs__pages { display: none; }

.docs__group + .docs__group { margin-top: 22px; }
.docs__group p { margin: 0 0 6px; padding-left: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy-dim); }
.docs__group ul { list-style: none; margin: 0; padding: 0; }
.docs__group a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--navy-text); text-decoration: none; font-size: 14px; line-height: 1.35; }
.docs__group a:hover { color: var(--navy-ink); background: rgba(150, 163, 179, 0.08); }
/* the page that shows: raised, as the app's tab is */
.docs__group a[aria-current="page"] { color: var(--navy-ink); font-weight: 600; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-line), inset 0 1px 0 rgba(255, 255, 255, 0.06); }

.docs__toc p { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy-dim); }
.docs__toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--navy-line); }
.docs__toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--navy-dim); text-decoration: none; font-size: 13px; line-height: 1.35; }
.docs__toc a:hover { color: var(--navy-ink); border-left-color: var(--mint); }

/* The page */

.doc { min-width: 0; max-width: 720px; }
.doc__group { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--mint); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; color: var(--navy-ink); text-wrap: balance; }
.doc__lede { margin: 14px 0 0; font-size: 18px; line-height: 1.5; color: var(--navy-text); text-wrap: pretty; }
.doc h2 { margin: 44px 0 0; padding-top: 26px; border-top: 1px solid var(--navy-line); font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; font-weight: 650; color: var(--navy-ink); scroll-margin-top: 70px; }
/* Which versions of hup the page is accurate for: the devices' badges, with numbers */
.doc__for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 13px; line-height: 1.6; color: var(--navy-dim); }
.doc__for + h2 { margin-top: 34px; }
.doc h3 { margin: 26px 0 0; font-size: 16px; line-height: 1.3; font-weight: 650; color: var(--navy-ink); }
.doc p { margin: 12px 0 0; text-wrap: pretty; }
.doc b, .doc strong { color: var(--navy-ink); font-weight: 600; }
.doc a { color: var(--mint); text-decoration: underline; text-decoration-color: rgba(var(--mint-rgb), 0.4); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: var(--mint); }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 22px; }
.doc li { margin-top: 6px; }
.doc li::marker { color: var(--navy-dim); }

.doc code { padding: 0.12em 0.4em; border-radius: 6px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); color: var(--navy-ink); font-size: 0.84em; }
.doc pre { margin: 14px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); overflow-x: auto; font: 13px/1.55 var(--mono); color: var(--navy-ink); }
.doc pre code { padding: 0; background: none; box-shadow: none; font-size: inherit; }

/* Keys, as the app's welcome card shows them: each on a cap of its own */
.keys { display: inline-flex; gap: 3px; vertical-align: 1px; white-space: nowrap; }
.docs kbd { min-width: 1.7em; padding: 0.08em 0.4em; border: 0; border-radius: 5px; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-rim), inset 0 1px 0 rgba(255, 255, 255, 0.07); color: var(--navy-ink); font: 600 0.8em/1.5 var(--sans); }

/* Which device a section is about: a hairline badge, as a host's name is in the app */
.ons { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 1px; }
.on { padding: 1px 7px; border-radius: 5px; background: rgba(var(--mint-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.45); color: var(--mint); font: 600 11.5px/1.6 var(--sans); letter-spacing: 0; white-space: nowrap; }
.on--ios { background: rgba(var(--sky-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--sky-rgb), 0.45); color: var(--sky); }
h2 .ons { vertical-align: 3px; }
/* at the start of a line, it says whom the line is for */
p > .ons:first-child, li > .ons:first-child { margin: 0 7px 0 0; }

/* Steps: numbered, each number on a small mint-rimmed disc */
.doc ol.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { position: relative; margin-top: 14px; padding-left: 40px; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(var(--mint-rgb), 0.1); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.5); color: var(--mint); font: 600 13px/26px var(--sans); text-align: center; }
.steps > li > p:first-child { margin-top: 0; }

/* A well: the app's darker panel with a hairline edge. A note is a well with a short label. */
.well, .note { margin: 18px 0 0; border-radius: 12px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); }
.note { padding: 13px 16px 14px; font-size: 15px; }
.note > p:first-child { margin-top: 0; }
.note__label { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mint); }

/* A picture of the app: a window with its own corners, twice the size it's shown at. The
   manual has only a few (app/scripts/docs-pictures.sh in gxp-term takes them). */
.shot { margin: 22px 0 0; }
/* (The picture is a link to itself at full size, for a small screen.) */
.shot a { display: block; }
.shot img { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.45)); }
.shot--tall img { max-width: 520px; }
/* A part of a window: cut square, so it gets corners and a hairline of its own. */
.shot--part img { border-radius: 12px; box-shadow: 0 0 0 1px var(--navy-line); }
/* A capture of an iPad's or iPhone's whole screen: its corners are square, so it gets a radius and a
   hairline here. */
.shot--screen img { border-radius: 14px; box-shadow: 0 0 0 1px var(--navy-line); }
.shot--phone img { max-width: 280px; }
.shot figcaption { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--navy-dim); }

/* A table in a well: rows parted by a hairline, as the app's lists are */
.doc table { width: 100%; margin: 18px 0 0; border-collapse: separate; border-spacing: 0; border-radius: 12px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); font-size: 15px; }
.doc th, .doc td { padding: 10px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--navy-line); }
.doc thead th { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--navy-dim); }
.doc tbody tr:first-child > * { border-top: 0; }
.doc thead + tbody tr:first-child > * { border-top: 1px solid var(--navy-line); }
.doc tbody th { font-weight: 500; color: var(--navy-ink); }
.doc td.k { width: 1%; white-space: nowrap; text-align: right; }
.doc td.k .keys + .keys { margin-left: 8px; }

/* The front page's doors: wells that are links, two to a row */
.doc .doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.doc .doors li { margin: 0; }
.doc .doors a { display: block; height: 100%; padding: 15px 18px 16px; border-radius: 12px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); color: var(--navy-text); text-decoration: none; font-size: 14.5px; line-height: 1.45; }
.doc .doors a:hover { background: #0a1524; box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.45); }
.doors b { display: block; margin-bottom: 3px; font-size: 16px; }
.doors .doors__step { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mint); }

/* The key bar of the iPad and iPhone app, drawn */
.bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 10px; border-radius: 12px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); }
.bar span { flex: 1 0 auto; min-width: 40px; padding: 6px 8px; border-radius: 8px; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-rim), inset 0 1px 0 rgba(255, 255, 255, 0.07); color: var(--navy-ink); font: 500 14px/1.4 var(--sans); text-align: center; }
.bar svg { display: block; width: 17px; height: 17px; margin: 1.5px auto; }
.bar .bar__mint { color: var(--mint); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.5), 0 0 12px rgba(var(--mint-rgb), 0.14); }

/* Before and next, at the page's foot */
.doc__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.doc .doc__pager a { display: block; padding: 12px 16px 13px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--navy-line); color: var(--navy-ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.doc .doc__pager a:hover { box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.45); }
.doc__pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--navy-dim); }
.doc__next { text-align: right; }

/* Narrower: what is on the page goes first, then the list of pages folds under its name */
@media (max-width: 1140px) {
  .docs__shell { grid-template-columns: 216px minmax(0, 1fr); gap: 0 44px; }
  .docs__toc { display: none; }
}
@media (max-width: 800px) {
  .docs__shell { display: block; padding-top: 14px; }
  .docs__side { position: static; max-height: none; margin-bottom: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--navy-line); }
  .docs__side { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 14px; }
  .docs__home { margin-bottom: 0; }
  .docs__pages { display: flex; align-items: center; justify-content: space-between; gap: 10px; justify-self: end; min-width: min(220px, 100%); padding: 7px 12px; border-radius: 9px; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-line); color: var(--navy-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
  .docs__chev { width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid var(--mint); border-bottom: 2px solid var(--mint); transform: rotate(45deg); }
  .docs__toggle:checked ~ .docs__pages .docs__chev { margin-top: 3px; transform: rotate(225deg); }
  .docs__toggle:focus-visible ~ .docs__pages { outline: 2px solid var(--mint); outline-offset: 2px; }
  .docs__nav { display: none; grid-column: 1 / -1; padding-top: 16px; }
  .docs__toggle:checked ~ .docs__nav { display: block; }
  .doc .doors { grid-template-columns: 1fr; }
  .doc th, .doc td { padding: 10px 13px; }
  .bar { flex-wrap: nowrap; gap: 5px; padding: 8px; }
  .bar span { flex: 1 1 0; min-width: 0; padding: 6px 0; font-size: 13px; }
}

/* The front page's picture of how hup works: your devices, ssh, hupd and its sessions */
.how { display: grid; grid-template-columns: auto minmax(44px, 1fr) minmax(0, 1.7fr); align-items: center; gap: 0 14px; margin: 20px 0 0; padding: 20px; border-radius: 12px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); }
.how__col { display: grid; gap: 8px; }
.how__chip { padding: 6px 16px; border-radius: 8px; background: var(--navy-up); box-shadow: inset 0 0 0 1px var(--navy-rim), inset 0 1px 0 rgba(255, 255, 255, 0.07); color: var(--navy-ink); font-size: 14px; font-weight: 600; text-align: center; }
.how__link { position: relative; height: 1px; background: linear-gradient(90deg, rgba(var(--mint-rgb), 0.15), var(--mint)); }
.how__link span { position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--mint); }
.how__host { padding: 14px 16px 16px; border-radius: 10px; background: rgba(var(--mint-rgb), 0.05); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), 0.45); }
.doc .how__name { margin: 0; font-weight: 650; color: var(--navy-ink); }
.how__name span { font-weight: 400; color: var(--navy-dim); }
.how__sessions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.how__sessions span { padding: 3px 10px; border-radius: 6px; background: var(--navy-in); box-shadow: inset 0 0 0 1px var(--navy-line); color: var(--navy-ink); font: 13px/1.5 var(--mono); }
@media (max-width: 520px) {
  .how { grid-template-columns: 1fr; gap: 0; padding: 16px; }
  .how__col { grid-template-columns: repeat(3, 1fr); }
  .how__link { width: 1px; height: 34px; margin: 0 auto; background: linear-gradient(180deg, rgba(var(--mint-rgb), 0.15), var(--mint)); }
  .how__link span { left: 12px; bottom: 8px; transform: none; }
}
