/* The Last Stop — a city journal laid out as one 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: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f1e8d0;
  --card: #fffaf0;
  --ink: #1b1a2e;
  --ink-soft: #4a4860;
  --amber: #ffb21a;
  --yellow: #ffc21a;

  --culture: #b5144f;
  --food: #b8420a;
  --movement: #0b5ed7;
  --people: #1b7a3d;
  --places: #6a3fb5;

  --display: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: "Literata", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --rail: 72px;
  --rail-x: 36px; /* centre of the rail */
  --sign-h: 52px;
}

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

html { scroll-padding-top: calc(var(--sign-h) + 16px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body.is-locked { overflow: hidden; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.skip:focus { top: 12px; }

/* ---------- masthead ---------- */

.masthead {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 0;
}
.masthead__kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
}
.masthead__title {
  margin: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(8px, 2vw, 24px);
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: .86;
  letter-spacing: -.01em;
}
.masthead__the {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(54px, 9vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(1.2rem, 2.6vw, 2.3rem);
  letter-spacing: .04em;
  margin-bottom: .4vw;
}
.masthead__name {
  font-size: clamp(3.4rem, 15.5vw, 10.5rem);
  padding-top: .08em;
}
.masthead__tag {
  max-width: 46ch;
  margin: 14px 0 18px;
  font-size: 1.1rem;
  font-style: italic;
}
.stripes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 -20px;
}
.stripes i {
  display: block;
  height: 8px;
  background: var(--c);
}
.stripes i:nth-child(odd) { margin-right: 6vw; }
.stripes i:nth-child(even) { margin-left: 4vw; }

/* ---------- LED destination sign ---------- */

.sign {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-top: 20px;
  background: var(--ink);
  border-block: 3px solid var(--ink);
}
.sign__plate {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--sign-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
}
.sign__route {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 34px;
  border-radius: 6px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1;
}
.sign__window {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0d0b08;
  border-radius: 4px;
  padding: 0 10px;
}
.sign__window::after {
  /* dot-matrix grid laid over the glowing letters */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#0d0b08 1px, transparent 1px),
    linear-gradient(90deg, #0d0b08 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: .55;
  pointer-events: none;
}
.sign__text {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 178, 26, .75);
  animation: ticker 16s linear infinite;
}
@keyframes ticker {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(min(0px, calc(-100% + 60vw))); }
}

/* ---------- layout ---------- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

/* ---------- board / controls ---------- */

.board {
  align-self: start;
}
.board__form {
  display: grid;
  gap: 18px;
  padding: 20px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
input[type="search"], select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
}
input[type="search"]::placeholder { color: #6d6a80; }
.select { position: relative; }
.select select {
  padding-right: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%231b1a2e' stroke-width='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: .95rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
}
.chip__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--ink);
}
.chip[aria-pressed="true"] {
  background: var(--c);
  color: #fff;
}
.chip[aria-pressed="true"] .chip__dot { background: #fff; }

.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 2px dashed var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.wallet__icon { display: flex; }
.wallet__label { flex: 1; }
.wallet__count {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: .9rem;
}
.wallet[aria-pressed="true"] {
  background: var(--ink);
  border-style: solid;
  color: var(--yellow);
}
.wallet[aria-pressed="true"] .wallet__count {
  background: var(--yellow);
  color: var(--ink);
}
.wallet[aria-pressed="true"]:focus-visible { outline-color: var(--ink); }

.board__note {
  margin: 16px 4px 0;
  font-size: .92rem;
  color: var(--ink-soft);
}

/* ---------- route ---------- */

.status {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  min-height: 1.5em;
}

.routewrap { position: relative; }
.route {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stop {
  --c: var(--ink);
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-bottom: 34px;
}
.stop[data-category="Culture"]  { --c: var(--culture); }
.stop[data-category="Food"]     { --c: var(--food); }
.stop[data-category="Movement"] { --c: var(--movement); }
.stop[data-category="People"]   { --c: var(--people); }
.stop[data-category="Places"]   { --c: var(--places); }

.stop::before {
  /* the line itself */
  content: "";
  position: absolute;
  left: calc(var(--rail-x) - 7px);
  width: 14px;
  top: 0;
  bottom: 0;
  background: var(--c);
}
.stop:first-child::before { top: 34px; }
.stop:last-child::before { bottom: auto; height: 34px; }
.stop:first-child:last-child::before { display: none; }

.stop__roundel {
  position: absolute;
  left: calc(var(--rail-x) - 24px);
  top: 10px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--c);
  box-shadow: 0 0 0 3px var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  z-index: 2;
}
.stop.is-saved .stop__roundel {
  background: var(--c);
  color: #fff;
}

.stop__body { grid-column: 2; min-width: 0; }

.stop__transfer {
  display: inline-block;
  margin: 0 0 10px;
  padding: 3px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ticket {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  overflow: hidden;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s ease-out, box-shadow .15s ease-out;
}
.ticket:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--c);
}
.ticket::before, .ticket::after {
  /* perforation notches */
  content: "";
  position: absolute;
  right: 122px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  z-index: 1;
}
.ticket::before { top: -12px; }
.ticket::after { bottom: -12px; }

.ticket__main { padding: 18px 20px 20px; min-width: 0; }
.ticket__tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 10px;
  background: var(--c);
  color: #fff;
  font-family: var(--display);
  font-weight: 500;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ticket__title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: .005em;
}
.open {
  all: unset;
  display: inline;
  cursor: pointer;
}
.open::after {
  /* stretch the control over the whole ticket */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
}
.open:focus-visible { outline: none; box-shadow: none; }
.open:focus-visible::after {
  outline: 4px solid var(--ink);
  outline-offset: -8px;
  box-shadow: inset 0 0 0 8px var(--yellow);
}
.ticket__summary { margin: 0 0 12px; max-width: 52ch; }
.ticket__by {
  margin: 0;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.ticket__stub {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 18px 10px;
  border-left: 2px dashed var(--ink);
  background: color-mix(in srgb, var(--c) 12%, var(--card));
  text-align: center;
}
.stub__label {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.stub__num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.2rem;
  line-height: 1;
}
.stub__num small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: .85rem;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stub__date {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.stamp {
  display: none;
  position: absolute;
  right: 150px;
  bottom: 14px;
  padding: 2px 10px;
  border: 3px solid var(--c);
  border-radius: 4px;
  color: var(--c);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  opacity: .9;
  pointer-events: none;
  z-index: 2;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
.stop.is-saved .stamp { display: block; }
.stop.is-saved .ticket__stub::before {
  /* the punched hole */
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}

/* the bus */
.bus {
  position: absolute;
  top: 0;
  left: calc(var(--rail-x) - 20px);
  width: 40px;
  height: 64px;
  pointer-events: none;
  z-index: 4;
  will-change: transform;
}
.bus svg { display: block; transform: rotate(180deg); transition: transform .35s ease; filter: drop-shadow(3px 3px 0 rgba(27, 26, 46, .35)); }
.bus.is-up svg { transform: rotate(0deg); }

/* ---------- empty ---------- */

.empty {
  padding: 36px 24px 32px;
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  background-image: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--ink) 14px 28px);
  background-size: 100% 14px;
  background-repeat: no-repeat;
  background-position: top;
}
.empty__big {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1;
  text-transform: uppercase;
}
.empty__why { margin: 0 0 20px; max-width: 48ch; font-size: 1.1rem; }

.btn {
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--ink-soft); }
.btn--ghost { background: #fff; color: var(--ink); }
.btn--ghost:hover { background: var(--paper); }

.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 48px;
}
.foot p {
  margin: 0;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--ink-soft);
  max-width: 70ch;
}

/* ---------- detail dialog ---------- */

dialog.detail {
  --c: var(--ink);
  padding: 0;
  border: 3px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  width: min(880px, calc(100vw - 32px));
  max-width: none;
  height: min(calc(100dvh - 32px), 960px);
  max-height: none;
  margin: auto;
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}
dialog.detail[open] { display: flex; flex-direction: column; }
dialog.detail[data-category="Culture"]  { --c: var(--culture); }
dialog.detail[data-category="Food"]     { --c: var(--food); }
dialog.detail[data-category="Movement"] { --c: var(--movement); }
dialog.detail[data-category="People"]   { --c: var(--people); }
dialog.detail[data-category="Places"]   { --c: var(--places); }
dialog.detail::backdrop { background: rgba(27, 26, 46, .78); }

.detail__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  background: var(--c);
  color: #fff;
}
.detail__stop {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.close {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid #fff;
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.close:hover { background: var(--paper); }
.close:focus-visible { outline-color: #fff; box-shadow: 0 0 0 6px var(--ink); }

.trip {
  --p: 0;
  flex: none;
  position: relative;
  height: 22px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.trip::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px);
  opacity: .35;
}
.trip__fill {
  position: absolute;
  left: 0;
  top: 8px;
  height: 6px;
  width: calc(var(--p) * 100%);
  background: var(--c);
}
.trip__bus {
  position: absolute;
  top: 2px;
  left: calc((100% - 28px) * var(--p));
  width: 28px;
  height: 18px;
  border-radius: 5px;
  background: var(--yellow);
  border: 2px solid var(--ink);
}
.trip__bus::before, .trip__bus::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}
.trip__bus::before { left: 3px; }
.trip__bus::after { right: 3px; }

.detail__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail__article {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 40px;
}
.detail__title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: .005em;
  text-wrap: balance;
}
.detail__title:focus { outline: none; }
.detail__meta {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.detail__summary {
  margin: 0 0 22px;
  padding-left: 16px;
  border-left: 6px solid var(--c);
  font-size: 1.2rem;
  font-style: italic;
}
.detail__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
  padding: 14px 0;
  border-block: 2px dashed var(--ink);
}
.save {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
}
.save:hover { background: var(--paper); }
.save[aria-pressed="true"] {
  background: var(--c);
  border-color: var(--ink);
  color: #fff;
}
.save[aria-pressed="true"]:hover { filter: brightness(1.1); background: var(--c); }
.save svg { flex: none; }
.save .save__fill { fill: transparent; }
.save[aria-pressed="true"] .save__fill { fill: currentColor; }

.detail__stamp {
  display: none;
  padding: 2px 12px;
  border: 3px solid var(--c);
  border-radius: 4px;
  color: var(--c);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}
dialog.detail.is-saved .detail__stamp {
  display: inline-block;
  animation: thunk .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes thunk {
  from { transform: rotate(-20deg) scale(2); opacity: 0; }
  to { transform: rotate(-7deg) scale(1); opacity: 1; }
}
.detail__time {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.detail__text p {
  margin: 0 0 1.15em;
  font-size: 1.15rem;
  line-height: 1.75;
}
.detail__text p:first-child::first-letter {
  float: left;
  margin: .06em .1em 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 4.4em;
  line-height: .8;
  color: var(--c);
}

.detail__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 3px solid var(--ink);
}
.nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.nav-btn:hover { background: var(--paper); }
.nav-btn--next { text-align: right; grid-column: 2; }
.nav-btn__dir {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-btn__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.2;
}

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  .layout {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 56px;
    padding-top: 40px;
  }
  .board {
    position: sticky;
    top: calc(var(--sign-h) + 24px);
  }
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  :root { --rail: 52px; --rail-x: 24px; --sign-h: 46px; }

  .masthead { padding-top: 18px; }
  .masthead__kicker { font-size: .7rem; }
  .sign__plate { padding: 0 12px; gap: 10px; }
  .sign__text { font-size: .9rem; }
  .layout { padding: 20px 14px 32px; }
  .stripes { margin: 0 -20px; }

  .stop::before { width: 10px; left: calc(var(--rail-x) - 5px); }
  .stop__roundel {
    left: calc(var(--rail-x) - 19px);
    width: 38px;
    height: 38px;
    border-width: 5px;
    font-size: .9rem;
    top: 14px;
  }
  .stop:first-child::before { top: 33px; }
  .stop:last-child::before { height: 33px; }
  .bus { left: calc(var(--rail-x) - 20px); }

  .ticket { grid-template-columns: 1fr; box-shadow: 4px 4px 0 var(--ink); }
  .ticket::before, .ticket::after { right: auto; top: auto; bottom: 55px; }
  .ticket::before { left: -12px; }
  .ticket::after { right: -12px; left: auto; }
  .ticket__main { padding: 16px 16px 40px; }
  .ticket__stub {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    min-height: 66px;
    padding: 8px 18px;
    border-left: 0;
    border-top: 2px dashed var(--ink);
  }
  .stub__num { font-size: 2rem; }
  .stub__date { margin: 0; }
  .stamp { right: 16px; bottom: 78px; font-size: 1rem; }
  .stop.is-saved .ticket__stub::before { top: 50%; right: auto; left: 50%; margin-top: -9px; margin-left: -9px; }

  dialog.detail {
    width: 100vw;
    height: 100dvh;
    border: 0;
    box-shadow: none;
    margin: 0;
  }
  .detail__article { padding: 24px 18px 36px; }
  .detail__stop { font-size: .9rem; letter-spacing: .1em; }
  .detail__text p { font-size: 1.08rem; }
  .save { width: 100%; justify-content: center; }
  .detail__time { margin-left: 0; }
  .detail__nav { grid-template-columns: 1fr; }
  .nav-btn--next { grid-column: 1; text-align: left; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .sign__text { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
