/* Shared LED matrix look, modelled on the amber displays at Aachen bus stops */

/* Jersey 10 (SIL Open Font License, see /fonts/OFL-Jersey10.txt), served from
   this site instead of Google Fonts so no visitor data goes to Google */
@font-face {
  font-family: "Jersey 10";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jersey10-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jersey 10";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jersey10-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --led: #ff9426;
  --led-dim: rgba(255, 148, 38, 0.55);
  --led-faint: rgba(255, 148, 38, 0.22);
  --led-glow: rgba(255, 140, 26, 0.75);
  --led-off: rgba(255, 140, 26, 0.07);
  /* Space between the LEDs; slightly see-through so the glow shows */
  --led-gap: rgba(0, 0, 0, 0.8);
  --bg: #000;
  --fs: 24px;
  /* Distance between LED dots, tied to the font size */
  --dot: calc(var(--fs) / 12);
  color-scheme: dark;
}

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

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--led);
  font-family: "Jersey 10", "VT323", ui-monospace, monospace;
  font-size: var(--fs);
  line-height: 1;
}

button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--led); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* LED look: the text glows (text-shadow) and a static grid of holes on top
   turns it into dots, so moving text lights up fixed LEDs. The faint
   background shows the unlit LEDs on the same grid.
   This is a plain painted background instead of mask-image + filter, which
   browsers struggle to render while scrolling large boards. */
.led {
  position: relative;
  background-image: radial-gradient(circle, var(--led-off) 40%, transparent 46%);
  background-size: var(--dot) var(--dot);
  text-shadow: 0 0 calc(var(--dot) * 0.6) var(--led-glow), 0 0 calc(var(--dot) * 2) rgba(255, 140, 26, 0.45);
}
.led::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, transparent 58%, var(--led-gap) 68%);
  background-size: var(--dot) var(--dot);
}

/* Departure row: line, destination, platform, time */
.dep {
  display: grid;
  grid-template-columns: 2.4em 1fr auto 3.1em;
  column-gap: 0.3em;
  align-items: baseline;
  height: 1.12em;
  white-space: nowrap;
}
.dep-line { text-align: right; }
.dep-dest { overflow: hidden; }
.dep-plat { text-align: right; min-width: 2em; max-width: 4em; overflow: hidden; }
.dep-when { text-align: right; }
.dep-plat.is-changed { animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.ticker { overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-block; padding-left: 100%; animation: ticker linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; padding-left: 0; }
  .dep-plat.is-changed { animation: none; text-decoration: underline; }
}
