@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #e9ecdc;
  --paper-high: #f7f6ea;
  --ink: #211c2e;
  --ink-soft: #514b5d;
  --ink-faint: #7b7485;
  --accent: #ff4b23;
  --focus: #0037d1;
  --acid: #d7ff3f;
  --art: #1f3cff;
  --film: #6d2c91;
  --food: #ed3f22;
  --literature: #a56a00;
  --music: #c0007c;
  --outdoors: #28714c;
  --walks: #0a7379;
  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --read: "Literata", Georgia, "Times New Roman", serif;
  --page: 1240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(33, 28, 46, 0.09) 0.55px, transparent 0.7px);
  background-size: 7px 7px;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper-high);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Masthead ---------- */

.masthead {
  width: min(var(--page), calc(100% - 56px));
  margin: 0 auto;
  padding-top: 26px;
}

.masthead__rule {
  display: flex;
  gap: 28px;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 11px;
  border-bottom: 3px solid var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.masthead__rule p:last-child {
  text-align: right;
}

.masthead__title {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-top: 28px;
}

.masthead h1 {
  font-size: clamp(6rem, 15vw, 12.6rem);
  font-weight: 700;
  line-height: 0.73;
  letter-spacing: -0.075em;
  margin-left: -0.035em;
}

.title-stop {
  color: var(--accent);
}

.line-badge {
  flex: none;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0;
  width: clamp(96px, 11vw, 146px);
  aspect-ratio: 1;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  color: var(--ink);
  transform: rotate(7deg);
  margin-bottom: clamp(8px, 2vw, 24px);
  box-shadow: 5px 6px 0 var(--ink);
}

.line-badge span {
  font-size: clamp(0.58rem, 1vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.line-badge strong {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.masthead__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.6fr);
  gap: clamp(28px, 6vw, 92px);
  align-items: start;
  margin-top: 34px;
}

.lede {
  font-family: var(--read);
  font-size: clamp(1.2rem, 2vw, 1.62rem);
  line-height: 1.48;
  max-width: 42ch;
  text-wrap: pretty;
}

.notice {
  justify-self: end;
  max-width: 23ch;
  padding: 14px 16px 15px;
  border: 2px solid var(--ink);
  background: var(--paper-high);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  transform: rotate(-1.4deg);
  box-shadow: 4px 4px 0 var(--ink);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 34px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cat);
  border: 1.5px solid var(--ink);
}

/* ---------- Controls ---------- */

main {
  width: min(var(--page), calc(100% - 56px));
  margin: 0 auto;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(180px, 0.7fr) minmax(220px, 0.8fr);
  gap: 22px;
  align-items: end;
  margin-top: 38px;
  padding: 18px 20px 20px;
  border: 2.5px solid var(--ink);
  background: var(--paper-high);
  box-shadow: 6px 6px 0 var(--ink);
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.field__input {
  position: relative;
  display: flex;
  align-items: center;
}

.field input {
  width: 100%;
  border: 0;
  border-bottom: 2.5px solid var(--ink);
  background: transparent;
  padding: 9px 40px 9px 2px;
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: 0;
}

.field input::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--focus);
  box-shadow: 0 3px 0 0 var(--focus);
}

.field input:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 4px;
}

.field__mark {
  position: absolute;
  right: 5px;
  width: 19px;
  height: 19px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
}

.field__mark::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -6px;
  width: 9px;
  height: 2.5px;
  background: var(--ink);
  transform: rotate(45deg);
  transform-origin: left center;
}

.select-wrap {
  position: relative;
}

.field select {
  width: 100%;
  appearance: none;
  border: 2.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  padding: 12px 42px 12px 12px;
  font-size: 1.02rem;
  font-weight: 500;
  cursor: pointer;
}

.select-wrap__arrow {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 11px;
  height: 11px;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.saved-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 51px;
  padding: 8px 14px 8px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.saved-toggle__punch {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.saved-toggle__punch::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.18s ease;
}

.saved-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-high);
}

.saved-toggle[aria-pressed="true"] .saved-toggle__punch {
  border-color: var(--acid);
}

.saved-toggle[aria-pressed="true"] .saved-toggle__punch::after {
  background: var(--acid);
  transform: scale(1);
}

.saved-toggle__text {
  min-width: 0;
  display: grid;
  line-height: 1.15;
}

.saved-toggle__action {
  font-size: 0.97rem;
  font-weight: 600;
}

.saved-toggle__count {
  font-size: 0.76rem;
  opacity: 0.75;
}

.result-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  margin-top: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.86rem;
  font-weight: 500;
}

#resultCount {
  font-weight: 600;
}

.result-line__hint {
  color: var(--ink-soft);
}

/* ---------- Route ---------- */

.route {
  position: relative;
  padding-top: 40px;
}

.route__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 5px;
  margin-left: -2.5px;
  background: var(--ink);
  z-index: 0;
}

.day {
  position: relative;
}

.day-marker {
  position: relative;
  z-index: 3;
  width: fit-content;
  margin: 30px auto 22px;
  padding: 11px 24px 12px;
  background: var(--ink);
  color: var(--paper-high);
  border: 2.5px solid var(--ink);
  outline: 3px solid var(--paper);
  transform: rotate(-1.2deg);
  text-align: center;
}

.day:first-child .day-marker {
  margin-top: 0;
}

.day-marker__day {
  display: block;
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.day-marker__date {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--paper);
  opacity: 0.85;
}

.stops {
  position: relative;
  z-index: 1;
}

.stop {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: center;
  min-height: 176px;
  padding: 12px 0;
}

.stop::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(50% - 52px);
  height: 2px;
  background: var(--ink);
  z-index: 0;
}

.stop--right::before {
  left: 50%;
}

.stop--left::before {
  left: auto;
  right: 50%;
}

.stop__card {
  position: relative;
  z-index: 2;
  grid-row: 1;
  grid-column: 3;
  display: block;
  width: 100%;
  padding: 16px 18px 15px;
  border: 2.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper-high);
  color: var(--ink);
  text-align: left;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(0.45deg);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.stop--left .stop__card {
  grid-column: 1;
  transform: rotate(-0.45deg);
}

.stop__card:hover {
  transform: rotate(0deg) translate(-1px, -2px);
  box-shadow: 7px 8px 0 var(--ink);
  background: #fffdf1;
}

.stop__card:focus-visible {
  transform: rotate(0deg) translate(-1px, -2px);
  box-shadow: 7px 8px 0 var(--ink);
}

.stop__node {
  position: relative;
  z-index: 3;
  grid-row: 1;
  grid-column: 2;
  justify-self: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--cat, var(--ink));
  border: 4px solid var(--paper);
  outline: 3px solid var(--ink);
}

.stop__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.stop__time {
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 4px;
  border: 1.5px solid var(--ink);
  background: var(--cat);
  color: #fff;
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.tag[data-cat="Literature"],
.tag[data-cat="Outdoors"],
.tag[data-cat="Food"] {
  padding-left: 11px;
  background: var(--paper-high);
  color: var(--ink);
  box-shadow: inset 5px 0 0 var(--cat);
}

.stop__title {
  display: block;
  font-size: clamp(1.22rem, 1.75vw, 1.55rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
  max-width: 22ch;
}

.stop__summary {
  display: block;
  margin-top: 8px;
  font-family: var(--read);
  font-size: 0.94rem;
  line-height: 1.48;
  color: var(--ink-soft);
  max-width: 46ch;
}

.stop__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1.5px solid rgba(33, 28, 46, 0.35);
  font-size: 0.79rem;
  font-weight: 500;
}

.stop__where {
  min-width: 0;
}

.stop__price {
  flex: none;
  font-weight: 700;
}

.stop__price span {
  font-weight: 500;
  color: var(--ink-soft);
}

.stop__open {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.stop__punch {
  position: absolute;
  top: -12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 5px;
  border: 2px solid var(--ink);
  background: var(--acid);
  font-size: 0.7rem;
  font-weight: 700;
  transform: rotate(2.5deg);
}

.stop--left .stop__punch {
  right: auto;
  left: 14px;
  transform: rotate(-2.5deg);
}

.stop__punch::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.stop__punch[hidden] {
  display: none;
}

/* ---------- Empty state ---------- */

.empty {
  margin: 48px auto 0;
  padding: 42px 28px 46px;
  max-width: 660px;
  border: 2.5px solid var(--ink);
  background: var(--paper-high);
  text-align: center;
  box-shadow: 7px 7px 0 var(--ink);
}

.empty[hidden] {
  display: none;
}

.empty__mark {
  font-size: 5.4rem;
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.08em;
  color: transparent;
  -webkit-text-stroke: 2.5px var(--ink);
}

.empty h2 {
  margin-top: 18px;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
}

.empty p {
  font-family: var(--read);
  font-size: 1.04rem;
  line-height: 1.55;
  max-width: 42ch;
  margin: 12px auto 0;
  color: var(--ink-soft);
}

.empty__reset {
  margin-top: 22px;
  padding: 12px 20px;
  border: 2.5px solid var(--ink);
  background: var(--acid);
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--ink);
}

.empty__reset:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

/* ---------- End of line ---------- */

.end-of-line {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  margin: 34px auto 0;
  padding: 22px 24px;
  border: 2.5px dashed var(--ink);
  background: var(--paper);
  text-align: center;
}

.end-of-line[hidden] {
  display: none;
}

.end-of-line__time {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.end-of-line p:last-child {
  font-family: var(--read);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 46ch;
  margin: 0 auto;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.footer {
  width: min(var(--page), calc(100% - 56px));
  margin: 84px auto 0;
  padding: 26px 0 46px;
  border-top: 3px solid var(--ink);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 30px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.footer p:last-child {
  text-align: right;
}

/* ---------- Detail ticket ---------- */

.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.detail-layer[hidden] {
  display: none;
}

.detail-scrim {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 34, 0.62);
  animation: scrim-in 0.25s ease both;
}

.ticket {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(580px, 94vw);
  height: 100dvh;
  background: var(--paper-high);
  border-left: 3px solid var(--ink);
  box-shadow: -16px 0 0 rgba(33, 28, 46, 0.16);
  animation: ticket-in 0.32s cubic-bezier(0.22, 0.75, 0.28, 1) both;
}

.ticket__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 26px;
  border-bottom: 2px dashed var(--ink);
  background: var(--paper);
}

.ticket__operator {
  font-size: 0.76rem;
  font-weight: 600;
}

.ticket__close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  background: var(--paper-high);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--ink);
}

.ticket__close span {
  font-size: 1.3rem;
  line-height: 0.8;
}

.ticket__close:hover {
  background: var(--ink);
  color: var(--paper-high);
}

.ticket__scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 36px 40px;
}

.ticket__stopno {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ticket__title {
  margin-top: 8px;
  font-size: clamp(2.1rem, 4.2vw, 3.3rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-wrap: balance;
  max-width: 14ch;
}

.ticket__when {
  margin-top: 14px;
  font-size: 1.02rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ticket__perf {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 26px 0;
  height: 2px;
  border-top: 2px dashed var(--ink);
}

.ticket__perf span {
  width: 5px;
  height: 5px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--ink);
}

.ticket__body {
  white-space: pre-line;
  font-family: var(--read);
  font-size: 1.08rem;
  line-height: 1.68;
  color: var(--ink);
  max-width: 48ch;
}

.facts {
  margin-top: 30px;
  border-top: 2px solid var(--ink);
}

.facts__row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1.5px solid rgba(33, 28, 46, 0.3);
  align-items: baseline;
}

.facts dt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.facts dd {
  font-family: var(--read);
  font-size: 0.98rem;
  line-height: 1.45;
}

.save-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  width: 100%;
  margin-top: 28px;
  padding: 16px 18px;
  border: 2.5px solid var(--ink);
  background: var(--paper);
  text-align: left;
  box-shadow: 5px 5px 0 var(--ink);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.save-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.save-item__hole {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border: 2.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.save-item__hole::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: currentColor;
  transform: scale(0);
  transition: transform 0.18s ease;
}

.save-item__label {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.save-item__hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.save-item[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-high);
}

.save-item[aria-pressed="true"] .save-item__hole {
  border-color: var(--acid);
}

.save-item[aria-pressed="true"] .save-item__hole::after {
  background: var(--acid);
  transform: scale(1);
}

.save-item[aria-pressed="true"] .save-item__hint {
  color: var(--paper);
}

.ticket__fine {
  margin-top: 26px;
  font-family: var(--read);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- Motion ---------- */

@keyframes draw-line {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes stop-in {
  from {
    opacity: 0;
    translate: 0 14px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ticket-in {
  from { translate: 100% 0; }
  to { translate: 0 0; }
}

@keyframes sheet-in {
  from { translate: 0 100%; }
  to { translate: 0 0; }
}

.route[data-intro="true"] .route__spine {
  transform-origin: top center;
  animation: draw-line 0.8s cubic-bezier(0.4, 0.1, 0.2, 1) both;
}

.route[data-intro="true"] .stop {
  animation: stop-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.04s);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .controls {
    grid-template-columns: minmax(0, 1.3fr) minmax(170px, 0.7fr);
  }

  .saved-toggle {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .stop {
    grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
  }

  .stop__title {
    font-size: 1.23rem;
  }

  .stop__summary {
    font-size: 0.9rem;
  }
}

@media (max-width: 720px) {
  .masthead,
  main,
  .footer {
    width: calc(100% - 34px);
  }

  .masthead {
    padding-top: 12px;
  }

  .masthead__rule {
    flex-wrap: wrap;
    gap: 5px 18px;
    font-size: 0.73rem;
    padding-bottom: 9px;
    border-bottom-width: 2.5px;
  }

  .masthead__rule p:nth-child(2) {
    order: 3;
    width: 100%;
  }

  .masthead__title {
    align-items: flex-start;
    gap: 12px;
    padding-top: 18px;
  }

  .masthead h1 {
    font-size: clamp(3.8rem, 20vw, 7rem);
  }

  .line-badge {
    width: 72px;
    margin-top: 4px;
    margin-bottom: 0;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .line-badge strong {
    font-size: 2rem;
  }

  .line-badge span {
    font-size: 0.5rem;
  }

  .masthead__intro {
    display: block;
    margin-top: 18px;
  }

  .lede {
    font-size: 1.08rem;
    line-height: 1.48;
  }

  .notice {
    margin-top: 12px;
    max-width: none;
    padding: 8px 10px 9px;
    font-size: 0.72rem;
    line-height: 1.35;
    transform: none;
  }

  .legend {
    margin-top: 16px;
    padding-top: 8px;
    gap: 6px 12px;
    font-size: 0.73rem;
  }

  .controls {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;
    margin-top: 20px;
    padding: 14px 13px 15px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .field--search {
    grid-column: 1 / -1;
  }

  .saved-toggle {
    grid-column: auto;
    gap: 8px;
    min-height: 48px;
    padding: 7px 10px 7px 8px;
  }

  .saved-toggle__punch {
    width: 20px;
    height: 20px;
  }

  .saved-toggle__punch::after {
    inset: 4px;
  }

  .saved-toggle__action {
    font-size: 0.84rem;
  }

  .saved-toggle__count {
    font-size: 0.69rem;
  }

  .result-line {
    margin-top: 16px;
  }

  .result-line__hint {
    display: none;
  }

  .route {
    padding-top: 18px;
  }

  .route__spine {
    left: 19px;
    margin-left: 0;
    width: 4px;
  }

  .day-marker {
    margin: 18px 0 8px 50px;
    padding: 8px 14px 9px;
    text-align: left;
  }

  .day:first-child .day-marker {
    margin-top: 0;
  }

  .day-marker__day {
    font-size: 1.12rem;
  }

  .stop {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 18px;
    min-height: 0;
    padding: 13px 0;
  }

  .stop::before {
    display: none;
  }

  .stop__node {
    grid-column: 1;
    justify-self: center;
    width: 24px;
    height: 24px;
    border-width: 3.5px;
    outline-width: 2.5px;
  }

  .stop__card,
  .stop--left .stop__card {
    grid-column: 2;
    transform: none;
    padding: 14px 14px 13px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .stop__card:hover,
  .stop__card:focus-visible {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--ink);
  }

  .stop__title {
    font-size: 1.24rem;
  }

  .stop__summary {
    font-size: 0.9rem;
  }

  .stop__foot {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    width: 100%;
  }

  .stop__punch,
  .stop--left .stop__punch {
    left: auto;
    right: 12px;
  }

  .footer {
    margin-top: 58px;
    padding-bottom: 32px;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .footer p:last-child {
    text-align: left;
  }

  .end-of-line {
    margin-top: 22px;
    padding: 18px;
  }

  .ticket {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 92dvh;
    border-left: 0;
    border-top: 3px solid var(--ink);
    box-shadow: 0 -12px 0 rgba(33, 28, 46, 0.14);
    animation: sheet-in 0.3s cubic-bezier(0.22, 0.75, 0.28, 1) both;
  }

  .ticket__top {
    padding: 12px 18px;
  }

  .ticket__scroll {
    padding: 22px 20px 30px;
  }

  .ticket__title {
    font-size: 2.1rem;
    max-width: 16ch;
  }

  .ticket__body {
    font-size: 1.02rem;
  }

  .facts__row {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  .masthead,
  main,
  .footer {
    width: calc(100% - 26px);
  }

  .field input {
    font-size: 1rem;
  }

  .stop__title {
    font-size: 1.16rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
