/* The programs site: pixels, the eighties and a neon evening.
 *
 * Borders and shadows are drawn as steps (box-shadow without blur) — this way rounding
 * looks pixelated, like in old games, and not smooth, like in a browser.
 * The colors are the same ones given to the cat as its palette in cat.js: it must feel at home here. */

/* ---- How to read a CSS file ----
   CSS says how the page LOOKS. It is the same idea as a JavaFX .css file: a "selector" says WHICH
   elements, and inside { } there are "properties" (name: value;) that say HOW they look.
   JavaFX writes -fx-background-color; the web writes just background-color.
     .item      the elements with class="item"   (like a JavaFX styleClass "item")
     #page      the element with id="page"       (like setId("page"))
     nav        all <nav> elements, by tag name
     .a .b      a .b element somewhere INSIDE an .a element
     .a.b       one element that has BOTH classes
     a, b       the same rules for a and for b
     :hover     only while the mouse is over it  (the same pseudo-class as in JavaFX)
   If two rules set the same property, the more exact selector wins; if they are equally exact,
   the one lower in the file wins.

   ---- @font-face: our own fonts ----
   A font file that comes with the site. font-family gives it a name; after that any rule can
   use the name, e.g. font-family: 'Press Start 2P'. Press Start 2P is the blocky arcade font
   used for titles. */
@font-face {
  font-family: 'Press Start 2P';
  /* url(...) is the path of the file, from this CSS file's folder; format() tells its type */
  src: url('fonts/PressStart2P.ttf') format('truetype');
  /* swap = show the text at once in a normal font, and switch to this one when its file arrives
     (otherwise the text would be invisible while the font downloads) */
  font-display: swap;
}

@font-face {
  /* Pixelify Sans: the pixel font for normal text */
  font-family: 'Pixelify Sans';
  src: url('fonts/PixelifySans.ttf') format('truetype');
  /* one file holds all weights from 400 (normal) to 700 (bold): a "variable" font */
  font-weight: 400 700;
  font-display: swap;
}

/* Chinese and Japanese use Fusion Pixel 12px (OFL, licenses in fonts/licenses).
 * unicode-range is on purpose: the browser downloads the font only when the page has
 * Chinese characters or kana, so a visitor reading Russian or English doesn't load it */
@font-face {
  font-family: 'Fusion Pixel ZH';
  src: url('fonts/FusionPixel-zh.woff2') format('woff2');
  /* U+4E00-9FFF and so on are ranges of character numbers (Unicode code points, written in
     hexadecimal): Chinese characters, kana, and full-width punctuation */
  unicode-range: U+2E80-2FDF, U+3000-30FF, U+3100-312F, U+31A0-31FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
  font-display: swap;
}

@font-face {
  font-family: 'Fusion Pixel JA';
  src: url('fonts/FusionPixel-ja.woff2') format('woff2');
  unicode-range: U+2E80-2FDF, U+3000-30FF, U+3100-312F, U+31A0-31FF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF00-FFEF;
  font-display: swap;
}

/* ---- :root and var(--x): CSS variables ----
   :root is the <html> element. Properties whose names start with -- are our own variables
   ("custom properties"). Anywhere below, var(--pink) means "the value of --pink". Change a
   color here, and it changes everywhere. (JavaFX CSS has "looked-up colors" for the same idea.)
   Colors like #140c2b are hexadecimal: 14 = red, 0c = green, 2b = blue (each from 00 to ff). */
:root {
  /* the darkest color: the night sky behind everything */
  --back: #140c2b;
  /* the background of panels and buttons */
  --panel: #231546;
  /* a bit lighter: panels under the mouse */
  --field: #2d1d57;
  /* the color of the pixel borders */
  --line: #3d2a72;
  /* the main text color, almost white */
  --ink: #f6eeff;
  /* a quiet grey-violet for less important text */
  --dim: #a493c9;
  /* the accent colors: pink, cyan, yellow; green and red for good and bad news */
  --pink: #ff5fa2;
  --pink-light: #ff9cc6;
  --cyan: #4de1ff;
  --yellow: #ffd84d;
  --green: #7dff9b;
  --red: #ff6b6b;
  /* the size of one "big pixel" of the borders */
  --px: 4px;
  /* The font lists: if the first font is not there (or has no such letter), the next one is used.
     monospace / sans-serif at the end mean "any font of this kind the computer has". */
  --title: 'Press Start 2P', monospace;
  --text: 'Pixelify Sans', 'Consolas', monospace;
}

/* Latin pixel fonts have no Chinese characters: they get their own pixel font.
 * It is drawn on a 12-pixel grid, so sizes are multiples of 12, otherwise the pixels blur */
/* ---- :lang() ----
   html:lang(zh) means "the <html> element when its lang attribute is zh". app.js changes that
   attribute when the visitor picks a language, so these rules switch on and off by themselves.
   Here we only redefine the two font variables; every rule that uses var(--text) follows. */
html:lang(zh) {
  --title: 'Press Start 2P', 'Fusion Pixel ZH', monospace;
  --text: 'Pixelify Sans', 'Fusion Pixel ZH', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

html:lang(ja) {
  --title: 'Press Start 2P', 'Fusion Pixel JA', monospace;
  --text: 'Pixelify Sans', 'Fusion Pixel JA', 'Yu Gothic', 'Hiragino Sans', sans-serif;
}

/* Bigger text for Chinese and Japanese: 12, 24 and 36 px are multiples of the font's 12 px grid. */
html:lang(zh) body,
html:lang(ja) body {
  font-size: 24px;
  /* line-height 1.6 = each line takes 1.6 times the font size */
  line-height: 1.6;
}

html:lang(zh) .page h1,
html:lang(ja) .page h1 {
  font-size: 36px;
}

/* Small captions in Chinese and Japanese: 12 px, the smallest sharp size */
html:lang(zh) .item-tag,
html:lang(ja) .item-tag,
html:lang(zh) .card-tag,
html:lang(ja) .card-tag,
html:lang(zh) .facts li,
html:lang(ja) .facts li,
html:lang(zh) .release,
html:lang(ja) .release,
html:lang(zh) .menu-foot,
html:lang(ja) .menu-foot {
  font-size: 12px;
}

/* the download heading and the buttons */
html:lang(zh) .get h2,
html:lang(ja) .get h2,
html:lang(zh) .btn,
html:lang(ja) .btn {
  font-size: 12px;
}

/* the colored line under a title, and the cat's bubble */
html:lang(zh) .page .tagline,
html:lang(ja) .page .tagline,
html:lang(zh) .bubble,
html:lang(ja) .bubble {
  font-size: 24px;
}

/* Russian captions in release notes keep the Russian font in other languages too */
/* a <pre> element with lang="ru" (app.js marks the release notes so) */
pre:lang(ru) {
  font-family: 'Pixelify Sans', monospace;
}

/* The star selector means EVERY element. box-sizing: border-box makes width and height include
   the padding and the border (the way JavaFX sizes nodes); the old web default adds them on top,
   which makes sizes hard to count. */
* {
  box-sizing: border-box;
}

/* Browsers give <body> a margin of 8 px by default: remove it. height: 100% lets the page
   fill the whole window height. */
html,
body {
  margin: 0;
  height: 100%;
}

/* ---- body: the whole page ----
   Properties set on body are "inherited" by everything inside it (text color, font...), unless
   a rule for an inner element says otherwise. */
body {
  background-color: var(--back);
  /* a starry sky made of pixels: several layers of dots with different spacing */
  /* Five background layers, the first one on top. radial-gradient(1px 1px at 20px 30px, ...) draws
     a tiny round dot at x 20, y 30: color #fff8 (white, 8 = half see-through) up to 50%, then
     transparent. The last layer, linear-gradient, is the sky: dark violet from top to bottom.
     (Now stars.js also draws twinkling stars on a canvas over this static sky.) */
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 110px 80px, #ff9cc699 50%, transparent 51%),
    radial-gradient(2px 2px at 170px 150px, #4de1ff66 50%, transparent 51%),
    radial-gradient(1px 1px at 60px 190px, #fff6 50%, transparent 51%),
    linear-gradient(180deg, #140c2b 0%, #1d1040 60%, #2a1250 100%);
  /* the size of one tile of each layer, in the same order. The tiles repeat over the page, and
     because the sizes differ (210, 230, 260, 190), the dots don't form a visible pattern */
  background-size: 210px 210px, 230px 230px, 260px 260px, 190px 190px, 100% 100%;
  /* fixed: the sky stays still while the page scrolls */
  background-attachment: fixed;
  /* the text color for the whole page */
  color: var(--ink);
  /* the text font (a variable: different for Chinese and Japanese, and for the font button) */
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.55;
  /* ---- image-rendering: pixelated ----
     When a small picture is shown bigger, browsers normally blur it. pixelated keeps every pixel
     as a sharp square — what pixel art needs. */
  image-rendering: pixelated;
}

/* Light scan lines like on a CRT. They live BEHIND the content (z-index 0, the page is 1):
   on the starry background they look retro, but they never run across text, screenshots
   or the cat's speech bubble — over those they made reading hard */
/* the <div class="scanlines"> from index.html */
.scanlines {
  /* pointer-events: none — the mouse "goes through" this element, so it never blocks a click */
  pointer-events: none;
  /* ---- position: fixed ----
     The element is placed relative to the WINDOW, not the page, and doesn't move when you
     scroll — like a node on a top StackPane layer that ignores the ScrollPane.
     inset: 0 is short for top: 0; right: 0; bottom: 0; left: 0 — so it covers the whole window. */
  position: fixed;
  inset: 0;
  /* A repeating stripe pattern, from top to bottom (180deg): 2 px transparent (#0000), then 1 px
     of black at 15% (#00000026; 26 in hex = 38 of 255). Then it repeats every 3 px. */
  background: repeating-linear-gradient(180deg, #0000 0 2px, #00000026 2px 3px);
  /* z-index decides what lies on top when elements overlap: a bigger number is closer to you
     (like toFront()/toBack() in JavaFX). It works on positioned elements (fixed, relative, ...). */
  z-index: 0;
}

/* pixel border: four steps of shadow instead of border-radius */
/* ---- the pixel border trick ----
   box-shadow paints a copy of the element's box shape, moved by x and y:
     box-shadow: x y blur spread color
   With blur 0 the copy has hard edges. Four copies moved up, down, left and right by 4 px make a
   border around the box whose CORNERS stay empty — so it looks like a pixel-art rounded corner.
   A fifth, darker copy moved down is a hard pixel shadow. Many rules below repeat this trick
   with fixed 4 px values. (.px-box itself is a ready-made class; the HTML does not use it now.) */
.px-box {
  background: var(--panel);
  /* Five shadows, separated by commas: up, down, left, right, and the dark one.
     calc() does math with CSS values: calc(-1 * var(--px)) is -4px (up).
     The last one: 8 px down, black with 40% opacity (#0006). */
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--line),
    0 var(--px) 0 0 var(--line),
    calc(-1 * var(--px)) 0 0 0 var(--line),
    var(--px) 0 0 0 var(--line),
    0 calc(2 * var(--px)) 0 0 #0006;
}

/* ---- .screen: the two-column layout ----
   position: relative + z-index: 1 put it above the stars and scan lines.
   ---- grid ----
   display: grid makes the element a grid, like a JavaFX GridPane.
   grid-template-columns: 280px 1fr = the first column is 280 px wide (the menu), the second takes
   the rest ("1fr" = one share of the free space). gap is the space between the cells. */
.screen {
  position: relative;
  z-index: 1;              /* above the scan lines */
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  /* at least as tall as the window */
  min-height: 100%;
  /* padding is the space INSIDE the element, between its edge and its content */
  padding: 28px;
  /* on a very wide screen the layout stops growing at 1240 px... */
  max-width: 1240px;
  /* ...and margin: 0 auto centres it. margin is the space OUTSIDE the element; "auto" on the
     left and right shares the free space equally. (0 = top and bottom, auto = left and right.) */
  margin: 0 auto;
}

/* ------------------------------------------------------------------ menu */

/* ---- position: sticky ----
   The menu scrolls with the page until it reaches 28 px from the top of the window, then it
   "sticks" there while the long page scrolls on. */
.menu {
  position: sticky;
  top: 28px;
  /* start: the menu is only as tall as its content (a grid cell would stretch it to the full row) */
  align-self: start;
  /* ---- flex ----
     display: flex lines the children up in one row or column, like a JavaFX HBox / VBox.
     flex-direction: column makes it a column (VBox); gap is the spacing between the children. */
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* the logo link: the N square and the word NEURO side by side (a row, like an HBox) */
.logo {
  display: flex;
  /* align-items: center — the children are centred vertically in the row */
  align-items: center;
  gap: 14px;
  color: var(--ink);
  /* links are underlined by default: no underline here */
  text-decoration: none;
  /* three values: 6px top, 4px left and right, 10px bottom */
  padding: 6px 4px 10px;
}

/* the pink square with the letter N */
.logo-mark {
  /* display: grid + place-items: center is the shortest way to centre one child in both directions
     (like a StackPane) */
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-family: var(--title);
  font-size: 26px;
  color: var(--back);
  background: var(--pink);
  /* The pixel border in the same pink (so the square looks bigger with cut corners), and an
     8 px cyan "shadow" down and right: a neon double. */
  box-shadow:
    0 -4px 0 0 var(--pink),
    0 4px 0 0 var(--pink),
    -4px 0 0 0 var(--pink),
    4px 0 0 0 var(--pink),
    8px 8px 0 0 var(--cyan);
}

/* the word NEURO */
.logo-text {
  font-family: var(--title);
  font-size: 15px;
  line-height: 1.5;
  /* letter-spacing adds space between letters */
  letter-spacing: 2px;
  /* text-shadow: x y blur color — a pink copy of the letters 3 px down and right, no blur */
  text-shadow: 3px 3px 0 var(--pink);
}

/* the small word under NEURO ("programs") */
.logo-text small {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--dim);
  text-shadow: none;
}

/* The ☰ button is for phones only (the @media block for narrow screens shows it) */
.menu-toggle {
  display: none;
}

/* ---- display: contents ----
   On a computer the folding wrapper must not change anything: display: contents makes the box
   itself vanish from the layout, and its children sit in .menu as if there were no wrapper
   (so the 18 px gap of the menu column still works between them). */
.menu-panel {
  display: contents;
}

/* the menu list: one button under another, 12 px apart */
nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---- .item: one program in the menu ----
   It is a <button>, and buttons come with the browser's own look: border: 0, font: inherit and
   color reset that, so it looks like the rest of our page. */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  /* the full width of the menu */
  width: 100%;
  padding: 12px 14px;
  border: 0;
  color: var(--ink);
  /* buttons centre their text by default; ours is left-aligned */
  text-align: left;
  /* font: inherit = take all font settings from the parent (buttons don't do it by themselves) */
  font: inherit;
  /* cursor: pointer shows the "hand" mouse cursor, so it is clear you can click */
  cursor: pointer;
  background: var(--panel);
  box-shadow:
    0 -4px 0 0 var(--line),
    0 4px 0 0 var(--line),
    -4px 0 0 0 var(--line),
    4px 0 0 0 var(--line);
  /* ---- transition ----
     When transform or background change (for example on :hover), they change smoothly over
     0.08 seconds instead of jumping. steps(2) makes it happen in 2 jumps, not smoothly — the
     "choppy" retro movement of old games. */
  transition: transform 0.08s steps(2), background 0.08s steps(2);
}

/* while the mouse is over a menu line */
.item:hover {
  background: var(--field);
  /* transform moves (or turns, or scales) an element without changing the layout around it
     (like setTranslateX in JavaFX). translateX(4px) = 4 px to the right. */
  transform: translateX(4px);
}

/* :focus-visible = the element has the keyboard focus AND the visitor uses the keyboard (Tab).
   Then we draw a dashed cyan frame 6 px around it, so keyboard users see where they are.
   (A mouse click doesn't show it.) */
.item:focus-visible {
  outline: 4px dashed var(--cyan);
  outline-offset: 6px;
}

/* the menu line of the open program (app.js gives it the class "active"): pink, with the cyan
   shadow, and lifted 2 px up and left */
.item.active {
  background: var(--pink);
  color: var(--back);
  box-shadow:
    0 -4px 0 0 var(--pink),
    0 4px 0 0 var(--pink),
    -4px 0 0 0 var(--pink),
    4px 0 0 0 var(--pink),
    8px 8px 0 0 var(--cyan);
  transform: translate(-2px, -2px);
}

/* the little dark square with the program's icon */
.item-icon {
  display: grid;
  place-items: center;
  /* flex: none — in a flex row, this child keeps its size and never shrinks or grows
     (like HBox.setHgrow(node, Priority.NEVER) plus a fixed min size) */
  flex: none;
  width: 34px;
  height: 34px;
  font-size: 20px;
  background: var(--back);
  color: var(--cyan);
}

/* the icon in the active (pink) line */
.item.active .item-icon {
  color: var(--pink);
}

/* the name and the short description, one under the other */
.item-text {
  display: flex;
  flex-direction: column;
  /* min-width: 0 allows this flex child to become narrower than its text, so the "..." cut in
     .item-tag below can work (by default a flex child is never narrower than its content) */
  min-width: 0;
}

/* the program's name in the menu */
.item-name {
  font-family: var(--title);
  font-size: 11px;
  letter-spacing: 1px;
}

/* the short description under the name */
.item-tag {
  font-size: 15px;
  color: var(--dim);
  /* One line only (nowrap); the part that doesn't fit is hidden (overflow: hidden) and replaced
     by "…" (text-overflow: ellipsis) — like a JavaFX Label that is too narrow. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* dark violet text on the pink background of the active line */
.item.active .item-tag {
  color: #3a1030;
}

/* language switch: small pixel keys under the menu */
/* the row of language buttons. flex-wrap: wrap lets them go on a second line when there is no
   room (like a JavaFX FlowPane) */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  /* three values: 6px top, 4px left and right, 0 bottom */
  margin: 6px 4px 0;
}

/* one language button (RU, EN, ...) */
.lang {
  min-width: 42px;
  padding: 6px 8px;
  border: 0;
  font-family: var(--title);
  font-size: 9px;
  color: var(--dim);
  cursor: pointer;
  background: var(--panel);
  /* the pixel border, 3 px this time (written in one line) */
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line);
}

/* the buttons 中文 and 日本 (app.js gives each button its own lang): the pixel font needs 12 px */
.lang:lang(zh),
.lang:lang(ja) {
  font-size: 12px;
}

.lang:hover {
  color: var(--ink);
  background: var(--field);
}

.lang:focus-visible {
  outline: 3px dashed var(--cyan);
  outline-offset: 5px;
}

/* the button of the current language: cyan */
.lang.active {
  color: var(--back);
  background: var(--cyan);
  box-shadow: 0 -3px 0 0 var(--cyan), 0 3px 0 0 var(--cyan), -3px 0 0 0 var(--cyan), 3px 0 0 0 var(--cyan);
}

/* the author's email: looks like a link, and a click copies the address */
/* A <button> that should look like a link: no padding, no border, no background. */
.mail {
  padding: 0;
  border: 0;
  font: inherit;
  color: var(--cyan);
  /* a dotted underline, 3 px below the text */
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  /* cursor: copy shows the "copy" mouse cursor (an arrow with a small plus) */
  cursor: copy;
  background: none;
}

.mail:hover {
  color: var(--pink-light);
}

/* for 2 seconds after the copy ("Copied!"): green, no underline */
.mail.done {
  color: var(--green);
  text-decoration: none;
}

/* the small text at the bottom of the menu */
.menu-foot {
  margin: 8px 4px 0;
  font-size: 14px;
  color: var(--dim);
}

/* ------------------------------------------------------------------ page */

/* ---- .page: the big panel in the middle (<main id="page">) ----
   Its padding is big at the bottom (160px) so the cat in the corner never covers the last line. */
.page {
  padding: 34px 38px 160px;
  min-height: 480px;
  /* no focus frame: the page gets focus from scripts only (tabindex="-1"), the frame would only disturb */
  outline: none;
  /* the panel color with "e6" at the end: 8-digit hex colors have alpha (opacity) as the last
     pair; e6 = 230 of 255, so 90% solid — the stars shine through a little */
  background: #231546e6;
  box-shadow:
    0 -4px 0 0 var(--line),
    0 4px 0 0 var(--line),
    -4px 0 0 0 var(--line),
    4px 0 0 0 var(--line),
    0 12px 0 0 #0005;
  /* ---- animation and @keyframes ----
     animation: appear 0.25s steps(4) plays the keyframes named "appear" (just below) once, in
     0.25 seconds, in 4 jumps. app.js restarts it every time a new page is shown. */
  animation: appear 0.25s steps(4);
}

/* @keyframes describes an animation. "from" is the start: invisible (opacity 0) and 8 px lower.
   There is no "to": then the end is simply the element's normal look. So the page rises and
   appears. (Like a JavaFX FadeTransition + TranslateTransition.) */
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* the big title of a page */
.page h1 {
  margin: 0 0 6px;
  font-family: var(--title);
  /* ---- clamp() ----
     clamp(20px, 3vw, 30px) = 3vw, but never less than 20px and never more than 30px.
     vw is a "viewport width" unit: 1vw = 1% of the window width. So the title grows with the
     window, within limits. */
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.35;
  letter-spacing: 2px;
  color: var(--ink);
  /* the pink pixel "shadow" of the letters, 4 px down and right */
  text-shadow: 4px 4px 0 var(--pink);
}

/* the cyan line under the title */
.page .tagline {
  margin: 0 0 26px;
  font-size: 20px;
  color: var(--cyan);
}

/* the paragraphs of a page */
.page p {
  margin: 0 0 16px;
  /* 62ch: "ch" is the width of the character "0", so a line holds about 62 characters —
     long lines are tiring to read */
  max-width: 62ch;
}

/* the list of yellow labels (<ul class="facts">): in a row that wraps */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 6px;
  /* a <ul> list has a left padding and dots by default: we remove both */
  padding: 0;
  list-style: none;
}

/* one label: yellow text on the dark background with a 3 px pixel border */
.facts li {
  padding: 3px 10px;
  font-size: 15px;
  color: var(--yellow);
  background: var(--back);
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line);
}

/* "Requires git..." and the gallery hint: quieter text */
.needs {
  color: var(--dim);
  font-size: 16px;
}

/* the screenshot of a program */
.shot {
  /* An <img> is "inline" by default (it sits in a line of text, with a small gap under it);
     display: block makes it a normal box. max-width: 100% shrinks it on narrow screens. */
  display: block;
  max-width: 100%;
  margin: 26px 0 8px;
  background: var(--back);
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), 10px 10px 0 0 #0006;
  /* auto = normal smooth scaling: screenshots are not pixel art (body has "pixelated") */
  image-rendering: auto;
}

/* ------------------------------------------------------------------ downloads */

/* the download part of a program page */
.get {
  margin-top: 30px;
}

/* the heading "Download · version 1.4.0" */
.get h2 {
  margin: 0 0 14px;
  font-family: var(--title);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--pink-light);
}

/* the row of download buttons; it wraps on narrow screens */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* ---- .btn: the yellow pixel buttons (they are <a> links that look like buttons) ----
   inline-flex: the button sits in a line like text, but its children are laid out as a flex row. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0;
  font-family: var(--title);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--back);
  background: var(--yellow);
  text-decoration: none;
  cursor: pointer;
  /* the yellow pixel border and a dark shadow 6 px right and 8 px down */
  box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 6px 8px 0 0 #000a;
}

/* under the mouse: a lighter yellow */
.btn:hover {
  background: #fff1a6;
  box-shadow: 0 -4px 0 0 #fff1a6, 0 4px 0 0 #fff1a6, -4px 0 0 0 #fff1a6, 4px 0 0 0 #fff1a6, 6px 8px 0 0 #000a;
}

/* :active = while the mouse button is held down on it. The button moves 4 px down and right and
   loses its shadow, so it looks "pressed into" the page */
.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow);
}

/* the pink "Open" button of programs that run in the browser */
.btn.open {
  background: var(--pink);
  box-shadow: 0 -4px 0 0 var(--pink), 0 4px 0 0 var(--pink), -4px 0 0 0 var(--pink), 4px 0 0 0 var(--pink), 6px 8px 0 0 #000a;
}

/* a <small> text inside a button (in a quieter font) */
.btn small {
  font-family: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  /* opacity: 0.75 = 75% visible */
  opacity: 0.75;
}

/* "Published 01.11.2026." and the release notes under the buttons */
.release {
  margin-top: 14px;
  font-size: 15px;
  color: var(--dim);
}

/* the release notes. A <pre> keeps all line breaks and spaces; pre-wrap also wraps long lines.
   max-height + overflow: auto: when the notes are longer than 220 px, a scroll bar appears
   (like a ScrollPane). */
.release pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 8px 0 0;
  padding: 10px 14px;
  max-height: 220px;
  overflow: auto;
  background: var(--back);
}

/* "A build will appear here soon." and other "nothing here" messages */
.empty {
  color: var(--dim);
}

/* ------------------------------------------------------------------ home page */

/* ---- the card grid on the home page ----
   repeat(auto-fill, minmax(200px, 1fr)) = "as many columns as fit, each at least 200 px wide,
   and share the rest of the width equally". So there are 3 columns on a wide screen and 1 on a
   phone — without any @media rule. */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  margin-top: 30px;
}

/* one card: a <button>, made to look like a dark tile */
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 0;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--back);
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line);
  transition: transform 0.08s steps(2);
}

/* under the mouse it jumps up-left and gets a cyan border and a pink shadow */
.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 0 -4px 0 0 var(--cyan), 0 4px 0 0 var(--cyan), -4px 0 0 0 var(--cyan), 4px 0 0 0 var(--cyan), 7px 7px 0 0 var(--pink);
}

/* the big icon of a card */
.card-icon {
  font-size: 26px;
  color: var(--cyan);
}

.card-name {
  font-family: var(--title);
  font-size: 11px;
}

.card-tag {
  font-size: 15px;
  color: var(--dim);
}

/* the blinking "_" after "Hello" on the home page */
.blink {
  /* blink for 1 second, again and again (infinite); steps(1) = jump, no smooth fade */
  animation: blink 1s steps(1) infinite;
}

/* at the middle (50%) of each second the element is invisible; at 0% and 100% it is normal.
   The PRESS START title reuses these keyframes. */
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ------------------------------------------------------------------ the cat */

/* ---- the cat in the bottom right corner ----
   position: fixed keeps it in the corner of the WINDOW while the page scrolls.
   It is a column (flex) of: the bubble, the cat, its name; align-items: flex-end puts them on the
   right edge. pointer-events: none lets clicks go through the empty parts of this box... */
.cat {
  position: fixed;
  right: 26px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

/* ...and pointer-events: auto turns clicks back on for the cat itself (a <button>) */
.cat-body {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  /* filter: drop-shadow draws a shadow that follows the SHAPE of the picture (the cat), not
     its rectangle; 4 px right and down, no blur — a pixel shadow (like a JavaFX DropShadow effect) */
  filter: drop-shadow(4px 4px 0 #0008);
}

/* the cat jumps up 4 px under the mouse */
.cat-body:hover {
  transform: translateY(-4px);
}

.cat-body:focus-visible {
  outline: 4px dashed var(--cyan);
  outline-offset: 4px;
}

/* the <canvas> with the cat: display: block removes the small gap under it; pixelated keeps it sharp */
.cat canvas {
  display: block;
  image-rendering: pixelated;
}

/* the cat's name under it */
.cat-name {
  margin-top: 4px;
  font-family: var(--title);
  font-size: 8px;
  color: var(--dim);
  letter-spacing: 1px;
}

/* a phrase is a pixel speech bubble with a tail pointing to the cat */
/* ---- the speech bubble ----
   position: relative lets its ::after tail be placed relative to the bubble.
   It starts invisible (opacity 0) and 6 px lower; cat.js adds the class "show" to make it appear. */
.bubble {
  position: relative;
  max-width: 300px;
  min-height: 0;
  margin: 0 22px 18px 0;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--back);
  background: var(--ink);
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 6px 8px 0 0 #0008;
  opacity: 0;
  transform: translateY(6px);
  /* opacity and transform change in 3 jumps over 0.15 s when the class "show" comes or goes */
  transition: opacity 0.15s steps(3), transform 0.15s steps(3);
}

/* ---- ::after: the tail of the bubble ----
   ::after is an extra, invisible-by-default "element" that CSS adds at the end of an element.
   content: '' makes it exist (empty). position: absolute places it exactly, relative to the
   bubble: 26 px from its right edge, 16 px below its bottom.
   It is an 8×8 square plus two shadow copies, each 4 px further down and right: a small
   staircase of pixels that points down to the cat. */
.bubble::after {
  content: '';
  position: absolute;
  right: 26px;
  bottom: -16px;
  width: 8px;
  height: 8px;
  background: var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink), 8px 8px 0 0 var(--ink);
}

/* visible, in its normal place ("none" = no transform) */
.bubble.show {
  opacity: 1;
  transform: none;
}

/* good news: light green bubble with a green border */
.bubble.mood-good {
  background: #e9fff0;
  box-shadow: 0 -4px 0 0 var(--green), 0 4px 0 0 var(--green), -4px 0 0 0 var(--green), 4px 0 0 0 var(--green), 6px 8px 0 0 #0008;
}

/* bad news: light red bubble with a red border */
.bubble.mood-bad {
  background: #ffe9e4;
  box-shadow: 0 -4px 0 0 var(--red), 0 4px 0 0 var(--red), -4px 0 0 0 var(--red), 4px 0 0 0 var(--red), 6px 8px 0 0 #0008;
}

/* a hint: light violet bubble */
.bubble.mood-hint {
  background: #e4dcf5;
}

/* ------------------------------------------------------------------ narrow screen */

/* ---- @media: rules for narrow screens ----
   The rules inside { } work only when the condition is true: here, when the window is at most
   820 px wide (phones, small tablets). They change the rules above. */
/* ---- the phone layout ----
   On a phone the menu is not a column on the left any more. It becomes a thin bar at the top of
   the window (the logo on the left, the ☰ button on the right), and the ☰ button opens the full
   menu over the page. app.js adds the class "open" to .menu and "menu-open" to <body> while the
   menu is open. On a computer none of these rules work, so the desktop look stays the same. */
@media (max-width: 820px) {
  /* ---- minmax(0, 1fr) ----
     One column. A plain "1fr" may grow wider than the screen when something inside is wide (a
     long word, a long line); minmax(0, 1fr) says "never wider than the free space", so nothing
     sticks out to the right any more. */
  .screen {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 0 12px 12px;
  }

  /* The top bar: it sticks to the top of the window while the page scrolls (sticky, top: 0).
     It is a row: the logo on the left, the ☰ button on the right. The right padding leaves room
     for the music button, which sits fixed in the top right corner of the window.
     The negative side margins stretch the bar over the 12 px padding of .screen, edge to edge. */
  .menu {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    margin: 0 -12px;
    padding: 0 84px 0 14px;
    background: #140c2bf2;
    /* a pixel line under the bar */
    box-shadow: 0 4px 0 0 var(--line);
  }

  /* a smaller logo, so it fits into the bar */
  .logo {
    padding: 0;
    gap: 12px;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
    font-size: 19px;
    box-shadow:
      0 -3px 0 0 var(--pink),
      0 3px 0 0 var(--pink),
      -3px 0 0 0 var(--pink),
      3px 0 0 0 var(--pink),
      5px 5px 0 0 var(--cyan);
  }

  .logo-text {
    font-size: 13px;
  }

  /* the ☰ button: a big pixel key, easy to hit with a thumb (at least 44 px, as phones advise) */
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 48px;
    height: 44px;
    padding: 0;
    border: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    background: var(--panel);
    box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line);
  }

  .menu-toggle:focus-visible {
    outline: 3px dashed var(--cyan);
    outline-offset: 5px;
  }

  /* while the menu is open the button turns pink (and shows ✕, set by app.js) */
  .menu.open .menu-toggle {
    color: var(--back);
    background: var(--pink);
    box-shadow: 0 -3px 0 0 var(--pink), 0 3px 0 0 var(--pink), -3px 0 0 0 var(--pink), 3px 0 0 0 var(--pink);
  }

  /* The folded menu: hidden until the ☰ button opens it */
  .menu-panel {
    display: none;
  }

  /* The open menu: a full-screen panel under the bar (top: 68px = the 64 px bar + its 4 px line).
     overflow-y: auto lets a long menu scroll inside the panel; overscroll-behavior: contain stops
     that scroll from passing on to the page under it when the panel reaches its end. */
  .menu.open .menu-panel {
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 18px 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--back);
    animation: appear 0.2s steps(3);
  }

  /* the page under the open menu must not scroll */
  body.menu-open {
    overflow: hidden;
  }

  /* the cat lies above the whole page (z-index 40): hide it while the menu is open */
  body.menu-open .cat {
    display: none;
  }

  /* no "slide to the right" under the finger: on a phone the menu lines are full width */
  .item:hover {
    transform: none;
  }

  /* bigger language keys, easier to tap */
  .langs {
    gap: 12px;
  }

  .lang {
    min-width: 52px;
    min-height: 38px;
    font-size: 11px;
  }

  /* the music button: in the top right corner, in the middle of the bar's height */
  .sound {
    top: 14px;
    right: 14px;
  }

  /* the page panel: smaller padding on the sides; more room at the bottom for the cat */
  .page {
    padding: 22px 16px 170px;
  }

  /* Long words (like NEUROASSISTANT in the big arcade font) may break anywhere instead of
     sticking out of the screen */
  .page h1 {
    font-size: 18px;
    letter-spacing: 1px;
    text-shadow: 3px 3px 0 var(--pink);
    overflow-wrap: anywhere;
  }

  .page p,
  .release pre,
  .facts li {
    overflow-wrap: anywhere;
  }

  .page .tagline {
    font-size: 18px;
  }

  /* the download buttons: one under another, as wide as the page — easy to tap */
  .buttons {
    flex-direction: column;
    gap: 20px;
  }

  .btn {
    justify-content: center;
    text-align: center;
  }

  /* home cards and pack cards: one column when the screen is narrow
     (min(230px, 100%) = 230 px, but never wider than the page) */
  .home-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 18px;
  }

  .packs {
    grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  }

  /* the cat closer to the corner, and a bubble that always fits on the screen
     (100vw = the window width) */
  .cat {
    right: 10px;
    bottom: 10px;
  }

  .bubble {
    max-width: min(260px, calc(100vw - 40px));
    margin-right: 10px;
    font-size: 15px;
  }

  /* the PRESS START box: less padding on a small screen */
  .press-box {
    padding: 24px 18px;
  }
}

/* Some people get sick or distracted from movement and turn on "reduce motion" in their system.
   For them all animations and transitions are switched off. *::before and *::after are the
   extra pseudo-elements of every element.
   !important makes these rules win over all others, even more exact ones. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------------ versions */

/* "v1.2.3" next to a program's name in the menu and on the home cards */
/* the small yellow "v1.2.3" badge. vertical-align: middle centres it in the line of text */
.ver {
  margin-left: 6px;
  padding: 1px 5px;
  font-family: var(--title);
  font-size: 8px;
  vertical-align: middle;
  color: var(--back);
  background: var(--yellow);
}

/* in the pink active menu line the badge is dark */
.item.active .ver {
  background: var(--back);
  color: var(--yellow);
}

/* the version line under a program's title. A NEGATIVE margin (-16px) pulls it up, closer to
   the tagline above (which has a 26 px bottom margin) */
.page .version {
  margin: -16px 0 22px;
  font-size: 16px;
  color: var(--yellow);
}

/* ------------------------------------------------------------------ assistants gallery */

/* the assistants gallery on the NeuroAssistant page */
.gallery {
  margin-top: 40px;
}

.gallery h2 {
  margin: 0 0 10px;
  font-family: var(--title);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--pink-light);
}

/* the grid of pack cards: as many 230 px columns as fit */
.packs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-top: 18px;
}

/* one pack card: a column, everything centred */
.pack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 16px;
  text-align: center;
  background: var(--back);
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line);
}

/* the portraits are pixel art: scale them without blurring */
/* the picture is 200×64 px: the three states of the character side by side */
.portrait {
  width: 200px;
  height: 64px;
  image-rendering: pixelated;
}

/* the pack's name */
.pack-name {
  font-family: var(--title);
  font-size: 10px;
  line-height: 1.6;
}

/* the names of its states, e.g. "calm · happy · angry" */
.pack-states {
  font-size: 14px;
  color: var(--dim);
}

/* "♫ own music  ◐ own theme" */
.pack-marks {
  font-size: 14px;
  color: var(--cyan);
}

/* the smaller download button on a pack card */
.btn.small {
  margin-top: 6px;
  padding: 8px 12px;
  font-size: 9px;
}

/* the 12 px pixel-font rule again, for the gallery and the version line */
html:lang(zh) .pack-states,
html:lang(ja) .pack-states,
html:lang(zh) .pack-marks,
html:lang(ja) .pack-marks,
html:lang(zh) .page .version,
html:lang(ja) .page .version {
  font-size: 12px;
}

/* the store price under a pack's name: every pack is free for now */
/* the green "Free" label */
.price {
  padding: 2px 8px;
  font-family: var(--title);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--back);
  background: var(--green);
}

html:lang(zh) .price,
html:lang(ja) .price {
  font-size: 12px;
}

/* ------------------------------------------------------------------ sound */

/* the Mute button: a pixel key in the top right corner, above everything but the scanlines */
/* position: fixed in the top right corner of the window; z-index 45 = above the cat (40) */
.sound {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 45;
  /* at least 52 px wide, so ♫ and ♪ ✕ make the same size of button */
  min-width: 52px;
  padding: 8px 10px;
  border: 0;
  font-family: var(--title);
  font-size: 13px;
  color: var(--back);
  cursor: pointer;
  background: var(--cyan);
  box-shadow: 0 -4px 0 0 var(--cyan), 0 4px 0 0 var(--cyan), -4px 0 0 0 var(--cyan), 4px 0 0 0 var(--cyan), 5px 7px 0 0 #000a;
}

/* under the mouse: light pink */
.sound:hover {
  background: var(--pink-light);
  box-shadow: 0 -4px 0 0 var(--pink-light), 0 4px 0 0 var(--pink-light), -4px 0 0 0 var(--pink-light), 4px 0 0 0 var(--pink-light), 5px 7px 0 0 #000a;
}

/* muted (music.js adds the class "off"): a grey, quiet button */
.sound.off {
  color: var(--dim);
  background: var(--panel);
  box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line), 5px 7px 0 0 #000a;
}

.sound:focus-visible {
  outline: 3px dashed var(--yellow);
  outline-offset: 6px;
}

/* While the browser still blocks sound (no click on the page yet), the music button blinks
   between its two colours in pixel steps: "press here and the music starts" */
/* music.js adds the class "waiting" while the browser blocks the sound */
.sound.waiting {
  animation: sound-wait 1.2s steps(1) infinite;
}

/* In the middle of each 1.2 s the button turns yellow; steps(1) in the rule above means it
   jumps between cyan and yellow, with no smooth fade. */
@keyframes sound-wait {
  50% {
    background: var(--yellow);
    box-shadow: 0 -4px 0 0 var(--yellow), 0 4px 0 0 var(--yellow), -4px 0 0 0 var(--yellow), 4px 0 0 0 var(--yellow), 5px 7px 0 0 #000a;
  }
}

/* ------------------------------------------------------------------ font choice */

/* Body text fonts the visitor can switch between (the "Font" button under the languages).
   Titles stay in the arcade Press Start 2P; Chinese and Japanese keep their pixel font.
   All are free (OFL) and have Cyrillic; each file is downloaded only when its font is chosen */
/* Handjet: a narrow pixel-like font; one variable file has weights 100..900 */
@font-face {
  font-family: 'Handjet';
  src: url('fonts/Handjet.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

/* IBM Plex Mono: two separate files with the same family name — one for normal (400) and one
   for bold (700) text. The browser picks the file by the weight it needs. */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('fonts/IBMPlexMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* Nunito: a soft round font, easy to read */
@font-face {
  font-family: 'Nunito';
  src: url('fonts/Nunito.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}

/* ":not(:lang(zh)):not(:lang(ja))" — the choice applies to Russian, English and German;
   Chinese and Japanese keep their own pixel font, it's the only one with their letters */
/* ---- attribute selectors and :not() ----
   html[data-font='handjet'] means "<html> when its data-font attribute is handjet" (app.js sets
   it when the Font button is clicked). :not(:lang(zh)) means "but NOT when the language is zh".
   Each font sets the --text variable, so every rule that uses var(--text) changes at once;
   the second rule fixes the size, because each font looks bigger or smaller at the same px. */
html[data-font='handjet']:not(:lang(zh)):not(:lang(ja)) {
  --text: 'Handjet', 'Consolas', monospace;
}

html[data-font='handjet']:not(:lang(zh)):not(:lang(ja)) body {
  font-size: 22px;
  letter-spacing: 0.3px;
}

html[data-font='plex']:not(:lang(zh)):not(:lang(ja)) {
  --text: 'IBM Plex Mono', 'Consolas', monospace;
}

html[data-font='plex']:not(:lang(zh)):not(:lang(ja)) body {
  font-size: 16px;
  line-height: 1.65;
}

html[data-font='nunito']:not(:lang(zh)):not(:lang(ja)) {
  --text: 'Nunito', 'Segoe UI', sans-serif;
}

html[data-font='nunito']:not(:lang(zh)):not(:lang(ja)) body {
  font-size: 17px;
  line-height: 1.65;
}

/* the "Font: …" button under the languages */
/* the "Font: …" button: a small pixel key, like the language buttons */
.font-switch {
  margin: 10px 4px 0;
  padding: 6px 10px;
  border: 0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  background: var(--panel);
  box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line);
}

.font-switch:hover {
  background: var(--field);
}

/* the font's name in it (<b> = bold): cyan */
.font-switch b {
  color: var(--cyan);
  font-weight: 700;
}

/* ------------------------------------------------------------------ animated stars */

/* The canvas stars.js draws on: fixed to the window like a background, behind the page
   (z-index 0; the page is 1). pointer-events: none — clicks go through it to the page.
   The scan lines come later in the HTML with the same z-index, so they lie over the stars */
/* the <canvas id="stars"> from index.html */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

/* ------------------------------------------------------------------ PRESS START */

/* The start screen (start.js): covers the whole window over everything (z-index 100),
   the site shines through the dark translucent background */
/* position: fixed + inset: 0 = it covers the whole window. #140c2bd9 is the sky color at 85%
   (d9 = 217 of 255), so the site shines through. */
.press-start {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;           /* centre the box, like StackPane's default alignment */
  background: #140c2bd9;
  cursor: pointer;
  /* when .gone sets opacity to 0, it fades in 4 jumps over 0.4 s */
  transition: opacity 0.4s steps(4);
}

/* start.js gives the splash the keyboard focus; a focus frame around the whole window would
   only look like a bug */
.press-start:focus-visible {
  outline: none;
}

/* .gone is added just before the splash is removed: it fades out in pixel steps */
.press-start.gone {
  opacity: 0;
}

/* the column in the middle: title, hint, "without sound" button */
.press-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 40px 48px;
  text-align: center;
}

/* the big arcade words, blinking like on a game console (the .blink keyframes are reused) */
.press-title {
  font-family: var(--title);
  font-size: clamp(22px, 4vw, 40px);
  letter-spacing: 3px;
  color: var(--yellow);
  text-shadow: 4px 4px 0 var(--pink);
  animation: blink 1.1s steps(1) infinite;
}

/* "Click anywhere — the site opens with music" */
.press-hint {
  font-size: 18px;
  color: var(--ink);
}

/* the small "Without sound" button, made to look like a dotted link */
.press-silent {
  padding: 4px 8px;
  border: 0;
  font: inherit;
  font-size: 15px;
  color: var(--dim);
  text-decoration: underline dotted;
  cursor: pointer;
  background: none;
}

.press-silent:hover {
  color: var(--pink-light);
}

/* the 24 px pixel-font size for Chinese and Japanese */
html:lang(zh) .press-hint,
html:lang(ja) .press-hint {
  font-size: 24px;
}

/* ------------------------------------------------------------------ download counters */

/* "⬇ Downloads: 12 · auto-updates: 3" under a program's version line, and on pack cards.
   :empty hides the line while there is nothing to show (no downloads yet) */
.page .downloads {
  margin: -16px 0 22px;
  font-size: 15px;
  color: var(--green);
}

.page .downloads:empty {
  display: none;
}

.pack-count {
  font-size: 13px;
  color: var(--green);
}

html:lang(zh) .page .downloads,
html:lang(ja) .page .downloads,
html:lang(zh) .pack-count,
html:lang(ja) .pack-count {
  font-size: 12px;
}

/* "⬇ 12" next to the version badge in the menu and on the home cards */
.dl {
  margin-left: 4px;
  font-family: var(--text);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--green);
  vertical-align: middle;
}

.item.active .dl {
  color: var(--back);
}

/* the split of the downloads by version, small and grey under the counter line;
   hidden while empty (e.g. before the counters arrive) */
.page .by-version {
  margin: -18px 0 22px;
  font-size: 13px;
  color: var(--dim);
}

.page .by-version:empty {
  display: none;
}
