/* rail, event log, edge keys, footer — the machine chrome around the boards */
#rail {
  position: fixed;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 70;
}
.rail-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ivory-d);
  opacity: 0.65;
  transition: opacity 200ms ease, color 200ms ease;
}
.rail-link .rail-name { opacity: 0; transform: translateX(-4px); transition: opacity 220ms ease, transform 220ms ease; }
#rail:hover .rail-name, .rail-link:focus-visible .rail-name { opacity: 1; transform: none; }
.rail-link:hover { opacity: 1; }
.rail-link.lit { opacity: 1; color: var(--prog-accent); }
.rail-link.lit::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--prog-accent); }
@media (max-width: 860px) { .rail-link .rail-name { display: none; } }
@media (max-width: 560px) { #rail { display: none; } }

/* — event log (fixed, upper right) — */
#event-log {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}
.log-line {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ivory);
  background: rgba(14, 13, 11, 0.82);
  border: 1px solid var(--brass-d);
  border-right: 3px solid var(--prog-accent);
  padding: 5px 10px;
  transition: opacity 700ms ease;
}
.log-line.ok { border-right-color: var(--verdigris); color: var(--verdigris); }
.log-line.felt { border-right-color: var(--felt); color: var(--felt); }
.log-line.fading { opacity: 0; }
@media (max-width: 560px) { #event-log { top: 10px; right: 10px; } .log-line { font-size: 9px; padding: 4px 7px; } }

/* — program accent: every cross-section tint follows the selected program
     (--prog-accent is set on <html> by the engine; felt/brass/copper) — */
:root { --prog-accent: var(--felt); }

/* — edge keys: an 88-key strip down the right viewport edge, PLAYABLE — */
#edge-keys {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--ebony-2);
  border-left: 1px solid var(--brass-d);
  z-index: 65;
  touch-action: none; /* a press is a strike, not a scroll */
  cursor: pointer;
}
#edge-keys .wk {
  flex: 1;
  background: var(--ivory);
  border-bottom: 1px solid rgba(14, 13, 11, 0.55);
  transition: background 60ms ease, box-shadow 60ms ease;
}
#edge-keys .wk:hover { background: var(--kraft-2); }
#edge-keys .wk.down {
  background: var(--kraft-2);
  box-shadow: inset 0 3px 5px rgba(14, 13, 11, 0.55), inset 0 -1px 0 var(--prog-accent);
}
@media (max-width: 860px) { #edge-keys { display: none; } }

/* — footer — */
#colophon {
  background: var(--ebony);
  border-top: 1px solid var(--brass-d);
  padding: 26px var(--gutter) 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-row { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; color: var(--ivory-d); }
.foot-row a { color: var(--brass); text-decoration: none; border-bottom: 1px solid transparent; }
.foot-row a:hover { border-bottom-color: var(--brass); }
.foot-dim { color: rgba(201, 192, 172, 0.55); }
