/* ==========================================================================
   TRANSFER — the weekend as a transit map
   ========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --paper: #f2efe5;
  --paper-2: #fbf9f2;
  --ink: #16150f;
  --ink-soft: #565247;
  --ink-faint: #8d887a;
  --yellow: #ffcf00;
  --rule: #16150f;
  --cat-default: #1b5fd6;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 2px;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(22, 21, 15, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 21, 15, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  line-height: 1.55;
  font-size: 16px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
}

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

button {
  cursor: pointer;
}

b {
  font-weight: 700;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  background: var(--yellow);
  color: var(--ink);
  padding: 10px 16px;
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

:focus-visible {
  outline: 3px solid #1b5fd6;
  outline-offset: 2px;
}

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

.masthead {
  border-bottom: 3px solid var(--ink);
  background: var(--paper-2);
}

.masthead__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: var(--ink);
  color: var(--paper-2);
  border-bottom: 3px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__roundel {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border-radius: 50%;
}
.brand__roundel svg {
  width: 34px;
  height: 34px;
}
.brand__roundel circle,
.brand__roundel path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
}
.brand__roundel .brand__arrow {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: 0.16em;
}

.masthead__net {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}

.masthead__date {
  margin: 0 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.masthead__date .sep {
  color: var(--yellow);
}
.masthead__month {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  color: #cfcbbd;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  padding: clamp(28px, 6vw, 64px) clamp(16px, 4vw, 44px)
    clamp(26px, 5vw, 52px);
}

.hero__kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(38px, 7.4vw, 78px);
  font-weight: 700;
  text-transform: uppercase;
}
.hero h1 em {
  font-style: normal;
  color: var(--paper-2);
  background: var(--ink);
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero__sub {
  max-width: 46ch;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.6vw, 18px);
}

.hero__diagram {
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  padding: 10px;
  transform: rotate(0.6deg);
}
.hero__diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.d-line path {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
}
.d-line--a path {
  stroke: #1b5fd6;
}
.d-line--b path {
  stroke: #f07c00;
}
.d-line--c path {
  stroke: #2f8f3e;
}
.d-line--d path {
  stroke: #e2167e;
}
.d-line--e path {
  stroke: #7a3fc1;
}
.d-nodes circle {
  fill: var(--paper-2);
  stroke: var(--ink);
  stroke-width: 3;
}

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

.route {
  width: calc(100% - 2 * clamp(16px, 4vw, 44px));
  max-width: 1120px;
  margin: 0 auto;
  transform: translateY(-10px);
  border: 2px solid var(--ink);
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}

.route__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  border-bottom: 2px dashed rgba(22, 21, 15, 0.45);
  padding-bottom: 10px;
}
.route__head h2 {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.route__status {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.route__track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  min-height: 30px;
}
.route__hint {
  margin: 0;
  max-width: 70ch;
  font-size: 14.5px;
}

.route-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  padding: 5px 10px 5px 6px;
  font-size: 13px;
  font-family: var(--sans);
  text-decoration: none;
  color: var(--ink);
}
.route-chip:hover {
  background: var(--ink);
  color: var(--paper-2);
}
.route-chip__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--cat, var(--cat-default));
  flex: none;
}
.route-chip__time {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.route-chip__day {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--paper-2);
  padding: 1px 6px;
}
.route-chip:hover .route-chip__day {
  background: var(--yellow);
  color: var(--ink);
}

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

.controls {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 44px) 6px;
}

.controls__row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(160px, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label,
.field__label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.field input,
.field select {
  width: 100%;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 11px 12px;
  border-radius: var(--radius);
  min-height: 46px;
}
.field input::placeholder {
  color: var(--ink-faint);
}

.saved-filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 11px 16px;
  min-height: 46px;
  border-radius: var(--radius);
  font-weight: 700;
  white-space: nowrap;
}
.saved-filter__star {
  font-size: 18px;
  line-height: 1;
}
.saved-filter[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-2);
}
.saved-filter[aria-pressed="true"] .saved-filter__star {
  color: var(--yellow);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 6px;
}
.legend__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--ink);
  background: transparent;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.legend__chip:hover {
  background: rgba(22, 21, 15, 0.08);
}
.legend__chip.is-active {
  background: var(--ink);
  color: var(--paper-2);
}
.legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--cat, var(--cat-default));
  border: 2px solid currentColor;
  flex: none;
}
.legend__swatch--all {
  background: conic-gradient(#e2167e, #f07c00, #2f8f3e, #1b5fd6, #e2167e);
}

/* ------------------------------------------------------------- day + stops */

.day-list {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 44px) 24px;
}

.day {
  position: relative;
  margin: 26px 0 44px;
  padding-left: 58px;
}

.day__head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
}
.day__num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(46px, 9vw, 92px);
  line-height: 0.8;
  color: var(--paper-2);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
}
.day__name {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  color: var(--ink-soft);
}
.day__name b {
  display: block;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.day__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.day__head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 14px,
    transparent 14px 22px
  );
}

/* the rail */
.day__track {
  position: relative;
}
.day__track::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: var(--ink);
  border-radius: 3px;
}

.stop {
  position: relative;
  margin-bottom: 16px;
}
.stop::before {
  content: "";
  position: absolute;
  left: -47px;
  top: 26px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cat, var(--cat-default));
  border: 4px solid var(--paper-2);
  box-shadow: 0 0 0 3px var(--ink);
  z-index: 1;
}

.stop__card {
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px 12px;
  border-left-width: 8px;
  border-left-color: var(--cat, var(--cat-default));
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stop__card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.stop__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 8px;
}
.cat-badge {
  background: var(--cat, var(--cat-default));
  color: #fff;
  padding: 2px 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  border: 2px solid var(--ink);
}
.stop__time {
  font-weight: 600;
}
.stop__price {
  color: var(--ink-soft);
}

.stop__title {
  font-size: clamp(19px, 2.6vw, 24px);
  margin-bottom: 6px;
}
.stop__summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 66ch;
}

.stop__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(22, 21, 15, 0.3);
}
.stop__venue {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.open-item {
  margin-left: auto;
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 2px 2px 0 var(--ink);
}
.open-item:hover {
  background: var(--ink);
  color: var(--paper-2);
}
.open-item:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

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

.empty {
  max-width: 1120px;
  margin: 10px auto 50px;
  border: 3px dashed var(--ink);
  background: var(--paper-2);
  padding: 40px 24px;
  text-align: center;
}
.empty__sign {
  font-size: 44px;
  margin: 0 0 8px;
}
.empty h2 {
  font-size: 28px;
  text-transform: uppercase;
}
.empty p {
  max-width: 46ch;
  margin: 12px auto 22px;
  color: var(--ink-soft);
}
.empty__reset {
  border: 2px solid var(--ink);
  background: var(--yellow);
  padding: 12px 20px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 3px solid var(--ink);
  background: var(--ink);
  color: #d8d4c6;
  padding: 26px clamp(16px, 4vw, 44px);
  font-size: 13px;
}
.footer p {
  margin: 0 0 6px;
  max-width: 80ch;
}
.footer__key {
  font-family: var(--mono);
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}

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

#detail {
  width: min(940px, calc(100vw - 32px));
  max-height: min(90vh, 780px);
  padding: 0;
  border: 3px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 10px 10px 0 rgba(22, 21, 15, 0.55);
  color: var(--ink);
  overflow: hidden;
}
#detail::backdrop {
  background: rgba(22, 21, 15, 0.62);
}

.detail__sheet {
  max-height: min(90vh, 780px);
  overflow: auto;
}

.detail__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--paper-2);
  padding: 12px 16px;
  border-bottom: 3px solid var(--ink);
}
.detail__badge {
  background: var(--cat, var(--cat-default));
  color: #fff;
  border: 2px solid var(--paper-2);
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.detail__code {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--yellow);
}
.close-detail {
  margin-left: auto;
  border: 2px solid var(--paper-2);
  background: transparent;
  color: var(--paper-2);
  padding: 7px 13px;
  font-weight: 700;
  font-size: 13px;
}
.close-detail:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--yellow);
}

.detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr);
  gap: 0;
}
.detail__main {
  padding: clamp(20px, 4vw, 34px);
}
.detail__eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.detail__main h2 {
  font-size: clamp(28px, 4.6vw, 46px);
  margin-bottom: 12px;
}
.detail__when {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  display: inline-block;
  padding: 4px 12px;
  margin: 0 0 20px;
}
.detail__body {
  white-space: pre-line;
  font-size: 16px;
  color: #2c2a23;
  border-left: 6px solid var(--cat, var(--cat-default));
  padding-left: 16px;
}

.detail__side {
  border-left: 3px solid var(--ink);
  background: var(--paper);
  padding: clamp(20px, 4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.save-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 3px solid var(--ink);
  background: var(--yellow);
  padding: 14px 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.save-item:hover {
  background: var(--ink);
  color: var(--paper-2);
}
.save-item[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-2);
}
.save-item[aria-pressed="true"] .save-item__mark {
  color: var(--yellow);
}
.save-item__mark {
  font-size: 22px;
  line-height: 1;
}

.facts {
  margin: 0;
  display: grid;
  gap: 12px;
}
.facts div {
  border-top: 1px dashed rgba(22, 21, 15, 0.4);
  padding-top: 10px;
}
.facts dt {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 700;
  font-size: 15px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero__diagram {
    max-width: 440px;
    transform: none;
  }
  .controls__row {
    grid-template-columns: 1fr;
  }
  .detail__grid {
    grid-template-columns: 1fr;
  }
  .detail__side {
    border-left: none;
    border-top: 3px solid var(--ink);
  }
}

@media (max-width: 560px) {
  .masthead__date {
    margin-left: 0;
    width: 100%;
  }
  .day {
    padding-left: 42px;
  }
  .day__track::before {
    left: -29px;
    width: 5px;
  }
  .stop::before {
    left: -38px;
    width: 18px;
    height: 18px;
  }
  .open-item {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  .route {
    width: calc(100% - 32px);
  }
  #detail {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
  .detail__sheet {
    max-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .stop__card:hover {
    transform: none;
  }
}
