/* ARM-DOS 4.00 - the page. Everything here is CSS; the machine is drawn with
   gradients and a few inline SVGs. Units inside the rig are container-relative
   (cqw) so the computer scales as one object. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/archivo-var.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/newsreader-400.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/newsreader-400i.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibmplexmono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibmplexmono-600.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/charis-400.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/charis-400i.woff2") format("woff2"); }
@font-face { font-family: "Charis SIL"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/charis-700.woff2") format("woff2"); }
/* the machine's own IBM VGA 8x16 face, made from emu/fonts/vga8x16.bin by web/tools/pcfont.mjs.
   Crisp at 16px (one font pixel = one CSS pixel) and whole multiples of it */
@font-face { font-family: "PC VGA"; font-style: normal; font-weight: 400; font-display: block; src: url("../fonts/pcvga.ttf") format("truetype"); }

:root {
  color-scheme: dark;
  /* the room: a flat, cool dark so the beige plastic and the picture tube do the talking */
  --room: #141718;
  --room-2: #1b1f20;
  --rule: #2c3133;
  --ink: #dcd8cc;
  --ink-2: #aaa69a;
  --ink-3: #7c7970;
  --accent: #ffff55;
  --link: #55ffff;

  /* the 16 colours of the CGA/EGA/VGA text palette, for everything the machine "prints" on the page */
  --c-black: #000000; --c-blue: #0000aa; --c-green: #00aa00; --c-cyan: #00aaaa;
  --c-red: #aa0000; --c-magenta: #aa00aa; --c-brown: #aa5500; --c-lgray: #aaaaaa;
  --c-dgray: #555555; --c-lblue: #5555ff; --c-lgreen: #55ff55; --c-lcyan: #55ffff;
  --c-lred: #ff5555; --c-lmagenta: #ff55ff; --c-yellow: #ffff55; --c-white: #ffffff;

  --plastic: #d9d1bd;
  --plastic-hi: #ece6d6;
  --plastic-lo: #bdb39b;
  --plastic-dk: #9b9179;
  --plastic-edge: #81776169;
  --charcoal: #2c2a27;
  --silk: #5b5446;

  --panel: #22252a;
  --panel-2: #1a1c20;
  --panel-edge: #0d0e10;
  --silk-w: #d7d9dc;
  --amber: #ffb340;
  --amber-dim: #6b4a1a;
  --amber-glow: 0 0 6px rgba(255, 170, 50, .55);
  --green: #74f29a;

  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;      /* silkscreen on the hardware */
  --serif: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;   /* the words */
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pc: "PC VGA", "IBM Plex Mono", ui-monospace, Menlo, monospace;        /* the machine talking */
}

* { box-sizing: border-box; }
html { background: var(--room); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.6 var(--serif);
  background: var(--room);
  padding: 0 max(16px, env(safe-area-inset-left)) 48px max(16px, env(safe-area-inset-right));
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code, kbd { font: 16px/1 var(--pc); }
code { color: var(--c-white); }
kbd { background: var(--c-lgray); color: var(--c-black); padding: 0 4px; white-space: nowrap; }
button { font: inherit; color: inherit; }
a:hover { color: var(--c-white); }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ masthead */
.masthead { max-width: 1480px; margin: 0 auto; padding: 20px 0 6px; display: grid; grid-template-columns: auto minmax(0, 48em); column-gap: 32px; align-items: end; }
.masthead .toplinks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 22px; font: 16px/16px var(--pc); }
.masthead .toplinks a { color: var(--c-lgray); text-decoration: none; }
.masthead .toplinks a.manual { color: var(--c-white); }
.masthead .toplinks a:hover { background: var(--c-lgray); color: var(--c-black); }
.masthead h1 { margin: 0; font: 400 48px/48px var(--pc); color: var(--c-white); white-space: nowrap; }
.masthead h1 .ver { color: var(--c-lgray); }
.masthead .subtitle { margin: 0 0 3px; font: 400 18px/1.4 var(--serif); color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 720px) { .masthead { grid-template-columns: 1fr; } .masthead h1 { font-size: 32px; line-height: 32px; } .masthead .subtitle { margin-top: 10px; } }

/* ------------------------------------------------------------------ layout */
.desk { max-width: 1480px; margin: 18px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.rig { container-type: inline-size; width: 100%; max-width: 900px; margin: 0 auto; position: relative; }
@media (max-width: 1180px) { .desk { grid-template-columns: minmax(0, 1fr); } }   /* (minmax: the inspector's long lines must not widen the column past the screen) */

/* ------------------------------------------------------------------ monitor */
.monitor { width: 82cqw; margin: 0 auto; position: relative; z-index: 3; }
.monitor .shell {
  position: relative;
  border-radius: 2.2cqw 2.2cqw 1.4cqw 1.4cqw;
  padding: 3.2cqw 3.6cqw 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 18%),
    linear-gradient(90deg, rgba(0,0,0,.07), rgba(0,0,0,0) 6%, rgba(0,0,0,0) 94%, rgba(0,0,0,.09)),
    var(--plastic);
  box-shadow:
    inset 0 .2cqw 0 rgba(255,255,255,.6),
    inset 0 -.4cqw .6cqw rgba(0,0,0,.12),
    0 .3cqw 0 var(--plastic-dk),
    0 2cqw 4cqw rgba(0,0,0,.55);
}
.monitor .shell::after { /* plastic grain */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .47 0 0 0 0 .4 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bezel {
  position: relative;
  padding: 2.1cqw;
  border-radius: 1.6cqw;
  background: linear-gradient(180deg, #bdb39c, #cfc6b0 40%, #d6cdb8);
  box-shadow:
    inset 0 .5cqw 1cqw rgba(0,0,0,.35),
    inset 0 -.2cqw .3cqw rgba(255,255,255,.45),
    0 .15cqw 0 rgba(255,255,255,.55);
}
.tube {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 3.2cqw / 3.6cqw;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #202624 0%, #151a18 60%, #0c0f0e 100%);
  box-shadow: 0 0 0 .35cqw #16181a, 0 0 0 .6cqw #3c3a35, inset 0 0 2cqw rgba(0,0,0,.9);
}
.tube canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: text; touch-action: manipulation;
  /* clip the canvas itself too: some browsers don't clip a GPU canvas to its parent's rounded corners */
  border-radius: inherit; clip-path: inset(0 round 3.2cqw / 3.6cqw); }
.tube canvas.gl-off { image-rendering: auto; }
.tube .glass {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 22% 8%, rgba(255,255,255,.10), rgba(255,255,255,0) 38%),
    radial-gradient(60% 40% at 80% 95%, rgba(255,255,255,.03), rgba(255,255,255,0) 60%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,.45) 100%);
  box-shadow: inset 0 0 1.2cqw rgba(0,0,0,.8), inset 0 .3cqw .6cqw rgba(255,255,255,.05);
}
.tube.focused { box-shadow: 0 0 0 .35cqw #16181a, 0 0 0 .6cqw #3c3a35, 0 0 1.4cqw .2cqw rgba(232,161,58,.28), inset 0 0 2cqw rgba(0,0,0,.9); }
.kbd-hint {
  position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
  font: 16px/16px var(--pc); color: var(--c-lgray);
  background: var(--c-black); padding: 4px 8px; pointer-events: none; transition: opacity .6s;
}
.kbd-hint .kbd-icon { color: var(--c-yellow); }
/* until the first key typed into the machine: where the keyboard goes is not obvious */
.kbd-nudge {
  position: absolute; left: 50%; bottom: 3.5%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
  font: 16px/16px var(--pc); color: var(--c-black);
  background: var(--c-lgray); padding: 4px 8px; pointer-events: none; z-index: 2;
}
.kbd-nudge .kbd-icon { color: var(--c-black); animation: kbd-nudge 1.07s steps(1) infinite; }   /* blinks at the cursor's rate */
@keyframes kbd-nudge { 50% { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .kbd-nudge { animation: none; } }
.kbd-hint.quiet { opacity: .0; }
.kbd-hint .locks { display: flex; gap: 6px; }
.kbd-hint .locks { gap: 8px; }
.kbd-hint .locks i { font: 16px/16px var(--pc); font-style: normal; color: var(--c-dgray); }
.kbd-hint .locks i.on { color: var(--c-lgreen); }
@media (max-width: 560px) { .kbd-hint .kbd-text { display: none; } }

.chin { display: flex; align-items: center; justify-content: space-between; height: 6.4cqw; padding: 0 .6cqw; }
.chin .brand { display: flex; align-items: baseline; gap: 1.2cqw; }
.chin .brand b { font: 700 1.9cqw/1 var(--sans); letter-spacing: .32em; color: #4a4439; text-shadow: 0 1px 0 rgba(255,255,255,.55); }
.chin .brand span { font: 600 .95cqw/1 var(--sans); letter-spacing: .22em; color: #7a715e; }
.chin .knobs { display: flex; gap: 1.1cqw; margin-right: 2.4cqw; }
.chin .degauss-btn { margin-left: auto; margin-right: 2cqw; display: flex; flex-direction: column; align-items: center; gap: .35cqw; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chin .degauss-btn .cap { width: 2.6cqw; height: 1.3cqw; border-radius: .25cqw; background: linear-gradient(#cfc6b0, #b2a88f); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 .15cqw .25cqw rgba(0,0,0,.35); transition: transform .06s, box-shadow .06s; }
.chin .degauss-btn:active .cap { transform: translateY(.1cqw); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 .05cqw .1cqw rgba(0,0,0,.35); }
.chin .degauss-btn .lbl { font: 600 .7cqw/1 var(--sans); letter-spacing: .18em; color: #7a715e; }
.chin .degauss-btn:focus-visible { outline: 2px solid #7a715e; outline-offset: .3cqw; border-radius: .3cqw; }
.chin .knobs i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: repeating-conic-gradient(#b5ab93 0 6deg, #c9c0a9 6deg 12deg); box-shadow: inset 0 0 0 .25cqw #c5bca6, 0 .15cqw .2cqw rgba(0,0,0,.35); }
.chin .mon-power { display: flex; align-items: center; gap: 1cqw; }
.chin .mon-btn { width: 3cqw; height: 1.8cqw; border-radius: .3cqw; background: linear-gradient(#cfc6b0, #b2a88f); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 .15cqw .25cqw rgba(0,0,0,.35); }

.postit {
  position: absolute; right: -5.5cqw; top: 6cqw; width: 11cqw; min-width: 76px; padding: 1.1cqw 1cqw 1.3cqw;
  background: linear-gradient(170deg, #fff39a, #f9e46b 70%, #f0d54f);
  color: #3b3522; font: italic 400 max(11px, 1.45cqw)/1.25 var(--serif);
  transform: rotate(5deg); box-shadow: 0 .6cqw 1cqw rgba(0,0,0,.35), inset 0 -.6cqw .8cqw rgba(0,0,0,.05);
  transition: opacity .8s, transform .8s; z-index: 3;
}
.postit span { display: block; text-align: right; margin-top: .3em; }
.postit::before { content: ""; position: absolute; left: 30%; right: 30%; top: -.5cqw; height: 1.3cqw; background: rgba(255,255,255,.35); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.postit.gone { opacity: 0; transform: rotate(12deg) translate(2cqw, 3cqw); pointer-events: none; }
@media (max-width: 620px) { .postit { right: -2cqw; top: -4cqw; } }

/* ------------------------------------------------------------------ system unit */
.case { width: 100cqw; margin: -.6cqw auto 0; position: relative; z-index: 1; }
.case-top {
  height: 2.2cqw; margin: 0 1.2cqw; border-radius: 1cqw 1cqw 0 0;
  background: linear-gradient(180deg, #e8e1cf, #d3cab4);
  box-shadow: inset 0 .15cqw 0 rgba(255,255,255,.7);
}
.front {
  position: relative;
  display: grid; grid-template-columns: 21fr 36fr 29fr 14fr; gap: 1.6cqw; align-items: stretch;
  min-height: 19cqw; padding: 2cqw 2.2cqw 2.2cqw;
  border-radius: .6cqw .6cqw 1cqw 1cqw;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 12%),
    linear-gradient(0deg, rgba(0,0,0,.14), rgba(0,0,0,0) 14%),
    var(--plastic);
  box-shadow: inset 0 .15cqw 0 rgba(255,255,255,.6), 0 .35cqw 0 var(--plastic-dk), 0 2.4cqw 4cqw rgba(0,0,0,.6);
}
.front::before { /* the long moulded groove across the front */
  content: ""; position: absolute; left: 2.2cqw; right: 2.2cqw; bottom: 1.1cqw; height: .25cqw; border-radius: 1px;
  background: linear-gradient(#a79d85, #ece6d6);
}
.front::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .2; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .47 0 0 0 0 .4 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.case-foot { display: flex; justify-content: space-between; padding: 0 6cqw; height: 1cqw; }
.case-foot i { width: 9cqw; height: 1cqw; background: #151310; border-radius: 0 0 .5cqw .5cqw; }

.badge-area { display: flex; flex-direction: column; justify-content: space-between; padding: .4cqw 0 .6cqw; }
.badge-area .logo {
  align-self: flex-start;
  font: 700 2.7cqw/1 var(--sans); letter-spacing: .26em; color: #f2ecdf;
  background: linear-gradient(180deg, #34404f, #1d2530); padding: .8cqw 1.1cqw .8cqw 1.4cqw; border-radius: .35cqw;
  box-shadow: inset 0 .1cqw 0 rgba(255,255,255,.25), 0 .15cqw .3cqw rgba(0,0,0,.35);
}
.badge-area .model { font: 700 1.55cqw/1.1 var(--sans); letter-spacing: .14em; color: var(--silk); margin-top: .9cqw; }
.badge-area .model span { display: block; font-weight: 600; font-size: .8cqw; letter-spacing: .22em; color: #857b66; margin-top: .4cqw; }
.vents { display: grid; grid-template-columns: repeat(6, 1fr); gap: .7cqw; margin-top: 1.2cqw; }
.vents i { height: 4.4cqw; border-radius: .5cqw; background: linear-gradient(90deg, #7e755f, #3a352c 45%, #5d5646); box-shadow: 0 .12cqw 0 rgba(255,255,255,.5); }

.bays { display: flex; flex-direction: column; gap: 1.1cqw; }
.bay { position: relative; border-radius: .4cqw; background: linear-gradient(180deg, #a59b83, #bfb59d); padding: .45cqw; box-shadow: inset 0 .2cqw .35cqw rgba(0,0,0,.35), 0 .12cqw 0 rgba(255,255,255,.55); }
.drive-face {
  height: 100%; border-radius: .3cqw; padding: .9cqw 1.2cqw .7cqw;
  background: linear-gradient(180deg, #3a3834, #2a2926 60%, #252421);
  box-shadow: inset 0 .12cqw 0 rgba(255,255,255,.12);
  display: flex; flex-direction: column; justify-content: space-between; gap: .6cqw;
}
.slot { position: relative; height: 1.25cqw; margin: 0 5%; border-radius: .6cqw; background: #070707; box-shadow: inset 0 .25cqw .3cqw rgba(0,0,0,.9), 0 .1cqw 0 rgba(255,255,255,.12); overflow: hidden; }
.slot::before { /* the spring-loaded flap */ content: ""; position: absolute; inset: .25cqw .5cqw; border-radius: .4cqw; background: linear-gradient(#1b1b1a, #111); transition: transform .25s; }
.drive.has-disk .slot::before { transform: translateY(80%); }
.disk-edge { position: absolute; left: 12%; right: 12%; top: 34%; height: 44%; border-radius: .2cqw; background: var(--disk-colour, #2b2d33); transform: translateY(160%); transition: transform .28s cubic-bezier(.3,1.4,.5,1); box-shadow: inset 0 .12cqw 0 rgba(255,255,255,.25); }
.drive.has-disk .disk-edge { transform: translateY(0); }
.drive-row { display: flex; align-items: center; gap: 1cqw; }
.drive-label { font: 700 1.05cqw/1 var(--sans); color: #b8b1a2; letter-spacing: .08em; }
.drive-logo { margin-left: auto; font: 600 .78cqw/1 var(--sans); color: #8d877a; letter-spacing: .16em; }
.eject {
  width: 4.2cqw; height: 1.5cqw; border: 0; border-radius: .25cqw; padding: 0; cursor: pointer;
  background: linear-gradient(180deg, #56534c, #3a3833); box-shadow: inset 0 .12cqw 0 rgba(255,255,255,.2), 0 .15cqw .2cqw rgba(0,0,0,.6);
  transform: translateZ(0); transition: transform .08s;
}
.drive.has-disk .eject { box-shadow: inset 0 .12cqw 0 rgba(255,255,255,.2), 0 .3cqw .3cqw rgba(0,0,0,.6); transform: translateY(-.1cqw); }
.eject:active { transform: translateY(.1cqw); }
.drive.drag-over { outline: .3cqw dashed var(--accent); outline-offset: .3cqw; }
.bay.blank { flex: 1; }
.blank-plate { height: 100%; min-height: 5cqw; border-radius: .3cqw; background: linear-gradient(180deg, #e3dcc9, #cfc6b0); box-shadow: inset 0 .12cqw 0 rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; }
.blank-plate span { font: 600 .82cqw/1 var(--sans); letter-spacing: .24em; color: #968c75; }

.controls { display: flex; flex-direction: column; justify-content: space-between; gap: 1cqw; }
.status-panel { display: flex; gap: 1.2cqw; align-items: stretch; background: linear-gradient(180deg, #2a2926, #1f1e1b); border-radius: .5cqw; padding: .9cqw 1.1cqw; box-shadow: inset 0 .2cqw .3cqw rgba(0,0,0,.6), 0 .12cqw 0 rgba(255,255,255,.5); }
.lamps { display: flex; flex-direction: column; justify-content: space-between; gap: .45cqw; }
.lamps label { display: flex; align-items: center; gap: .7cqw; font: 600 .8cqw/1 var(--sans); letter-spacing: .14em; color: #bdb6a6; }
.mhz { flex: 1; display: flex; align-items: flex-end; gap: .4cqw; background: #120505; border-radius: .3cqw; padding: .5cqw .7cqw; box-shadow: inset 0 .15cqw .4cqw #000; }
.mhz svg { width: 100%; height: auto; display: block; }
.mhz-unit { font: 700 .8cqw/1 var(--sans); color: #8f3a2a; letter-spacing: .08em; padding-bottom: .2cqw; }
.seg { fill: #2c0c08; transition: fill .05s; }
.seg.on { fill: #ff3b24; filter: drop-shadow(0 0 1.2px rgba(255,70,40,.95)); }

.buttons { display: flex; align-items: center; gap: 1.2cqw; }
.pushbtn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .45cqw; }
.pushbtn .cap {
  width: 5.2cqw; height: 2.6cqw; border-radius: .35cqw;
  background: linear-gradient(180deg, #ebe5d6, #c8bea7);
  box-shadow: 0 .35cqw 0 #8f866e, 0 .5cqw .5cqw rgba(0,0,0,.35), inset 0 .12cqw 0 rgba(255,255,255,.8);
  transition: transform .06s, box-shadow .06s;
}
.pushbtn.small .cap { width: 3.4cqw; height: 2.1cqw; background: linear-gradient(180deg, #5b5750, #3d3a35); box-shadow: 0 .3cqw 0 #22201c, 0 .45cqw .45cqw rgba(0,0,0,.4), inset 0 .12cqw 0 rgba(255,255,255,.25); }
.pushbtn[aria-pressed="true"] .cap, .pushbtn:active .cap { transform: translateY(.25cqw); box-shadow: 0 .1cqw 0 #8f866e, 0 .2cqw .3cqw rgba(0,0,0,.3), inset 0 .12cqw 0 rgba(255,255,255,.6); }
.pushbtn.small:active .cap { box-shadow: 0 .08cqw 0 #22201c, inset 0 .12cqw 0 rgba(255,255,255,.2); }
.pushbtn em { font: 600 .8cqw/1 var(--sans); font-style: normal; letter-spacing: .16em; color: var(--silk); }
.keylock { margin-left: auto; width: 3.6cqw; height: 3.6cqw; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #e9e9e6, #9fa09c 55%, #6b6c68); box-shadow: 0 .15cqw .3cqw rgba(0,0,0,.4), inset 0 0 0 .3cqw #b7b8b3; position: relative; }
.keylock i { position: absolute; left: 46%; top: 22%; width: 8%; height: 56%; background: #2b2b2b; border-radius: 1px; transform: rotate(-30deg); }

.power { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9cqw; }
.rocker {
  width: 8.2cqw; height: 11cqw; border: 0; padding: .6cqw; cursor: pointer; border-radius: .7cqw;
  background: linear-gradient(180deg, #3a3833, #211f1c); box-shadow: inset 0 .3cqw .5cqw rgba(0,0,0,.7), 0 .15cqw 0 rgba(255,255,255,.45);
  perspective: 30cqw;
}
.rocker-face {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; height: 100%;
  border-radius: .5cqw; padding: 1cqw 0 1.1cqw;
  background: linear-gradient(180deg, #d8322a 0%, #b8231c 48%, #8e1712 52%, #c02820 100%);
  box-shadow: inset 0 .15cqw 0 rgba(255,255,255,.35), 0 .3cqw .4cqw rgba(0,0,0,.5);
  transform-origin: 50% 50%; transform: rotateX(-14deg); transition: transform .09s cubic-bezier(.4,2,.5,1), background .09s;
  font: 700 1.9cqw/1 var(--sans); color: rgba(255,230,220,.9);
}
.rocker[aria-pressed="true"] .rocker-face { transform: rotateX(14deg); background: linear-gradient(180deg, #c02820 0%, #8e1712 48%, #b8231c 52%, #d8322a 100%); }
.rocker .o { width: 1.6cqw; height: 1.6cqw; border: .3cqw solid rgba(255,230,220,.9); border-radius: 50%; font-size: 0; }
.rocker .i { width: .35cqw; height: 1.9cqw; background: rgba(255,230,220,.9); border-radius: .1cqw; font-size: 0; }
.power-label { font: 700 .9cqw/1 var(--sans); letter-spacing: .2em; color: var(--silk); }
.rocker.beckon .rocker-face { animation: beckon 2.6s ease-in-out 1.2s infinite; }
@keyframes beckon { 0%, 80%, 100% { box-shadow: inset 0 .15cqw 0 rgba(255,255,255,.35), 0 .3cqw .4cqw rgba(0,0,0,.5); } 88% { box-shadow: inset 0 .15cqw 0 rgba(255,255,255,.35), 0 0 1.6cqw .3cqw rgba(255,90,60,.55); } }

/* LEDs */
.led { display: inline-block; flex: none; width: max(7px, 1.05cqw); height: max(7px, 1.05cqw); border-radius: 50%; background: #2f2a22; box-shadow: inset 0 1px 1px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.35); transition: background .05s, box-shadow .05s; }
.led.small { width: max(6px, .8cqw); height: max(6px, .8cqw); }
.led.green { background: #1c3322; } .led.green.on { background: #6dff8e; box-shadow: 0 0 6px 1px rgba(90,255,130,.75), inset 0 -1px 1px rgba(0,80,20,.5); }
.led.amber { background: #3a2a12; } .led.amber.on { background: #ffb02e; box-shadow: 0 0 6px 1px rgba(255,170,40,.8), inset 0 -1px 1px rgba(120,60,0,.5); }
.led.yellow { background: #38351a; } .led.yellow.on { background: #ffe94d; box-shadow: 0 0 6px 1px rgba(255,230,60,.7), inset 0 -1px 1px rgba(110,90,0,.5); }

/* ------------------------------------------------------------------ toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px auto 0; padding: 10px; border-radius: 4px; background: #0e1011; box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.05); }
.toolbar .spacer { flex: 1; }
.key {
  border: 0; cursor: pointer; padding: 7px 12px 9px; border-radius: 6px;
  font: 600 12px/1 var(--sans); letter-spacing: .04em; color: #3a352b;
  background: linear-gradient(180deg, #efe9da, #d4ccb6);
  box-shadow: 0 3px 0 #8f866e, 0 4px 6px rgba(0,0,0,.35), inset 0 1px 0 #fff;
  transition: transform .05s, box-shadow .05s;
}
.key:active, .key[aria-pressed="true"].latched { transform: translateY(2px); box-shadow: 0 1px 0 #8f866e, 0 2px 3px rgba(0,0,0,.3), inset 0 1px 0 #fff; }
.key.toggle { position: relative; padding-left: 24px; }
.key.toggle::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: #5a5244; }
.key.toggle[aria-pressed="true"]::before { background: #3bd16a; box-shadow: 0 0 5px rgba(60,220,110,.8); }
.key.on { background: linear-gradient(180deg, #ffe7b8, #f0c877); }
/* the monitor swap (VGA colour / Hercules mono) */
.key.monitor-sel { display: inline-flex; align-items: center; gap: 6px; cursor: default; padding-top: 4px; padding-bottom: 6px; }
.key.monitor-sel select { font: 600 12px/1.2 var(--sans); color: #3a352b; background: rgba(255,255,255,.55); border: 1px solid #b3a98f; border-radius: 4px; padding: 2px 4px; max-width: 16em; cursor: pointer; }
.monitor-note { flex-basis: 100%; order: 99; font: 15px/1.45 var(--serif); color: var(--ink); padding: 4px 2px 0; }
.mobile-only { display: none; }
@media (pointer: coarse), (max-width: 700px) { .mobile-only { display: inline-block; } }
.extra-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.extra-keys button { border: 0; padding: 10px 11px; min-width: 40px; border-radius: 6px; font: 600 13px/1 var(--sans); color: #efe6d2; background: linear-gradient(180deg, #4a443b, #36312a); box-shadow: 0 2px 0 #1b1814; }
.extra-keys button:active, .extra-keys button.on { background: linear-gradient(180deg, #e8a13a, #c47f1f); color: #221a0e; }
.extra-keys .fkeys { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
.soft-kbd { position: fixed; left: -1000px; top: 0; width: 10px; height: 10px; opacity: 0; font-size: 16px; }

/* ------------------------------------------------------------------ inspector
   A debugger of the machine's own day: Turbo Debugger's CPU window, in the text palette and
   the VGA font. Windows are drawn like box-drawing characters (the single line through the
   middle of a character cell, 2 px sides); a .section-cap is a window's top edge with its
   title and controls sitting on the line, the way TD put [■] and the title on a frame. */
.inspector { position: sticky; top: 14px; display: flex; align-items: stretch; max-height: calc(100vh - 28px); }
.insp-tab {
  flex: none; width: 24px; border: 0; cursor: pointer; padding: 0;
  background: var(--c-lgray); color: var(--c-black);
  display: flex; align-items: center; justify-content: center;
}
.insp-tab:hover { background: var(--c-white); }
.insp-tab .tab-text { writing-mode: vertical-rl; transform: rotate(180deg); font: 16px/16px var(--pc); }
.inspector.closed .insp-body { display: none; }
.inspector.closed .insp-tab { height: 240px; }
.insp-body {
  --line: var(--c-white);
  width: 480px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--c-cyan) var(--c-blue);
  padding: 0 8px 16px;
  background: var(--c-blue); color: var(--c-lgray);
  font: 16px/16px var(--pc);
  position: relative;
}
/* the menu bar across the top, READY at its right as in TD */
.insp-head { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; height: 16px; margin: 0 -8px 8px; padding: 0 8px; background: var(--c-lgray); color: var(--c-black); }
.insp-title { font: 16px/16px var(--pc); }
.insp-title span { color: var(--c-dgray); margin-left: 8px; }
.insp-state { display: flex; align-items: center; gap: 8px; font: 16px/16px var(--pc); }
.lamp { width: 8px; height: 8px; background: var(--c-dgray); }
.lamp.run { background: var(--c-green); }
.lamp.halt { background: var(--c-red); }
.lamp.idle { background: var(--c-brown); }

.panel-row { margin-bottom: 8px; }
.cap, .section-cap { font: 16px/16px var(--pc); color: var(--c-lgray); }
.section-cap {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; height: 16px; margin: 16px 0 8px; padding: 0 8px;
  background: linear-gradient(var(--line), var(--line)) 0 7px / 100% 1px no-repeat;
}
.section-cap:has(+ .win:not([hidden])) { margin-bottom: -9px; }        /* its line is the window's top edge */
.section-cap > * { flex: none; white-space: nowrap; background: var(--c-blue); padding: 0 8px; }
.section-cap > .last-int { flex: 0 1 auto; }
.section-cap > span:first-child { margin-right: auto; color: var(--c-white); }
.section-cap > .hwkey.small, .section-cap > .mem-jumps { padding: 0; }
.meters { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; margin-top: 16px; }
.meter { position: relative; border: 2px solid var(--line); border-width: 1px 2px; padding: 12px 6px 7px; }
.meter > .cap:first-child { position: absolute; top: -8px; left: 6px; padding: 0 8px; background: var(--c-blue); color: var(--c-white); }
.meter.narrow { display: flex; flex-direction: column; gap: 0; }
.mrow { display: flex; justify-content: space-between; gap: 8px; }
.readout { font: 16px/16px var(--pc); color: var(--c-white); display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.readout small { font: 16px/16px var(--pc); color: var(--c-lgray); }
.mrow .readout { gap: 0; } .mrow .readout small { margin-left: 8px; }
.readout.big { font-size: 32px; line-height: 32px; color: var(--c-yellow); }
#spark { width: 100%; height: 44px; display: block; margin-top: 8px; }

.win { border: 2px solid var(--line); border-width: 1px 2px; padding: 8px 6px 7px; color: var(--c-lgray); font: 16px/16px var(--pc); font-variant-numeric: tabular-nums; }
.regs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.reg { display: flex; gap: 8px; white-space: nowrap; }
.reg .rn { color: var(--c-lgray); width: 3ch; }
.reg .ra { color: var(--c-lcyan); width: 2ch; }
.reg .rv { color: var(--c-white); }
.reg.chg .rv { color: var(--c-yellow); }
.cpsr { display: flex; gap: 0; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.flag { min-width: 3ch; text-align: center; font: 16px/16px var(--pc); color: var(--c-lblue); }
.flag.on { color: var(--c-black); background: var(--c-cyan); }
.cpsr .mode { margin-left: auto; font: 16px/16px var(--pc); color: var(--c-lgray); }
.cpsr .mode b { font-weight: 400; color: var(--c-white); }

/* the Borland button: green, with a hard black shadow a character to the right and half a row down; pressed, it moves into its shadow */
.debug-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-right: 8px; margin: 16px 0 8px; }
.hwkey {
  border: 0; cursor: pointer; padding: 0 4px; height: 16px; border-radius: 0; white-space: nowrap;
  font: 16px/16px var(--pc); color: var(--c-black);
  background: var(--c-green); box-shadow: 8px 8px 0 var(--c-black);
}
.hwkey:hover { color: var(--c-white); }
.hwkey:active { transform: translateX(8px); box-shadow: none; }
.hwkey:disabled { color: var(--c-dgray); cursor: default; }
.hwkey:disabled:active { transform: none; box-shadow: 8px 8px 0 var(--c-black); }
.hwkey.run { color: var(--c-white); }
.hwkey.lit { background: var(--c-yellow); color: var(--c-black); }
/* small controls on a window's edge: [SET] [HOLD] [OPEN], like TD's frame icons */
.hwkey.small { background: var(--c-blue); box-shadow: none; padding: 0; color: var(--c-lgreen); }
.hwkey.small::before { content: "["; color: var(--c-white); }
.hwkey.small::after { content: "]"; color: var(--c-white); }
.hwkey.small:hover { color: var(--c-white); }
.hwkey.small:active { transform: none; background: var(--c-cyan); }
.hwkey.small.lit { color: var(--c-yellow); background: var(--c-blue); }

.disasm { min-height: 208px; white-space: pre; }
.disasm .ln { display: flex; gap: 8px; cursor: pointer; margin: 0 -6px; padding: 0 6px; }
.disasm .ln:hover { background: #0000c8; }
.disasm .ln .bp { width: 1ch; flex: none; color: var(--c-lred); }
.disasm .ln .ad { color: var(--c-lgray); }
.disasm .ln .op { color: var(--c-cyan); }
.disasm .ln .tx { color: var(--c-white); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.disasm .ln.cur { background: var(--c-cyan); }
.disasm .ln.cur .tx, .disasm .ln.cur .ad, .disasm .ln.cur .op, .disasm .ln.cur .bp { color: var(--c-black); }
.bp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lcd-input { width: 10ch; border: 0; border-radius: 0; padding: 0 4px; height: 16px; background: var(--c-cyan); color: var(--c-black); font: 16px/16px var(--pc); text-transform: uppercase; }
.lcd-input::placeholder { color: #006a6a; }
.lcd-input:focus { outline: none; background: var(--c-lcyan); }
.bp-list { display: flex; gap: 8px; flex-wrap: wrap; }
.bp-list button { border: 0; padding: 0 4px; height: 16px; background: var(--c-red); color: var(--c-white); font: 16px/16px var(--pc); cursor: pointer; }
.bp-list button:hover { text-decoration: line-through; }
.intlog { height: 160px; overflow-y: auto; white-space: pre; scrollbar-width: thin; scrollbar-color: var(--c-cyan) var(--c-blue); }
.intlog .e .n { color: var(--c-cyan); } .intlog .e .x { color: var(--c-white); } .intlog .e.irq { color: var(--c-lgreen); }
.last-int { color: var(--c-yellow); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.mini { position: relative; color: var(--c-lgray); display: flex; align-items: center; cursor: pointer; }
label.mini input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
label.mini::before { content: "[ ] "; white-space: pre; color: var(--c-white); }
label.mini:has(input:checked)::before { content: "[X] "; }
label.mini:has(input:focus-visible) { outline: 2px solid var(--accent); }
.hex { white-space: pre; overflow-x: auto; }
.hex .a { color: var(--c-lgray); } .hex .c { color: var(--c-lcyan); } .hex .d { color: var(--c-yellow); }
.win.hex { color: var(--c-white); }
.mem-jumps { display: flex; gap: 8px; }
@media (max-width: 1180px) {
  .inspector { position: static; max-height: none; width: 100%; max-width: 900px; margin: 0 auto; flex-direction: column; }
  .insp-tab { width: 100%; height: 32px; }
  .inspector.closed .insp-tab { height: 32px; }
  .insp-tab .tab-text { writing-mode: horizontal-tb; transform: none; }
  .insp-body { width: 100%; overflow: visible; }
  .insp-head { position: static; }
}
@media (max-width: 480px) {
  .meters { grid-template-columns: 1fr; }
  .regs { grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .reg .ra { display: none; }
  .debug-keys { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ peripherals */
.peripherals { max-width: 1480px; margin: 40px auto 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px 36px; align-items: start; }
.peripherals h2, .about h2 { margin: 0 0 16px; font: 400 16px/16px var(--pc); color: var(--c-white); }
.h2-sub { color: var(--c-lgray); margin-left: 8px; }
.hint { font: 15px/1.5 var(--serif); color: var(--ink-2); margin: 10px 0; }
.hint.small { font-size: 14px; color: var(--ink-3); }
.hint code, .credits code { font-size: 16px; color: var(--ink); }
/* buttons the page itself offers: a DOS dialog's, light grey with black type */
.btn { display: inline-flex; align-items: center; border: 0; border-radius: 0; background: var(--c-lgray); color: var(--c-black); padding: 4px 8px; font: 16px/16px var(--pc); cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--c-white); }
.btn:active:not(:disabled) { background: var(--c-cyan); }
.btn:disabled { background: var(--c-dgray); color: #2a2a2a; cursor: default; }
.btn.small { padding: 0 8px; }
.btn.primary { background: var(--c-green); color: var(--c-black); box-shadow: 8px 8px 0 var(--c-black); }
.btn.primary:hover { color: var(--c-white); background: var(--c-green); }
.btn.danger { color: var(--c-red); }
.btn.danger.armed { background: var(--c-red); color: var(--c-white); }
.disk-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 4px; }

.diskbox {
  position: relative; display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end;
  padding: 26px 20px 18px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(60,70,80,.35), rgba(30,34,40,.55)), linear-gradient(180deg, #2a2f35, #1c1f23);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -20px 30px rgba(0,0,0,.35), 0 12px 26px rgba(0,0,0,.45);
  min-height: 150px;
}
.diskbox::before { content: "DISKETTE FILE 3\00BD\201D"; position: absolute; top: 8px; left: 20px; font: 700 9px/1 var(--sans); letter-spacing: .28em; color: #7d8791; }
.floppy { position: relative; width: 104px; border: 0; padding: 0; background: none; cursor: grab; transition: transform .18s, filter .18s; filter: drop-shadow(0 6px 6px rgba(0,0,0,.45)); text-align: left; }
.floppy:hover, .floppy:focus-visible { transform: translateY(-8px) rotate(-1.5deg); }
.floppy svg { display: block; width: 104px; height: 108px; }
/* (only the picture fades: opacity on the button would fade its hover tip too) */
.floppy.in-drive { filter: none; transform: none; cursor: default; }
.floppy.in-drive > svg, .floppy.in-drive > .modified { opacity: .16; }
.floppy.missing { cursor: not-allowed; }
.floppy.missing > svg { opacity: .5; }
.floppy .tip { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 210px; padding: 6px 9px; border-radius: 0; background: #fffbe6; color: #2a2620; font: 14px/1.35 var(--serif); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; box-shadow: 3px 3px 0 rgba(0,0,0,.45); }
.floppy:hover .tip, .floppy:focus-visible .tip { opacity: 1; }
.floppy .modified { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; background: var(--c-yellow); color: var(--c-black); font: 16px/16px var(--pc); text-align: center; }

.printer-wrap { min-width: 0; }
.paper-view {
  position: relative; height: 300px; overflow: hidden; margin: 0 6%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 44px); mask-image: linear-gradient(180deg, transparent 0, #000 44px);
}
.paper-feed { position: absolute; left: 0; right: 0; bottom: 0; transition: transform .14s linear; will-change: transform; }
.paper-feed canvas { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.paper-empty { position: absolute; left: 0; right: 0; bottom: 90px; text-align: center; color: var(--ink-3); font: italic 15px/1.5 var(--serif); padding: 0 12px; z-index: 1; }
.printer { position: relative; z-index: 2; margin-top: -4px; }
.printer-top { height: 34px; margin: 0 3%; border-radius: 10px 10px 0 0; background: linear-gradient(180deg, #e6dfcc, #cfc6af); box-shadow: inset 0 1px 0 #fff; padding: 9px 5% 0; }
.platen { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(180deg, #121212, #2c2c2c 60%, #121212); box-shadow: inset 0 2px 3px #000; }
.head { position: absolute; top: -5px; left: 0; width: 26px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, #56524a, #2e2c28); box-shadow: 0 2px 3px rgba(0,0,0,.5); transform: translateX(0); transition: transform .05s linear; }
.printer-front { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px 14px; border-radius: 4px 4px 12px 12px; background: linear-gradient(180deg, #d9d1bd, #c7bea8); box-shadow: 0 3px 0 var(--plastic-dk), 0 14px 26px rgba(0,0,0,.5); }
.printer-front .btn { background: linear-gradient(180deg, #efe9da, #d4ccb6); color: #3a352b; border-color: #a99f87; }
.printer-front .btn:hover:not(:disabled) { background: linear-gradient(180deg, #fff, #dfd8c4); }
.printer-name { font: 600 11px/1 var(--sans); letter-spacing: .24em; color: #6b624f; margin-right: auto; }
.printer-name b { font-weight: 700; color: #3f392e; }
.printer-lamps { display: flex; gap: 12px; }
.printer-lamps label { display: flex; gap: 5px; align-items: center; font: 600 9px/1 var(--sans); letter-spacing: .12em; color: #6b624f; }

.serial-wrap { grid-column: 1 / -1; }
.serial-wrap summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.serial-wrap summary::-webkit-details-marker { display: none; }
.serial-wrap summary::before { content: "\25BA"; font: 16px/16px var(--pc); color: var(--c-lgray); }
.serial-wrap[open] summary::before { content: "\25BC"; }
.serial-wrap summary h2 { margin: 0; }
.serial { margin: 12px 0 8px; height: 192px; overflow: auto; padding: 8px; background: var(--c-black); color: var(--c-lgray); font: 16px/16px var(--pc); white-space: pre-wrap; word-break: break-all; }
.serial-in { display: flex; gap: 8px; }
.serial-in input { flex: 1; min-width: 0; border: 0; background: var(--c-black); color: var(--c-white); border-radius: 0; padding: 4px 8px; font: 16px/16px var(--pc); caret-color: var(--c-white); }

@media (max-width: 900px) { .peripherals { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ words */
.about { max-width: 1480px; margin: 64px auto 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px 64px; padding-top: 32px; border-top: 1px solid var(--rule); }
.about p { margin: 0 0 14px; max-width: 64ch; }
.about p:first-of-type { font-size: 19px; line-height: 1.55; color: var(--ink); }
.about .col:first-child p:not(:first-of-type) { color: var(--ink-2); }
.try { margin: 0; padding: 0; list-style: none; }
.try li { position: relative; padding: 0 0 10px 24px; color: var(--ink-2); }
.try li::before { content: "\25BA"; position: absolute; left: 0; top: .3em; font: 16px/16px var(--pc); color: var(--c-dgray); }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } }
.credits { max-width: 1480px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--rule); font: 14px/1.6 var(--serif); color: var(--ink-3); }
.credits p { max-width: 110ch; margin: 0 0 8px; }
.credits a { color: var(--ink-2); }
.credits .sig { margin-top: 16px; font-style: italic; }
.credits p:empty { display: none; }
.credits .release { margin: 18px 0 0; font: 16px/16px var(--pc); color: var(--c-dgray); }

/* ------------------------------------------------------------------ modal, drop veil */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-card { position: relative; width: min(560px, 100%); background: var(--c-lgray); color: var(--c-black); border: 3px double var(--c-white); border-width: 3px 6px; padding: 16px 16px 24px; box-shadow: 16px 16px 0 rgba(0,0,0,.7); font: 16px/16px var(--pc); }
.modal-card h3 { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); margin: 0; padding: 0 8px; background: var(--c-lgray); color: var(--c-white); font: 400 16px/16px var(--pc); white-space: nowrap; }
.modal-card textarea { width: 100%; border: 0; border-radius: 0; background: var(--c-blue); color: var(--c-white); font: 16px/16px var(--pc); padding: 8px; resize: vertical; caret-color: var(--c-white); }
.modal-card textarea::placeholder { color: var(--c-lcyan); }
.modal-actions { display: flex; justify-content: flex-end; gap: 24px; margin-top: 16px; padding-right: 8px; }
.modal-card .btn { background: var(--c-green); color: var(--c-black); box-shadow: 8px 8px 0 var(--c-black); padding: 0 16px; }
.modal-card .btn:hover { color: var(--c-white); }
.modal-card .btn:active { transform: translateX(8px); box-shadow: none; }
.modal-card .btn.primary { color: var(--c-white); }
.drop-veil { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.drop-veil div { border: 3px double var(--c-white); border-width: 3px 6px; padding: 24px 32px; color: var(--c-white); font: 16px/24px var(--pc); background: var(--c-blue); text-align: center; }
.noscript { text-align: center; color: var(--accent); }

/* ------------------------------------------------------------------ fullscreen */
.monitor:fullscreen { width: 100vw; height: 100vh; background: #000; display: flex; align-items: center; justify-content: center; }
.monitor:fullscreen .shell { width: min(100vw, calc(100vh * 1.25)); }
.monitor:fullscreen .postit { display: none; }

/* ------------------------------------------------------------------ small screens: the case reflows */
@container (max-width: 560px) {
  .front { grid-template-columns: 1fr 1fr; grid-template-areas: "bays bays" "controls power"; gap: 3cqw; padding: 3.5cqw; }
  .badge-area { display: none; }
  .bays { grid-area: bays; }
  .bay.blank { display: none; }
  .controls { grid-area: controls; }
  .power { grid-area: power; flex-direction: row; justify-content: flex-end; gap: 3cqw; }
  .drive-face { padding: 2.4cqw 3cqw 2cqw; gap: 2cqw; }
  .slot { height: 3cqw; }
  .drive-label, .drive-logo { font-size: 2.6cqw; }
  .eject { width: 10cqw; height: 3.6cqw; }
  .lamps label, .pushbtn em, .power-label, .mhz-unit { font-size: 2.2cqw; }
  .status-panel { padding: 2cqw; gap: 2.5cqw; }
  .pushbtn .cap { width: 12cqw; height: 6cqw; } .pushbtn.small .cap { width: 8cqw; height: 5cqw; }
  .keylock { display: none; }
  .rocker { width: 17cqw; height: 22cqw; }
  .rocker-face { font-size: 4cqw; }
  .rocker .o { width: 3.6cqw; height: 3.6cqw; border-width: .7cqw; } .rocker .i { width: .8cqw; height: 4.2cqw; }
  .monitor { width: 100cqw; }
  .chin { height: 9cqw; }
  .chin .brand b { font-size: 3.6cqw; } .chin .brand span { display: none; }
  .chin .knobs i { width: 4cqw; height: 4cqw; }
  .chin .mon-btn { width: 6cqw; height: 3.4cqw; }
  .chin .degauss-btn .cap { width: 5cqw; height: 2.5cqw; } .chin .degauss-btn .lbl { font-size: 1.4cqw; }
  .led { width: 2.2cqw; height: 2.2cqw; } .led.small { width: 1.8cqw; height: 1.8cqw; }
  .postit { width: 22cqw; font-size: 3cqw; right: 1cqw; top: -7cqw; }
}
/* "Reduce motion": animations and transitions finish at once rather than not at all, so what
   an animation leaves behind still happens (the case's lid is lifted off by one; without it the lid
   stayed on); looping ones stop after their one instant pass */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0s !important; }
}

/* ------------------------------------------------------------------ files (A: / C: browser) */
.files { margin-top: 20px; background: var(--c-blue); border: 3px double var(--c-lcyan); border-width: 3px 6px; font: 16px/16px var(--pc); color: var(--c-lcyan); }
.files.drag-over { border-color: var(--c-yellow); }
.files-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-bottom: 1px solid var(--c-lcyan); flex-wrap: wrap; }
.files-tabs { display: flex; gap: 0; }
.ftab { border: 0; cursor: pointer; padding: 0 8px; height: 16px; border-radius: 0; font: 16px/16px var(--pc); color: var(--c-lcyan); background: none; }
.ftab:hover { color: var(--c-white); }
.ftab[aria-selected="true"] { color: var(--c-black); background: var(--c-cyan); }
.files-path { flex: 1; min-width: 0; color: var(--c-white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-head .btn { background: var(--c-cyan); }
.files-head .btn:hover { background: var(--c-lcyan); }
.files-list { max-height: 272px; min-height: 128px; overflow-y: auto; padding: 4px 0; scrollbar-width: thin; scrollbar-color: var(--c-cyan) var(--c-blue); }
.frow { display: grid; grid-template-columns: 1fr 9ch 16ch; gap: 8px; width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0 8px; cursor: pointer; }
.frow:hover, .frow:focus-visible { background: var(--c-cyan); color: var(--c-black); outline: none; }
.frow:hover .fn, .frow:hover .fs, .frow:hover .fd, .frow:focus-visible .fn, .frow:focus-visible .fs, .frow:focus-visible .fd { color: var(--c-black); }
.frow .fs, .frow .fd { text-align: right; color: var(--c-lcyan); white-space: nowrap; }
.frow.dir .fn { color: var(--c-white); }
.frow .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-empty { padding: 32px 16px; text-align: center; color: var(--c-lcyan); }
.files-foot { padding: 4px 8px; color: var(--c-lcyan); border-top: 1px solid var(--c-lcyan); min-height: 25px; }
.files-foot.err { color: var(--c-yellow); }
.files-foot.ok { color: var(--c-white); }
@media (max-width: 480px) { .frow { grid-template-columns: 1fr 9ch; } .frow .fd { display: none; } }

/* ------------------------------------------------------------------ device keyboard field
   iOS opens its keyboard only for a focusable, visible field: 1px, almost transparent,
   16px text so Safari doesn't zoom, parked over the monitor so focusing it scrolls nowhere. */
.soft-kbd {
  position: absolute; left: 50%; top: 20%; right: auto; width: 1px; height: 1px; opacity: .01;
  font-size: 16px; line-height: 1; padding: 0; margin: 0; border: 0; resize: none; overflow: hidden;
  color: transparent; background: transparent; caret-color: transparent; pointer-events: none; z-index: 0;
}
.kbd-btn { font-size: 13px; }

/* ------------------------------------------------------------------ on-screen PC keyboard */
.pckeys {
  margin: 12px auto 0; padding: 10px; border-radius: 12px; max-width: 900px;
  background: linear-gradient(180deg, #cfc6b0, #b9af97); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 0 var(--plastic-dk), 0 12px 24px rgba(0,0,0,.45);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  display: flex; flex-direction: column; gap: 5px;
}
.pckeys .krow { display: flex; gap: 5px; }
.pckeys .kgap { display: block; }
.pckeys .k {
  position: relative; min-width: 0; height: 44px; padding: 0 2px; border: 0; border-radius: 5px; cursor: pointer;
  font: 600 14px/1 var(--sans); color: #2e2a23; white-space: nowrap; overflow: hidden;
  background: linear-gradient(180deg, #f3eee2 0%, #e2dac7 80%, #d3caB4 100%);
  box-shadow: 0 3px 0 #8f866e, 0 4px 4px rgba(0,0,0,.25), inset 0 1px 0 #fff;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.pckeys .k.fn, .pckeys .k.arrow { background: linear-gradient(180deg, #a59d8b, #8a8271); color: #f6f1e4; box-shadow: 0 3px 0 #5d574b, 0 4px 4px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.35); font-size: 12px; }
.pckeys .k.sm { font-size: 11px; }
.pckeys .k.space { background: linear-gradient(180deg, #f3eee2, #ddd5c1); }
.pckeys .k.down { transform: translateY(2px); box-shadow: 0 1px 0 #6f675a, inset 0 1px 0 rgba(255,255,255,.4); filter: brightness(.93); }
.pckeys .k.mod.latched { background: linear-gradient(180deg, #ffd27a, #e3a131); color: #2a1c05; box-shadow: 0 3px 0 #7a5212, 0 0 10px rgba(255,170,50,.55), inset 0 1px 0 #fff3d6; }
@media (max-width: 560px) {
  .pckeys { padding: 6px 4px; gap: 4px; border-radius: 8px; }
  .pckeys .krow { gap: 3px; }
  .pckeys .k { height: 40px; font-size: 13px; border-radius: 4px; }
  .pckeys .k.fn, .pckeys .k.arrow { font-size: 10px; }
  .pckeys .k.sm { font-size: 8px; letter-spacing: -.02em; }
  .pckeys .krow:first-child .k { font-size: 10.5px; letter-spacing: -.03em; }
}
/* the game pad */
.pckeys.pad { flex-direction: row; justify-content: space-between; align-items: center; gap: 14px; padding: 14px; }
.pckeys .pad-left, .pckeys .pad-right { display: flex; flex-direction: column; gap: 10px; }
.pckeys .dpad { display: grid; grid-template-columns: repeat(3, 62px); grid-template-rows: repeat(3, 62px); gap: 4px; }
.pckeys .dpad .k { height: 100%; font-size: 22px; border-radius: 10px; }
.pckeys .pad-buttons { display: grid; grid-template-columns: repeat(2, 84px); gap: 8px; }
.pckeys .pad-buttons .k { height: 60px; border-radius: 30px; font-size: 14px; letter-spacing: .08em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.pckeys .pad-buttons .k small { font: 600 9px/1 var(--sans); letter-spacing: .1em; opacity: .7; }
.pckeys .pad-buttons .k.red { background: linear-gradient(180deg, #e0463a, #b3261c); color: #fff3ea; box-shadow: 0 3px 0 #6e140e, 0 4px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.pckeys .pad-small { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.pckeys .pad-small .k { height: 36px; flex: none !important; }
@media (max-width: 400px) {
  .pckeys .dpad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); }
  .pckeys .pad-buttons { grid-template-columns: repeat(2, 70px); }
  .pckeys.pad { padding: 10px 8px; gap: 8px; }
}

/* ------------------------------------------------------------------ phones in portrait: screen on top, keyboard right below it */
@media (max-width: 700px) {
  .keys-open .rig { display: flex; flex-direction: column; }
  .keys-open .rig > .monitor { order: 1; }
  .keys-open .rig > .pckeys { order: 2; width: 100%; }
  .keys-open .rig > .toolbar { order: 3; }
  .keys-open .rig > .case { order: 4; }
  .keys-open .rig > .modem { order: 5; }
  .keys-open .rig > .modem-extras { order: 6; }
}

/* ------------------------------------------------------------------ the app layout (home-screen app, ?app, phones in landscape) */
.appbar, .disk-menu { display: none; }
html.app, html.app body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.app body {
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: #0d0c0a; min-height: 0;
}
html.app .masthead, html.app .peripherals, html.app .about, html.app .credits, html.app .case, html.app .toolbar, html.app .postit,
html.app .monitor .chin, html.app .kbd-hint .kbd-text, html.app .rig > .modem, html.app .rig > .modem-extras,
html.app .phone-card { display: none !important; }
html.app .desk { display: block; margin: 0; max-width: none; height: 100%; }
html.app .rig { max-width: none; height: 100%; display: flex; flex-direction: column; container-type: normal; }
html.app .appbar {
  display: flex; gap: 6px; align-items: center; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; flex: none;
  background: linear-gradient(180deg, #2a2620, #1c1915); border-bottom: 1px solid #000;
}
html.app .appbar::-webkit-scrollbar { display: none; }
.ab {
  flex: none; border: 0; border-radius: 6px; padding: 8px 10px; min-height: 34px; cursor: pointer;
  font: 700 11px/1 var(--sans); letter-spacing: .08em; color: #3a352b;
  background: linear-gradient(180deg, #efe9da, #d4ccb6); box-shadow: 0 2px 0 #8f866e, inset 0 1px 0 #fff;
}
.ab b { font-family: var(--mono); color: #7a2a1e; letter-spacing: 0; }
.ab[aria-pressed="true"], .ab[aria-expanded="true"] { background: linear-gradient(180deg, #ffe0a3, #f0bd5c); }
.ab-power { background: linear-gradient(180deg, #d8322a, #a11d16); color: #fff0ea; box-shadow: 0 2px 0 #5d0f0a, inset 0 1px 0 rgba(255,255,255,.35); display: flex; align-items: center; gap: 6px; }
.ab-power[aria-pressed="true"] { background: linear-gradient(180deg, #d8322a, #a11d16); }
.ab-led { width: 8px; height: 8px; border-radius: 50%; background: #3b1a14; }
.ab-power[aria-pressed="true"] .ab-led { background: #6dff8e; box-shadow: 0 0 6px rgba(90,255,130,.9); }
.ab-exit { margin-left: auto; }
html.standalone .ab-exit { display: none; }
html.app .disk-menu:not([hidden]) {
  display: flex; flex-direction: column; gap: 4px; position: fixed; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 52px); left: 8px; right: 8px; max-width: 360px;
  padding: 8px; border-radius: 0; background: var(--room-2); border: 1px solid var(--rule); box-shadow: 0 16px 40px rgba(0,0,0,.6);
}
.disk-menu button { display: flex; justify-content: space-between; gap: 10px; border: 0; border-radius: 0; padding: 8px 10px; background: #262b2d; color: var(--ink); font: 16px/16px var(--pc); text-align: left; cursor: pointer; }
.disk-menu button:disabled { opacity: .4; }
.disk-menu button .sw { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.disk-menu button.cur { outline: 1px solid var(--accent); }
html.app .monitor { order: 1; flex: 1 1 auto; min-height: 0; width: 100%; margin: 0; display: flex; align-items: center; justify-content: center; padding: 6px; container-type: size; }
html.app .monitor .shell {
  width: min(100cqw, calc((100cqh - 24px) * 4 / 3 + 24px)); padding: 8px; border-radius: 12px;
}
html.app .bezel { padding: 4px; border-radius: 8px; }
html.app .tube { border-radius: 14px / 16px; }
html.app .tube canvas { clip-path: inset(0 round 14px / 16px); }
html.app .pckeys { order: 2; flex: none; margin: 0 6px 6px; max-width: none; }
html.app .pckeys.pad { margin: 0 6px 6px; }
html.app .inspector { display: none; }
html.app.insp-open .inspector {
  display: flex; position: fixed; z-index: 25; inset: calc(env(safe-area-inset-top, 0px) + 50px) 0 0 auto; width: min(460px, 100vw);
  max-height: none; flex-direction: row;
}
html.app.insp-open .insp-tab { display: none; }
html.app.insp-open .insp-body { width: 100%; height: 100%; overflow-y: auto; border-radius: 10px 0 0 0; }
/* landscape: the screen gets the whole height; keys float over it */
@media (orientation: landscape) {
  html.app .appbar { padding: 4px 8px; }
  html.app .ab { min-height: 28px; padding: 6px 9px; }
  html.app .pckeys.full { position: fixed; z-index: 20; left: calc(env(safe-area-inset-left, 0px) + 6px); right: calc(env(safe-area-inset-right, 0px) + 6px); bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); margin: 0; background: rgba(40,36,30,.35); box-shadow: none; backdrop-filter: blur(2px); }
  html.app .pckeys.full { padding: 4px; gap: 3px; background: rgba(40,36,30,.18); }
  html.app .pckeys.full .krow { gap: 3px; }
  html.app .pckeys.full .k { opacity: .5; height: 27px; font-size: 11px; }
  html.app .pckeys.full .k.down, html.app .pckeys.full .k.latched { opacity: .9; }
  html.app .pckeys.pad { position: fixed; z-index: 20; inset: auto 0 calc(env(safe-area-inset-bottom, 0px) + 6px) 0; margin: 0; background: none; box-shadow: none; pointer-events: none; padding: 0 calc(env(safe-area-inset-right, 0px) + 10px) 0 calc(env(safe-area-inset-left, 0px) + 10px); }
  html.app .pckeys.pad > * { pointer-events: auto; }
  html.app .pckeys.pad .k { opacity: .78; }
  html.app .pckeys.pad .pad-small { grid-template-columns: repeat(4, 1fr); }
  html.app .pckeys.pad .pad-small .k { height: 30px; }
}
.pckeys .k.arrow { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; }
/* the disk LED while C: waits for a chunk from the network: a slow amber pulse instead of a flicker */
.led.amber.net { animation: netwait 0.9s ease-in-out infinite; }
@keyframes netwait { 0%, 100% { background: #5a3d12; box-shadow: none; } 50% { background: #ffb02e; box-shadow: 0 0 6px 1px rgba(255,170,40,.8); } }

/* the alt-CPU (x86) activity LED, driven by js/altled.js */
.led.x86.on { transition: opacity .08s linear; }
.ab-x86 { display: inline-flex; align-items: center; gap: .35em; cursor: default; }

/* ------------------------------------------------------------------ the joystick (js/joystick.js) */
/* the lamp on the front panel and in the app bar: lit while a controller (or the pad's JOY
   mode) is plugged into the game port, amber while a button is held */
.joy-lamp { display: inline-flex; align-items: center; gap: .3em; cursor: default; }
.joy-ico { width: max(12px, 1.9cqw); height: max(12px, 1.9cqw); fill: currentColor; opacity: .75; flex: none; }
.joy-ico .joy-btn { fill: #b3261c; }
.ab-joy { display: inline-flex; align-items: center; gap: .35em; cursor: default; }
.ab-joy .joy-ico { width: 14px; height: 14px; }
.led.green.joy.on.fire { background: #ffd23a; box-shadow: 0 0 6px 1px rgba(255,200,40,.85), inset 0 -1px 1px rgba(120,80,0,.5); }
/* the pad's JOY switch in the D-pad's hub */
.pckeys .dpad .k.joytoggle { font: 700 11px/1 var(--sans); letter-spacing: .1em; border-radius: 50%; margin: 8px; height: auto; opacity: .85; }
.pckeys .dpad .k.joytoggle[aria-pressed="true"] { background: linear-gradient(180deg, #3a8f4a, #25663a); color: #eaffee; box-shadow: 0 2px 0 #123a1d, 0 0 8px rgba(90,255,130,.45), inset 0 1px 0 rgba(255,255,255,.3); opacity: 1; }
.pckeys.pad.joy .dpad .k.arrow { outline: 1px solid rgba(90,255,130,.35); }

/* full screen: a small bar that shows the mouse state and fades away */
.fs-bar { display: none; }
.monitor:fullscreen .fs-bar {
  display: flex; position: absolute; z-index: 5; top: 14px; left: 50%; transform: translate(-50%, -8px); gap: 10px; align-items: center;
  padding: 4px 8px; border-radius: 0; background: var(--c-black); border: 0;
  font: 16px/16px var(--pc); color: var(--c-lgray); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s;
}
.monitor:fullscreen .fs-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fs-bar button { border: 0; border-radius: 0; padding: 0 8px; cursor: pointer; font: 16px/16px var(--pc); background: var(--c-lgray); color: var(--c-black); }
.fs-bar button.on { background: var(--c-cyan); color: var(--c-black); }
.fs-bar .fs-hint { color: var(--c-dgray); }

/* C: could not be saved in this browser (storage.js): the disk bay and the status line say so */
.blank-plate .not-saving-tag { display: none; margin-left: .8em; font: 700 .78cqw/1 var(--sans); letter-spacing: .12em; color: #fff; background: #b3261e; padding: .25em .5em; border-radius: 3px; }
.blank-plate.not-saving .not-saving-tag { display: inline-block; }
#hdStatus.warn { color: #ffb4a8; }
