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

:root {
  --ink: #0a0f14;
  --ink-2: #10171e;
  --ink-3: #16212a;
  --paper: #f3eee3;
  --paper-2: #e7dfcf;
  --muted: #98a5ae;
  --muted-2: #77858f;
  --rule: #2e3a44;
  --rule-soft: rgba(243, 238, 227, 0.14);
  --accent: #ff5c35;
  --accent-soft: #ff8f70;
  --focus: #ffd166;
  --active-line: #f3eee3;
  --culture: #c9a7ff;
  --food: #ff9a63;
  --movement: #5fd6c4;
  --people: #ff8fb3;
  --places: #f2c94c;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-width: 300px;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 70% 42% at 8% -8%, rgba(255, 92, 53, 0.16), transparent 62%),
    radial-gradient(ellipse 55% 35% at 100% 8%, rgba(95, 214, 196, 0.1), transparent 70%);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(243, 238, 227, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 238, 227, 0.035) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  touch-action: manipulation;
}

* {
  -webkit-tap-highlight-color: rgba(255, 92, 53, 0.28);
}

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

.detail :focus-visible {
  outline-color: #a83a13;
}

.sr-only {
  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: 100;
  transform: translateY(-160%);
  padding: 10px 16px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
}

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

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-left > span:not(.signal):not(.slash) {
  white-space: nowrap;
}

.signal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 92, 53, 0.18);
  flex: none;
}

.slash {
  color: var(--rule);
}

.clock-label {
  color: var(--muted-2);
}

#clock {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

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

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 48px;
  align-items: end;
  padding-block: 42px 36px;
}

.issue {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent-soft);
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(58px, 8.6vw, 118px);
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.wordmark-the {
  font-size: 0.52em;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--paper-2);
}

.wordmark-main {
  display: inline-block;
}

.wordmark-dot {
  color: var(--accent);
}

.deck {
  max-width: 45ch;
  margin: 24px 0 0;
  color: #c3ccd2;
  font-size: 16.5px;
  line-height: 1.55;
  text-wrap: pretty;
}

.route-note {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.route-arrow {
  color: var(--accent);
}

.map-wrap {
  padding-bottom: 6px;
}

.loop-map {
  width: 100%;
  height: auto;
  overflow: visible;
}

.map-grid {
  fill: none;
  stroke: rgba(243, 238, 227, 0.07);
  stroke-width: 1;
}

.map-river {
  fill: none;
  stroke: rgba(95, 214, 196, 0.24);
  stroke-width: 10;
  stroke-linecap: round;
}

.map-loop {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.map-stops circle {
  stroke: var(--ink);
  stroke-width: 3;
}

.map-you circle:first-child {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.55;
}

.map-you circle:last-child {
  fill: var(--accent);
}

.map-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.14em;
}

.map-label-dim {
  fill: var(--muted-2);
}

/* ---------- ticker ---------- */

.ticker {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 34s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-run {
  display: block;
  padding: 8px 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.17em;
  white-space: nowrap;
}

.ticker-run b {
  padding-inline: 18px;
  font-weight: 600;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

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

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(200px, 0.75fr) minmax(230px, 0.8fr);
  gap: 18px;
  align-items: end;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--rule);
  background: linear-gradient(135deg, rgba(22, 33, 42, 0.9), rgba(13, 20, 26, 0.92));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.control {
  min-width: 0;
}

.control label,
.control-label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.input-wrap,
.select-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

#search,
#filter {
  width: 100%;
  height: 50px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background-color: #0b1218;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
}

#search {
  padding: 0 14px 0 42px;
}

#search::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

#search:hover,
#filter:hover {
  border-color: #50606b;
}

#search:focus,
#filter:focus {
  border-color: var(--accent);
}

#filter {
  appearance: none;
  padding: 0 40px 0 14px;
}

#filter option {
  background-color: #0b1218;
  color: var(--paper);
}

.chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.pocket-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  background: #0b1218;
  color: var(--paper);
  text-align: left;
}

.pocket-button:hover {
  border-color: var(--accent-soft);
  background: #121b22;
}

.pocket-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

.ticket-icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.pocket-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.pocket-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pocket-sub {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pocket-button[aria-pressed="true"] .pocket-sub {
  color: rgba(10, 15, 20, 0.72);
}

.count-badge {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.status-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--active-line);
  box-shadow: 0 0 8px color-mix(in srgb, var(--active-line) 70%, transparent);
  transition: background-color 220ms ease, box-shadow 220ms ease;
}

.status-hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

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

.route {
  margin-block: 42px 72px;
}

.route-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.route-head-left {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.route-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.route-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.route-sub span {
  color: var(--accent);
}

.route-head-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  color: var(--muted-2);
  text-align: right;
}

.stop-list {
  position: relative;
}

.stop {
  display: grid;
  grid-template-columns: 84px 34px minmax(0, 1fr);
  align-items: stretch;
}

.stop-number {
  padding: 14px 16px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  line-height: 0.9;
  text-align: right;
  color: transparent;
  -webkit-text-stroke: 1px rgba(243, 238, 227, 0.3);
  font-variant-numeric: tabular-nums;
  transition: color 220ms ease, -webkit-text-stroke-color 220ms ease;
}

@supports not (-webkit-text-stroke: 1px black) {
  .stop-number {
    color: rgba(243, 238, 227, 0.3);
  }
}

.stop-rail {
  position: relative;
}

.stop-rail::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: color-mix(in srgb, var(--active-line) 40%, transparent);
  transition: background-color 220ms ease;
}

.stop:first-child .stop-rail::after {
  top: 33px;
}

.stop:last-child .stop-rail::after {
  bottom: calc(100% - 33px);
}

.stop:only-child .stop-rail::after {
  top: 33px;
  bottom: auto;
  height: 64px;
}

.stop-dot {
  position: absolute;
  top: 27px;
  left: 50%;
  z-index: 1;
  width: 13px;
  height: 13px;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--line, var(--paper));
  box-shadow: 0 0 0 1px rgba(243, 238, 227, 0.28);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.stop:hover .stop-dot,
.stop:focus-within .stop-dot {
  transform: translateX(-50%) scale(1.35);
  box-shadow: 0 0 0 1px var(--line), 0 0 18px color-mix(in srgb, var(--line) 55%, transparent);
}

.stop:hover .stop-number,
.stop:focus-within .stop-number {
  color: var(--line);
  -webkit-text-stroke-color: var(--line);
}

.stop-card {
  min-width: 0;
  padding: 20px 0 32px;
  border-bottom: 1px solid var(--rule-soft);
}

.stop:first-child .stop-card {
  padding-top: 6px;
}

.stop-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.line-pill {
  padding: 3px 8px 2px;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  color: var(--line);
  background: color-mix(in srgb, var(--line) 8%, transparent);
}

.in-pocket {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 2px;
  background: var(--paper);
  color: var(--ink);
}

.in-pocket::before {
  content: "◆";
  font-size: 7px;
  color: var(--accent);
}

.stop-title {
  margin: 0;
  font-weight: 400;
}

.open-item {
  display: inline;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(23px, 3.1vw, 36px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-align: left;
  text-wrap: balance;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--line) 36%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.open-item:hover {
  color: var(--line);
  text-decoration-color: var(--line);
  text-decoration-thickness: 1.5px;
}

.open-item::after {
  content: " →";
  display: inline-block;
  margin-left: 4px;
  font-family: var(--sans);
  font-size: 0.5em;
  vertical-align: 0.18em;
  color: var(--line);
  opacity: 0.45;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.open-item:hover::after,
.open-item:focus-visible::after {
  opacity: 1;
  transform: translateX(3px);
}

.stop-summary {
  max-width: 66ch;
  margin: 8px 0 0;
  color: #b9c3ca;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.62;
  text-wrap: pretty;
}

.stop-byline {
  margin: 13px 0 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.stop[data-category="Culture"] { --line: var(--culture); }
.stop[data-category="Food"] { --line: var(--food); }
.stop[data-category="Movement"] { --line: var(--movement); }
.stop[data-category="People"] { --line: var(--people); }
.stop[data-category="Places"] { --line: var(--places); }

.detail[data-category="Culture"] { --line: var(--culture); }
.detail[data-category="Food"] { --line: var(--food); }
.detail[data-category="Movement"] { --line: var(--movement); }
.detail[data-category="People"] { --line: var(--people); }
.detail[data-category="Places"] { --line: var(--places); }

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

.empty-state {
  margin-top: 28px;
  padding: 58px 28px;
  border: 1px dashed #455560;
  background:
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(243, 238, 227, 0.025) 12px 24px),
    var(--ink-2);
  text-align: center;
}

.empty-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-soft);
}

.empty-title {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.empty-copy {
  max-width: 48ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
}

.empty-button {
  margin-top: 24px;
  padding: 12px 18px;
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}

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

.site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding-block: 28px 44px;
  border-top: 1px solid var(--rule);
}

.footer-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.footer-copy p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.6;
}

.footer-copy p + p {
  margin-top: 4px;
}

.footer-copy strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.footer-end {
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  color: var(--muted-2);
  text-align: right;
  white-space: nowrap;
}

.footer-end span {
  color: var(--accent);
}

.noscript {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 16px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  text-align: center;
}

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

.detail {
  width: min(880px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100vh - 52px);
  max-height: calc(100dvh - 52px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}

.detail::backdrop {
  background: rgba(3, 6, 9, 0.76);
  backdrop-filter: blur(7px);
}

.sheet {
  min-height: 100%;
}

.sheet-top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 10px 26px;
  border-top: 7px solid var(--line, var(--accent));
  border-bottom: 1px solid rgba(10, 15, 20, 0.18);
  background: var(--paper);
}

.sheet-route {
  display: flex;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  color: #55606a;
  text-transform: uppercase;
}

.sheet-line {
  color: #0a0f14;
  font-weight: 600;
}

.close-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(10, 15, 20, 0.5);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.close-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.close-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.sheet-body {
  padding: 34px 62px 54px;
}

.sheet-body button,
.sheet-title {
  scroll-margin-top: 84px;
}

.sheet-kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #59646d;
}

.sheet-title {
  max-width: 20ch;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.sheet-standfirst {
  max-width: 52ch;
  margin: 22px 0 0;
  color: #39444c;
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  text-wrap: pretty;
}

.sheet-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 24px 0 0;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(10, 15, 20, 0.24);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #59646d;
}

.byline-author {
  font-weight: 600;
  color: var(--ink);
}

.byline-dot {
  color: #9ba3a9;
}

.article-body {
  max-width: 62ch;
  padding-top: 26px;
  font-family: var(--body);
  font-size: 17.5px;
  line-height: 1.76;
  color: #1d262d;
}

.article-body p {
  margin: 0 0 1.25em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body p:first-child::first-letter {
  float: left;
  margin: 0.06em 0.09em 0 0;
  color: #c2410c;
  font-family: var(--serif);
  font-size: 4.1em;
  line-height: 0.78;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px dashed rgba(10, 15, 20, 0.38);
}

.save-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1.5px dashed var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.save-button:hover {
  border-color: var(--accent);
  background: rgba(255, 92, 53, 0.12);
}

.save-button[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.save-ticket {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.save-note {
  max-width: 30ch;
  margin: 0;
  color: #59646d;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.next-stop {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: 30px;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid rgba(10, 15, 20, 0.24);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.next-stop-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #59646d;
}

.next-stop-title {
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.next-stop:hover .next-stop-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.next-stop:hover .next-stop-kicker {
  color: #a83a13;
}

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

@media (prefers-reduced-motion: no-preference) {
  .detail[open] .sheet {
    animation: sheet-in 260ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
  }

  .detail[open]::backdrop {
    animation: backdrop-in 220ms ease both;
  }

  @keyframes sheet-in {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ticker-track {
    animation: none;
    transform: none;
  }
}

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

@media (max-width: 959px) {
  .wrap {
    width: min(100% - 40px, 760px);
  }

  .masthead {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 24px;
  }

  .controls {
    grid-template-columns: minmax(0, 1.3fr) minmax(190px, 0.7fr);
  }

  .control-saved {
    grid-column: 1 / -1;
  }

  .pocket-button {
    max-width: 320px;
  }
}

@media (max-width: 719px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .topbar {
    min-height: 40px;
    font-size: 9.5px;
  }

  .topbar-edition,
  .clock-label {
    display: none;
  }

  .masthead {
    grid-template-columns: 1fr;
    padding-block: 30px 26px;
  }

  .map-wrap {
    display: none;
  }

  .wordmark {
    font-size: clamp(54px, 16vw, 84px);
  }

  .deck {
    margin-top: 18px;
    font-size: 15px;
  }

  .route-note {
    display: none;
  }

  .issue {
    font-size: 9.5px;
    line-height: 1.6;
  }

  .ticker-run {
    padding-block: 7px;
    font-size: 9.5px;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 20px;
    padding: 14px;
  }

  #search,
  #filter {
    font-size: 16px;
  }

  .control-saved {
    grid-column: auto;
  }

  .pocket-button {
    max-width: none;
  }

  .status-hint {
    display: none;
  }

  .status-row {
    padding-top: 10px;
  }

  .route {
    margin-block: 30px 56px;
  }

  .route-head {
    align-items: flex-start;
  }

  .route-head-note {
    display: none;
  }

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

  .stop-number {
    display: none;
  }

  .stop-rail::after {
    top: 0;
    bottom: 0;
  }

  .stop:first-child .stop-rail::after {
    top: 29px;
  }

  .stop:last-child .stop-rail::after {
    bottom: calc(100% - 29px);
  }

  .stop:only-child .stop-rail::after {
    top: 29px;
    bottom: auto;
    height: 52px;
  }

  .stop-dot {
    top: 23px;
    width: 11px;
    height: 11px;
    border-width: 2.5px;
  }

  .stop-card {
    padding: 16px 0 26px;
  }

  .stop:first-child .stop-card {
    padding-top: 4px;
  }

  .open-item {
    font-size: clamp(22px, 6.4vw, 30px);
  }

  .stop-summary {
    font-size: 14px;
  }

  .site-footer {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 32px;
  }

  .footer-end {
    display: none;
  }

  .detail {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }

  .sheet-top {
    padding: 10px 16px;
    min-height: 54px;
  }

  .sheet-route {
    font-size: 8.5px;
    gap: 5px;
  }

  .close-button {
    padding: 6px 8px;
    font-size: 9px;
  }

  .close-button svg {
    width: 13px;
    height: 13px;
  }

  .sheet-body {
    padding: 26px 20px 44px;
  }

  .sheet-title {
    font-size: clamp(34px, 10.5vw, 50px);
  }

  .sheet-standfirst {
    font-size: 17px;
  }

  .article-body {
    font-size: 16.5px;
  }
}

@media (max-width: 390px) {
  .topbar-left {
    gap: 7px;
  }

  .topbar-left .slash:first-of-type,
  .topbar-left .slash:first-of-type + span {
    display: none;
  }

  .sheet-route span:nth-last-child(-n + 2) {
    display: none;
  }
}
