/* luir.org: one narrow column of plain text, in the colours of the logo.

   The type is the DEC Rainbow 100's 80-column font, from VileR's Ultimate
   Oldschool PC Font Pack. Its pixels sit on a 20px em, 10px to a character,
   and it only stays crisp at that size: keep type at 20px, line heights in
   whole pixels, and emphasis in colour. It has one weight, and a synthesised
   bold smears the pixels. */

/* Font credit, as its licence asks: DEC Rainbow 100 (re.80), from the Ultimate
   Oldschool PC Font Pack by VileR, https://int10h.org/oldschool-pc-fonts/,
   licensed CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/.
   The licence is served beside the font, at
   /fonts/Ultimate-Oldschool-PC-Font-Pack-LICENSE.txt. */
@font-face {
  font-family: "DEC Rainbow 100";
  src: url("/fonts/WebPlus_Rainbow100_re_80.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #1e1d2d; /* the logo's own ground, so it sits flush */
  --panel: #242430;
  --rule: #4c4360;
  --text: #b5c0d1;
  --bright: #e3e7ef;
  --dim: #8f98a6;
  --head: #aaa0d6;
  --link: #769edd;
  --visited: #aaa0d6;
  --hover: #a9c4f2;
  --mono: "DEC Rainbow 100", ui-monospace, "DejaVu Sans Mono", "Cascadia Mono",
    Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 16px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 26px;
  font-synthesis: none;
}

::selection {
  background: #6b5784;
  color: #fff;
}

.page {
  max-width: 72ch;
  margin: 0 auto;
  padding: 28px 0 40px;
}

/* --- header ------------------------------------------------------------ */

header {
  text-align: center;
}

.logo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.tagline {
  margin: 8px 0 0;
  color: var(--dim);
}

nav {
  margin: 12px 0 0;
  color: var(--rule);
}

nav a[aria-current="page"] {
  color: var(--bright);
  text-decoration: none;
}

nav.sub {
  margin: 0 0 20px;
  text-align: left;
}

hr {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 22px 0;
}

/* --- text -------------------------------------------------------------- */

h1,
h2,
h3 {
  color: var(--head);
  font-size: 1em;
  line-height: 26px;
  margin: 30px 0 10px;
}

h1 {
  margin-top: 0;
}

h2::before {
  content: "== ";
  content: "== " / "";
  color: var(--rule);
}

h2::after {
  content: " ==";
  content: " ==" / "";
  color: var(--rule);
}

h3::before {
  content: ":: ";
  content: ":: " / "";
  color: var(--rule);
}

p,
ul,
ol,
dl,
pre,
blockquote {
  margin: 0 0 14px;
}

ul,
ol {
  padding-left: 3ch;
}

li + li {
  margin-top: 2px;
}

a {
  color: var(--link);
  /* The underscore sits right where an underline would, so x86_64 in a
     link read as "x86 64". Drop the line clear of it. */
  text-underline-offset: 3px;
}

a:visited {
  color: var(--visited);
}

a:hover,
a:focus-visible {
  color: var(--hover);
}

:focus-visible {
  outline: 1px dotted var(--hover);
  outline-offset: 2px;
}

code {
  color: var(--bright);
  font-family: var(--mono);
}

pre,
.table-wrap {
  scrollbar-color: var(--rule) var(--panel);
}

pre {
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  overflow-x: auto;
  line-height: 24px;
}

pre code {
  color: var(--text);
}

blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 2ch;
  color: var(--dim);
}

strong {
  color: var(--bright);
}

.dim {
  color: var(--dim);
}

/* --- screenshots ------------------------------------------------------ */

/* One wide shot, then the rest two abreast, each linking to its full size.
   A shot with .wide takes the whole row. */

figure.shot {
  margin: 0 0 14px;
}

figure.shot a {
  display: block;
  border: 1px solid var(--rule);
  line-height: 0;
}

figure.shot a:hover,
figure.shot a:focus-visible {
  border-color: var(--hover);
}

figure.shot img {
  display: block;
  width: 100%;
  height: auto;
}

figure.shot figcaption {
  margin-top: 6px;
  color: var(--dim);
}

.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 2ch;
  margin: 0 0 14px;
}

.shots figure.shot {
  margin: 0;
}

.shots .wide {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .shots {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- tables ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 14px;
}

.table-wrap table {
  margin: 0;
}

td.file {
  white-space: nowrap;
}

th,
td {
  border: 1px solid var(--rule);
  padding: 3px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  color: var(--head);
  font-weight: normal;
}

/* A long list of short names, three abreast where there is room. */
ul.cols {
  columns: 3 22ch;
  column-gap: 2ch;
  list-style: none;
  padding-left: 0;
}

ul.cols li {
  break-inside: avoid;
}

/* --- option reference -------------------------------------------------- */

dl.opts dt {
  margin-top: 20px;
}

dl.opts dt:first-child {
  margin-top: 0;
}

dl.opts .key {
  color: var(--bright);
  text-decoration: none;
}

dl.opts .key:hover {
  text-decoration: underline;
}

dl.opts .meta {
  color: var(--dim);
}

dl.opts dd {
  margin: 4px 0 0 3ch;
}

dl.opts dd > :last-child {
  margin-bottom: 0;
}

/* --- contents sidebar ------------------------------------------------- */

/* Narrow screens get the contents folded away at the top of the page. Wide
   ones get a sticky box to the left of the text, and the widest a matching
   empty track on the right as well, so the column stays centred. */

.side {
  display: none;
}

details.toc-inline {
  margin: 0 0 20px;
  border: 1px solid var(--rule);
  padding: 4px 1ch;
}

details.toc-inline > summary {
  cursor: pointer;
  color: var(--head);
}

details.toc-inline[open] > summary {
  margin-bottom: 6px;
}

ul.toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.toc li,
ul.toc li + li {
  margin: 0;
  line-height: 24px;
}

ul.toc a {
  display: block;
  color: var(--link);
  text-decoration: none;
}

ul.toc a:hover,
ul.toc a:focus-visible {
  color: var(--hover);
  text-decoration: underline;
}

ul.toc li.opt > a {
  color: var(--dim);
}

ul.toc .d1 {
  padding-left: 2ch;
}

ul.toc .d2 {
  padding-left: 4ch;
}

ul.toc .d3 {
  padding-left: 6ch;
}

/* A panel with its name set into the top edge, the way luir draws its boxes. */
.box {
  position: relative;
  border: 1px solid var(--rule);
  padding: 14px 1.5ch 10px;
}

.box-title {
  position: absolute;
  top: 0;
  left: 1.5ch;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 0.5ch;
  background: var(--bg);
  color: var(--dim);
  line-height: 1;
}

ul.files > li.file > a {
  color: var(--text);
}

ul.files > li.file > a[aria-current="page"] {
  color: var(--bright);
}

ul.files > li.file > a[aria-current="page"]::before {
  content: "> ";
  content: "> " / "";
  color: var(--head);
}

ul.files ul.toc {
  margin: 2px 0 8px 1ch;
  padding-left: 1ch;
  border-left: 1px dashed var(--rule);
}

@media (min-width: 1150px) {
  .page.has-side {
    max-width: none;
    display: grid;
    grid-template-columns:
      minmax(0, 1fr) 30ch minmax(0, 72ch) minmax(0, 1fr);
    column-gap: 3ch;
  }

  .page.has-side > * {
    grid-column: 3;
  }

  .page.has-side > header { grid-row: 1; }
  .page.has-side > .top-rule { grid-row: 2; }
  .page.has-side > main { grid-row: 3; }
  .page.has-side > .bottom-rule { grid-row: 4; }
  .page.has-side > footer { grid-row: 5; }

  .page.has-side > .side {
    display: block;
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 12px 0 16px;
    scrollbar-color: var(--rule) var(--bg);
    scrollbar-width: thin;
  }

  .has-side details.toc-inline,
  .has-side nav.sub {
    display: none;
  }
}

@media (min-width: 1480px) {
  .page.has-side {
    grid-template-columns:
      minmax(0, 1fr) 30ch minmax(0, 72ch) 30ch minmax(0, 1fr);
  }
}

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

footer {
  color: var(--dim);
  text-align: center;
}

footer p {
  margin: 0 0 4px;
}
