/* ARM-DOS documentation pages. A sibling of the play page (../css/armdos.css): the same
   room, with the manual as a page out of the binder that came with the machine. Set in
   Charis (Bitstream Charter's descendant, a 1987 face made for documents like this one),
   with commands, screens and the section numbers in the machine's own VGA font, the way a
   manual of the day set what you type apart from what you read. Fonts are at ../fonts/. */

@font-face { font-family: "Charis SIL"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/charis-400.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/charis-400i.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/charis-700.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/charis-700i.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/archivo-var.woff2") format("woff2"); }
/* made from emu/fonts/vga8x16.bin by web/tools/pcfont.mjs: crisp at 16px and whole multiples */
@font-face { font-family: "PC VGA"; font-style: normal; font-weight: 400; font-display: block; src: url("../fonts/pcvga.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --room: #141718;
  --room-rule: #2c3133;
  --room-ink: #dcd8cc;
  --room-ink-2: #aaa69a;

  --paper: #f5f2ea;
  --paper-edge: #d8d2c3;
  --ink: #1e1d1a;
  --ink-2: #4a473f;
  --ink-3: #77736a;
  --rule: #cbc4b3;

  /* links in the colours a 1990s browser used, which are also two of the machine's own */
  --link: #0000aa;
  --visited: #aa00aa;

  /* the text palette, for the screens */
  --c-black: #000000; --c-blue: #0000aa; --c-cyan: #00aaaa; --c-red: #aa0000;
  --c-lgray: #aaaaaa; --c-dgray: #555555; --c-lcyan: #55ffff; --c-yellow: #ffff55; --c-white: #ffffff;

  --serif: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pc: "PC VGA", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--room); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 18px/1.6 var(--serif);
  background: var(--room);
  padding: 0 max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left));
  -webkit-text-size-adjust: 100%;
  counter-reset: figure;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: var(--visited); }
a:hover { color: var(--c-white); background: var(--link); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* ------------------------------------------------------------ top bar (on the room): a menu bar */
.topbar {
  max-width: 1120px; margin: 0 auto; padding: 20px 0 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px;
  font: 16px/16px var(--pc);
}
.topbar .brand { color: var(--c-white); text-decoration: none; font: 32px/32px var(--pc); margin-right: auto; }
.topbar .brand span { color: var(--c-lgray); }
.topbar .brand:hover { background: none; color: var(--c-white); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.topbar nav a { color: var(--c-lgray); text-decoration: none; padding: 4px 8px; }
.topbar nav a:hover { color: var(--c-black); background: var(--c-lgray); }
.topbar nav a[aria-current="page"] { color: var(--c-black); background: var(--c-lgray); }
.topbar .play-small { color: var(--c-white); background: var(--c-red); text-decoration: none; padding: 4px 12px; }
.topbar .play-small:hover { background: #cc1a10; color: var(--c-white); }

/* ------------------------------------------------------------ the paper */
.sheet {
  max-width: 1120px; margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  padding: clamp(24px, 5vw, 64px) clamp(18px, 6vw, 88px) clamp(28px, 5vw, 64px);
  position: relative;
}
/* the three punched holes of a binder page, on wide screens */
@media (min-width: 900px) {
  .sheet::before {
    content: ""; position: absolute; left: 22px; top: 90px; bottom: 90px; width: 16px;
    background:
      radial-gradient(circle, var(--room) 6px, rgba(0,0,0,.18) 7px, transparent 8px) 0 0 / 16px 16px no-repeat,
      radial-gradient(circle, var(--room) 6px, rgba(0,0,0,.18) 7px, transparent 8px) 0 50% / 16px 16px no-repeat,
      radial-gradient(circle, var(--room) 6px, rgba(0,0,0,.18) 7px, transparent 8px) 0 100% / 16px 16px no-repeat;
  }
}
.prose { max-width: 42rem; margin: 0 auto; }
.wide { max-width: 60rem; margin-left: auto; margin-right: auto; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; color: var(--ink); line-height: 1.2; text-wrap: balance; }
h1 { font: 400 64px/64px var(--pc); margin: 0 0 20px; letter-spacing: 0; }
h2 { font-size: clamp(25px, 3vw, 30px); margin: 2.4em 0 .6em; padding-top: .7em; border-top: 1px solid var(--ink); position: relative; }
/* section numbers hang in the margin, printed by the machine */
h2 .num { font: 400 32px/32px var(--pc); color: var(--ink-3); position: absolute; right: calc(100% + 24px); top: .55em; }
h3 { font-size: 21px; margin: 1.8em 0 .4em; }
h4 { font-size: 18px; margin: 1.4em 0 .3em; font-style: italic; }
p { margin: 0 0 1em; }
.kicker { font: italic 400 18px/1.3 var(--serif); color: var(--ink-3); margin: 0 0 12px; }
.lede { font-size: clamp(20px, 2.2vw, 23px); line-height: 1.5; color: var(--ink-2); margin-bottom: 1.2em; text-wrap: pretty; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: .25em 0; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
@media (max-width: 1100px) { h2 .num { position: static; font-size: 16px; line-height: 1; margin-right: 12px; vertical-align: .2em; } }
@media (max-width: 600px) { h1 { font-size: 48px; line-height: 48px; } }

code, samp { font: 16px/1 var(--pc); overflow-wrap: anywhere; }
kbd {
  font: 600 .72em/1 var(--sans); letter-spacing: .02em; color: #2a2620; white-space: nowrap;
  background: #ece6d6; border: 1px solid #9c937e; border-bottom-width: 3px; border-radius: 3px; padding: .15em .4em .1em;
}

/* A DOS screen: what you type (bold: bright white) and what comes back */
pre, .dos {
  font: 16px/16px var(--pc);
  background: var(--c-black); color: var(--c-lgray);
  padding: 16px; margin: 0 0 1.4em;
  overflow-x: auto; white-space: pre;
}
pre b, .dos b { color: var(--c-white); font-weight: 400; }
pre i, .dos i { color: var(--c-cyan); font-style: normal; }
pre code { font: inherit; }

/* ------------------------------------------------------------ hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 32px; }
.hero h1 .ver { color: var(--ink-3); }
.hero figure { margin: 0; }
.hero figure img { display: block; box-shadow: 6px 6px 0 rgba(30, 25, 15, .18); border: 1px solid #000; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 24px; } }

.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 24px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.btn-play { font: 16px/16px var(--pc); padding: 12px 16px; background: var(--c-red); color: var(--c-white); box-shadow: 6px 6px 0 var(--ink); }
.btn-play:visited { color: var(--c-white); }
.btn-play:hover { background: #cc1a10; color: var(--c-white); }
.btn-play:active { transform: translate(6px, 6px); box-shadow: none; }
.btn-play .sw { display: inline-block; width: 4px; height: 14px; background: var(--c-white); }   /* the I of the rocker */
.btn-ghost { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.btn-ghost:visited { color: var(--visited); }

/* ------------------------------------------------------------ Kevin's letter */
/* ruled paper: the text sits on the rules, so every vertical size is a multiple of --rule */
.letter {
  --rule: 26px;
  position: relative; margin: 40px auto 48px; max-width: 42rem;
  background:
    linear-gradient(90deg, transparent 52px, rgba(200, 60, 60, .45) 52px, rgba(200, 60, 60, .45) 54px, transparent 54px),
    repeating-linear-gradient(180deg, #fffdf7 0 calc(var(--rule) - 1px), #c9d8ec calc(var(--rule) - 1px) var(--rule));
  background-color: #fffdf7;
  border: 1px solid #e1d8c2;
  box-shadow: 0 10px 24px rgba(40, 30, 10, .16), 0 1px 2px rgba(40, 30, 10, .15);
  padding: calc(2 * var(--rule)) 30px var(--rule) 74px;
  font-size: 16px; line-height: var(--rule);
  transform: rotate(-.4deg);
}
.letter::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 110px; height: 26px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(240, 225, 170, .75); box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.letter .from { font: italic 400 16px/var(--rule) var(--serif); color: #9a3a2a; margin: calc(-1 * var(--rule)) 0 0; }
.letter p { margin: 0; }
.letter p + p { text-indent: 1.6em; }               /* (paragraphs indent, as in a letter, rather than skip a line) */
.letter .sig { text-align: right; font-style: italic; text-indent: 0; }
.letter a:hover { background: none; color: var(--link); text-decoration: underline; }
@media (max-width: 520px) { .letter { transform: none; padding: calc(2 * var(--rule)) 18px var(--rule) 40px; background: linear-gradient(90deg, transparent 26px, rgba(200, 60, 60, .45) 26px, rgba(200, 60, 60, .45) 28px, transparent 28px), repeating-linear-gradient(180deg, #fffdf7 0 calc(var(--rule) - 1px), #c9d8ec calc(var(--rule) - 1px) var(--rule)); font-size: 15px; } }

/* ------------------------------------------------------------ notes, figures, tables */
/* a note is set off by rules, with its label out in the margin like a manual's */
.note { position: relative; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: 10px 0 12px; margin: 1.4em 0; font-size: .94em; }
.note::before { content: "Note"; position: absolute; right: calc(100% + 24px); top: 10px; font: italic 700 16px/1.6 var(--serif); color: var(--ink-3); }
.note > :last-child { margin-bottom: 0; }
p.note { color: var(--ink-2); }
.brandnote::before { content: none; }
.brandnote .badge {
  display: inline-block; font: 700 13px/1 var(--sans); letter-spacing: .3em; color: #ece6d6; background: #1f2530;
  border: 1px solid #0c0f14; padding: 5px 6px 4px 9px; border-radius: 2px; margin-right: 6px; vertical-align: .1em;
}
@media (max-width: 1100px) { .note::before { position: static; display: block; margin-bottom: 2px; } .brandnote::before { content: none; } }

figure { margin: 1.8em 0; }
figure img { display: block; border: 1px solid #000; }
figcaption { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; counter-increment: figure; }
figcaption::before { content: "Figure " counter(figure) ". "; font-weight: 700; color: var(--ink); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 28px 24px; margin: 1.8em 0; }
.shots figure { margin: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
table { border-collapse: collapse; width: 100%; font-size: 16.5px; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 7px 14px 7px 0; border-bottom: 1px solid var(--rule); }
th { font: italic 400 16px/1.3 var(--serif); color: var(--ink-3); border-bottom: 1px solid var(--ink); }
td code { white-space: nowrap; }
td.num, th.num { text-align: right; padding-right: 16px; }

/* things to try: short lists under rules, two across */
.tries { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px 36px; margin: 1.4em 0 2em; }
.try { border-top: 1px solid var(--ink); padding-top: 8px; }
.try h3 { margin: 0 0 .5em; font-size: 18px; }
.try ul { list-style: none; padding: 0; margin: 0 0 1em; font-size: 16px; }
.try li { margin: 0 0 .65em; line-height: 1.5; }
.try li code:first-child { background: var(--c-black); color: var(--c-white); padding: 0 4px; }

/* further reading: the other manuals on the shelf */
.deeper { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 36px; margin: 1.4em 0; }
.deeper a { display: block; text-decoration: none; color: var(--ink); border-top: 1px solid var(--rule); padding: 12px 0 16px; }
.deeper a:visited { color: var(--ink); }
.deeper b { display: block; font: 700 19px/1.3 var(--serif); margin-bottom: 4px; color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.deeper span { font-size: 16px; color: var(--ink-2); line-height: 1.5; display: block; }
.deeper a:hover { background: none; color: var(--ink); }
.deeper a:hover b { background: var(--link); color: var(--c-white); text-decoration: none; display: inline; }

/* the phone list */
.phones td:first-child { font: 16px/1.45 var(--pc); white-space: nowrap; }

/* table of contents */
.toc { border-top: 1px solid var(--ink); padding: 12px 0 0; margin: 0 0 1em; font-size: 16.5px; }
.toc b { font: italic 400 16px/1.3 var(--serif); color: var(--ink-3); }
.toc ol { margin: 8px 0 0; columns: 2 16rem; column-gap: 32px; padding: 0; list-style: none; counter-reset: toc; }
.toc li { margin: .2em 0; break-inside: avoid; counter-increment: toc; display: flex; gap: 12px; }
.toc li::before { content: counter(toc); font: 16px/1.6 var(--pc); color: var(--ink-3); min-width: 2ch; text-align: right; }

/* ------------------------------------------------------------ footer */
.foot {
  max-width: 1120px; margin: 28px auto 0; color: var(--room-ink-2); font-size: 15.5px; line-height: 1.5;
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; align-items: baseline;
}
.foot a, .foot a:visited { color: var(--c-lcyan); }
.foot a:hover { color: var(--c-black); background: var(--c-lcyan); }
.foot .contact { font: 16px/16px var(--pc); }

@media (max-width: 520px) {
  body { font-size: 17px; }
  pre, .dos { padding: 12px; }
  .topbar { gap: 10px 14px; }
  .topbar .brand { font-size: 16px; line-height: 16px; }
  table { font-size: 15px; }
}
