/* nodegraph.doodleshnookie.net
 *
 * The page is the front panel of a vector graphics instrument: one flat
 * blue-grey panel, legends printed on it, push keys with a closed grammar
 * (out, in, dim), and screens that are bounded dark faceplates in a bezel.
 * Only a screen is dark; only a screen glows. Guide and change pages are the
 * instrument's manual: pale paper with the panel as a rail. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Iosevka";
  src: url("fonts/iosevka.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Iosevka";
  src: url("fonts/iosevka-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* The panel and what is printed on it. */
  --panel: #aab8c4;
  --panel-well: #9cabb8;
  --panel-key: #bdc9d2;
  --ink: #0f1822;
  --ink-2: #2b3947;
  --rule: rgb(15 24 34 / 0.6);
  --rule-soft: rgb(15 24 34 / 0.2);

  /* The trim: nameplate and foot, the instrument's blue. */
  --trim: #243a55;
  --trim-2: #1a2c42;
  --trim-ink: #eef3f7;
  --trim-ink-2: #bccad7;

  /* The tube. */
  --bezel: #2a2f34;
  --bezel-edge: #171a1d;
  --face: #0e1712;
  --phosphor: #a8f5bd;
  --trace: #5fe38a;
  --phosphor-dim: #7fae8d;
  --lamp-off: #5b6873;

  /* The manual. */
  --paper: #eef1f1;
  --paper-well: #dfe5e8;
  --paper-rule: rgb(15 24 34 / 0.16);

  --sans: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --mono: "Iosevka", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --page: 90rem;
  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
  scrollbar-color: var(--ink-2) var(--panel-well);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--panel);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 100%;
  font-stretch: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
  font-variant-numeric: lining-nums;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  outline: none;
}

::selection {
  background: var(--trim);
  color: var(--trim-ink);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

img,
svg {
  max-width: 100%;
}

code,
pre,
kbd {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
}

.skip:focus-visible {
  top: 12px;
}

.num {
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Printed legends ------------------------------------------------------ */

.legend,
.group-label,
.readout-label,
.controls-legend dt,
.spec-table th,
.releases thead th,
.lamp-text {
  font-family: var(--sans);
  font-weight: 620;
  font-stretch: 72%;
  font-size: 0.74rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* A group label is printed the way an instrument brackets a row of controls:
 * a line from edge to edge with the name set into it and short ticks turning
 * down at both ends. */
.group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ink);
}

.group-label::before,
.group-label::after {
  content: "";
  align-self: stretch;
  margin-top: 0.36em;
  height: 9px;
  border-top: 1.5px solid var(--ink);
}

.group-label::before {
  width: 14px;
  flex: none;
  border-left: 1.5px solid var(--ink);
}

.group-label::after {
  flex: 1;
  border-right: 1.5px solid var(--ink);
}

/* --- Vector lettering (Hershey Simplex, drawn by site.js) --------------------- */

[data-hershey] {
  font-weight: 300;
  font-stretch: 82%;
  letter-spacing: 0.02em;
}

.hv {
  display: inline-block;
  overflow: visible;
}

.hv path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hv.is-drawing path {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  animation: pen 260ms var(--ease) forwards;
  animation-delay: var(--t, 0ms);
}

@keyframes pen {
  to {
    stroke-dashoffset: 0;
  }
}

/* --- Keys --------------------------------------------------------------------- */

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  font-family: var(--sans);
  font-weight: 640;
  font-stretch: 74%;
  font-size: 0.8rem;
  line-height: 1.1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel-key);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear;
}

.key:hover {
  background: var(--panel-well);
}

.key:active,
.key.is-in,
.key[aria-pressed="true"] {
  background: var(--ink);
  color: var(--panel-key);
}

.key:disabled,
.key[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.key-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.72rem;
}

/* The primary key: the one action on a panel, in the trim's blue. Lamps are
 * kept for the one screen that is writing. */
.key-lit {
  background: var(--trim);
  border-color: var(--trim);
  color: var(--trim-ink);
}

.key-lit:hover {
  background: var(--trim-2);
}

.key-lit:active {
  background: var(--ink);
  color: var(--trim-ink);
}

/* --- Lamps --------------------------------------------------------------------- */

.lamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
}

.lamp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.35);
  transition: background-color 160ms linear;
}

[data-state="live"] .lamp {
  color: var(--ink);
}

[data-state="live"] .lamp-dot {
  background: var(--trace);
  box-shadow: 0 0 0 1px #0d3d20, 0 0 8px 1px rgb(95 227 138 / 0.55);
}

[data-state="loading"] .lamp-dot {
  animation: blink 900ms steps(2, jump-none) infinite;
}

@keyframes blink {
  50% {
    background: var(--trace);
  }
}

/* --- Ink links ------------------------------------------------------------------ */

.ink,
.prose a,
.sec-sub a,
.statement a,
.op a,
.spec-table a,
.use-text a,
.rail-source a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 120ms linear;
}

.ink:hover,
.prose a:hover,
.sec-sub a:hover,
.statement a:hover,
.op a:hover,
.spec-table a:hover,
.use-text a:hover,
.rail-source a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}

/* --- Nameplate ---------------------------------------------------------------------- */

.nameplate {
  background: var(--trim);
  color: var(--trim-ink);
  border-bottom: 3px solid var(--trim-2);
}

.nameplate-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px 28px;
  flex-wrap: wrap;
  min-height: 64px;
}

.maker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--trim-ink);
  text-decoration: none;
}

.badge {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.name {
  font-size: 1.95rem;
  line-height: 1;
  --hv-stroke: 1.7px;
}

.model {
  font-weight: 560;
  font-stretch: 72%;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--trim-ink-2);
  padding-left: 28px;
  border-left: 1px solid rgb(238 243 247 / 0.28);
  line-height: 1.3;
}

.plate-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.plate-nav .key {
  min-height: 36px;
  padding: 0 14px;
  color: var(--trim-ink);
  background: transparent;
  border-color: rgb(238 243 247 / 0.5);
}

.plate-nav .key:hover {
  background: var(--trim-2);
}

.plate-nav .key.is-in {
  background: var(--trim-ink);
  color: var(--trim);
  border-color: var(--trim-ink);
}

.plate-nav :focus-visible,
.maker:focus-visible,
.readout:focus-visible,
.trim :focus-visible {
  outline-color: var(--trim-ink);
}

/* A readout window: the version, lit on a small screen of its own. */
.readout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--trim-ink-2);
}

.readout-value {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--phosphor);
  background: var(--face);
  padding: 6px 10px 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--bezel);
  font-variant-numeric: tabular-nums;
}

.readout:hover .readout-value {
  color: #e8fff0;
}

/* --- Screens ----------------------------------------------------------------------------- */

.screen {
  margin: 0;
  min-width: 0;
}

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.legend {
  color: var(--ink);
}

.bezel {
  background: var(--bezel);
  border-radius: 22px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px var(--bezel-edge);
}

.face {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--face);
  border-radius: 14px / 16px;
  overflow: hidden;
  isolation: isolate;
}

/* The tube's own falloff towards the edges of the faceplate. */
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 36px 4px rgb(0 0 0 / 0.55);
}

.face .still {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  object-fit: contain;
  z-index: 1;
}

/* A world-fit scene draws at a fixed camera: the still and the live canvas
 * share a 900x600 stage, scaled to the face by screens.js (--k). Without
 * script the stage is the face and the still is simply scaled. */
.stage {
  position: absolute;
  inset: 0;
}

.face.is-staged .stage {
  inset: auto;
  top: 0;
  left: 0;
  width: 900px;
  height: 600px;
  transform: scale(var(--k, 1));
  transform-origin: 0 0;
}

.face .screen-mount,
.face canvas {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  z-index: 2;
  pointer-events: auto !important;
}

.face canvas:focus-visible {
  outline: 2px solid var(--trace);
  outline-offset: -4px;
}

/* The storage tube erases with a flash of the whole faceplate. */
.flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--phosphor);
  opacity: 0;
}

.is-erasing .flash {
  animation: erase 460ms var(--ease);
}

@keyframes erase {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
  }
}

.screen-foot {
  margin-top: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 70ch;
}

/* --- Landing: the deck ------------------------------------------------------------------ */

.deck {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--gutter) 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 25rem);
  gap: 32px 48px;
  align-items: start;
}

.screen-main {
  max-width: calc((100svh - 230px) * 1.5 + 28px);
  min-width: min(100%, 36rem);
}

.controls-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 14px 0 0;
}

.controls-legend div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.controls-legend dt {
  color: var(--ink);
}

.controls-legend dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.controls-legend .for-touch {
  display: none;
}

@media (pointer: coarse) {
  .controls-legend .for-mouse {
    display: none;
  }

  .controls-legend .for-touch {
    display: block;
  }
}

.deck-controls {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.statement {
  font-size: 1.15rem;
  line-height: 1.45;
  font-weight: 430;
  max-width: 38ch;
}

.statement code {
  font-size: 0.92em;
}

.plate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  background: var(--panel-key);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}

.plate-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
}

.plate-text code {
  font-family: var(--mono);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: -8px;
}

/* The message tape: a readout window the scene's messages are written to. */
.tape-caption {
  font-size: 0.9rem;
  color: var(--ink-2);
  margin: -4px 0 12px;
}

.tape-window {
  position: relative;
  height: 7.75rem;
  background: var(--face);
  border: 8px solid var(--bezel);
  border-radius: 14px;
  padding: 12px 14px;
  overflow: hidden;
  box-shadow: inset 0 0 22px rgb(0 0 0 / 0.5);
}

.tape-roll {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: auto 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--phosphor);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40%);
}

.tape-roll li {
  display: grid;
  grid-template-columns: 1.1em 1fr auto;
  gap: 2px 6px;
  overflow-wrap: anywhere;
}

.tape-roll li::before {
  content: ">";
  color: var(--phosphor-dim);
}

.tape-roll .tape-count {
  color: var(--phosphor-dim);
  font-variant-numeric: tabular-nums;
}

.tape-roll li.is-new {
  animation: write 700ms var(--ease);
}

@keyframes write {
  from {
    color: #f4fff7;
  }
}

.tape-empty {
  color: var(--phosphor-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 36ch;
}

.tape-window.has-lines .tape-empty {
  display: none;
}

/* --- Bands ---------------------------------------------------------------------------------- */

.band {
  max-width: var(--page);
  margin: 0 auto;
  padding: 64px var(--gutter);
  border-top: 1.5px solid var(--ink);
}

.sec-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin-bottom: 36px;
}

.sec-head h2 {
  font-size: clamp(2.2rem, 1.6rem + 1.8vw, 3.3rem);
  line-height: 1;
  --hv-stroke: 2px;
}

.sec-sub {
  max-width: 58ch;
  font-size: 1.08rem;
  color: var(--ink-2);
}

/* Demos: one screen, a bank of channel keys. */
.channels-body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 32px 40px;
  align-items: start;
}

.selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 24px;
}

.channel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--panel-key);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  text-decoration: none;
  transition: background-color 120ms linear, color 120ms linear;
}

.channel::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.35);
}

.channel:hover {
  background: var(--panel-well);
}

.channel[aria-current="true"] {
  background: var(--ink);
  color: var(--panel-key);
}

.channel[data-live="true"]::after {
  background: var(--trace);
  box-shadow: 0 0 0 1px #0d3d20, 0 0 8px 1px rgb(95 227 138 / 0.55);
}

.ch-no {
  font-weight: 640;
  font-stretch: 72%;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
}

.channel .ch-no::before {
  content: "CH ";
}

.ch-name {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.panels {
  display: grid;
  gap: 64px;
  min-width: 0;
}

.is-tuned .channel-panel:not(.is-on) {
  display: none;
}

.channel-panel {
  display: grid;
  gap: 20px;
  min-width: 0;
  scroll-margin-top: 24px;
}

/* Never wider than its 900x600 stage plus the bezel: the stage scales down,
 * never up. */
.screen-wide {
  max-width: min(928px, calc((100svh - 200px) * 1.5 + 28px));
}

.panel-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 32px;
  align-items: start;
}

.ch-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 500;
}

.ch-title code {
  font-size: 1.05em;
}

.ch-title .ch-no {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 1.9rem;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--phosphor);
  background: var(--face);
  border-radius: 4px;
  box-shadow: inset 0 0 0 3px var(--bezel);
}

.ch-shows {
  font-size: 1.08rem;
  max-width: 48ch;
}

.ch-run {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.ch-run .plate {
  min-width: 20rem;
}

/* Theory of operation: a block diagram printed on the panel. */
.theory-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px 64px;
  align-items: start;
}

.diagram {
  margin: 0;
  padding: 24px;
  background: var(--panel-well);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
}

.diagram figcaption {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 60ch;
}

.loop {
  display: block;
  width: 100%;
  height: auto;
}

/* Below 40rem the wide diagram's lettering would fall under 12px: the
 * stacked variant takes over. */
.loop-narrow {
  display: none;
  max-width: 26rem;
}

@media (max-width: 40rem) {
  .diagram {
    padding: 16px 12px;
  }

  .loop-wide {
    display: none;
  }

  .loop-narrow {
    display: block;
  }
}

.loop-block rect {
  fill: var(--panel-key);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.loop-owner rect {
  fill: var(--panel);
  stroke-width: 3;
}

.loop-name {
  font-family: var(--sans);
  font-weight: 650;
  font-stretch: 74%;
  font-size: 15px;
  letter-spacing: 0.12em;
  text-anchor: middle;
  fill: var(--ink);
}

.loop-note {
  font-family: var(--sans);
  font-size: 12.5px;
  text-anchor: middle;
  fill: var(--ink-2);
}

.loop-wire path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.loop-head {
  fill: var(--ink);
}

.loop-tag text {
  font-family: var(--mono);
  font-size: 12.5px;
  fill: var(--ink);
  text-anchor: middle;
}

.loop-tag .loop-tag-start {
  text-anchor: start;
}

.loop-tag .loop-tag-end {
  text-anchor: end;
}

.op + .op {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--rule-soft);
}

.op h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.op p {
  max-width: 60ch;
}

.op code,
.sec-sub code,
.spec-table code,
.ch-shows code {
  font-size: 0.9em;
}

/* Specification and use. */
.spec-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px 72px;
  align-items: start;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid var(--ink);
}

.spec-table tr {
  border-bottom: 1px solid var(--rule-soft);
}

.spec-table th {
  text-align: left;
  vertical-align: top;
  width: 9.5rem;
  padding: 18px 20px 16px 0;
  color: var(--ink);
}

.spec-table td {
  padding: 13px 0;
  vertical-align: top;
}

.spec-table td.md ul {
  margin: 0;
  padding-left: 1.1em;
}

.spec-table td.md li + li {
  margin-top: 6px;
}

.mount {
  margin: 0 0 24px;
}

.face-capture {
  aspect-ratio: 1200 / 750;
}

.face-capture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mount figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--ink-2);
}

.use-text {
  font-size: 1.12rem;
  max-width: 50ch;
  margin-bottom: 20px;
}

.use-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

/* --- Foot --------------------------------------------------------------------------------- */

.trim {
  background: var(--trim);
  color: var(--trim-ink-2);
  border-top: 3px solid var(--trim-2);
}

.trim-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 32px var(--gutter) 40px;
}

.trim-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  color: var(--trim-ink);
}

.trim-name {
  font-size: 1.5rem;
  --hv-stroke: 1.4px;
}

.trim-credits {
  margin-top: 16px;
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 64ch;
}

.trim a {
  color: var(--trim-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgb(238 243 247 / 0.45);
}

.trim a:hover {
  text-decoration-color: currentColor;
}

/* --- The manual ------------------------------------------------------------------------------ */

.is-manual main {
  background: var(--paper);
}

.manual {
  display: grid;
  grid-template-columns: minmax(17rem, calc((100% - var(--page)) / 2 + 17rem)) minmax(0, 1fr);
  min-height: 100%;
}

.rail {
  background: var(--panel);
  border-right: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 36px 20px 40px;
}

.rail > * {
  width: min(17rem, 100%);
}

.rail-title {
  margin-bottom: 14px;
}

.rail-title a {
  font-weight: 640;
  font-stretch: 72%;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.rail-title a:hover {
  text-decoration: underline;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  position: sticky;
  top: 16px;
}

.rail-item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 3px;
  font-size: 0.95rem;
  line-height: 1.25;
}

.rail-item:hover {
  background: var(--panel-well);
}

.rail-item.is-on {
  background: var(--ink);
  color: var(--panel-key);
}

.rail-item.is-release {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rail-item.is-release .rail-name {
  font-family: var(--mono);
}

.rail-no,
.rail-date {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.8;
}

.rail-source {
  margin-top: 28px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.sheet {
  min-width: 0;
  max-width: 54rem;
  padding: 48px var(--gutter) 88px;
}

.sheet-head {
  margin-bottom: 36px;
}

.sheet-head h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: clamp(2.3rem, 1.7rem + 2vw, 3.4rem);
  font-weight: 300;
  line-height: 1.05;
  --hv-stroke: 2px;
}

.sheet-no {
  display: inline-grid;
  place-items: center;
  min-width: 3.2rem;
  height: 2.6rem;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--phosphor);
  background: var(--face);
  border-radius: 5px;
  box-shadow: inset 0 0 0 4px var(--bezel);
}

.sheet-sub {
  margin-top: 16px;
  font-size: 1.12rem;
  color: var(--ink-2);
  max-width: 60ch;
}

.prose > :is(p, ul, ol, blockquote, h2, h3, h4, dl) {
  max-width: 60ch;
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 1.2rem;
}

.prose h4 {
  margin-top: 1.6em;
  font-size: 1.05rem;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
  margin-top: 0.6em;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--ink-2);
}

.prose :not(pre) > code {
  font-size: 0.9em;
  padding: 0.08em 0.32em;
  background: var(--paper-well);
  border-radius: 3px;
}

/* A linked name in running text keeps its chip and gains the link's rule. */
.prose a code {
  border-bottom: 1px solid var(--ink-2);
  border-radius: 3px 3px 0 0;
}

.prose a:hover code {
  border-bottom-width: 2px;
}

.prose pre,
.notice pre {
  margin: 1.4em 0;
  padding: 16px 20px;
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-x: auto;
  border: 7px solid var(--bezel);
  border-radius: 14px;
  box-shadow: inset 0 0 22px rgb(0 0 0 / 0.45);
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: var(--phosphor-dim) var(--face);
}

.prose pre code {
  font-size: inherit;
}

.prose blockquote {
  margin: 1.4em 0;
  padding-left: 18px;
  border-left: 1px solid var(--ink);
  color: var(--ink-2);
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--paper-rule);
  vertical-align: top;
}

.prose .screen {
  margin: 2em 0;
  max-width: 900px;
}

.prose .screen .bezel {
  border-radius: 18px;
  padding: 12px;
}

.contents {
  margin-top: 56px;
}

.contents h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.contents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1.5px solid var(--ink);
}

.contents-list li {
  border-bottom: 1px solid var(--paper-rule);
}

.contents-list a {
  display: grid;
  grid-template-columns: 3rem minmax(0, 14rem) minmax(0, 1fr);
  gap: 4px 20px;
  align-items: baseline;
  padding: 14px 0;
  text-decoration: none;
}

.contents-list a:hover .contents-name {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.contents-no {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink-2);
}

.contents-name {
  font-weight: 640;
  font-size: 1.08rem;
}

.contents-lead {
  color: var(--ink-2);
  font-size: 0.98rem;
}

.turn {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1.5px solid var(--ink);
}

.turn .key {
  text-transform: none;
  letter-spacing: 0;
  font-stretch: 100%;
  font-weight: 560;
  font-size: 0.98rem;
  gap: 12px;
}

.turn-dir {
  font-weight: 640;
  font-stretch: 72%;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.turn-next {
  margin-left: auto;
}

/* Change information. */
.releases {
  width: 100%;
  max-width: 44rem;
  border-collapse: collapse;
  border-top: 1.5px solid var(--ink);
}

.releases th,
.releases td {
  text-align: left;
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--paper-rule);
  font-size: 0.98rem;
}

.releases thead th {
  padding-top: 13px;
  color: var(--ink);
}

.releases tbody th {
  font-family: var(--mono);
  font-weight: 400;
}

.notice {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1.5px solid var(--ink);
  scroll-margin-top: 16px;
}

.notice-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-bottom: 24px;
}

.notice-head h2 {
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  --hv-stroke: 1.8px;
}

.notice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.95rem;
  color: var(--ink-2);
}

/* --- Not found ---------------------------------------------------------------------------------- */

.lost {
  max-width: var(--page);
  margin: 0 auto;
  padding: 56px var(--gutter) 88px;
  display: grid;
  grid-template-columns: minmax(0, 36rem) minmax(0, 1fr);
  gap: 40px 56px;
  align-items: center;
}

.face-lost {
  display: grid;
  place-items: center;
}

.spot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #eafff0;
  box-shadow: 0 0 6px 3px rgb(95 227 138 / 0.7), 0 0 22px 8px rgb(95 227 138 / 0.25);
}

.lost-code {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 3.4rem;
  color: var(--trace);
  --hv-stroke: 2px;
}

.lost-text h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.lost-text p + p {
  margin-top: 20px;
}

/* --- Narrower panels ------------------------------------------------------------------------------ */

@media (max-width: 75rem) {
  .deck {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem);
    gap: 28px 32px;
  }

  .screen-main,
  .screen-wide {
    min-width: 0;
  }

  .statement {
    font-size: 1.08rem;
  }

  .spec-band,
  .theory-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 70rem) {
  .model {
    display: none;
  }
}

@media (max-width: 60rem) {
  .deck {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The tape follows the screen it prints for. */
  .deck-controls {
    padding-top: 0;
  }

  .deck-controls .tape {
    order: -1;
  }

  .statement {
    max-width: 52ch;
  }

  .channels-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .selector {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .channel {
    flex: none;
  }

  .panel-text {
    grid-template-columns: minmax(0, 1fr);
  }

  .manual {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
    align-items: stretch;
    padding: 16px var(--gutter);
  }

  .rail > * {
    width: auto;
  }

  .rail-title {
    margin-bottom: 8px;
  }

  .rail-list {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .rail-list li {
    flex: none;
  }

  .rail-item {
    grid-template-columns: auto auto;
    border: 1.5px solid var(--ink);
    padding: 8px 12px;
  }

  .rail-item .rail-date {
    display: none;
  }

  .rail-source {
    margin-top: 10px;
  }

  .lost {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  body {
    font-size: 1rem;
  }

  .nameplate-inner {
    gap: 10px 16px;
  }

  .name {
    font-size: 1.6rem;
  }

  .plate-nav {
    order: 3;
    margin-left: 0;
    width: 100%;
  }

  .plate-nav .key {
    flex: 1;
    padding: 0 8px;
  }

  .readout {
    margin-left: auto;
  }

  .readout-label {
    display: none;
  }

  .bezel {
    border-radius: 16px;
    padding: 9px;
  }

  .face {
    border-radius: 10px / 12px;
  }

  .deck {
    padding-top: 20px;
  }

  .statement {
    font-size: 1.08rem;
  }

  .controls-legend {
    gap: 6px 18px;
  }

  .ch-run .plate {
    min-width: 0;
    width: 100%;
  }

  .ch-run {
    align-items: stretch;
  }

  .spec-table th {
    width: 7rem;
  }

  .contents-list a {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .contents-lead {
    grid-column: 2;
  }

  .turn .key {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .is-erasing .flash {
    animation: none;
  }
}
