/* The styles of the pack's page, in every language. fonts.css has the fonts' faces. */
:root {
    --paper: #0c0c14; --panel: #15151f; --ink: #d7d7d7; --dim: #8c8ca0; --line: #2a2a3a;
    --cyan: #00d7d7; --yellow: #ffff00; --px: 2;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0 auto; max-width: 1056px; padding: 0 24px 64px; font: 16px/24px "ZX Spectrum 6x8", monospace;
       -webkit-font-smoothing: none; }
/* In a window of an odd width the centred page would start at half a pixel, where a browser draws the letters and
   the boxes around them a pixel apart: so the left margin is a whole number of pixels. */
@supports (margin-left: round(down, 1.5px, 1px)) {
    body { margin-left: max(0px, round(down, (100% - 1056px) / 2, 1px)); }
}
a { color: var(--cyan); }
a:hover { color: var(--yellow); }
h1, h2 { font-weight: bold; }
header { padding: 16px 0 8px; }
/* The page in its other languages, at its top alone: the language of the screens' text is in the menu. */
.langs { margin: 0 0 16px; text-align: right; }
.langs a, .langs strong { margin-left: 16px; }
.langs strong { font-weight: normal; color: var(--yellow); }
/* The mark: the pack's name in letters of its languages, each in a machine's font and its screen's colors. Its 14
   tiles of 59 pixels, 14 apart, are as wide as the page's column of 1008; a narrower page has smaller ones. */
.mark { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; font-size: 32px; line-height: 32px;
        font-synthesis: none; }
.mark span { display: block; width: 48px; padding: 8px 0; text-align: center; background: var(--back);
             color: var(--fore); --data: var(--fore); --data-gap: var(--back); }
@media (min-width: 1080px) {
    .mark { gap: 14px; font-size: 48px; line-height: 48px; }
    .mark span { width: 59px; padding: 5px 0 6px; }
}
.mark span::after { content: none; }
/* A dark screen has a line inside its edge, to stand off the dark page. */
.mark .pico-8, .mark .tic-80 { box-shadow: inset 0 0 0 2px #8c8ca0; }
/* A tile before its first letter, and one that loads its next in stripes of its screen's two colors, or of the
   Spectrum's tape. */
.mark .zx-spectrum, .mark .zx-spectrum-6x8 { --data: #d7d700; --data-gap: #0000d7; }
.mark span.empty { background: #3a3a4a; color: transparent; }
.mark span.loading { color: transparent; box-shadow: none; animation: load 0.5s steps(8) both;
                     background: repeating-linear-gradient(var(--data) 0 4px, var(--data-gap) 0 6px,
                         var(--data) 0 12px, var(--data-gap) 0 16px, var(--data) 0 18px, var(--data-gap) 0 26px)
                         0 0 / 100% 104px; }
@keyframes load {
    from { background-position: 0 0; }
    to { background-position: 0 80px; }
}
h1 { font-size: 48px; line-height: 56px; margin: 0 0 8px; color: #fff; }
h1 small { display: block; font-size: 16px; line-height: 24px; color: var(--yellow); }
.lead { max-width: 44em; }
h2 { font-size: 16px; line-height: 24px; margin: 0 0 8px; color: #fff; }
nav { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 24px; align-items: center;
      padding: 12px 0; background: var(--paper); border-bottom: 2px solid var(--line); font-size: 16px; }
/* A font's link is in that font, without a smeared bold or slant where it has none. */
nav a { text-decoration: none; font-synthesis: none; }
/* The fonts' links are a line, and the page's other links and the controls the next. */
.break { flex-basis: 100%; }
.size { margin-left: auto; color: var(--dim); }
button, select { font: inherit; color: var(--ink); background: none; border: 0; padding: 0 6px; cursor: pointer; }
.keys { margin: 0 0 8px; }
.keys button { margin-right: 12px; box-shadow: inset 0 0 0 2px var(--line); }
button:hover { color: var(--yellow); }
/* A select cuts its text off at its own edge, so the indent keeps the first letter's first column off it. */
.size select { color: var(--yellow); max-width: 14em; margin-right: 16px; padding-left: 2px; text-indent: 4px; }
.size option { color: #000; }
button[aria-pressed="true"], button[aria-pressed="true"]:hover { color: var(--paper); background: var(--yellow); }
section { padding: 48px 0 0; scroll-margin-top: 48px; }
/* PICO-8's letters are 4 by 5 pixels of a cell of 8, so text in its font is half as large again, to be as high as
   the other fonts' beside it. Its screen has its own size. */
#pico-8, #pico-8 h2, nav a[href="#pico-8"], .keys button[value="pico-8"], dl[data-font="pico-8"] { font-size: 24px; }
/* A font's section is in that font. One without a bold has its heading in the regular, not in a smeared one. */
.font { font-synthesis: none; }
.about, .license, .note { color: var(--dim); margin: 0 0 16px; max-width: 44em; }
figure { margin: 0 0 24px; }
figcaption { color: var(--dim); margin-top: 8px; }
/* A machine's screen: the glass is its text's columns and rows, the screen's padding its border, and the case the
   monitor around them. A font's pixel is --px CSS pixels, times --mul for a machine with a small screen. */
.case { display: inline-block; max-width: 100%; overflow-x: auto; vertical-align: top; padding: 12px;
        background: #000; border-radius: 8px; box-shadow: 0 0 0 2px var(--line); }
.screen { font-size: calc(8px * var(--px) * var(--mul)); line-height: 1; padding: var(--border, 1em);
          background: var(--edge, var(--back)); color: var(--fore); -webkit-font-smoothing: none; }
/* The glass cuts text off half a character past its columns, in the border, so that at a zoom where its edge is
   between two of the display's pixels it doesn't cut a column of the first letter's. */
.glass { position: relative; box-sizing: content-box; width: calc(var(--cols) * var(--cw) * 0.125em);
         height: calc(var(--rows) * 1em); padding: 0 0.5em; margin: 0 -0.5em; overflow: hidden;
         background: var(--back); }
/* While the text is typed in, the cursor drawn under it is hidden and the script draws the caret: the character at
   it in the screen's colors exchanged, in that character's cell, as the machine's cursor is. */
.text { white-space: pre-wrap; word-break: break-all; outline: 0; min-height: 1em; caret-color: transparent; }
.glass:focus-within .cur { visibility: hidden; }
.caret { position: absolute; width: calc(var(--cw) * 0.125em); height: 1em; overflow: hidden; white-space: pre;
         pointer-events: none; background: var(--cursor, var(--fore)); color: var(--back);
         animation: blink 1s steps(2, jump-none) infinite; }
.status { position: absolute; left: 0.5em; right: 0.5em; bottom: 0; white-space: pre; }
.cur { display: inline-block; width: calc(var(--cw) * 0.125em); background: var(--cursor, var(--fore));
       animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cur { animation: none; } }
/* The Spectrum's white paper and border, and the report of a program that ended. */
.zx-spectrum, .zx-spectrum-6x8 { --back: #d7d7d7; --fore: #000; --border: 3em 4em; position: relative; }
.zx-spectrum::after, .zx-spectrum-6x8::after {
    content: ""; position: absolute; right: 24px; bottom: 0; width: 48px; height: 12px; transform: skewX(-30deg);
    background: linear-gradient(90deg, #d70000 25%, #d7d700 0 50%, #00d700 0 75%, #00d7d7 0);
}
/* MSX BASIC's white on blue, with the function keys in the last line. */
.msx { --back: #5455ed; --fore: #fff; --border: 2em 2em; }
/* The Z88's supertwist LCD: eight lines. Its 106 columns are wider than most pages, so it is as wide as the page. */
.cambridge-z88 { --back: #b4c2ad; --fore: #1b2350; --border: 1em; background: #2b2b33; display: block; }
.cambridge-z88 .glass { width: auto; }
.pico-8 { --back: #000; --fore: #c2c3c7; --cursor: #ff004d; --border: 0 0.5em; }
.tic-80 { --back: #1a1c2c; --fore: #f4f4f4; --cursor: #b13e53; --border: 1em; }
.sheets { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.sheets img { display: block; image-rendering: pixelated; filter: invert(1); max-width: 100%; height: auto; }
.files { border-collapse: collapse; margin-bottom: 8px; }
.files th { text-align: left; font-weight: normal; color: var(--dim); padding: 2px 24px 2px 0; }
.files a { margin-right: 16px; }
/* The samples are in the font chosen above them, each of whose buttons is in its own font. */
#languages .keys, dl { font-synthesis: none; }
#languages .keys button { margin-bottom: 8px; }
dl { margin: 16px 0; }
dt { color: var(--yellow); }
dd { margin: 0 0 16px; color: #fff; }
dd strong { font-weight: normal; color: var(--ink); }
table.plain { border-collapse: collapse; }
table.plain th { white-space: nowrap; }
table.plain th, table.plain td { text-align: left; padding: 6px 24px 6px 0; border-bottom: 1px solid var(--line);
                                 vertical-align: top; }
code { font: inherit; color: #fff; }
footer { margin-top: 64px; padding-top: 16px; border-top: 2px solid var(--line); color: var(--dim); font-size: 16px; }
@media (max-width: 640px) {
    h1 { font-size: 32px; line-height: 40px; }
    .size { margin-left: 0; }
    nav { position: static; }
}
