/* fourier-singer channel - styled to the CRT theme.
 *
 * The page body is wrapped by the SSG's page template, so it inherits the
 * cabinet, scanlines and sidebar. This file only styles the instrument, and
 * uses the theme's own colour tokens (--crt-color, --crt-glow, --crt-dim)
 * rather than hard-coded phosphor values, so it tracks the active colour mode.
 * The spectrogram's own ramp is the article's, drawn on the canvas.
 */

.fs-head {
  margin-bottom: 1.2rem;
}

.fs-head h1 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: var(--crt-color);
  text-shadow: 0 0 6px var(--crt-glow);
}

.fs-sub {
  margin: 0;
  max-width: 68ch;
  line-height: 1.55;
  color: var(--crt-color);
  opacity: 0.85;
}

.fs-mono {
  font-family: "Courier New", Courier, monospace;
}

/* ---- controls ---- */
.fs-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 1.2rem 0 0.8rem;
}

.fs-btn {
  background: #071407;
  color: var(--crt-color);
  border: 1px solid var(--crt-dim);
  padding: 0.5rem 1.1rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 6px var(--crt-glow);
}

.fs-btn:hover:not(:disabled) {
  border-color: var(--crt-color);
  background: #0c2a0e;
}

.fs-btn.on {
  border-color: #ffb000;
  color: #ffb000;
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

.fs-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

/* the guide is the one thing on the page that tells you what to do next */
.fs-guide {
  letter-spacing: 0.08em;
}

.fs-guide.up,
.fs-guide.down {
  color: var(--phosphor-amber, #ffb000);
}

.fs-guide.tuned {
  color: #c9ffc0;
}

.fs-status {
  /* takes the slack so the switches stay on one row, and can shrink */
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--crt-color);
  opacity: 0.7;
}

.fs-status.live {
  opacity: 1;
}

.fs-status.bad {
  color: #ffb000;
  opacity: 1;
}

/* ---- the naming switch and the pitch method switch ---- */
.fs-switch {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--crt-dim);
}

/* the second switch follows the first, already separated by the row's gap */
.fs-switch + .fs-switch {
  margin-left: 0;
}

.fs-switch button {
  background: transparent;
  color: var(--crt-color);
  border: 0;
  border-right: 1px solid var(--crt-dim);
  padding: 0.42rem 0.7rem;
  font: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.6;
}

.fs-switch button:last-child {
  border-right: 0;
}

.fs-switch button:hover {
  opacity: 1;
}

/* the selected one has to be obvious at a glance: two shades of green were not,
   so it also gets an amber bar on its leading edge */
.fs-switch button.on {
  background: #123f14;
  opacity: 1;
  color: var(--phosphor-amber, #ffb000);
  box-shadow: inset 3px 0 0 var(--phosphor-amber, #ffb000);
}

.fs-switch button:not(.on) {
  opacity: 0.45;
}

/* ---- spectrogram ---- */
.fs-scope {
  margin: 0.6rem 0 1rem;
}

.fs-scope .fs-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--crt-color);
  opacity: 0.7;
}

.fs-mel {
  display: block;
  width: 100%;
  height: 180px;
  background: #050a05;
  border: 1px solid var(--crt-dim);
  image-rendering: pixelated;
}

.fs-fft {
  height: 140px;
}

.fs-axis {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--crt-color);
  opacity: 0.55;
}

/* ---- readout ---- */
.fs-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  padding: 0.9rem 0 1rem;
  border-top: 1px solid var(--crt-dim);
  border-bottom: 1px solid var(--crt-dim);
}

.fs-note {
  font-size: 3.2rem;
  line-height: 1;
  min-width: 4.2ch;
  color: var(--crt-color);
  text-shadow: 0 0 12px var(--crt-glow);
}

.fs-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.15rem 1.2rem;
  font-size: 0.86rem;
}

.fs-dl dt {
  color: var(--crt-color);
  opacity: 0.55;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  align-self: center;
}

.fs-dl dd {
  margin: 0;
  color: var(--crt-color);
  font-family: "Courier New", Courier, monospace;
}

.fs-stars {
  letter-spacing: 0.12em;
  color: #ffb000;
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.45);
}

.fs-stars-num {
  margin-left: 0.6ch;
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ---- keyboard strip ---- */
.fs-keys {
  display: grid;
  grid-template-columns: repeat(28, minmax(0, 1fr));
  gap: 2px;
  margin: 1rem 0 1.4rem;
}

.fs-key {
  background: #071407;
  border: 1px solid var(--crt-dim);
  color: var(--crt-color);
  font: inherit;
  font-size: 0.58rem;
  padding: 0.45rem 0;
  cursor: pointer;
  opacity: 0.75;
}

.fs-key:hover {
  border-color: var(--crt-color);
  opacity: 1;
}

.fs-keys.solfege .fs-key {
  font-size: 0.5rem;
  letter-spacing: 0;
}

.fs-key.on {
  border-color: var(--crt-color);
  background: #123f14;
  opacity: 1;
  box-shadow: 0 0 10px var(--crt-glow) inset;
}

@media (max-width: 768px) {
  .fs-keys {
    grid-template-columns: repeat(14, minmax(0, 1fr));
  }

  .fs-note {
    font-size: 2.4rem;
  }
}
