/* SPDX-License-Identifier: MPL-2.0 */
/* AFFINE's site: MONO2K's structure (one 12-column grid with its dotted rules, one 8 px spacing scale, numbered
 * sections: the number on 4 columns, the text on 8), in AFFINE's POLYGON look: night, one hot colour for what plays,
 * one cool for amounts, ordered dither (4x4 Bayer) for every gradient, the pixel font for titles and labels.
 * The skin's eight colours are custom properties: site.js sets them for the skin picked (the firmware's five) and
 * draws the dither patterns (--d-*, --g-*) in them.
 *   label   the pixel font at 2x, uppercase
 *   small   14 Inter Tight
 *   text    17 Inter Tight, for reading
 *   title   the pixel font at 3x
 *   display the pixel font at 6x (4x on a phone), section titles
 * Components, one of each family (after shadcn/ui's anatomy, MIT, in POLYGON: square, the pixel font):
 *   .btn     --primary (hot) / --outline / --solid (ink); --sm 32, md 40, --lg 48
 *   .card    padding --card-pad, gap 16; .card__head (title, a badge; the hot rule), .card__foot (the dotted rule)
 *   .badge   --cool / --hot;  kbd a keycap
 * Motion: the pixel reveals stay stepped, as the FM-1 draws; what moves the layout (drawers, the tabs' bar, tooltips)
 * takes transitions.dev's tokens (--duration-*, --ease-smooth-out, --distance-*: its free tokens and recipes). */
@font-face { font-family: "AFF Pixel"; src: url(fonts/mono2k-font.otf) format("opentype"); font-display: block; }
@font-face { font-family: "Inter Tight"; src: url(fonts/InterTight-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url(fonts/InterTight-600.woff) format("woff"); font-weight: 600 900; font-display: swap; }

:root {
  /* POLYGON (app/ui/common.c SKIN_RGB): site.js replaces them with the skin picked */
  --line: #282454; --dim: #545082; --gray: #787696; --cool: #46d6c8; --hot: #ff5c28; --card: #181634; --ink: #ece6d6;
  --bg: #060814;
  --pix: "AFF Pixel", ui-monospace, Menlo, monospace;
  --text: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pu: 8px;                      /* the pixel font's design pixel at 1x: sizes are whole multiples of it */
  --s05: 4px; --s1: 8px; --s15: 12px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --s12: 96px; --s16: 128px;
  --gut: var(--s2);
  --max: 1440px;                  /* the content's width at most; backgrounds and rules still run edge to edge */
  --pad: max(var(--gut), calc((100% - var(--max)) / 2 + var(--gut)));   /* (on an element as wide as the window) */
  --h-sm: 32px; --h-md: 40px; --h-lg: 48px;   /* control heights */
  --card-pad: var(--s3);
  --ring-w: 2px; --ring-o: 2px;
  /* transitions.dev's motion tokens (the ones used) */
  --duration-stagger: 40ms; --duration-micro: 80ms; --duration-quick: 150ms; --duration-fast: 250ms;
  --duration-medium: 350ms; --duration-slow: 400ms; --duration-very-slow: 500ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1); --ease-out: ease-out;
  --distance-micro: 4px; --distance-base: 8px; --distance-medium: 12px;
  --label: 400 calc(var(--pu) * 2) / calc(var(--pu) * 2.5) var(--pix);
  --small: 400 14px / 20px var(--text);
  --body: 400 17px / 24px var(--text);
  --title: 400 calc(var(--pu) * 3) / 1 var(--pix);
  --display: 400 calc(var(--pu) * 6) / 1 var(--pix);
  color-scheme: dark;
}
@media (max-width: 700px) { :root { --display: 400 calc(var(--pu) * 4) / 1 var(--pix); } }
@media (max-width: 360px) { :root { --display: 400 calc(var(--pu) * 3) / 1 var(--pix); } }   /* (the titles on one line on the narrowest phones) */

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--body); overflow-x: clip; -webkit-font-smoothing: antialiased; }
p, h1, h2, h3, h4, dl, dd, ol, ul, figure { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
img, canvas { image-rendering: pixelated; }
::selection { background: var(--hot); color: var(--bg); }

.label { font: var(--label); text-transform: uppercase; letter-spacing: 0; }
.small { font: var(--small); }
.lede { font: var(--body); max-width: 40em; color: var(--ink); }
.title { font: var(--title); text-transform: uppercase; }
.display { font: var(--display); text-transform: uppercase; letter-spacing: 0; word-spacing: -0.25em; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hot { color: var(--hot); }
.cool { color: var(--cool); }

/* the grid: twelve columns with the gutter; the rules mark each column's start */
.bar, .hero__sub, .sec, .rules { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); }
.bar, .sec, .rules { padding-left: var(--pad); padding-right: var(--pad); }
.rules { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.rules i { border-left: 1px dotted var(--line); }
.rules i:last-child { border-right: 1px dotted var(--line); }   /* (the last column closed: the grid's right edge) */

/* the bars, top and foot */
.bar { position: relative; z-index: 2; align-items: center; min-height: var(--s6); border-bottom: 1px solid var(--line); background: var(--bg); }
.bar > * { grid-column: span 3; }
.brand { display: inline-flex; align-items: center; gap: var(--s1); text-decoration: none; color: var(--ink); }
.brand canvas { width: 28px; height: 28px; image-rendering: pixelated; }   /* (brand.js: the gem, in 3D on a pointer) */
.brand b { font: var(--title); font-size: calc(var(--pu) * 2.5); letter-spacing: 0.02em; }
.dev { display: flex; align-items: center; gap: var(--s1); color: var(--gray); }
.dev .badge { color: var(--ink); }
header.bar > .acts { grid-column: span 6; display: flex; justify-content: flex-end; align-items: center; gap: var(--s1); }
/* .btn: one button, three variants, three heights (the chip's settings are small outline buttons too) */
.btn, .chips button {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  height: var(--h-md); padding: 0 var(--s2); white-space: nowrap; cursor: pointer; text-decoration: none; border-radius: 0;
  font: var(--label); text-transform: uppercase; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
}
.btn--sm, .chips button { height: var(--h-sm); padding: 0 var(--s15); }
.btn--lg { height: var(--h-lg); padding: 0 var(--s3); }
.btn--primary { color: var(--bg); background: var(--hot); border-color: var(--hot); }
.btn--primary:hover { color: var(--hot); background: var(--bg); }
.btn--outline:hover, .chips button:hover { border-color: var(--ink); }
.btn--solid, .btn--outline:is([aria-pressed="true"], [aria-expanded="true"]) { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.cta::after, .links a::after, .kofi::after {
  content: ""; display: inline-block; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat; mask: var(--arrow) center / contain no-repeat;
}
:root { --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' shape-rendering='crispEdges'%3E%3Cpath d='M3 2h7v7H8V5.4l-5.3 5.3-1.4-1.4L6.6 4H3z'/%3E%3C/svg%3E"); }
.skinbtn { padding: 0 var(--s1); }
.skinbtn i { display: inline-grid; grid-template-columns: repeat(4, 5px); grid-auto-rows: 5px; }
.skinbtn i b { display: block; }

.subnav { position: sticky; top: 0; z-index: 3; display: flex; gap: var(--s3); align-items: center; min-height: 40px;
  padding: 0 var(--pad); background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav a { font: var(--label); text-transform: uppercase; text-decoration: none; color: var(--gray); white-space: nowrap; padding: var(--s1) 0; position: relative;
  transition: color var(--duration-fast) var(--ease-smooth-out); }
/* the section in view: one bar that slides from link to link (transitions.dev's sliding tabs; site.js measures);
 * the link pointed at gets a dim one of its own */
.subnav a::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--dim); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--duration-quick) steps(4); }
.subnav a:hover::before { transform: none; }
.subnav a:hover, .subnav a.on { color: var(--ink); }
.subnav__ink { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w, 0px); transform: translateX(var(--x, 0px)); background: var(--hot); pointer-events: none;
  transition: transform var(--duration-fast) var(--ease-smooth-out), width var(--duration-fast) var(--ease-smooth-out); }
.subnav .sp { flex: 1; }
.subnav .tag { color: var(--hot); }

/* the hero: the scene across the grid (the floor, the gem, the wordmark), then its one line and its three ways in */
.hero { position: relative; z-index: 1; padding: var(--s3) var(--pad) 0; }
.scene { position: relative; display: block; border: 1px solid var(--line); background: var(--bg); overflow: hidden; cursor: crosshair; }
#scene { display: block; width: 100%; height: auto; }
.scene__hint { position: absolute; right: var(--s1); bottom: var(--s1); font: var(--label); color: var(--gray); text-transform: uppercase; pointer-events: none;
  opacity: 0; transition: opacity 0s 2.4s; }
.scene.ready .scene__hint { opacity: 1; }
.hero__sub { padding: var(--s3) 0 var(--s4); border-top: 3px solid var(--hot); margin-top: var(--s2); }
.hero__line { grid-column: 1 / span 7; align-self: center; font: 400 clamp(20px, 2vw, 28px) / 1.25 var(--text); }
.hero__acts { grid-column: 8 / span 5; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--s1); }
/* what you point at answers: AFFINE's tear (below), then the washed rest: a faint dither and scanlines behind the
 * words; a press sinks it */
.btn::before, .chips button::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink) 9%, transparent) 0 1px, transparent 1px 3px),
    var(--d-hot) 0 0 / 4px 4px; image-rendering: pixelated;
}
:is(.btn, .chips button):is(:hover, :focus-visible)::before { opacity: 0.55; }
:is(.btn, .chips button):active { transform: translateY(1px); }
/* one focus ring for everything you can reach with the keyboard */
:is(.btn, .chips button, .bk, .stage__go, .subnav a, .links a, .kofi, .brand, .strip li, .hit, a):focus-visible {
  outline: var(--ring-w) solid var(--hot); outline-offset: var(--ring-o); }

/* the instrument: the FM-1 across the page, as wide as the window lets it stand whole with its bar under it */
.play { position: relative; z-index: 1; padding: var(--s6) var(--pad) var(--s4); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  --pw: min(100%, calc((100vh - 168px) * 1000 / 640)); --pw: min(100%, calc((100svh - 168px) * 1000 / 640)); }
.play > * { width: max(var(--pw), min(100%, 560px)); margin-left: auto; margin-right: auto; }
.devbox { overflow-x: auto; overscroll-behavior-x: contain; }
.devwrap { position: relative; }
.device { position: relative; width: 100%; min-width: 560px; aspect-ratio: 1000 / 640; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation; outline: none; }
.device:focus-visible { outline: 2px solid var(--hot); outline-offset: 4px; }
.device svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#lcd { position: absolute; left: 31.8%; top: 9.6875%; width: 20%; height: 31.25%; background: var(--bg); }
.hit { position: absolute; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: 12px; }
.hit.knob { cursor: ns-resize; border-radius: 50%; }
.hit:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
/* the panel's drawing (panel.js): every colour the skin's */
.pn-body { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.pn-tray { fill: var(--bg); }
.pn-bezel { fill: #000; stroke: var(--line); stroke-width: 2; }
.pn-knob { fill: var(--line); stroke: var(--dim); stroke-width: 2; }
.pn-ind { stroke: var(--ink); stroke-width: 4; }
.pn-ring { fill: none; stroke: var(--hot); stroke-width: 3; stroke-dasharray: 4 4; opacity: 0; transition: opacity 0s 300ms; }
.turning .pn-ring { opacity: 1; transition: none; }
.pn-btn { fill: var(--card); stroke: var(--line); stroke-width: 2; }
.pn-lbl { fill: var(--gray); font-family: var(--pix); text-transform: uppercase; }
.pn-key.white { fill: var(--gray); }
.pn-key.black { fill: var(--dim); }
.lit .pn-btn { fill: var(--hot); stroke: var(--hot); }
.lit .pn-lbl.btn { fill: var(--bg); }
.dim .pn-btn { fill: color-mix(in srgb, var(--hot) 35%, var(--card)); }
.lit .pn-key.white { fill: var(--hot); }
.lit .pn-key.black { fill: var(--cool); }
.dim .pn-key.white { fill: color-mix(in srgb, var(--hot) 40%, var(--gray)); }
.dim .pn-key.black { fill: color-mix(in srgb, var(--cool) 45%, var(--dim)); }
.held .pn-btn, .held .pn-key { stroke: var(--ink); stroke-width: 4; }
.latched .pn-btn, .latched .pn-key { stroke: var(--cool); stroke-width: 4; stroke-dasharray: 6 4; }
.start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  display: grid; gap: var(--s1); padding: var(--s3) var(--s4); min-width: 46%;
  background: var(--hot); color: var(--bg); border: 0; cursor: pointer; text-align: left; font: var(--display); text-transform: uppercase; }
.start small { font: var(--label); text-transform: uppercase; }
.start::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--s4); background: var(--g-hot) 0 0 / 4px var(--s4) repeat-x; image-rendering: pixelated; }
.start:hover, .start:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }
/* a beam runs round the edge, in pixel steps (after Libraries.dev's border beam, in CSS): the one thing to press */
@property --beam { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.beam::before { content: ""; position: absolute; inset: -4px; padding: 3px; pointer-events: none; z-index: 1;
  background: conic-gradient(from var(--beam), transparent 0 72%, color-mix(in srgb, var(--ink) 35%, transparent) 84%, var(--ink) 92%, transparent 93%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam 2.8s steps(56) infinite; }
@keyframes beam { to { --beam: 360deg; } }
.start[disabled] { cursor: progress; }
.start.gone { display: none; }
.playbar { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); padding: var(--s1) 0; border-top: 3px solid var(--hot); border-bottom: 1px solid var(--line); }
.status { flex: 1 1 auto; min-width: 0; min-height: 40px; display: flex; align-items: center; gap: var(--s1); font: var(--small); }
.status b { font: var(--label); text-transform: uppercase; color: var(--hot); white-space: nowrap; }
.status.flip { animation: st-in 160ms steps(4, end); }
@keyframes st-in { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0); } }
.playbar__acts { flex: 0 0 auto; display: flex; gap: var(--s05); }
.cpu { font: var(--label); color: var(--gray); white-space: nowrap; }
#snd[aria-pressed="true"]::after { content: ""; width: 7px; height: 7px; background: currentColor; order: -1; }
/* the drawers open as an accordion (transitions.dev's: the row 0fr to 1fr, the same time both ways); play.js
 * shows the drawer, then .open; closing, the class goes and the drawer hides when the row has closed */
.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--duration-fast) var(--ease-smooth-out); }
.drawer[hidden] { display: none; }
.drawer.open { grid-template-rows: 1fr; }
.drawer__clip { min-height: 0; overflow: hidden; opacity: 0; transition: opacity var(--duration-fast) var(--ease-smooth-out); }
.drawer.open > .drawer__clip { opacity: 1; }
.drawer__in { padding: var(--s2) 0 var(--s3); }
.drawer.open { border-bottom: 1px solid var(--line); }
.keymap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--gut); }
.keys h3 { font: var(--label); text-transform: uppercase; padding-bottom: var(--s1); border-bottom: 3px solid var(--hot); }
.keys dl { display: grid; }
.keys dt { font: 600 14px / 20px var(--text); padding-top: var(--s1); }
.keys dd { font: var(--small); color: var(--gray); padding-bottom: var(--s1); border-bottom: 1px dotted var(--line); }
/* a keycap: the key's face, its edge below */
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 var(--s05); font: 400 16px / 1 var(--pix); text-transform: uppercase;
  color: var(--bg); background: var(--ink); border-bottom: 3px solid var(--gray); vertical-align: middle; }
.ask { display: grid; gap: var(--s2); }
.ask p { max-width: 44em; font: var(--small); }
.ask__acts { display: flex; flex-wrap: wrap; gap: var(--s1); }

/* the sections: the number on 4 columns, the text on 8; full-width blocks below them */
.sec { position: relative; z-index: 1; row-gap: var(--s4); padding-top: clamp(var(--s8), 7vw, var(--s12)); padding-bottom: clamp(var(--s8), 7vw, var(--s12)); border-bottom: 1px solid var(--line); }
.sec::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--s4); background: var(--g-down) 0 0 / 4px var(--s4) repeat-x; image-rendering: pixelated; pointer-events: none; }
.sec.inv { background: var(--card); }
.sec__n { grid-column: 1 / span 4; font: 400 calc(var(--pu) * 14) / 0.8 var(--pix); color: var(--ink);
  background: var(--chrome) 0 0 / 4px calc(var(--pu) * 14) repeat; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  image-rendering: pixelated; }
.sec__body { grid-column: 5 / span 8; display: grid; gap: var(--s3); align-content: start; }
/* a section's title after the logo's speed stripes: four slanted bars, dark to hot */
.display.stripes { display: flex; align-items: center; gap: calc(var(--pu) * 2); }
.display.stripes::before { content: ""; flex: 0 0 auto; width: calc(var(--pu) * 5); height: calc(var(--pu) * 5);
  background: linear-gradient(90deg, var(--line) 0 18%, transparent 18% 27%, var(--dim) 27% 45%, transparent 45% 54%, color-mix(in srgb, var(--hot) 60%, var(--line)) 54% 72%, transparent 72% 81%, var(--hot) 81%);
  transform: skewX(-31deg); }
@media (max-width: 700px) { .display.stripes::before { width: calc(var(--pu) * 3.5); height: calc(var(--pu) * 3.5); } }
/* .card: a bordered block; its head a title and a badge over the hot rule, its foot under a dotted rule */
.card { position: relative; isolation: isolate; display: grid; gap: var(--s2); align-content: start; min-width: 0;
  padding: var(--card-pad); border: 1px solid var(--line); background: var(--bg); }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: var(--s4); padding-bottom: var(--s1); border-bottom: 3px solid var(--hot); }
.card__title { font: var(--title); text-transform: uppercase; }
.card__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s1); padding-top: var(--s2); border-top: 1px dotted var(--line); }
/* .badge: a short tag */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s1); font: var(--label); text-transform: uppercase; white-space: nowrap;
  color: var(--gray); border: 1px solid var(--line); }
.badge--cool { color: var(--cool); border-color: color-mix(in srgb, var(--cool) 45%, var(--line)); }
.badge--hot { color: var(--bg); background: var(--hot); border-color: var(--hot); }

/* the screens: the FM-1's own pictures (the simulator's), recoloured to the skin by site.js */
.scr { margin: 0; min-width: 0; }
.scr canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; border: 1px solid var(--line); background: var(--bg); }
.scr figcaption { margin-top: var(--s1); font: var(--label); text-transform: uppercase; color: var(--gray); }
/* beside a plate (02 the chip, 03 perform): the screen's card and the plate one height. The row is as tall as the taller;
 * the plate's picture (the scope, the keys) takes what the plate has over, the screen's card its own ground around the
 * screen; the caption under the card, so their bottoms line up */
@media (min-width: 641px) {
  .chip__screen, .chip__plate, .perf__screen, .perf__plate { align-self: stretch; }
  .chip__screen, .perf__screen { display: flex; padding-bottom: var(--s4); }
  .chip__screen .scr, .perf__screen .scr { position: relative; flex: 1; display: flex; flex-direction: column; }
  .scr__box { flex: 1; display: flex; align-items: center; border: 1px solid var(--line); background: var(--bg); }
  .scr__box canvas { border: 0; }
  .chip__screen .scr figcaption, .perf__screen .scr figcaption { position: absolute; left: 0; top: 100%; }
  .chip__plate { display: flex; flex-direction: column; margin-bottom: var(--s4); }   /* (a .card) */
  .chip__plate .scope { flex: 1 1 auto; min-height: 120px; }
  .chip__plate #scope { position: absolute; inset: 0; height: 100%; }   /* (its own size never pushes the plate) */
  .perf__plate { display: flex; flex-direction: column; margin-bottom: var(--s4); }   /* (a .card) */
  .perf__plate .bks { flex: 1 1 auto; align-content: center; }
  .perf__plate .knobs4 { margin-top: auto; }
}

/* 01 how to play: things to try, a name and its keys */
.todo { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); counter-reset: td; }
.todo li { counter-increment: td; position: relative; isolation: isolate; display: grid; gap: var(--s1); align-content: start; padding: var(--card-pad); border: 1px solid var(--line); background: var(--bg); }
.todo li::before { content: counter(td, decimal-leading-zero); font: var(--title); color: var(--hot); }
.todo h4 { font: 600 17px / 22px var(--text); }
.todo .where { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s05); padding-top: var(--s1); border-top: 1px dotted var(--line); }
.howto { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); row-gap: var(--s3); align-items: start; }
.howto .keymap { grid-column: 1 / span 12; }

/* 02 the chip: the bus as a chain of five stages, one open; its screen, its sound and a live scope */
.chip { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); row-gap: var(--s3); align-items: start; }
/* the five stages as tabs: one hot block slides to the stage open (transitions.dev's sliding tabs; chip.js sets --on) */
.chain { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; background: var(--bg); }
.chain::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 20%; z-index: 1; background: var(--hot); pointer-events: none;
  transform: translateX(calc(var(--on, 1) * 100%)); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.chain li { position: relative; }
.stage__go { width: 100%; display: grid; gap: var(--s05); justify-items: start; padding: var(--s2); text-align: left; cursor: pointer; z-index: 2;
  color: var(--ink); background: transparent; border: 1px solid var(--line); margin-right: -1px; font: inherit; position: relative; isolation: isolate;
  transition: color var(--duration-fast) var(--ease-smooth-out); }
.stage__go b { font: var(--title); text-transform: uppercase; }
.stage__go i { font: var(--label); font-style: normal; text-transform: uppercase; color: var(--gray); transition: color var(--duration-fast) var(--ease-smooth-out); }
.stage__go::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none; image-rendering: pixelated;
  background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--ink) 7%, transparent) 0 1px, transparent 1px 3px), var(--d-dots) 0 0 / 4px 4px; }
.stage__go:hover::after { opacity: 1; }
.chain li.on .stage__go { color: var(--bg); border-color: var(--hot); z-index: 3; }
.chain li.on .stage__go i { color: var(--bg); }
.chain li.on .stage__go::after { display: none; }
.chip__screen { grid-column: 1 / span 4; }
.chip__plate { grid-column: 5 / span 8; }
.chip__line { font: var(--body); min-height: 48px; }
.scope { position: relative; }
#scope { display: block; width: 100%; height: 160px; border: 1px solid var(--line); }
.scope__t { position: absolute; left: var(--s1); top: var(--s1); font: var(--label); text-transform: uppercase; color: var(--gray); pointer-events: none; }
.scope__p { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--hot); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: var(--s05); }   /* (even columns, like a toggle group; 144: SPACE ECHO whole) */

.chips button[aria-pressed="true"] { background: var(--hot); color: var(--bg); border-color: var(--hot); }
.chips button[aria-pressed="true"]::before { display: none; }
.chip__facts { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); }

/* tiles: a big number and its words */
.tile { position: relative; isolation: isolate; display: grid; gap: var(--s1); align-content: start; padding: var(--card-pad); border: 1px solid var(--line); background: var(--bg); }
.tile b { font: 400 calc(var(--pu) * 6) / 1 var(--pix); color: var(--ink); font-variant-numeric: tabular-nums; }
.tile { container-type: inline-size; }
@container (max-width: 200px) { .tile b { font-size: calc(var(--pu) * 4); } }   /* (a narrow tile: the number a step down, whole) */
.tile span { font: var(--label); text-transform: uppercase; color: var(--gray); }
.tile.hot { background: var(--hot); border-color: var(--hot); }
.tile.hot b, .tile.hot span { color: var(--bg); }
/* AFFINE's hover, on what you can act on (buttons, links, the keys, the steps with a note; the owner chose TEAR and
 * then: "remove the hover animation for the elements that are not interactive", so the cards and tiles stay still):
 * the rows slip as a disc skips, in steps, then it rests washed out, faded and lifted, over a faint dither and
 * scanlines behind the words, which stay whole */
.dg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
:is(.btn, .chips button, .stage__go, .bk, .subnav a, .links a, .kofi, .strip li, .brand b):hover {
  filter: saturate(0.42) brightness(1.16) contrast(0.88); animation: dg-tear 420ms steps(1) both;
}
@keyframes dg-tear { 0% { filter: url(#dg-tear) saturate(1.4); } 18% { filter: none; } 30% { filter: url(#dg-tear2); }
  52% { filter: url(#dg-tear) brightness(1.4); } 70% { filter: none; } 82% { filter: url(#dg-tear2) saturate(0.6); } 100% { filter: saturate(0.42) brightness(1.16) contrast(0.88); } }
.tile::before, .todo li > h4::after {     /* (a still facet in the corner, inside the padding: the polygon look) */
  content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px; pointer-events: none;
  background: var(--line); clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.tile.hot::before { background: var(--bg); }

/* 03 perform: the eleven black keys as the FM-1 has them, one held at a time; its screen beside */
.perf { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); row-gap: var(--s3); align-items: start; }
.perf__screen { grid-column: 1 / span 4; }
.perf__plate { grid-column: 5 / span 8; }
.perf__line { font: var(--body); min-height: 48px; }
.bks { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: var(--s1); padding: var(--s2) 0; }
.bk { position: relative; display: grid; place-content: center; justify-items: center; gap: var(--s05); min-width: 0; min-height: 72px;
  padding: var(--s1) 2px; cursor: pointer; border: 0; color: var(--ink); background: var(--dim); border-radius: 999px;
  font: var(--label); text-transform: uppercase; touch-action: none; transition: transform 60ms steps(2); }
.bk span { white-space: nowrap; }
.bk small { font: var(--label); color: var(--bg); opacity: 0.8; }
.bk:hover { background: color-mix(in srgb, var(--cool) 40%, var(--dim)); }
.bk[aria-pressed="true"] { background: var(--cool); color: var(--bg); transform: translateY(2px); }
.knobs4 { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); }
.knobs4 li { display: flex; flex-direction: column; gap: var(--s1); padding-top: var(--s1); border-top: 1px dotted var(--line); }
.knobs4 .gauge { margin-top: auto; }   /* (the gauges on one line, however the words wrap) */
.knobs4 b { font: var(--label); text-transform: uppercase; }
.knobs4 span { font: var(--small); color: var(--gray); }
.gauge { height: 6px; background: var(--d-dots) 0 0 / 4px 4px; image-rendering: pixelated; position: relative; }
.gauge i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--cool); transition: width 400ms steps(8); }
/* .seg: a segmented switch (the black keys' rows, a page's parts): one hot block slides to the one on (transitions.dev's
 * sliding tabs; --n the segments, --on the one lit, set by the script) */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line); background: var(--bg); }
.seg::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% / var(--n, 2)); background: var(--hot); pointer-events: none;
  transform: translateX(calc(var(--on, 0) * 100%)); transition: transform var(--duration-fast) var(--ease-smooth-out); }
.seg button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-width: 0; height: var(--h-sm); padding: 0 var(--s15);
  font: var(--label); text-transform: uppercase; white-space: nowrap; color: var(--gray); background: none; border: 0; cursor: pointer;
  transition: color var(--duration-fast) var(--ease-smooth-out); }
.seg button:hover { color: var(--ink); }
.seg button b { font-weight: 400; opacity: 0.6; }
.seg [aria-checked="true"], .seg [aria-pressed="true"] { color: var(--bg); }
.seg [aria-checked="true"]:hover, .seg [aria-pressed="true"]:hover { color: var(--bg); }
.seg button:focus-visible { outline: var(--ring-w) solid var(--hot); outline-offset: var(--ring-o); }
/* 03: the row switch, and beside it what a PUNCH key holds (its parts, AFFINE's own keys cool) */
.perf__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.perf__bar .seg { flex: 0 0 auto; }
.perf__mix { display: flex; align-items: center; gap: var(--s05); min-height: var(--h-sm); }
.perf__mix .badge { animation: mix-in var(--duration-quick) steps(3) both; animation-delay: calc(var(--i, 0) * var(--duration-stagger)); }
.perf__plus { font: var(--label); color: var(--gray); }
.perf__how { color: var(--gray); }
@keyframes mix-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
/* a row's names arrive key by key, stepped (transitions.dev's text swap, staggered) */
.bk.swap span { animation: bk-swap var(--duration-fast) steps(4) both; animation-delay: calc(var(--i, 0) * var(--duration-stagger)); }
@keyframes bk-swap { from { clip-path: inset(0 0 100% 0); transform: translateY(calc(var(--distance-micro) * -1)); } to { clip-path: inset(0); transform: none; } }
.bks[data-row="1"] .bk:hover { background: color-mix(in srgb, var(--hot) 40%, var(--dim)); }
.bks[data-row="1"] .bk[aria-pressed="true"] { background: var(--hot); }

/* 04 controls: the FM-1 drawn (panel.js), the control pressed lit hot, what works with it dim; its screen beside (sticky
 * while the panel and the card scroll past), a small copy in the panel's own bezel; the card under the panel, so the
 * panel never moves as the card changes */
.map { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); row-gap: var(--s3); align-items: start; }
.map__screen { grid-column: 1 / span 4; grid-row: 1 / span 2; position: sticky; top: calc(40px + var(--s2)); }
.map__panel { grid-column: 5 / span 8; grid-row: 1; min-width: 0; }
.map__dev { position: relative; aspect-ratio: 1000 / 640; }
.map__info { grid-column: 5 / span 8; grid-row: 2; }
.map__panel svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.map__lcd { position: absolute; left: 31.8%; top: 9.6875%; width: 20%; height: 31.25%; pointer-events: none; }
.map__panel .ctl { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; transform-box: fill-box; transition: transform 60ms steps(2); }
.map__panel .ctl.press { transform: translateY(4px); }
.map__panel .ctl:hover :is(.pn-btn, .pn-knob, .pn-key) { stroke: var(--ink); stroke-width: 3; }
.map__panel .ctl:focus-visible :is(.pn-btn, .pn-knob, .pn-key) { stroke: var(--hot); stroke-width: 5; }
.map__panel .lit .pn-knob { fill: var(--hot); stroke: var(--hot); }
.map__panel .lit .pn-ind { stroke: var(--bg); }
.map__panel .lit .pn-ring { opacity: 1; transition: none; }
.map__panel .lit .pn-lbl:not(.btn) { fill: var(--ink); }
.map__panel .dim .pn-knob { fill: color-mix(in srgb, var(--hot) 35%, var(--line)); }
.map__panel :is(.pn-btn, .pn-knob, .pn-key) { transition: fill var(--duration-quick) steps(3); }
.map__line { font: var(--body); min-height: 48px; }
.map__parts button { padding: 0 var(--s1); }
.map__items { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s05) var(--s05); }
.map__items .badge { animation: mix-in var(--duration-quick) steps(3) both; animation-delay: calc(var(--i, 0) * var(--duration-stagger)); }
.map__k { color: var(--hot); margin-right: var(--s05); }
.map__hold { flex: 1 0 100%; display: flex; align-items: baseline; gap: var(--s05); font: var(--small); color: var(--gray); padding-top: var(--s1); }
.map__hint { color: var(--gray); flex: 1 1 auto; }
.map__step { display: inline-flex; align-items: center; gap: var(--s1); }
.map__step .btn { width: var(--h-sm); padding: 0; }
.map__step .label { min-width: 7ch; text-align: center; color: var(--gray); }

/* 04 how it was made: four steps, the numbers, the facts */
.strip { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); }
.strip li { position: relative; display: flex; align-items: center; gap: var(--s1); padding: var(--s1) 0; border-top: 3px solid var(--hot); outline: none; cursor: default; }
.strip i { display: grid; place-items: center; width: 40px; height: 40px; font: var(--label); font-style: normal; color: var(--bg); background: var(--hot); flex: 0 0 auto; }
.strip li:nth-child(2) i { background: var(--d-hot) 0 0 / 4px 4px; color: var(--ink); }
.strip li:nth-child(3) i { background: var(--d-hot2) 0 0 / 4px 4px; color: var(--ink); }
.strip li:nth-child(4) i { background: var(--bg); color: var(--hot); box-shadow: inset 0 0 0 1px var(--hot); }
.strip b { font: 600 16px / 20px var(--text); }
.tip { position: absolute; z-index: 4; top: calc(100% + var(--s1)); left: 0; width: max-content; max-width: min(320px, calc(100vw - 48px)); padding: var(--s1) var(--s15);
  font: var(--small); color: var(--ink); background: var(--bg); border: 1px solid var(--hot); pointer-events: none;
  opacity: 0; clip-path: inset(0 100% 0 0); transition: clip-path 50ms steps(2), opacity 0s 50ms; }
.strip li:is(:hover, :focus) .tip { opacity: 1; clip-path: inset(0);
  transition: clip-path var(--duration-quick) steps(4) var(--duration-micro), opacity 0s var(--duration-micro); }
.nums { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gut); }
.facts { grid-column: 1 / -1; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gut); }
.facts .tile b { font-size: calc(var(--pu) * 4); line-height: 1; text-transform: uppercase; }
.status__acts { grid-column: auto; justify-content: flex-start; }
.credits { font: var(--small); color: var(--gray); max-width: 52em; }
.credits a { text-underline-offset: 3px; }

/* the author, elsewhere; the foot */
.links, .bar.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); padding-top: var(--s1); padding-bottom: var(--s1); }
.links { margin-top: var(--s8); border-top: 3px solid var(--hot); }
.links + .foot { margin-top: 0; }
.links a, .kofi { text-decoration: none; color: var(--ink); }
.links a::after, .kofi::after { margin-left: 6px; }
.links a:hover, .kofi:hover { color: var(--hot); }
.bar.foot { border-bottom: 0; border-top: 1px solid var(--line); color: var(--gray); }
.r { text-align: right; }

/* the page's motion (site.js adds .reveal only when motion is welcome): blocks wipe in through a dithered edge,
 * screens scan in from the top, stepped as the FM-1 draws; the .in comes once */
.reveal .rv-up { opacity: 0; transform: translateY(var(--distance-medium)); transition: opacity var(--duration-very-slow) steps(6), transform var(--duration-very-slow) steps(6); transition-delay: calc(var(--i, 0) * var(--duration-micro)); }
.reveal .rv-up.in { opacity: 1; transform: none; }
.reveal .wipe { -webkit-mask: var(--m-wipe) 100% 0 / 300% 100% no-repeat; mask: var(--m-wipe) 100% 0 / 300% 100% no-repeat;
  transition: -webkit-mask-position 620ms steps(12), mask-position 620ms steps(12); transition-delay: calc(var(--i, 0) * var(--duration-micro)); }
.reveal .wipe.in { -webkit-mask-position: 0 0; mask-position: 0 0; }
/* the FM-1's screens resolve out of a mosaic as they arrive (site.js; after Libraries.dev's image reveal, in 2D) */
.reveal .scan:not(.in) canvas { visibility: hidden; }
.reveal .wipe.done { -webkit-mask: none; mask: none; }
.reveal .sec::before { transform: scaleX(0); transform-origin: 0 50%; transition: transform 720ms steps(18); }
.reveal .sec.in::before { transform: none; }
.reveal .sec__n { clip-path: inset(0 0 100% 0); transition: clip-path 560ms steps(7); }
.reveal .sec.in .sec__n { clip-path: inset(0); }

/* narrower */
@media (max-width: 1100px) {
  .bks { grid-template-columns: repeat(6, minmax(0, 1fr)); }   /* (two rows: each name fits its key) */
  .knobs4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s2); }
  .chain { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stage__go { padding: var(--s1); }
  .stage__go i { display: none; }
}
@media (max-width: 860px) {
  .bar > * { grid-column: span 6; }
  header.bar > .dev { display: none; }
  .hero__line { grid-column: 1 / -1; }
  .hero__acts { grid-column: 1 / -1; justify-content: flex-start; margin-top: var(--s2); }
  .sec__n { grid-column: 1 / -1; font-size: calc(var(--pu) * 8); background-size: 4px calc(var(--pu) * 8); }
  .sec__body { grid-column: 1 / -1; }
  :root { --card-pad: var(--s2); }
  .chip__screen, .perf__screen { grid-column: 1 / span 5; }
  .chip__plate, .perf__plate { grid-column: 6 / span 7; }
  .map__panel { grid-column: 1 / -1; grid-row: 1; }
  .map__screen { grid-column: 1 / span 5; grid-row: 2; position: static; }
  .map__info { grid-column: 6 / span 7; grid-row: 2; }
  .todo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s2); }
  .strip li:nth-child(2n) .tip { left: auto; right: 0; }
  .keymap { grid-template-columns: 1fr; }
  .nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --gut: var(--s2); }
  .chip__screen, .perf__screen, .chip__plate, .perf__plate { grid-column: 1 / -1; }
  .chip__screen .scr, .perf__screen .scr, .map__screen .scr { max-width: 240px; }
  .map__panel, .map__screen, .map__info { grid-column: 1 / -1; grid-row: auto; }
  .map__panel { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }   /* (as the FM-1 above: wide enough to press, swiped across) */
  .map__dev { min-width: 520px; }
  .map__parts { display: flex; flex-wrap: wrap; gap: var(--s05); border: 0; background: none; }   /* (wrapped: no row to slide along) */
  .map__parts::before { display: none; }
  .map__parts button { flex: 1 1 auto; border: 1px solid var(--line); background: var(--bg); }
  .map__parts [aria-pressed="true"] { background: var(--hot); border-color: var(--hot); }
  .chain { display: flex; flex-wrap: wrap; gap: var(--s05); background: none; }
  .chain::before { display: none; }   /* (wrapped: no row to slide along) */
  .chain li { flex: 1 1 auto; }
  .stage__go { margin-right: 0; justify-items: center; background: var(--bg); }
  .chain li.on .stage__go { background: var(--hot); }
  .stage__go b { font-size: calc(var(--pu) * 2); }
  .chip__facts, .knobs4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s2); }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: 1fr; }
  .todo { grid-template-columns: 1fr; }
  .start { min-width: 0; width: calc(100% - 32px); padding: var(--s2) var(--s3); }
  .hero__acts .btn { flex: 1 1 auto; }   /* (the rows fill: no button alone at the end) */
  .playbar { flex-wrap: wrap; }
  .cpu { display: none; }
  .brand b { display: none; }
  .subnav { gap: var(--s2); }
}
/* ===================================================================================== the manual (manual.html)
 * MONO2K's docs: the contents on the grid's first three columns, sticky; one page on columns 5-12 (the sections'
 * body), its breadcrumb, a display title and one line, then tables, the FM-1's screens and cards. A phone: the
 * contents fold above the page. manual.js shows one page at a time; without it they all show. */
html.manual { scroll-behavior: auto; }   /* (a page swaps at once: a smooth scroll after it glides through the new page) */
.subnav a[aria-current="page"] { color: var(--ink); }
.subnav a[aria-current="page"]::before { transform: none; background: var(--hot); }
.docs { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut);
  padding: 0 var(--pad); }
.docs__side { grid-column: 1 / span 3; align-self: start; position: sticky; top: 41px; max-height: calc(100vh - 41px); overflow-y: auto;
  padding: var(--s3) 0 var(--s2); scrollbar-width: thin; }
.docs__side > summary { display: none; }
.docs__side h4 { padding: var(--s2) 0 var(--s05); border-bottom: 3px solid var(--hot); color: var(--ink); }
.docs__side h4:first-of-type { padding-top: 0; }
.docs__side ol { list-style: none; padding: 0; margin: 0 0 var(--s1); }
.docs__side li a { display: flex; gap: var(--s15); align-items: baseline; padding: 6px var(--s1); border-bottom: 1px dotted var(--line);
  font: var(--small); color: var(--gray); text-decoration: none; transition: color var(--duration-quick) var(--ease-smooth-out); }
.docs__side li a i { font: var(--label); font-style: normal; color: var(--dim); }
.docs__side li a:hover { color: var(--ink); }
.docs__side li a[aria-current="page"] { color: var(--bg); background: var(--ink); }
.docs__side li a[aria-current="page"] i { color: var(--bg); }
.doc { grid-column: 5 / span 8; min-width: 0; padding: var(--s4) 0 var(--s8); }
.doc article { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); align-content: start; }
.doc article > * { max-width: 46em; }
.doc article > :is(.shots, .cards, .panelfig, .tbl.cmd, .tbl.keys, [data-changelog]) { max-width: none; }
.noscript-all .doc article + article { margin-top: var(--s12); padding-top: var(--s6); border-top: 3px solid var(--hot); }
.crumb { display: flex; flex-wrap: wrap; gap: var(--s1); color: var(--gray); }
.crumb span + span::before { content: "/"; margin-right: var(--s1); color: var(--dim); }
.doc h1 { margin-top: calc(var(--s1) * -1); }
.doc .sub { font: 400 clamp(19px, 1.6vw, 22px) / 1.35 var(--text); color: var(--ink); padding-bottom: var(--s3); border-bottom: 3px solid var(--hot); }
.doc h2.title { margin-top: var(--s3); }
.doc p a, .doc td a, .log__up a { text-underline-offset: 3px; text-decoration-color: var(--hot); }
.doc p a:hover, .doc td a:hover, .log__up a:hover { color: var(--hot); }
.doc code, .log__up code { font: 400 14px / 1 ui-monospace, Menlo, monospace; padding: 2px var(--s05); background: var(--card); border: 1px solid var(--line); }
.doc b { font-weight: 600; }
/* a table: the pixel font for what is printed on the FM-1 (the first column), the reading font for what it does */
.tbl { width: 100%; border-collapse: collapse; font: var(--small); }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: var(--s1) var(--s15) var(--s1) 0; border-bottom: 1px dotted var(--line); }
.tbl thead th { font: var(--label); text-transform: uppercase; color: var(--gray); border-bottom: 1px solid var(--line); }
.tbl tbody th, .tbl tbody td:first-child { font: var(--label); text-transform: uppercase; color: var(--ink); white-space: nowrap; width: 1%; padding-right: var(--s3); }
.tbl.keys td { font: var(--label); text-transform: uppercase; }
.tbl.keys td small { display: block; color: var(--cool); font: var(--label); font-size: calc(var(--pu) * 1.5); }
.tbl.keys td:first-child { color: var(--gray); }
/* the FM-1's screens, as many to a row as fit */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--s2); }
.shots .scr { max-width: 280px; }
.panelfig { margin: 0; }
.panelfig .map__dev { max-width: 860px; min-width: 0; }   /* (whole at any width: a picture here, not the map to press) */
.steps { display: grid; gap: var(--s15); padding: 0; margin: 0; list-style: none; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: var(--s4) 1fr; gap: var(--s15); align-items: baseline; }
.steps li::before { content: counter(st, decimal-leading-zero); font: var(--label); color: var(--hot); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s1); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s05); }
/* the pages to read in order, and the ones to look up: cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--s2); }
.cards .card { padding: var(--s2) var(--s2) var(--s3); border: 1px solid var(--line); background: var(--bg); text-decoration: none; color: var(--ink); gap: var(--s05);
  transition: border-color var(--duration-quick) var(--ease-smooth-out); }
.cards .card:hover { border-color: var(--hot); }
.cards .card i { font: var(--label); font-style: normal; color: var(--hot); }
.cards .card b { font: var(--title); font-size: calc(var(--pu) * 2.5); text-transform: uppercase; }
.cards .card span { font: var(--small); color: var(--gray); }
.callout { display: grid; gap: var(--s1); padding: var(--s2); border: 1px dotted var(--dim); background: var(--card); }
.callout .badge { justify-self: start; }
/* previous and next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s8); }
.pager a { display: grid; gap: var(--s05); padding: var(--s2); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color var(--duration-quick) var(--ease-smooth-out); }
.pager a:hover { border-color: var(--hot); }
.pager small { color: var(--gray); }
.pager .pager__next { grid-column: 2; text-align: right; }
.noscript-all .pager { display: none; }
/* the change log: the kinds as toggles, each update a dated block, each line its kind's badge */
.log__kinds { margin-bottom: var(--s4); }
.log__kinds small { font: var(--label); opacity: 0.6; }
.log__up { display: grid; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.log__up header { display: grid; gap: var(--s05); }
.log__up time { color: var(--hot); }
.log__up ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s15); }
.log__up li { display: grid; grid-template-columns: 112px 1fr; gap: var(--s15); align-items: start; font: var(--small); }
.log__up li .badge { justify-self: start; }
.log__up p { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .docs__side { grid-column: 1 / -1; position: static; max-height: none; padding: var(--s2) 0 0; border-bottom: 1px solid var(--line); }
  .docs__side > summary { display: flex; justify-content: space-between; align-items: center; min-height: var(--h-md); cursor: pointer; list-style: none; color: var(--ink); }
  .docs__side > summary::-webkit-details-marker { display: none; }
  .docs__side > summary::after { content: "+"; color: var(--hot); }
  .docs__side[open] > summary::after { content: "−"; }
  .docs__side[open] { padding-bottom: var(--s3); }
  .doc { grid-column: 1 / -1; padding-top: var(--s3); }
}
@media (max-width: 640px) {
  .log__up li { grid-template-columns: 1fr; gap: var(--s05); }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s15); }
  .tbl tbody th, .tbl tbody td:first-child { white-space: normal; }
  .tbl.cmd thead { display: none; }
  .tbl.cmd tr { display: grid; grid-template-columns: 1fr; padding: var(--s1) 0; border-bottom: 1px dotted var(--line); }
  .tbl.cmd td { border: 0; padding: 2px 0; width: auto; }
  .tbl.cmd td:nth-child(3) { color: var(--gray); }
  .pager { grid-template-columns: 1fr; }
  .pager .pager__next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
