/* MetaChimera. CHIMERA's vector-display look: pure black, hairline frames, glowing
   single-stroke lettering. One colour is structure, and it is the colour of the section being
   browsed (blue at home); amber is sound (whatever is playing, and the controls that play it).
   No fills, no rounded corners.

   Written phone first: the list is the page, the player docks at the bottom, the stage is a
   full-screen layer. From 900px the same list becomes a sidebar with the stage beside it. */

@font-face {
  font-family: "Hershey";
  src: url("fonts/AVHersheySimplexLight.otf") format("opentype");
  font-weight: 100 400;
  font-display: swap;
}
@font-face {
  font-family: "Hershey";
  src: url("fonts/AVHersheySimplexMedium.otf") format("opentype");
  font-weight: 401 900;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* the stroke face has no "@": this lends it Archivo's lightest one, so a handle does not begin with a heavy letter */
@font-face {
  font-family: "At";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
  unicode-range: U+0040;
}
/* the stroke face draws "-" as wide as a dash ("four-part" read as "four — part"): this lends
   Archivo's short one, and comes first in the stack because the stroke face does have the sign */
@font-face {
  font-family: "Hyphen";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 200;
  font-display: swap;
  unicode-range: U+002D;
}

/* The colour of the moment. Registered as a colour, so a script that asks for it is given the
   colour worked out, in every section. */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #4fb6f2; }

:root {
  --accent: #4fb6f2;        /* lines, marks and running text: the home blue */
  --mid: #3f97d6;           /* secondary text: never under 4.5:1 on black */
  --dim: #1f5f8c;           /* lines only, never text */
  --frame: #133954;         /* the faintest hairlines */
  --glow: 0 0 1.5px rgba(79, 182, 242, 0.9), 0 0 6px rgba(79, 182, 242, 0.4);
  --halo: rgba(79, 182, 242, 0.7);      /* the soft edge of a drawn line */
  --haze: rgba(79, 182, 242, 0.18);
  --white: #eef6f8;
  --amber: #ffb340;
  --amber-dim: #7d5518;
  --amber-frame: #3d2a0e;
  --glow-amber: 0 0 1.5px rgba(255, 179, 64, 0.9), 0 0 6px rgba(255, 179, 64, 0.35);
  --lens: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23000' stroke-width='1.1'%3E%3Ccircle cx='5.8' cy='5.8' r='4.3'/%3E%3Cpath d='M9 9l4 4'/%3E%3C/svg%3E");
  /* One face, the original CHIMERA's: Hershey, drawn with single lines. Archivo only lends the
     signs it lacks ("Hyphen" and "At" are two of them, cut to match). */
  --font: "Hyphen", "Hershey", "At", "Archivo", system-ui, -apple-system, "Segoe UI", "Noto Sans", sans-serif;
  --pad: 16px;
  --side: 420px;
  --dock-h: 0px;
  /* three sizes of lettering, and no others */
  --big: 18px;
  --text: 16px;
  --small: 13px;
  color-scheme: dark;
}

/* Each section has its own colour, one of the original CHIMERA's line colours (the same four
   values as sections.js; the checker compares them). The script names the section being browsed
   on the root element, and that one attribute re-tints everything: no rule below names a section
   or one of these colours. The quieter shades are the same hue at a set lightness, so secondary
   text is as readable in one tint as in another. A browser that cannot work a colour out of
   another stays blue throughout. */
@supports (color: oklch(from red l c h)) {
  :root[data-section="apps"] { --accent: #4fb6f2; }
  :root[data-section="songs"] { --accent: #ff73cf; }
  :root[data-section="videos"] { --accent: #5be381; }
  :root[data-section="tools"] { --accent: #ff5d40; }
  :root {
    --mid: oklch(from var(--accent) min(0.65, l - 0.08) calc(c * 0.9) h);
    --dim: oklch(from var(--accent) 0.46 calc(c * 0.7) h);
    --frame: oklch(from var(--accent) 0.33 calc(c * 0.5) h);
    --glow: 0 0 1.5px oklch(from var(--accent) l c h / 0.9), 0 0 6px oklch(from var(--accent) l c h / 0.4);
    --halo: oklch(from var(--accent) l c h / 0.7);
    --haze: oklch(from var(--accent) l c h / 0.18);
  }
}
/* Changing section: the old view dissolves into the new one, list and colour together (setTab in
   shell.js asks for it; a browser that cannot, or a visitor who asked for less motion, gets the
   change at once). The colour itself is never blended: halfway from one section's to another's is grey. */
::view-transition-group(root) { animation-duration: 0.16s; }      /* the two pictures inherit it, and the change is over when the longest of the three is */
::view-transition-old(root), ::view-transition-new(root) { animation-timing-function: ease-out; }
/* Firefox then lets a click through to the page while the dissolve runs. Chrome and Safari do not:
   there a click in that fifth of a second lands on nothing. */
::view-transition { pointer-events: none; }

* { box-sizing: border-box; }
html { background: #000; -webkit-text-size-adjust: 100%; }
/* a row brought into view (by the keyboard, or by a link) clears the tabs that stick to the top and the player */
html { scroll-padding: 56px 0 calc(var(--dock-h) + 8px); }
body {
  margin: 0;
  background: #000;
  color: var(--accent);
  font-family: var(--font);
  font-size: var(--text);
  /* The lines of the face are thinner than a pixel at these sizes, and a line thinner than a pixel
     is drawn grey and uneven. So: its heavier cut everywhere (the light one is not used), a third
     of a pixel added to every line, and the browser's own thickening on a Mac left on. */
  font-weight: 500;
  -webkit-text-stroke: 0.3px;
  line-height: 1.45;
  letter-spacing: 0.035em;
}
a { color: inherit; }
button, input, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 2px; }
.dock :focus-visible { outline-color: var(--amber); }
[hidden] { display: none !important; }

/* ---- the column ---- */
.side { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px)); }

.head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
  padding: 18px var(--pad) 6px;
}
.mark {
  margin: 0;
  font-size: var(--big);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: var(--glow);
}
.mark a { display: inline-block; padding: 12px 0; margin: -12px 0; text-decoration: none; }
.scope { display: block; width: 100%; height: 28px; }
.tag { grid-column: 1 / -1; margin: 6px 0 0; color: var(--mid); }
.tag a { color: var(--accent); text-underline-offset: 3px; }

/* ---- submit a link: the button in the head, and the sheet it opens ---- */
/* amber, framed and lit: the one thing the page asks for (the SING key of the original) */
.text-btn.submit { min-height: 36px; margin: 4px 0; border-color: var(--amber); color: var(--amber); text-shadow: var(--glow-amber); box-shadow: 0 0 6px rgba(255, 179, 64, 0.35), inset 0 0 8px rgba(255, 179, 64, 0.12); }
.text-btn.submit:hover { border-color: var(--amber); box-shadow: 0 0 10px rgba(255, 179, 64, 0.55), inset 0 0 8px rgba(255, 179, 64, 0.18); }
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 100dvh;
  margin: auto 0 0;
  padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border: 0;
  border-top: 1px solid var(--accent);
  background: #000;
  color: var(--accent);
}
/* the sheet is amber throughout, like the key that opens it, whatever section is behind it */
.sheet {
  --accent: var(--amber);
  --mid: #c98a2c;
  --dim: var(--amber-dim);
  --frame: var(--amber-frame);
  --glow: var(--glow-amber);
  --halo: rgba(255, 179, 64, 0.7);
  --haze: rgba(255, 179, 64, 0.18);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.75); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; border-bottom: 1px solid var(--frame); }
.sheet-title { margin: 0; font-size: var(--big); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--white); text-shadow: var(--glow); }
.sheet-head .icon { min-width: 44px; min-height: 44px; font-size: 26px; line-height: 1; color: var(--white); }
.sheet-line { margin: 14px 0 0; color: var(--mid); }
.sheet-big { margin: 20px 0 0; font-size: var(--big); color: var(--white); text-shadow: var(--glow); }
/* the two ways in: 1, a line to hand your own agent; 2, the form */
.sheet-step { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: var(--small); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--white); }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--accent); border-radius: 50%; letter-spacing: 0; color: var(--accent); }
.sheet-way { margin-top: 16px; border-top: 1px solid var(--frame); }
.sheet-way .sheet-step { margin-top: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.agent-say { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 8px 8px 10px; border: 1px solid var(--dim); }
.agent-text { flex: 1; min-width: 0; margin: 0; font-size: var(--small); color: var(--accent); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.agent-say .text-btn { flex: none; min-width: 84px; min-height: 44px; padding: 0 14px; border-color: var(--accent); }
.field { display: block; margin-top: 14px; font-size: var(--small); letter-spacing: 0.16em; text-transform: uppercase; color: var(--white); }
.field .optional { letter-spacing: 0.04em; text-transform: none; color: var(--mid); }
.field input, .field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--dim);
  border-radius: 0;
  background: none;
  color: var(--white);
  font-size: var(--big);        /* 16px or more, or a phone zooms in when the field is tapped */
  letter-spacing: 0.035em;
  text-transform: none;
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 0; height: calc(1.45em + 17px); }
.field input::placeholder, .field textarea::placeholder { color: var(--mid); opacity: 1; }
.field input:focus-visible, .field textarea:focus-visible { outline: 0; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: #ff5d40; }   /* what is wrong is red, now that the sheet is amber */
.field-hint { margin: 6px 0 0; font-size: var(--small); color: var(--mid); }
/* out of sight and out of reach: only a bot fills it in */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sheet-status { flex: 1; min-width: 0; margin: 0; color: var(--white); }
.sheet-status.bad { color: #ff7a61; }
.sheet-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 16px; }
.sheet-keys .text-btn { min-height: 44px; padding: 0 18px; }
.sheet-keys .send { border-color: var(--accent); text-shadow: var(--glow); }
.sheet-keys .send:disabled { opacity: 0.5; cursor: default; }
.sheet-done:focus { outline: 0; }
@media (min-width: 600px) {
  .sheet { width: 440px; margin: auto; max-height: calc(100dvh - 48px); border: 1px solid var(--accent); }
}

/* the four sections: always in reach (it sticks to the top on a phone), spread across the column */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 var(--pad);
  background: #000;
  border-bottom: 1px solid var(--frame);
}
.tabs a {
  padding: 15px 0 13px;
  margin-bottom: -1px;
  border-bottom: 1px solid transparent;
  font-size: var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--mid);
}
/* the narrowest phones: the four still stand apart */
@media (max-width: 370px) { .tabs a { letter-spacing: 0.04em; } }
.tabs a:hover { color: var(--white); }
.tabs a[aria-current="page"] { color: var(--white); text-shadow: var(--glow); border-bottom-color: var(--accent); }
.count { font-size: var(--small); letter-spacing: 0.04em; text-shadow: none; color: var(--mid); }

/* the quiet switch: the order */
.sort { display: flex; flex-wrap: wrap; }
.seg {
  min-height: 44px;
  padding: 6px 10px;
  font-size: var(--small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
}
.seg[aria-pressed="true"] { color: var(--white); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }
.seg:hover { color: var(--white); }

/* the one search field: a hairline to type on, and a lens so it is not taken for a heading */
.find { position: relative; padding: 0 var(--pad); }
.find::before {
  content: "";
  position: absolute;
  left: var(--pad);
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: var(--mid);
  -webkit-mask: var(--lens) center / contain no-repeat;
  mask: var(--lens) center / contain no-repeat;
  pointer-events: none;
}
.find input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 0 0 24px;
  border: 0;
  border-bottom: 1px solid var(--frame);
  border-radius: 0;
  background: none;
  color: var(--white);
  font-size: var(--big);        /* 16px or more, or a phone zooms in when the field is tapped */
  -webkit-appearance: none;
  appearance: none;
}
.find input::placeholder { color: var(--mid); opacity: 1; font-size: var(--small); letter-spacing: 0.18em; text-transform: uppercase; }
.find input:hover { border-bottom-color: var(--dim); }
.find input:focus-visible { outline: 0; border-bottom-color: var(--accent); }
.find input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin: 0 2px 0 10px;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 46%, var(--accent) 46%, var(--accent) 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--accent) 46%, var(--accent) 54%, transparent 54%);
}
.more-rows { height: 1px; }

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 calc(var(--pad) - 10px) 0 var(--pad);
}
.group-head h2 {
  margin: 0;
  font-size: var(--small);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
}
/* a list in one piece (Tools, or any search): the tab above already names it */
.group.sole .group-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.group.sole .group-head { justify-content: flex-end; }
.note { margin: 0; padding: 24px var(--pad); color: var(--mid); }
/* an old address whose entry is no longer listed: one plain line above the list it lands on */
.note.gone { padding: 14px var(--pad); border-bottom: 1px solid var(--frame); }
.note.gone span { color: var(--white); }

/* ---- one entry ---- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  column-gap: 14px;
  padding: 12px var(--pad);
}
.row + .row { border-top: 1px solid var(--frame); }

.thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--frame);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; opacity: 0; transition: opacity 0.18s ease-out; }
.thumb img.in { opacity: 1; }                                /* shown only once it has loaded whole */
@media (prefers-reduced-motion: reduce) { .thumb img { transition: none; } }
.row.distinct .thumb { border-color: var(--dim); }
.emblem { width: 44px; height: 44px; overflow: visible; }
.emblem path { fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px var(--halo)); }
.row.out .emblem path { stroke: var(--mid); filter: none; }
/* amber is what is open or playing, whatever the section's colour */
.row[aria-current="true"] .emblem path, .dock .emblem path { stroke: var(--amber); filter: drop-shadow(0 0 2px rgba(255, 179, 64, 0.6)); }

/* Every row has a picture now (a screenshot or a repository's card): the same wide frame as Videos,
   16:10, the top of the page in view */
.list .row { grid-template-columns: 124px minmax(0, 1fr) auto; column-gap: 12px; }
.list .thumb { position: relative; width: 124px; height: auto; aspect-ratio: 16 / 10; }
.list .thumb img { position: absolute; inset: 0; object-position: 50% 0; }
.list .thumb .emblem { width: 40px; height: 40px; }
.list.tools .thumb img, .app.full .list.tools .thumb img { object-position: 0 50%; }   /* a repository's card reads from the left */

/* Videos: the row is built round a still, 16:9 whatever the picture's own shape, so nothing moves
   when a picture arrives. Where there is none the squiggle stands in the same frame. */
.videos .row { grid-template-columns: 124px minmax(0, 1fr) auto; column-gap: 12px; }
.videos .thumb { position: relative; width: 124px; height: auto; aspect-ratio: 16 / 9; }
.videos .thumb img { position: absolute; inset: 0; object-position: 50% 50%; }
.videos .thumb .emblem { width: 40px; height: 40px; }
.len {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 5px 1px;
  background: #000;
  font-size: var(--small);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--white);
}
.videos .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.videos .row.open .name { display: block; }
.videos .blurb { font-size: var(--small); letter-spacing: 0.06em; color: var(--mid); }
.videos .row.picked .blurb { font-size: var(--text); letter-spacing: inherit; color: var(--accent); }
.videos .tail { min-height: 0; justify-content: flex-end; }

.words { min-width: 0; }
.name {
  display: block;
  font-size: var(--big);
  line-height: 1.25;
  color: var(--white);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.name::after { content: ""; position: absolute; inset: 0; }      /* the whole row is the target */
.by { display: block; margin-top: 1px; color: var(--mid); }
.by a {
  position: relative;
  z-index: 1;
  padding: 6px 0;          /* inline, so a long maker line wraps like text; the padding only widens the target */
  color: var(--accent);
  text-decoration-color: var(--dim);
  text-underline-offset: 3px;
}
.by a:hover { text-decoration-color: var(--accent); }
.sent {                   /* a visitor sent it in: a small amber key, like Submit; opens the submit sheet */
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: -2px 0 -2px 2px;
  padding: 2px 6px 1px;    /* capitals sit high in the line: this centres them in the frame */
  border: 1px solid var(--amber);
  font-size: 0.82em;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: baseline;
  color: var(--amber);
  box-shadow: 0 0 4px rgba(255, 179, 64, 0.3);
}
/* a plus, drawn: what both amber keys do is add something */
.text-btn.submit::before, .sent::before {
  content: "";
  flex: none;
  width: 0.72em;
  height: 0.72em;
  background:
    linear-gradient(currentColor, currentColor) center / 100% var(--stroke, 1.5px) no-repeat,
    linear-gradient(currentColor, currentColor) center / var(--stroke, 1.5px) 100% no-repeat;
  filter: drop-shadow(0 0 2px rgba(255, 179, 64, 0.6));
}
.text-btn.submit::before { margin-right: 9px; }
.sent::before { --stroke: 1px; margin-top: -1px; }
.sent::after { content: ""; position: absolute; inset: -8px -4px; }   /* a bigger target than the key */
.sent-at { white-space: nowrap; }
.sent:hover { box-shadow: 0 0 8px rgba(255, 179, 64, 0.55); }
.when { white-space: nowrap; font-variant-numeric: tabular-nums; }   /* when it was posted: part of the maker line, never split */
.blurb {
  margin: 3px 0 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--accent);
}
.row.picked .blurb { display: block; }              /* a hand-written line is shown whole */
.row.open .blurb { display: block; }

.tail { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 4px; min-height: 56px; }
.kind { padding-top: 4px; font-size: var(--small); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mid); white-space: nowrap; }
.more {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 -12px -8px 0;
  color: var(--mid);
}
.more:hover { color: var(--white); }
.more svg { transition: transform 0.15s; }
.row.open .more svg { transform: rotate(180deg); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.row:hover .name { text-shadow: var(--glow); }
.row:hover .thumb { border-color: var(--dim); }
.row[aria-current="true"] { box-shadow: inset 2px 0 0 var(--amber); }
.row[aria-current="true"] .name { color: var(--amber); text-shadow: var(--glow-amber); }
.row[aria-current="true"] .thumb { border-color: var(--amber-dim); }

/* the opened entry: the picture, the full description, the links */
.detail { grid-column: 1 / -1; position: relative; z-index: 1; padding-top: 12px; }
.detail p { margin: 0 0 8px; }
.detail .shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 0; margin: 0 0 12px; border: 1px solid var(--frame); }
.detail .facts, .detail .caveat { color: var(--mid); }
.detail .install {
  display: block;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--frame);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--small);
  letter-spacing: 0;
  color: var(--white);
  overflow-wrap: anywhere;
  user-select: all;
}
.links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.links a { display: inline-block; padding: 10px 0; color: var(--white); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 4px; }
.links a:hover { text-decoration-color: var(--accent); }

.icon.full-key { display: none; }                         /* wide screens only */
.foot { padding: 28px var(--pad) 24px; font-size: var(--small); letter-spacing: 0.06em; color: var(--mid); }
.foot p { margin: 0; }

/* ---- shared controls ---- */
.icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); }
.icon:hover { color: var(--white); }
.icon svg.i { width: 22px; height: 22px; }
.icon.sound { color: var(--amber); }
.icon.sound svg.i { filter: drop-shadow(0 0 2px rgba(255, 179, 64, 0.6)); }
.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--dim);
  font-size: var(--small);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--white);
}
.text-btn:hover { border-color: var(--accent); }

/* ---- the player ---- */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "screen screen screen" "now now keys" "seek seek seek";
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #000;
  border-top: 1px solid var(--amber-dim);
}
.screen {
  grid-area: screen;
  position: relative;
  display: grid;
  place-items: center;
  height: min(34dvh, 100vw);
  border-bottom: 1px solid var(--amber-frame);
  overflow: hidden;
  cursor: pointer;
}
.screen .emblem { width: 40px; height: 40px; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.screen-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  margin: 0;
  text-align: center;
  font-size: var(--small);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.now { grid-area: now; min-width: 0; padding: 8px 0 8px var(--pad); }
.now-name {
  display: block;
  font-size: var(--big);
  line-height: 1.25;
  color: var(--amber);
  text-shadow: var(--glow-amber);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-by { display: block; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keys { grid-area: keys; display: flex; padding-right: 4px; }
.seek { grid-area: seek; display: flex; align-items: center; gap: 10px; padding: 0 var(--pad); }
.time { min-width: 4ch; font-size: var(--small); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--mid); }
.time:last-child { text-align: right; }

input[type="range"] { flex: 1; min-width: 0; height: 28px; margin: 0; background: none; accent-color: var(--amber); -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: linear-gradient(to right, var(--amber) var(--at, 0%), var(--amber-dim) var(--at, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -5px; border: 1px solid var(--amber); border-radius: 50%; background: #000; box-shadow: 0 0 6px rgba(255, 179, 64, 0.5); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--amber-dim); }
input[type="range"]::-moz-range-progress { height: 1px; background: var(--amber); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 1px solid var(--amber); border-radius: 50%; background: #000; }

/* what each kind of player shows */
.dock #show { grid-area: show; display: none; }
.dock[data-kind="audio"] .screen video, .dock[data-kind="stage"] .screen video { display: none; }
.dock[data-kind="video"] .screen .emblem { display: none; }
.dock[data-kind="audio"] #size, .dock[data-kind="stage"] #size { display: none; }

/* small: one row with a thumbnail-sized screen; the line along the top edge is the progress */
.dock[data-size="small"], .dock[data-kind="audio"], .dock[data-kind="stage"] { grid-template-areas: "screen now keys"; }
.dock[data-size="small"] .screen, .dock[data-kind="audio"] .screen, .dock[data-kind="stage"] .screen {
  width: 48px;
  height: 48px;
  margin: 8px 0 8px var(--pad);
  border: 1px solid var(--amber-frame);
}
.dock[data-size="small"] .now, .dock[data-kind="audio"] .now, .dock[data-kind="stage"] .now { padding-left: 12px; }
.dock[data-size="small"] .seek, .dock[data-size="small"] .screen-note { display: none; }
.dock[data-kind="audio"] .screen-note, .dock[data-kind="stage"] .screen-note { display: none; }
.dock[data-kind="audio"] { grid-template-areas: "screen now keys" "seek seek seek"; }
.dock[data-kind="audio"] .seek { padding-bottom: 6px; }
.dock[data-size="small"]:not([data-kind="stage"])::before, .dock[data-kind="audio"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: var(--at, 0%);
  height: 1px;
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 179, 64, 0.7);
}
.dock[data-kind="audio"]::before { display: none; }

/* an app left running on the stage: its name, a way back to it, a way to stop it */
.dock[data-kind="stage"] { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "screen now show keys"; }
.dock[data-kind="stage"] #show { display: inline-flex; }
.dock[data-kind="stage"] #play, .dock[data-kind="stage"] #next, .dock[data-kind="stage"] .seek { display: none; }
.app[data-view="stage"] .dock[data-kind="stage"] { display: none; }

/* ---- the stage: a full-screen layer on a phone ---- */
.stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: #000;
  visibility: hidden;        /* hidden, not removed: an app left running keeps sounding */
  pointer-events: none;
}
.app[data-view="stage"] .stage { visibility: visible; pointer-events: auto; }
.stage-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 6px 4px 8px;
  padding-top: calc(4px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--frame);
}
.stage-title { flex: 1; min-width: 0; padding: 0 8px; }
.stage-name, .stage-by { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* on a phone the buttons leave the name a third of the bar, so it may run to a second line */
.stage-name { color: var(--white); line-height: 1.25; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.stage-by { font-size: var(--small); letter-spacing: 0.06em; color: var(--mid); }
.stage-bar .close, .own .wide { display: none; }
.stage-bar .icon { width: 40px; }
/* a line between the bar and the app. "How to start this song" is the one a visitor must not
   miss: amber, the colour of sound, names it, and the words are the white of a title */
.stage-hint { flex: none; margin: 0; padding: 7px var(--pad); border-bottom: 1px solid var(--frame); color: var(--mid); }
.stage-hint.how { padding: 9px var(--pad) 10px; border-bottom-color: var(--amber-dim); color: var(--white); }
.hint-label { margin-right: 8px; font-size: var(--small); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; color: var(--amber); text-shadow: var(--glow-amber); }
.frame { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.frame::before { content: attr(data-wait); color: var(--mid); font-size: var(--small); letter-spacing: 0.2em; text-transform: uppercase; }
.frame[data-wait=""]::before { display: none; }
.frame > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.idle { display: none; }
/* a framed address that does not answer: said plainly, with the way to the maker's page */
.offline { position: relative; display: grid; justify-items: center; gap: 6px; max-width: 34em; padding: 24px var(--pad); text-align: center; }
.offline .emblem { width: 96px; height: 96px; margin-bottom: 14px; }
.offline .emblem path { stroke: var(--dim); filter: none; }
.offline p { margin: 0; }
.offline-line { font-size: var(--big); color: var(--white); }
.offline-more { color: var(--mid); }
.offline .links { justify-content: center; margin-top: 8px; }

.offline-line { overflow-wrap: anywhere; }
/* a post from X: X's own embed in a column that scrolls; the plain words stand in when it does not load */
.post { position: absolute; inset: 0; overflow-y: auto; display: grid; justify-items: center; align-content: start; align-content: safe center; padding: 12px var(--pad) 24px; }   /* in the middle when it fits, from the top when it is taller */
.post:has(.offline) { align-content: center; }
.tweet { width: 100%; max-width: 550px; }
/* a post from Bluesky or Mastodon: the same column, the site's own embed in a frame as tall as it says it is */
.post > iframe { display: block; width: 100%; max-width: 550px; border: 0; color-scheme: light; }   /* as for X below: no white behind its round corners */
.tweet > * { margin: 0 auto !important; }
.tweet iframe { color-scheme: light; }   /* the same scheme as X's own page inside, or the browser paints white behind its round corners */
/* X's script marks its frame visible itself, which would show it through the hidden stage over the list */
@media not all and (min-width: 900px) { .app:not([data-view="stage"]) .tweet iframe { visibility: hidden !important; } }

/* the picture that appears beside the list while pointing at an app (wide screens only) */
.peek { display: none; }

html.locked { overflow: hidden; }

/* ---- wide: the column becomes a sidebar, the stage sits beside it ---- */
@media (min-width: 900px) {
  html.locked { overflow: visible; }
  .app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100dvh; }
  .side { display: flex; flex-direction: column; min-height: 0; padding-bottom: 0; border-right: 1px solid var(--frame); }
  .head, .tabs, .find, .foot, .dock { flex: none; }
  .head { padding-top: 22px; }
  .tabs { position: static; }
  .seg { min-height: 32px; }
  .find input { height: 34px; font-size: var(--text); }
  .post { padding-top: 24px; }
  .group-head { min-height: 32px; margin-top: 14px; }
  .more { width: 36px; height: 32px; margin: 0 -8px 0 0; }
  .links a { padding: 5px 0; }
  .list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--frame) transparent; padding-bottom: 16px; }
  .foot { padding: 10px var(--pad); border-top: 1px solid var(--frame); }

  .dock { position: relative; grid-template-areas: "now now keys" "seek seek seek"; padding-top: 4px; }
  /* big: a video takes the stage */
  .dock[data-size="big"][data-kind="video"] .screen {
    position: fixed;
    left: calc(var(--side) + 1px);
    top: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
    z-index: 10;
    background: #000;
  }
  .dock[data-size="big"] .screen-note { bottom: 28px; }
  .dock[data-size="small"] { grid-template-areas: "screen now keys" "seek seek seek"; }
  .dock[data-size="small"] .seek { display: flex; }
  .dock[data-size="small"] .screen { width: 72px; height: 72px; }
  .dock[data-size="small"]::before, .dock[data-size="small"]:not([data-kind="stage"])::before { display: none; }
  .dock[data-kind="stage"] { display: none; }
  .seek { padding-bottom: 6px; }

  .stage { position: relative; inset: auto; z-index: auto; visibility: visible; pointer-events: auto; min-width: 0; }
  .stage-bar { min-height: 48px; padding: 4px 8px 4px var(--pad); gap: 4px; }
  .stage-title { padding: 0 12px 0 0; display: flex; align-items: baseline; gap: 12px; }
  .stage-name { font-size: var(--big); display: block; white-space: nowrap; overflow-wrap: normal; }
  .stage-by { font-size: var(--text); letter-spacing: inherit; }
  .stage-bar .back { display: none; }
  .stage-bar .close { display: grid; }
  .own .wide { display: inline; }
  .own { margin: 0 4px; }

  .idle { flex: 1; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; }
  .stage.on .idle { display: none; }
  .side:has(.dock:not([hidden])) ~ .stage .idle-line { visibility: hidden; }   /* something is already playing */
  .stage:not(.on) .frame { display: none; }
  /* the head: turns by itself, spins when dragged, sings when tapped */
  .idle-head { width: 260px; height: 260px; margin-bottom: 8px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
  .idle-head:active { cursor: grabbing; }
  .idle-line { margin: 0; font-size: var(--big); color: var(--white); }
  .idle-keys { margin: 0; font-size: var(--small); letter-spacing: 0.12em; color: var(--mid); }

  /* the full-screen list: the key beside the search, and the list as a grid of cards across the window */
  .find { display: flex; align-items: center; gap: 4px; }
  .find input { flex: 1; min-width: 0; }
  .icon.full-key { display: grid; flex: none; width: 34px; height: 34px; margin-right: -6px; color: var(--mid); }
  .app.full .full-key { display: none; }                  /* already full screen */
  .full-key:hover { color: var(--white); }
  .full-key svg.i { width: 18px; height: 18px; }
  .app.full { grid-template-columns: minmax(0, 1fr); }
  .app.full .stage { display: none; }               /* the head stops turning when it is out of view */
  .app.full .side { border-right: 0; }
  /* the head as on a phone: the mark, a longer trace and Submit at the far right; the line under the mark */
  .app.full .scope { max-width: 1400px; }
  .app.full .tabs { justify-content: flex-start; gap: 48px; }
  /* one grid for every group: the original is the first card, the order switch sits above it on the right */
  .app.full .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 18px; align-content: start; padding: 0 var(--pad) 16px; }
  .app.full .group, .app.full .rows { display: contents; }
  .app.full .list > .note, .app.full .group-head, .app.full .more-rows { grid-column: 1 / -1; }
  .app.full .list > .note { padding-left: 0; padding-right: 0; }
  .app.full .note.gone { order: -3; }
  .app.full .group-head { order: -2; justify-content: flex-end; margin: 14px -10px -8px 0; padding: 0; }
  .app.full .group-head h2, .app.full .group.pinned .group-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app.full .more-rows { order: 1; }
  .app.full .row.picked .thumb { position: relative; }
  .app.full .row.picked .thumb::after { content: "Original"; position: absolute; left: 0; top: 0; padding: 1px 7px 2px; background: #000; font-size: var(--small); letter-spacing: 0.2em; text-transform: uppercase; color: var(--mid); }
  .app.full .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; row-gap: 8px; column-gap: 6px; padding: 0; }
  .app.full .row + .row { border-top: 0; }
  .app.full .row[aria-current="true"] { box-shadow: none; }
  .app.full .thumb, .app.full .videos .thumb { grid-column: 1 / -1; width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .app.full .videos .thumb { aspect-ratio: 16 / 9; }
  .app.full .row[aria-current="true"] .thumb { border-color: var(--amber); box-shadow: 0 0 8px rgba(255, 179, 64, 0.35); }
  .app.full .thumb .emblem { width: 64px; height: 64px; }
  .app.full .thumb img { object-position: 50% 0; }
  .app.full .videos .thumb img { object-position: 50% 50%; }
  .app.full .name, .app.full .videos .name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--text); }
  .app.full .row.open .name { display: block; }
  .app.full .by { font-size: var(--small); letter-spacing: 0.06em; }
  .app.full .blurb, .app.full .row.picked .blurb { display: -webkit-box; -webkit-line-clamp: 1; font-size: var(--small); letter-spacing: 0.06em; color: var(--mid); }
  .app.full .row.open .blurb { display: block; }
  .app.full .tail { min-height: 0; justify-content: flex-start; }
  .app.full .kind { padding-top: 2px; }
  .app.full .more { margin: -6px -8px 0 0; }

  .peek {
    position: fixed;
    left: calc(var(--side) + 14px);
    z-index: 40;
    display: block;
    width: 380px;
    border: 1px solid var(--dim);
    background: #000;
    box-shadow: 0 0 28px var(--haze);
    pointer-events: none;
  }
  .peek img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
  .peek p { margin: 0; padding: 7px 10px 8px; font-size: var(--small); letter-spacing: 0.06em; color: var(--mid); border-top: 1px solid var(--frame); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
