/* ==========================================================
   STOP REQUESTED — a city journal laid out as a bus route
   ========================================================== */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #141414;
  --ink-soft: #3d3a35;
  --enamel: #f5efe0;
  --enamel-2: #ebe3cf;
  --paper: #fffdf6;
  --amber: #ffb21a;
  --amber-dim: #5a3b00;
  --stop-red: #d4231b;
  --stop-yellow: #f2c230;
  --navy: #14203d;
  --focus: #ffd400;

  --c-culture: #6f3496;
  --c-food: #b84a0c;
  --c-movement: #00784f;
  --c-people: #b51f5a;
  --c-places: #1d5fc0;

  --sign: "Oswald", "Arial Narrow", Impact, sans-serif;
  --read: "Literata", Georgia, "Times New Roman", serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --moquette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Crect width='96' height='96' fill='%23182241'/%3E%3Cpath d='M0 20h32v12H0zM48 68h32v12H48z' fill='%2326a19d'/%3E%3Cpath d='M32 0h12v32H32zM80 48h12v32H80z' fill='%23c42a5f'/%3E%3Ccircle cx='72' cy='24' r='9' fill='%23f2b632'/%3E%3Ccircle cx='24' cy='72' r='9' fill='%23f2b632'/%3E%3Cpath d='M8 44l8 8-8 8-8-8zM56 -4l8 8-8 8-8-8zM56 92l8 8-8 8-8-8z' fill='%23e9e1cc'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--read);
  font-size: 16px;
  line-height: 1.5;
  /* The bus seat. */
  background-color: #182241;
  background-image:
    linear-gradient(rgba(8, 12, 28, .62), rgba(8, 12, 28, .62)),
    var(--moquette);
  background-size: auto, 96px 96px;
  min-height: 100vh;
}

body.riding { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--ink);
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px;
  z-index: 50;
  background: var(--focus); color: var(--ink);
  font-family: var(--sign); text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ----------------------------------------------------------
   Destination blind (header)
   ---------------------------------------------------------- */

.blind {
  background: #0b0b0b;
  border-bottom: 6px solid var(--stop-yellow);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  color: var(--amber);
}

.blind-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 10px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.route-no {
  flex: none;
  width: 84px; height: 84px;
  display: grid; place-items: center;
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  font-family: var(--sign);
  font-weight: 700;
  font-size: 68px;
  line-height: 1;
  box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 7px var(--paper), inset 0 0 0 9px var(--ink);
}

.blind-text { min-width: 0; flex: 1; }

.masthead {
  margin: 0;
  font-family: var(--sign);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: clamp(40px, 6.2vw, 84px);
  line-height: .95;
}

/* dot-matrix LED effect */
.led-text {
  display: inline-block;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 170, 20, .55);
  -webkit-mask-image: radial-gradient(circle at center, #000 58%, transparent 64%);
  mask-image: radial-gradient(circle at center, #000 58%, transparent 64%);
  -webkit-mask-size: 4px 4px;
  mask-size: 4px 4px;
  transition: color .25s ease, text-shadow .25s ease;
}

.blind.requested .led-text {
  color: #ff4a3d;
  text-shadow: 0 0 22px rgba(255, 60, 40, .9);
}

.tagline {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: #d9c9a4;
}

.bell-lamp {
  flex: none;
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--sign); text-transform: uppercase; letter-spacing: .12em;
  font-size: 12px; color: #8c8577;
}
.lamp {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b1d18, #2a0807);
  border: 3px solid #333;
  transition: background .2s ease, box-shadow .2s ease;
}
.blind.requested .lamp {
  background: radial-gradient(circle at 35% 30%, #ff9a8a, #e3261c 60%);
  box-shadow: 0 0 22px 4px rgba(255, 50, 30, .7);
}

.ticker {
  overflow: hidden;
  border-top: 1px solid #2a2a2a;
  background: #050505;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--amber);
  white-space: nowrap;
}
.ticker-track {
  display: inline-block;
  padding: 7px 0;
  animation: ticker 60s linear infinite;
}
.ticker-track span { padding-right: 3em; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ----------------------------------------------------------
   Ticket machine (controls)
   ---------------------------------------------------------- */

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.machine {
  background: linear-gradient(180deg, #2b2f36, #1d2026);
  border: 3px solid #0d0e10;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 30px rgba(0,0,0,.4);
  padding: 14px 18px 14px;
  color: #f1ece0;
  position: relative;
}
.machine::before {
  content: "";
  position: absolute; left: 18px; right: 18px; top: 0;
  height: 4px; border-radius: 0 0 4px 4px;
  background: repeating-linear-gradient(90deg, var(--stop-yellow) 0 18px, #111 18px 30px);
}

.machine-title {
  margin: 4px 0 10px;
  font-family: var(--sign);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 14px;
  color: var(--stop-yellow);
}
.machine-title span { color: #a9a393; font-weight: 400; margin-left: .6em; }

.machine-controls {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: end;
}

.field label, .label-like {
  display: block;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  margin-bottom: 6px;
  color: #fff;
}
.hint {
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: #b9b2a1;
  margin-left: .5em;
}

.field input, .field select {
  width: 100%;
  height: 50px;
  border-radius: 8px;
  border: 2px solid #0b0b0b;
  background: #0b0b0b;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 17px;
  padding: 0 14px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.8), 0 0 0 1px #444;
}
.field input::placeholder { color: #8a6a2b; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--amber) 50%),
    linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 22px) 22px, calc(100% - 16px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field select option { background: #111; color: #fff; }

.wallet {
  width: 100%;
  height: 50px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(circle at 0 50%, transparent 7px, var(--paper) 7.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 7px, var(--paper) 7.5px) right / 51% 100% no-repeat;
  color: var(--ink);
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 15px;
  text-align: left;
  filter: drop-shadow(0 3px 0 #000);
  transition: transform .15s ease;
}
.wallet:hover { transform: translateY(-1px) rotate(-.6deg); }
.wallet-hole {
  flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px dashed #8b8373;
}
.wallet-text { flex: 1; line-height: 1.1; }
.wallet-count {
  flex: none;
  min-width: 30px; height: 30px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 14px;
}
.wallet[aria-pressed="true"] {
  background:
    radial-gradient(circle at 0 50%, transparent 7px, var(--stop-yellow) 7.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 7px, var(--stop-yellow) 7.5px) right / 51% 100% no-repeat;
}
.wallet[aria-pressed="true"] .wallet-hole {
  border: 0;
  background: #1d2026;
  box-shadow: inset 0 2px 3px rgba(0,0,0,.6);
}

.interchange {
  margin-top: 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.interchange-label {
  font-family: var(--sign); text-transform: uppercase; letter-spacing: .12em;
  font-size: 13px; color: #b9b2a1;
}
.interchange-lines { display: flex; flex-wrap: wrap; gap: 8px; }

.line-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px;
  padding: 4px 12px 4px 6px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: #33373f;
  color: #f1ece0;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 14px;
}
.line-btn .roundel {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--paper);
  border: 5px solid var(--c, #888);
}
.line-btn .n { font-family: var(--mono); font-size: 12px; color: #b9b2a1; }
.line-btn:hover { background: #40454f; }
.line-btn[aria-pressed="true"] {
  background: var(--c, var(--paper));
  border-color: #fff;
  color: #fff;
}
.line-btn[aria-pressed="true"] .n { color: rgba(255,255,255,.85); }
.line-btn[data-line="all"] .roundel {
  border: 0;
  background: conic-gradient(var(--c-culture) 0 20%, var(--c-food) 0 40%, var(--c-movement) 0 60%, var(--c-people) 0 80%, var(--c-places) 0);
}
.line-btn[data-line="all"][aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.line-btn[data-line="all"][aria-pressed="true"] .n { color: var(--ink-soft); }

/* ----------------------------------------------------------
   Enamel route-map panel
   ---------------------------------------------------------- */

.map-panel {
  margin-top: 22px;
  background: var(--enamel);
  border-radius: 18px;
  padding: 18px 22px 30px;
  position: relative;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 6px var(--enamel), inset 0 0 0 7px #c9bfa6, 0 18px 40px rgba(0,0,0,.45);
  /* rivets */
  background-image:
    radial-gradient(circle at 14px 14px, #b8ae96 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) 14px, #b8ae96 3px, transparent 4px),
    radial-gradient(circle at 14px calc(100% - 14px), #b8ae96 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #b8ae96 3px, transparent 4px);
}
.map-panel:focus { outline: none; }
.map-panel:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-bottom: 3px solid var(--ink);
  padding: 4px 8px 10px;
  margin: 0 0 8px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  font-size: 28px;
}
.panel-head h2 span { font-weight: 400; color: var(--ink-soft); }
.status {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- the strip map ---------- */

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stop { position: relative; }

.stop-card {
  background: var(--paper);
  border-radius: 10px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  display: flex; flex-direction: column;
}

.flag {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--c);
  color: #fff;
  padding: 6px 10px 6px 12px;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
}
.flag-no {
  font-family: var(--mono);
  letter-spacing: 0;
  background: rgba(0,0,0,.28);
  padding: 1px 7px;
  border-radius: 4px;
}

.stop-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.stop-name {
  margin: 0;
  font-family: var(--sign);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.12;
  letter-spacing: .005em;
}

.stop-summary {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.stop-meta {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: #5c574d;
  display: flex; flex-wrap: wrap; gap: 4px 12px;
}

.stop-foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* the red STOP button */
.bell {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  border: 2px solid var(--ink);
  border-radius: 30px;
  background: var(--stop-yellow);
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 3px 0 var(--ink);
}
.bell-dot {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #ff6a5c, var(--stop-red) 62%, #8e130d);
  border: 2px solid var(--ink);
  color: #fff;
  font-size: 10px;
  letter-spacing: .06em;
  font-weight: 700;
}
.bell:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.bell:hover .bell-dot { box-shadow: 0 0 14px 2px rgba(255,60,40,.6); }
.bell:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.kept-stamp {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--stop-red);
  border: 2px solid var(--stop-red);
  border-radius: 4px;
  padding: 2px 6px;
  transform: rotate(-6deg);
  white-space: nowrap;
}

/* markers and route line (shared pieces) */
.stalk { background: var(--ink); }
.marker-zone { position: relative; }
.marker {
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 7px solid var(--c);
  box-shadow: 0 0 0 3px var(--ink);
  z-index: 2;
}

/* ---------- Desktop: horizontal strip map, like the one above the bus door ---------- */
@media (min-width: 1200px) {
  .strip {
    display: grid;
    /* columns set from JS: one more track than there are stops */
    grid-template-rows: auto 64px auto;
    column-gap: 0;
    justify-content: center;
    padding: 18px 0 8px;
  }
  .stop {
    display: flex;
    flex-direction: column;
    padding: 0 7px;
  }
  .stop.is-top { grid-row: 1 / 3; align-self: end; }
  .stop.is-bottom { grid-row: 2 / 4; align-self: start; flex-direction: column-reverse; }

  .stop .stalk { width: 4px; height: 22px; margin: 0 auto; flex: none; }
  .stop .marker-zone { height: 64px; flex: none; margin: 0 -7px; }
  .stop .marker { left: 50%; top: 50%; transform: translate(-50%, -50%); }

  /* this stop's line segment runs from its marker to the next marker */
  .stop .marker-zone::before {
    content: "";
    position: absolute;
    left: 50%; right: 0; top: 50%;
    height: 14px; transform: translateY(-50%);
    background: var(--c);
    border-top: 3px solid var(--ink);
    border-bottom: 3px solid var(--ink);
  }
  .stop.is-last .marker-zone::before {
    background: repeating-linear-gradient(90deg, var(--c) 0 10px, transparent 10px 18px);
    border: 0;
    height: 8px;
  }
  .stop.is-first .marker-zone::after {
    content: "";
    position: absolute;
    left: 0; width: 50%; top: 50%;
    height: 8px; transform: translateY(-50%);
    background: repeating-linear-gradient(90deg, transparent 0 8px, #8b8373 8px 18px);
  }
  .stop-card { min-height: 0; }
}

/* ---------- Mobile/tablet: vertical strip map ---------- */
@media (max-width: 1199.98px) {
  .strip { max-width: 760px; margin: 0 auto; padding: 10px 0 0; }
  .stop {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    padding-bottom: 18px;
  }
  .stop .stop-card { grid-column: 2; grid-row: 1; }
  .stop .stalk { display: none; }
  .stop .marker-zone { grid-column: 1; grid-row: 1; margin-bottom: -18px; }
  .stop .marker { left: 50%; top: 18px; transform: translateX(-50%); }
  .stop .marker-zone::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 14px; transform: translateX(-50%);
    background: var(--c);
    border-left: 3px solid var(--ink);
    border-right: 3px solid var(--ink);
  }
  .stop.is-first .marker-zone::before { top: 30px; }
  .stop.is-first .marker-zone::after {
    content: "";
    position: absolute; top: 0; height: 30px; left: 50%;
    width: 8px; transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, transparent 0 6px, #8b8373 6px 14px);
  }
  .stop.is-last .marker-zone::before {
    top: 30px;
    width: 8px;
    border: 0;
    background: repeating-linear-gradient(180deg, var(--c) 0 10px, transparent 10px 18px);
  }
  /* small tick connecting the line to the card */
  .stop .stop-card { position: relative; overflow: visible; }
  .stop .stop-card::before {
    content: "";
    position: absolute; left: -16px; top: 30px;
    width: 14px; height: 4px; background: var(--ink);
  }
  .stop .flag { border-radius: 8px 8px 0 0; }
}

/* ---------- empty state ---------- */
.empty {
  text-align: center;
  padding: 34px 16px 20px;
}
.empty-sign {
  display: inline-block;
  margin: 0 0 12px;
  background: #0b0b0b;
  color: var(--amber);
  font-family: var(--sign);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 30px;
  padding: 8px 22px;
  border-radius: 8px;
  border: 3px solid #333;
}
.empty-title { margin: 0 0 6px; font-family: var(--sign); font-size: 24px; text-transform: uppercase; letter-spacing: .04em; }
.empty-msg { margin: 0 auto 18px; max-width: 46ch; color: var(--ink-soft); }
.btn-reset {
  border: 2px solid var(--ink);
  background: var(--stop-yellow);
  border-radius: 30px;
  padding: 12px 22px;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 3px 0 var(--ink);
}
.btn-reset:hover { transform: translateY(-1px); }

/* ---------- footer ---------- */
.colophon {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: #d8d0bd;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.colophon p { margin: 0 0 6px; max-width: 90ch; }
.colophon strong { color: var(--amber); font-weight: 400; }

/* ----------------------------------------------------------
   The ride (detail dialog)
   ---------------------------------------------------------- */

.ride {
  padding: 0;
  border: 0;
  width: min(900px, 94vw);
  max-width: none;
  height: min(94vh, 1000px);
  max-height: none;
  border-radius: 18px;
  background: var(--enamel);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.ride::backdrop {
  background: rgba(6, 8, 18, .72);
}
.ride[open] { animation: board .32s cubic-bezier(.2,.8,.2,1); }
@keyframes board {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.ride-bar {
  position: sticky; top: 0; z-index: 5;
  background: #0b0b0b;
  color: #f1ece0;
  padding: 10px 16px 0;
  border-bottom: 4px solid var(--stop-yellow);
}
.ride-bar-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.alight {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 6px 16px 6px 10px;
  border-radius: 24px;
  border: 2px solid #f1ece0;
  background: transparent;
  color: #f1ece0;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
}
.alight:hover { background: #f1ece0; color: var(--ink); }
.alight svg { width: 18px; height: 18px; }

.ride-pos {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
}

/* the keep-ticket toggle */
.keep {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 6px 16px 6px 12px;
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(circle at 0 50%, transparent 6px, var(--paper) 6.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 6px, var(--paper) 6.5px) right / 51% 100% no-repeat;
  color: var(--ink);
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 15px;
  transition: transform .15s ease;
}
.keep:hover { transform: rotate(-1.5deg); }
.keep-hole {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px dashed #8b8373;
  flex: none;
}
.keep[aria-pressed="true"] {
  background:
    radial-gradient(circle at 0 50%, transparent 6px, var(--stop-yellow) 6.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 6px, var(--stop-yellow) 6.5px) right / 51% 100% no-repeat;
}
.keep[aria-pressed="true"] .keep-hole {
  border: 0;
  background: #0b0b0b;
  animation: punch .3s ease;
}
@keyframes punch {
  0% { transform: scale(0); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* journey rail with the moving bus */
.rail {
  position: relative;
  height: 34px;
  margin: 6px 6px 0;
}
.rail-line {
  position: absolute; left: 0; right: 0; top: 20px;
  height: 6px; border-radius: 3px;
  background: #3a3a3a;
}
.rail-line::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: calc(var(--p, 0) * 100%);
  background: var(--c);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}
.rail-dot {
  position: absolute; top: 17px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #0b0b0b;
  border: 2px solid #777;
  transform: translateX(-50%);
}
.rail-dot.passed { border-color: #fff; background: var(--c); }
.rail-bus {
  position: absolute; top: 0;
  left: calc(var(--p, 0) * 100%);
  width: 34px; height: 20px;
  transform: translateX(-50%);
  color: var(--stop-yellow);
  z-index: 2;
}

/* the station name board */
.platform {
  margin: 22px 22px 0;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 22px 26px 0;
  box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 5px #fff;
  overflow: hidden;
}
.platform-kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stop-yellow);
}
.platform h2 {
  margin: 0;
  font-family: var(--sign);
  font-weight: 600;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.05;
}
.platform-by {
  margin: 12px 0 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: #cfd6e6;
}
.platform-band {
  margin: 0 -26px;
  height: 16px;
  background: var(--c);
  border-top: 3px solid #fff;
}

.window {
  margin: 18px 22px 0;
}
.window-frame {
  height: 210px;
  border-radius: 46px;
  border: 12px solid #2d3036;
  box-shadow: inset 0 0 0 2px #000, inset 0 10px 30px rgba(0,0,0,.4);
  background-color: #333;
  background-size: 140% auto;
  background-position: 0% 50%;
  background-repeat: repeat-x;
  animation: passing 40s linear infinite alternate;
  position: relative;
  overflow: hidden;
}
.window-frame::after {
  /* reflection on the glass */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 38%, transparent 46%);
}
@keyframes passing {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}
.window figcaption {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #6a6458;
}

.journey {
  margin: 28px 22px 0;
  padding: 0 0 0 42px;
  position: relative;
}
/* the route continues down through the text */
.journey::before {
  content: "";
  position: absolute; left: 12px; top: 8px; bottom: 8px;
  width: 8px; border-radius: 4px;
  background: var(--c);
}
.dek {
  font-family: var(--read);
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  margin: 0 0 22px;
  max-width: 36em;
  color: var(--ink-soft);
}
.body p {
  font-family: var(--read);
  font-size: 19px;
  line-height: 1.72;
  margin: 0 0 1.1em;
  max-width: 36em;
  position: relative;
}
.body p::before {
  content: "";
  position: absolute;
  left: -34px; top: .45em;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  border: 4px solid var(--ink);
}
.body p:first-child::first-letter {
  font-family: var(--sign);
  font-weight: 700;
  float: left;
  font-size: 3.4em;
  line-height: .9;
  padding: .06em .12em 0 0;
  color: var(--c);
}

.terminus {
  margin: 30px 22px 30px;
  padding: 18px 20px;
  border-top: 3px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.terminus-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.next-stop {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 30px;
  padding: 6px 18px 6px 8px;
  font-family: var(--sign);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 15px;
  text-align: left;
  box-shadow: 0 3px 0 var(--ink);
  max-width: 100%;
}
.next-stop .roundel {
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 6px solid var(--nc, var(--ink));
}
.next-stop small { display: block; font-family: var(--mono); text-transform: none; letter-spacing: 0; font-size: 11px; color: var(--ink-soft); }
.next-stop:hover { transform: translateY(-1px); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .blind-inner { padding: 12px 14px 8px; gap: 12px; }
  .route-no { width: 56px; height: 56px; font-size: 44px; border-radius: 8px; }
  .masthead { font-size: 34px; }
  .led-text { -webkit-mask-size: 3px 3px; mask-size: 3px 3px; }
  .tagline { font-size: 11.5px; }
  .bell-lamp { display: none; }
  .ticker { font-size: 11.5px; }

  main { padding: 14px 12px 30px; }
  .machine { padding: 12px 12px; border-radius: 14px; }
  .machine-controls { grid-template-columns: 1fr; gap: 12px; }
  .field .hint { display: block; margin: 2px 0 0; }
  .interchange-label { width: 100%; }
  .line-btn { font-size: 13px; }

  .map-panel { padding: 14px 10px 20px; border-radius: 14px; }
  .panel-head { padding: 2px 4px 8px; }
  .panel-head h2 { font-size: 22px; }
  .status { font-size: 12.5px; }
  .stop { grid-template-columns: 40px minmax(0, 1fr); }
  .stop .stop-card::before { left: -12px; width: 10px; }
  .stop-name { font-size: 21px; }

  .ride {
    width: 100vw; height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  .ride-bar { padding: 8px 10px 0; }
  .alight { font-size: 13px; padding: 6px 12px 6px 8px; }
  .ride-pos { display: none; }
  .keep { font-size: 13px; padding: 6px 12px 6px 10px; }
  .platform { margin: 14px 12px 0; padding: 16px 16px 0; }
  .platform-band { margin: 0 -16px; }
  .window { margin: 14px 12px 0; }
  .window-frame { height: 150px; border-radius: 32px; border-width: 9px; }
  .journey { margin: 22px 12px 0; padding-left: 34px; }
  .journey::before { left: 8px; width: 6px; }
  .body p::before { left: -30px; width: 14px; height: 14px; border-width: 3px; }
  .dek { font-size: 18px; }
  .body p { font-size: 17.5px; line-height: 1.68; }
  .terminus { margin: 20px 12px 30px; padding: 16px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .ticker-track { animation: none; transform: none; }
  .window-frame { animation: none; background-position: 50% 50%; }
}
