/* ALL STOPS — a city journal you ride */
@font-face { font-family: "Oswald"; src: url("assets/oswald.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "DM Serif"; src: url("assets/dm-serif.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/literata.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("assets/space-grotesk.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("assets/dm-sans.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("assets/ibm-plex-mono.ttf") format("truetype"); font-display: swap; }

:root {
  --ink: #152030;
  --night: #0c1421;
  --paper: #f5f0df;
  --paper-2: #ece3c9;
  --card: #faf6e9;
  --amber: #ffb000;
  --culture: #d64045;
  --food: #e8930c;
  --movement: #0e9594;
  --people: #7a5af8;
  --places: #2f9e44;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: "DM Sans", "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
img { max-width: 100%; display: block; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--amber); color: #111; font-weight: 700;
  padding: 10px 16px; border-radius: 8px; transition: top .15s;
}
.skip:focus { top: 12px; }

/* ---------- masthead ---------- */
.masthead { background: var(--night); color: var(--paper); border-bottom: 6px solid var(--amber); }
.masthead-inner {
  max-width: 1180px; margin: 0 auto; padding: 26px 22px 18px;
  display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
}
.brand { display: flex; gap: 18px; align-items: flex-start; }
.brand-kicker {
  font-family: "Plex Mono", monospace; font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--amber); margin: 2px 0 6px;
}
.wordmark {
  font-family: "Oswald", sans-serif; font-weight: 700; font-size: clamp(44px, 7vw, 84px);
  line-height: .95; letter-spacing: 2px; margin: 0;
}
.wordmark em { font-style: normal; color: transparent; -webkit-text-stroke: 2px var(--amber); }
.brand-tag { max-width: 46ch; color: #d8d2ba; margin: 10px 0 0; font-size: 15px; }
.masthead-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.clockbox, .pocketbox {
  font-family: "Plex Mono", monospace; background: #060b14; border: 2px solid #2a3a52;
  border-radius: 10px; padding: 8px 14px; min-width: 210px; text-align: right;
}
.clockbox-label, .pocketbox-label { display: block; font-size: 10px; letter-spacing: 3px; color: #8fa0b8; }
.clockbox-time { font-size: 30px; color: var(--amber); font-weight: 700; letter-spacing: 2px; }
.pocketbox-count { font-size: 16px; color: var(--paper); }
.stamp {
  font-family: "Plex Mono", monospace; font-size: 11px; color: #8fa0b8;
  border: 1.5px dashed #4a5d78; border-radius: 6px; padding: 4px 10px;
  transform: rotate(-2deg); margin: 2px 0 0;
}

.ticker { background: var(--amber); color: #14100a; overflow: hidden; border-top: 3px solid #14100a; }
.ticker-track { display: inline-block; white-space: nowrap; padding: 7px 0; font-family: "Plex Mono", monospace; font-size: 13px; font-weight: 700; animation: tick 28s linear infinite; }
.ticker-track span { padding-right: 40px; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- zones ---------- */
main { background: var(--paper); }
.zone { max-width: 1180px; margin: 0 auto; padding: 34px 22px 8px; }
.zone-kicker { font-family: "Plex Mono", monospace; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: #6b6250; margin: 0 0 6px; }
.zone h2 { font-family: "Oswald", sans-serif; font-size: clamp(28px, 4vw, 44px); margin: 0 0 6px; letter-spacing: .5px; line-height: 1.05; }
.zone-sub { max-width: 62ch; margin: 0 0 18px; color: #3d3a2f; }

/* ---------- map ---------- */
.mapboard { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: 8px 8px 0 var(--ink); }
.mapframe { position: relative; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; background: #f9f4e2; }
#mapSvg { display: block; width: 100%; height: auto; }
#mapSvg .dashes { animation: dashmove 1.2s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -16; } }

.station {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 7px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 12px 3px 3px; cursor: pointer; font: inherit;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s;
}
.station:hover { transform: translate(-50%, -50%) rotate(-2deg) scale(1.06); }
.station-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--line); color: #fff; font-family: "Plex Mono", monospace; font-weight: 700; font-size: 13px;
  border: 2.5px solid var(--ink); flex: none;
}
.station-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 13px; white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 14px 0 4px; padding: 0; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 14px;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 14px 6px 8px;
  box-shadow: 3px 3px 0 var(--ink);
}
.legend-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.legend-hint { font-size: 13px; color: #6b6250; margin: 8px 2px 2px; font-style: italic; }

/* ---------- ticket machine ---------- */
.machine-panel {
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 22px; box-shadow: 8px 8px 0 #0a0f18; border: 3px solid #060b14;
}
.machine-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.machine-top h2 { color: var(--paper); }
.machine-note { font-family: "Plex Mono", monospace; font-size: 12px; color: var(--amber); margin: 0; }
.machine-controls { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 14px; margin-top: 16px; align-items: end; }
.field label { display: block; font-family: "Plex Mono", monospace; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 13px;
  border: 2.5px solid var(--amber); border-radius: 9px; background: #060b14; color: var(--paper);
}
.field input::placeholder { color: #7c8aa0; }
.field-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.field-buttons button {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px;
  border: 2.5px solid var(--amber); border-radius: 9px; padding: 10px 16px; cursor: pointer;
  background: var(--amber); color: #14100a;
}
#savedToggle { background: transparent; color: var(--paper); }
#savedToggle[aria-pressed="true"] { background: var(--amber); color: #14100a; }
#surprise { background: transparent; color: var(--amber); border-style: dashed; }
#surprise:hover { background: #1a2740; }

/* ---------- timetable tickets ---------- */
.list-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.count { font-family: "Plex Mono", monospace; font-size: 13px; background: var(--ink); color: var(--amber); border-radius: 8px; padding: 8px 14px; margin: 0 0 8px; }
.tickets { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding-bottom: 10px; }
.ticket {
  position: relative; display: grid; grid-template-columns: 86px 1fr;
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  overflow: hidden; box-shadow: 6px 6px 0 var(--ink); transition: transform .12s;
}
.ticket:hover { transform: translate(-2px, -2px) rotate(-.4deg); box-shadow: 8px 8px 0 var(--ink); }
.ticket[hidden] { display: none; }
.stub {
  background: var(--line, var(--ink)); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 6px; border-right: 3px dashed var(--ink); position: relative;
}
.stub-num { font-family: "Oswald", sans-serif; font-size: 30px; font-weight: 700; line-height: 1; writing-mode: horizontal-tb; }
.stub-line { font-family: "Plex Mono", monospace; font-size: 9.5px; letter-spacing: 1.5px; text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg); }
.ticket-main { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ticket-cat { display: flex; align-items: center; gap: 8px; font-family: "Plex Mono", monospace; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #6b6250; }
.ticket-cat .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid var(--ink); flex: none; }
.ticket-main h3 { font-family: "DM Serif", Georgia, serif; font-weight: 400; font-size: 22px; line-height: 1.15; margin: 0; }
.ticket-main .summary { margin: 0; color: #4a463a; font-size: 15px; }
.ticket-meta { font-family: "Plex Mono", monospace; font-size: 12px; color: #6b6250; margin: 0; }
.ticket-row { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.open-btn {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 18px;
}
.open-btn:hover { background: var(--line); border-color: var(--ink); }
.in-pocket {
  font-family: "Plex Mono", monospace; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: var(--amber); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px;
}

.empty {
  border: 3px dashed var(--ink); border-radius: var(--radius); background: var(--card);
  text-align: center; padding: 44px 20px; margin-bottom: 26px;
}
.empty-sign { font-size: 52px; margin: 0; font-family: "Plex Mono", monospace; }
.empty h3 { font-family: "Oswald", sans-serif; font-size: 26px; margin: 6px 0; }
.empty button {
  font: inherit; font-weight: 700; cursor: pointer; margin-top: 10px;
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 22px; border: 2.5px solid var(--ink);
}

/* ---------- platform / detail ---------- */
.veil {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  background: rgba(6, 11, 20, .72); padding: 4vh 16px;
}
.veil[hidden] { display: none; }
.platform {
  max-width: 760px; margin: 0 auto; background: var(--paper);
  border: 4px solid var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 12px 12px 0 #000;
}
.board { background: #060b14; color: var(--amber); padding: 16px 22px 12px; font-family: "Plex Mono", monospace; border-bottom: 4px solid var(--amber); }
.board-line { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 2px; }
.board-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--line, var(--amber)); border: 2px solid var(--amber); flex: none; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.board-sub { margin: 4px 0 0; font-size: 12px; color: #8fa0b8; letter-spacing: 1.5px; }
.platform-body { padding: 24px 26px 28px; }
.detail-kicker { font-family: "Plex Mono", monospace; font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase; color: #6b6250; margin: 0 0 8px; }
.platform-body h2 { font-family: "DM Serif", Georgia, serif; font-weight: 400; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin: 0 0 10px; }
.detail-meta { font-family: "Plex Mono", monospace; font-size: 13px; color: #6b6250; margin: 0 0 16px; }
.detail-figure { margin: 0 0 18px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.detail-figure img { width: 100%; height: 260px; object-fit: cover; filter: sepia(.25) saturate(1.05); }
.detail-figure figcaption { font-family: "Plex Mono", monospace; font-size: 11px; color: #6b6250; padding: 7px 12px; }
.detail-prose { font-family: "Literata", Georgia, serif; font-size: 18px; line-height: 1.7; color: #23211a; }
.detail-prose p { margin: 0 0 1.1em; }
.detail-prose p:first-child::first-letter {
  font-family: "Oswald", sans-serif; font-size: 3.1em; float: left; line-height: .85;
  padding: 4px 10px 0 0; color: var(--line, var(--ink));
}
.detail-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.detail-actions button { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 15px; border-radius: 999px; padding: 11px 20px; cursor: pointer; }
#saveBtn { background: var(--amber); border: 3px solid var(--ink); color: #14100a; box-shadow: 4px 4px 0 var(--ink); }
#saveBtn[aria-pressed="true"] { background: var(--ink); color: var(--amber); }
#closeBtn { background: transparent; border: 3px solid var(--ink); color: var(--ink); }
#closeBtn .esc { font-family: "Plex Mono", monospace; font-size: 11px; border: 1.5px solid currentColor; border-radius: 5px; padding: 1px 6px; margin-left: 6px; }

/* ---------- colophon ---------- */
.colophon { background: var(--night); color: #cfc8ab; margin-top: 40px; border-top: 6px solid var(--amber); }
.colophon-inner { max-width: 1180px; margin: 0 auto; padding: 30px 22px 40px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; }
.colophon h2 { font-family: "Oswald", sans-serif; letter-spacing: 2px; color: var(--paper); margin: 0 0 8px; }
.colophon h3 { font-family: "Plex Mono", monospace; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--amber); margin: 0 0 8px; }
.colophon p { font-size: 14px; margin: 0; max-width: 52ch; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .tickets { grid-template-columns: 1fr; }
  .machine-controls { grid-template-columns: 1fr; }
  .colophon-inner { grid-template-columns: 1fr; }
  .masthead-side { align-items: flex-start; }
}
@media (max-width: 560px) {
  .station { padding: 2px; }
  .station-name { display: none; }
  .station-dot { width: 30px; height: 30px; font-size: 11px; }
  .ticket { grid-template-columns: 64px 1fr; }
  .detail-figure img { height: 180px; }
  .platform-body { padding: 18px 16px 22px; }
  .detail-prose { font-size: 16.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  #mapSvg .dashes { animation: none; }
  .board-dot { animation: none; }
  * { transition: none !important; }
}
