/* SPDX-License-Identifier: GPL-3.0-only */
/* The manual's pages (tools/make_manual.py): the site's tokens (web/emu/index.html), a red banner with the menu and
 * two drifting bands, the reading on near-black. Fonts served with the site (SIL OFL), at the site's root. */
@font-face { font-family: "Inter Tight"; src: url("../fonts/inter-tight-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root { --red: #fe0000; --violet: #760595; --shade: #3a0254; --black: #14000f; --pale: #ffd6f0; --d1: #ffb04a; --d2: #45e3d3;
        --lfo: #dcbcff; --ink: #fbe9f2; --muted: #d3b3c4; --rule: #ffffff24; --card: #24081f;
        --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace; color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--black); color: var(--ink); font: 400 17px/1.6 "Inter Tight", "Helvetica Neue", Arial, sans-serif; }
a { color: var(--pale); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--pale); outline-offset: 3px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--pale); color: var(--black); padding: .6em 1em;
        border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
main:focus { outline: none; }

/* the banner: red, the bands from its top left to its bottom right (manual.js), the words pale where they cross */
.top { background: var(--red); color: var(--black); position: relative; }
.top-bands { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.top-bands path { fill: var(--violet); }
.top-bands path.dark { fill: var(--shade); mix-blend-mode: multiply; }
.top-over { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: var(--pale); clip-path: url(#topclip); }
.top-over .menu { visibility: hidden; }
.top-in { position: relative; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.title { padding: 4vh 0 7vh; position: relative; z-index: 1; }   /* short: the page's content starts high (2026-11-13) */
.title small { font: 500 1rem var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.title h1 { font: 500 clamp(2.6rem, 7vw, 5rem)/.95 "Inter Tight", sans-serif; letter-spacing: -.03em; margin: .2em 0 .25em; }
.title p { font: 500 clamp(1.2rem, 2vw, 1.5rem)/1.35 "Inter Tight", sans-serif; max-width: 40ch; margin: 0;
           min-height: calc(2em * 1.35); }   /* room for two rows on every page, so every banner is as tall */
@media (max-width: 820px) { .title { padding: 1.2rem 0 2.2rem; min-height: 0; } .title h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
                            .title p { font-size: 1.1rem; min-height: 0; } }

/* the menu: home at the left; Install, Source and the menu button at the right */
.top-in > .menu { position: relative; z-index: 5; }
.menu { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 4px; padding: 14px 0;
        font: 500 .82rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.menu > a { color: var(--pale); background: var(--black); padding: .45em .95em; border-radius: 999px; text-decoration: none; }
.menu > a:hover { text-decoration: underline; }
.menu a.homeicon { margin-right: auto; padding: .42rem .7rem; line-height: 0; }
.menu a.homeicon svg { width: 1.25rem; height: 1.25rem; }
.menubtn .panel a.langitem { display: none; }
@media (max-width: 480px) { .menu { gap: 6px 3px; font-size: .74rem; letter-spacing: .05em; }
  .menu > a { padding: .45em .75em; white-space: nowrap; } .menu > a[aria-label^="Source"], .menu > a[aria-label^="GitHub"] { font-size: 0; padding: .42rem .7rem; line-height: 0; }
  .menu > a[aria-label^="Source"] .gh, .menu > a[aria-label^="GitHub"] .gh { width: 1.25rem; height: 1.25rem; margin: 0; vertical-align: 0; }
  .menu > a.lang { display: none; } .menubtn .panel a.langitem { display: flex; } }   /* no room on a phone: in the menu */

.gh { width: 1.05em; height: 1.05em; vertical-align: -.17em; margin-left: .45em; }
.menubtn { position: relative; }
.menubtn summary { list-style: none; cursor: pointer; font-size: 0; line-height: 0; display: block; padding: .5rem .8rem;
                   border-radius: 999px; background: var(--black); color: var(--pale); }
.menubtn summary::-webkit-details-marker { display: none; }
.menubtn summary::before { content: ""; display: inline-block; width: 1.15rem; height: .85rem; vertical-align: middle;
  background: linear-gradient(currentColor 0 0) 0 0 / 100% 2px no-repeat, linear-gradient(currentColor 0 0) 0 50% / 100% 2px no-repeat,
              linear-gradient(currentColor 0 0) 0 100% / 100% 2px no-repeat; }
.menubtn[open] summary::before { height: 1.15rem; background: linear-gradient(45deg, #0000 45%, currentColor 45% 55%, #0000 55%),
                                                              linear-gradient(-45deg, #0000 45%, currentColor 45% 55%, #0000 55%); }
.menubtn .panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 15rem; display: grid; gap: 2px;
                  background: var(--black); border-radius: 18px; padding: 8px; box-shadow: 0 18px 40px #14000f80;
                  text-transform: none; letter-spacing: 0; }
.menubtn .panel a { display: block; border-radius: 12px; padding: .6em .9em; font: 600 1.02rem "Inter Tight", sans-serif;
                    color: var(--pale); text-decoration: none; }
.menubtn .panel a small { display: block; font: 500 .78rem/1.3 "Inter Tight", sans-serif; color: var(--muted); }
.menubtn .panel a:hover, .menubtn .panel a[aria-current] { background: var(--card); }

/* the reading */
.page { max-width: 1080px; margin: 0 auto; padding: 32px 16px 80px; }
.page.side { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; }
@media (max-width: 820px) { .page.side { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.prose h2 { font: 600 1.9rem/1.15 "Inter Tight", sans-serif; letter-spacing: -.015em; margin: 2.2rem 0 .5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 600 1.25rem/1.25 "Inter Tight", sans-serif; margin: 1.8rem 0 .4rem; }
.prose h4 { font: 600 1.05rem "Inter Tight", sans-serif; margin: 1.4rem 0 .3rem; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose .onpage, .prose .doors { padding-left: 0; }
.prose li { margin: .25rem 0; }
/* a page's screen at the start of its section, the words beside it and then under it (as a flag's stars beside its
 * stripes); each list item beside it is narrowed whole, so its bullet stays clear of the picture */
.prose img.shot { float: left; width: 240px; margin: .35rem 32px 16px 0; border-radius: 8px; }
.prose img.shot ~ ul { list-style: none; padding-left: 0; }
.prose img.shot ~ ul > li { overflow: hidden; position: relative; padding-left: 1.3rem; }
.prose img.shot ~ ul > li::before { content: "•"; position: absolute; left: .35rem; }
.prose img.shot ~ ol { list-style: none; padding-left: 0; counter-reset: n; }   /* numbers drawn, as the bullets */
.prose img.shot ~ ol > li { overflow: hidden; position: relative; padding-left: 1.6rem; counter-increment: n; }
.prose img.shot ~ ol > li::before { content: counter(n) "."; position: absolute; left: .2rem; }
.prose h2, .prose h3 { clear: both; scroll-margin-top: 20px; }   /* a subhead starts below the picture beside the table above it */
.prose svg.diagram { display: block; clear: both; width: 100%; max-width: 760px; height: auto; margin: 1rem 0 1.4rem; }   /* a drawing (docs/manual/media/*.svg) */
.prose svg.diagram.tall { display: none; max-width: 400px; }
.prose svg.diagram:not(.wide) + p { margin-top: -.8rem; font-size: .88rem; line-height: 1.4; color: var(--muted); max-width: 760px; }   /* its caption */
@media (max-width: 600px) { .prose svg.diagram.wide { display: none; } .prose svg.diagram.tall { display: block; } }
@media (max-width: 600px) { .prose img.shot { float: none; display: block; margin: 0 0 16px; } }
.prose img { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; }
.prose code { font: 500 .88em var(--mono); background: var(--card); padding: .05em .35em; border-radius: 5px; }
.tablewrap { overflow-x: auto; margin: 1rem 0 1.4rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); }
.prose table:not(:has(thead)) td:first-child { width: 10rem; }   /* a list of terms (About's details): one column width down the page */
.prose th { font: 500 .78rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note { background: var(--card); border-left: 4px solid var(--lfo); border-radius: 0 12px 12px 0; padding: 4px 16px; margin: 1.2rem 0; }
.lead { font-size: 1.15rem; }
.muted { color: var(--muted); }
.k { font: 500 .82em var(--mono); border: 1.5px solid currentColor; border-radius: 5px; padding: .05em .4em; white-space: nowrap; }
.toc { position: sticky; top: 16px; align-self: start; font-size: .95rem; }
.toc h2 { font: 500 .75rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.toc ul { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.toc li a { display: block; padding: .3rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.toc li a:hover { background: var(--card); }
.toc li a[aria-current] { background: var(--card); color: var(--pale); font-weight: 600; }
.toc summary, .onpage-nav summary { display: none; }
@media (max-width: 820px) {
  .toc { position: static; background: var(--card); border-radius: 14px; }
  .toc summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none;
                 padding: .7rem 1rem; font-weight: 600; color: var(--pale); }
  .toc summary::-webkit-details-marker { display: none; }
  .toc summary small { font: 500 .72rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .toc summary::after { content: ""; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 2px 2px 0;
                        transform: rotate(45deg) translateY(-25%); flex: none; }
  .toc details[open] summary::after { transform: rotate(-135deg); }
  .toc h2 { display: none; } .toc ul { margin: 0; padding: 0 .4rem .6rem; } }

/* the doors on the manual's first page and the reference's */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0; list-style: none; }
@media (min-width: 900px) { .doors:has(> li:nth-child(6)):not(:has(> li:nth-child(7))) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }   /* six: 3 x 2 */
.doors a { display: block; height: 100%; background: var(--card); border-radius: 20px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.doors small { font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.doors b { display: block; font: 600 1.4rem "Inter Tight", sans-serif; color: var(--pale); margin: .25rem 0; }
.doors span { color: var(--muted); font-size: .95rem; }

/* the recipes: the kinds as tabs, every recipe of the page listed at its top */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.tabs a { text-decoration: none; padding: .5em 1em; border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; }
.tabs a[aria-current] { background: var(--pale); color: var(--black); }
@media (max-width: 820px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 22px; padding: 0 16px;
                                    scroll-padding: 0 16px; }
                            .tabs::-webkit-scrollbar { display: none; } .tabs a { white-space: nowrap; flex: none; } }
.onpage-nav { margin: 0 0 36px; }
/* a group of recipes: a small label, as in the list at the top, so each recipe's title is the big heading */
.prose h2.group-head { font: 500 .85rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
                       margin: 3rem 0 0; padding: 0; border: 0; }   /* the page's recipes, a line a group (make_manual.py onpage) */
.onpage { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.prose .onpage li { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 4px 16px; margin: 0; max-width: none;
                    padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.onpage li > b { font: 500 .74rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
.prose .onpage li:not(:has(> b)) { grid-template-columns: minmax(0, 1fr); }
.onpage .names { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.onpage .names a { color: var(--pale); font-weight: 600; text-decoration: none; }
.onpage .names a:hover { text-decoration: underline; }
.onpage .soon { color: var(--muted); }
@media (max-width: 600px) { .prose .onpage li { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  .onpage-nav { background: var(--card); border-radius: 14px; }
  .onpage-nav summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none;
                        padding: .7rem 1rem; font-weight: 600; color: var(--pale); }
  .onpage-nav summary::-webkit-details-marker { display: none; }
  .onpage-nav summary::after { content: ""; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 2px 2px 0;
                               transform: rotate(45deg) translateY(-25%); flex: none; }
  .onpage-nav details[open] summary::after { transform: rotate(-135deg); }
  .onpage { margin: 0 1rem .6rem; } }
.onpage li.soon small { display: block; font: 500 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.onpage li.soon b { display: block; color: var(--ink); }

/* a recipe */
.recipe { border-top: 1px solid #ffffff4d; padding: 40px 0; scroll-margin-top: 12px; }
.recipe-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.prose .recipe-head :is(h2, h3) { font: 600 1.9rem/1.15 "Inter Tight", sans-serif; margin: 0; letter-spacing: -.015em; }
/* two columns: the steps with the sound under them, the screens on the right at the screen's own size (240 px: two
 * stacked about as tall as an average recipe, so they don't make it longer) */
.recipe-body { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto 1fr;
               grid-template-areas: "how shots" "listen shots"; gap: 24px 48px; margin-top: 10px; align-items: start; }
.recipe-body .how { grid-area: how; }
.recipe-body:not(:has(.screens)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "how" "listen"; }
.recipe-body:not(:has(.screens)) .how { max-width: 680px; }
.recipe-body .screens { grid-area: shots; }
.recipe-body .listen { grid-area: listen; max-width: 480px; }
.recipe-body.pair { grid-template-columns: minmax(0, 1fr) 494px; }   /* two screens side by side, where stacked they'd be
                                                                    * taller than the recipe (manual.js) */
.recipe-body.pair .screens { grid-template-columns: 240px 240px; }
@media (max-width: 820px) { .recipe-body { gap: 24px 28px; } }
@media (max-width: 640px) { .recipe-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
                                           grid-template-areas: "how" "shots" "listen"; } }
.prose .moves { counter-reset: m; list-style: none; padding: 0; margin: .4rem 0 0; }
.prose .stage { font: 500 .78rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 .2rem; }   /* a walk-through's stages */
.prose .moves li { counter-increment: m; position: relative; padding: .35rem 0 .35rem 2.4rem; margin: 0; }
.moves li::before { content: counter(m); position: absolute; left: 0; top: .35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
                    background: var(--pale); color: var(--black); font: 600 .9rem/1.7rem "Inter Tight", sans-serif; text-align: center; }
.good { background: var(--card); border-left: 4px solid var(--lfo); border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 1.2rem 0 0; }
.good > b { font: 500 .75rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--lfo); display: block; margin-bottom: .2rem; }
.good p { margin: .2rem 0 0; }
figure { margin: 0; }
.screens { display: grid; grid-template-columns: 1fr; gap: 14px; }
.screens img { width: 100%; display: block; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
.listen { background: var(--card); border-radius: 16px; padding: 16px 18px; margin: 0; }
.prose .listen :is(h3, h4) { font: 600 1.05rem "Inter Tight", sans-serif; margin: 0; }
.listen audio { width: 100%; margin: .4rem 0 .6rem; }
/* the player in the site's colors (manual.js; without script the browser's own player shows) */
.pl { display: flex; align-items: center; gap: 12px; margin: .5rem 0 .7rem; }
.pl .pp { all: unset; width: 40px; height: 40px; border-radius: 50%; background: var(--pale); display: grid; place-items: center; cursor: pointer; flex: none; }
.pl .pp::before { content: ""; border-left: 13px solid var(--black); border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 4px; }
.pl .pp.on::before { width: 4px; height: 14px; border: solid var(--black); border-width: 0 4px; margin: 0; }
.pl .pp:focus-visible { outline: 3px solid var(--pale); outline-offset: 3px; }
.pl input[type=range] { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; margin: 0; }
.pl input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(var(--pale) 0 0) 0 / var(--p, 0%) 100% no-repeat, #ffffff2e; }
.pl input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #ffffff2e; }
.pl input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--pale); }
.pl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--pale); margin-top: -4px; }
.pl input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--pale); }
.pl input[type=range]:focus-visible { outline: 3px solid var(--pale); outline-offset: 4px; border-radius: 4px; }
.pl .tm { font: 500 .8rem var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.prose .listen ol { list-style: none; padding: 0; margin: 0; }
.prose .listen li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 10px; padding: .25rem 0; margin: 0; border-top: 1px solid var(--rule); font-size: .95rem; }
.listen li button { all: unset; cursor: pointer; font: 500 .85rem var(--mono); color: var(--pale); text-decoration: underline; }
.listen li button:focus-visible { outline: 3px solid var(--pale); outline-offset: 2px; }
.foot { border-top: 1px solid var(--rule); max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; font-size: .88rem; color: var(--muted); }

/* videos (the About page): YouTube's no-cookie player, 16:9, a caption with its link */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin: 1rem 0 1.6rem; }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: var(--card); display: block; }
.video figcaption { margin-top: .4rem; font-size: .88rem; line-height: 1.35; }

/* cards (the About page's features): a title and a line each */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 0; list-style: none; margin: 1rem 0 1.6rem; }
.prose .cards li { margin: 0; max-width: none; background: var(--card); border-radius: 14px; padding: 14px 16px; }
.cards b { display: block; color: var(--pale); font-size: 1.05rem; margin-bottom: .2rem; }
.cards span { display: block; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.prose .cards { padding-left: 0; }

/* icons (Phosphor, light, MIT): in the text's color, above a card's title */
.ic { width: 1.6rem; height: 1.6rem; display: block; margin-bottom: .45rem; color: var(--pale); }
.cards .ic { width: 28px; height: 28px; }
.doors .ic { width: 30px; height: 30px; }

/* icons in the menu (before each item) and the recipe tabs; the Reference's list as linked cards */
.menubtn .panel a { display: flex; gap: .7rem; align-items: flex-start; }
.mi { width: 22px; height: 22px; flex: none; margin-top: .1rem; color: var(--pale); }
.ti { width: 18px; height: 18px; vertical-align: -.2em; margin-right: .4rem; }
.cards li > a { display: block; height: 100%; text-decoration: none; color: inherit; margin: -14px -16px; padding: 14px 16px; border-radius: 14px; }
.cards li > a:hover b { text-decoration: underline; }

/* the feedback form (Help) */
.feedback { display: grid; gap: 14px; max-width: 640px; background: var(--card); border-radius: 20px; padding: 20px; margin: 1rem 0 2rem; }
.feedback label { display: grid; gap: 6px; font-weight: 600; color: var(--pale); }
.feedback label small { font-weight: 400; color: var(--muted); }
.feedback input:not([type=radio]), .feedback textarea { font: 400 1rem "Inter Tight", sans-serif; color: var(--ink); background: var(--black);
  border: 1px solid var(--muted); border-radius: 12px; padding: .6em .8em; }
.feedback input:focus-visible, .feedback textarea:focus-visible { outline: 3px solid var(--pale); outline-offset: 2px; }
.feedback fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.feedback legend { font-weight: 600; color: var(--pale); margin-bottom: 6px; padding: 0; }
.feedback fieldset label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.feedback input[type=radio] { accent-color: var(--pale); width: 1.1em; height: 1.1em; }
.feedback .gotcha { position: absolute; left: -9999px; }
.feedback .sent-note { margin: 0; color: var(--muted); font-size: .9rem; }
.feedback button { justify-self: start; font: 600 1rem "Inter Tight", sans-serif; color: var(--black); background: var(--pale);
  border: 0; border-radius: 999px; padding: .6em 1.6em; cursor: pointer; }
.feedback button:disabled { opacity: .6; cursor: default; }
.feedback-status { margin: 0; min-height: 1.6em; }
