/* =================================================================
   metro.me.uk — "Departure board" theme

   Two ideas carry the whole design:
   1. The departure board. The site's answer to "which ticket?" is always
      shown on an amber dot-matrix board, like a British station display.
      Boards and the finder around them are theme-independent: they are
      a physical object, dark in daylight and at night alike.
   2. The line diagram. A system page is drawn as a route in that
      network's own colour, each section a stop along it; the site-wide
      stripe is every network's colour in turn.

   Every text colour below has a contrast figure beside it. They were
   measured, not estimated — see the audit in bin/, and re-run it after
   changing any token.
   ================================================================= */

@font-face {
  font-family: "Barlow Semi Condensed"; font-weight: 500; font-style: normal; font-display: swap;
  src: url(/assets/fonts/barlow-semi-condensed-500.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(/assets/fonts/barlow-semi-condensed-600.woff2) format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed"; font-weight: 700; font-style: normal; font-display: swap;
  src: url(/assets/fonts/barlow-semi-condensed-700.woff2) format("woff2");
}
@font-face {
  font-family: "Doto"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url(/assets/fonts/doto-variable.woff2) format("woff2");
}

:root {
  /* Timetable paper */
  --bg: #f4f1e8;
  --surface: #fffdf7;
  --surface-2: #ebe6d8;
  --ink: #141a2e;          /* 15.2:1 on --bg */
  --ink-soft: #3c4459;     /*  8.6:1 */
  --ink-faint: #5d6477;    /*  5.2:1 on --bg, 5.8 on --surface */
  --line: #ddd6c6;         /* decorative only */
  --field-line: #8a8577;   /* 3:1 non-text: form borders */
  --accent: #a33c0a;       /* burnt signal orange, 5.8:1 on --bg */
  --accent-soft: #fbe6d4;
  --btn-bg: #141a2e;
  --btn-ink: #ffd27a;      /* 12:1 on --btn-bg */
  --hero-bg: #141a2e;
  --hero-ink: #f4f1e8;
  --hero-soft: #c3c8d6;    /* 10:1 on --hero-bg */

  /* The board unit: identical in both themes. */
  --fp-bg: #141925;
  --fp-ink: #eef0f4;
  --fp-soft: #a9b1c2;      /* 8:1 on --fp-bg */
  --fp-line: #323a4d;
  --fp-field: #0b0e15;
  --fp-field-line: #6a748b;/* 3:1+ on both --fp-bg and --fp-field */
  --board-bg: #050608;
  --board-fg: #ffb000;     /* 11:1 on --board-bg */
  --board-dim: #d0941d;    /*  7:1 */

  --radius: 12px;
  --wrap: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-board: "Doto", ui-monospace, "Cascadia Mono", Menlo, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Night service */
    --bg: #0d1017;
    --surface: #151a24;
    --surface-2: #0a0d13;
    --ink: #eef0f4;        /* 16.7:1 */
    --ink-soft: #b4bccb;   /*  9.8:1 */
    --ink-faint: #8a93a6;  /*  5.5:1 on --surface */
    --line: #262d3b;
    --field-line: #666f84; /*  3.4:1 on --surface */
    --accent: #ffb547;     /* 10.9:1 */
    --accent-soft: #2a2012;
    --btn-bg: #ffb547;
    --btn-ink: #141a2e;
    --hero-bg: #111624;
    --hero-ink: #f4f1e8;
    --hero-soft: #c3c8d6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display); font-weight: 700;
  line-height: 1.08; letter-spacing: -.005em; margin: 0 0 .5rem;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 3.6rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.icon {
  width: 1.15em; height: 1.15em; flex: 0 0 auto;
  vertical-align: -.2em; stroke: currentColor;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--ink-faint); }

.skip { position: absolute; left: -9999px; background: var(--btn-bg); color: var(--btn-ink); padding: .6rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; }

/* ---------- The stripe: every network, in turn ---------- */
.stripe { display: flex; height: 5px; }
.stripe span { flex: 1 1 0; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); position: sticky; top: 0; z-index: 10; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem 1.25rem; flex-wrap: wrap; padding-block: .7rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none;
  color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
  letter-spacing: -.01em;
}
.brand-mark { width: 40px; height: 18px; color: var(--accent); }
.brand-stop { fill: var(--surface); stroke: currentColor; stroke-width: 3.5; }
.brand-dim { color: var(--ink-faint); font-weight: 600; }
.site-header nav { display: flex; gap: .25rem 1.2rem; flex-wrap: wrap; }
.site-header nav a {
  color: var(--ink-soft); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  padding: .15rem 0; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--btn-bg); color: var(--btn-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: .01em;
  padding: .65rem 1.2rem; border-radius: 8px; border: 0; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.12); }
.button-ghost { background: transparent; color: var(--fp-ink); border: 1px solid var(--fp-field-line); }
.linklike {
  background: none; border: 0; padding: 0; margin-left: .75rem; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline;
}

/* =================================================================
   The departure board and the finder around it
   ================================================================= */
.finder {
  background: var(--fp-bg); color: var(--fp-ink);
  border: 1px solid var(--fp-line); border-radius: 16px;
  padding: 1.1rem; display: grid; gap: .9rem;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .55);
}
.finder-label {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  letter-spacing: .02em; color: var(--fp-soft); margin-bottom: .35rem;
}
.finder-label .icon { color: var(--board-fg); }
.finder select, .finder input[type="number"] {
  font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  color: var(--fp-ink); background: var(--fp-field);
  border: 1px solid var(--fp-field-line); border-radius: 8px;
}
.finder select { width: 100%; padding: .55rem .7rem; }
.finder-steppers { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.stepper-controls { display: flex; align-items: stretch; }
.stepper-controls input {
  width: 100%; min-width: 0; text-align: center; padding: .45rem 0;
  border-radius: 0; -moz-appearance: textfield; appearance: textfield;
}
.stepper-controls input::-webkit-outer-spin-button,
.stepper-controls input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-controls button {
  flex: 0 0 44px; display: grid; place-items: center; cursor: pointer;
  background: var(--fp-field); color: var(--board-fg);
  border: 1px solid var(--fp-field-line);
}
.stepper-controls button:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.stepper-controls button:last-child  { border-radius: 0 8px 8px 0; border-left: 0; }
.stepper-controls button:hover { background: #1b2130; }
.stepper-controls .icon { width: 20px; height: 20px; }
/* Without JavaScript the steppers would be dead buttons; the number field
   still works and the form still submits, so show just that. */
.finder:not(.is-live) .stepper-controls button { display: none; }
.finder:not(.is-live) .stepper-controls input { border-radius: 8px; }

.board {
  background: var(--board-bg); border-radius: 8px;
  border: 1px solid #000; outline: 4px solid #1d2230; outline-offset: 0;
  padding: .9rem 1rem .8rem; color: var(--board-fg);
  font-family: var(--font-board); font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  /* the faint glow of lit LEDs */
  text-shadow: 0 0 6px rgba(255, 176, 0, .45);
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1.2px);
  background-size: 5px 5px;
}
.board-row { margin: 0; }
.board-query {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--board-dim); font-size: 1rem; line-height: 1.35;
  padding-bottom: .5rem; border-bottom: 1px dashed rgba(255, 176, 0, .25); margin-bottom: .55rem;
}
.board-main {
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap;
  font-size: clamp(1.45rem, 3.2vw, 1.9rem); line-height: 1.15;
}
.board-total { white-space: nowrap; margin-left: auto; }
.board-detail { color: var(--board-dim); font-size: 1rem; line-height: 1.4; margin-top: .35rem; }
.board-versus {
  display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin-top: .55rem;
  font-size: 1rem; line-height: 1.35;
}
.board-versus span:empty { display: none; }

.finder-notes { display: flex; gap: .5rem; margin: 0; font-size: .92rem; color: var(--fp-soft); }
.finder-notes .icon { color: var(--board-fg); margin-top: .2em; }
.finder-scope { margin: 0; font-size: .88rem; color: var(--fp-soft); }
.finder-go { margin: 0; display: flex; gap: .6rem; flex-wrap: wrap; }
.finder .button { background: var(--board-fg); color: #141a2e; }
.finder a { color: var(--board-fg); }

/* ---------- Home hero ---------- */
.home-hero {
  background: var(--hero-bg); color: var(--hero-ink);
  padding: clamp(2.25rem, 6vw, 4.25rem) 0;
  background-image:
    radial-gradient(1100px 420px at 85% -10%, rgba(255, 176, 0, .10), transparent 60%),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}
.home-hero-inner {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--board-fg);
}
.home-hero h1 { color: var(--hero-ink); margin-bottom: 1rem; }
.home-hero h1 span { color: var(--board-fg); }
.home-hero .lede { color: var(--hero-soft); font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 54ch; }
.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .55rem; }
.hero-points li { display: flex; gap: .6rem; align-items: flex-start; color: var(--hero-soft); }
.hero-points .icon { color: var(--board-fg); margin-top: .15em; width: 1.25em; height: 1.25em; }

/* ---------- Narrow heroes (inner pages) ---------- */
.hero {
  padding: clamp(2.25rem, 6vw, 3.75rem) 0 clamp(1.75rem, 4vw, 2.5rem);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.hero .lede { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--ink-soft); max-width: 66ch; }
.crumbs { font-size: .9rem; color: var(--ink-faint); margin-bottom: .6rem; }
.crumbs a { color: var(--ink-faint); }
.crumbs span { margin: 0 .35rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.25rem, 5vw, 3.5rem) 1.25rem; }
.section-title {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  font-size: clamp(1.45rem, 3vw, 1.85rem); margin-bottom: .6rem;
}
.section-title .icon { color: var(--accent); width: 1.1em; height: 1.1em; }
.section-title .count {
  font-family: var(--font-board); font-weight: 800; font-size: .95rem;
  background: var(--board-bg); color: var(--board-fg);
  padding: .1rem .5rem; border-radius: 5px; letter-spacing: .05em;
}
.section-intro { max-width: 64ch; color: var(--ink-soft); margin-bottom: 1.5rem; }
.prose, .prose-section p { max-width: 68ch; }
.prose-section h2 { margin-top: 2.25rem; }
.prose-section h2:first-child { margin-top: 0; }

/* ---------- Filter ---------- */
.filter { margin: 2.5rem 0 -1rem; }
.filter label {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .45rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--ink-soft);
}
.filter input {
  width: 100%; max-width: 32rem; padding: .7rem .9rem; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 10px;
}
.filter input::placeholder { color: var(--ink-faint); }
.filter-status { margin: .5rem 0 0; font-size: .9rem; color: var(--ink-faint); min-height: 1.4em; }
.filter-empty { margin: 2.5rem auto; color: var(--ink-soft); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(20, 26, 46, .45); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-photo { display: block; aspect-ratio: 520 / 320; overflow: hidden; background: var(--surface-2); }
.card-photo .photo { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-photo .photo { transform: scale(1.04); }
/* The route line under the photo, with the mode badge as its station. */
.card-line { position: relative; display: block; height: 6px; background: var(--tint, var(--accent)); }
.card-mode {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); border: 4px solid var(--tint, var(--accent));
}
.card-mode .icon { width: 20px; height: 20px; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.25rem 1.25rem; }
.card-head { display: flex; gap: .8rem; align-items: flex-start; margin-bottom: .7rem; padding-right: 2.5rem; }
.card-head h3 { margin: 0 0 .1rem; font-size: 1.4rem; }
.card-city { margin: 0; font-size: .86rem; color: var(--ink-faint); display: flex; gap: .3rem; align-items: flex-start; }
.card-city .icon { margin-top: .2em; }
.card-summary { font-size: .93rem; color: var(--ink-soft); margin-bottom: .9rem; }
.card-verdict {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .75rem;
  margin: 0 0 .9rem; padding: .5rem .7rem; border-radius: 6px;
  background: var(--board-bg); color: var(--board-fg);
  font-family: var(--font-board); font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  text-shadow: 0 0 5px rgba(255, 176, 0, .4);
}
.card-verdict-q { color: var(--board-dim); font-size: .85rem; }
.card-verdict-a { font-size: 1rem; }
.card-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem;
  margin: 0; padding-top: .9rem; border-top: 1px solid var(--line);
}
.card-stats div { margin: 0; min-width: 0; }
.card-stats .stat-wide { grid-column: 1 / -1; }
.card-stats dt {
  display: flex; align-items: center; gap: .3rem;
  font-family: var(--font-display); font-weight: 600; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
}
.card-stats dd { margin: 0; font-size: .9rem; font-weight: 600; }
.card-cta {
  margin-top: auto; padding-top: 1rem; display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--accent);
}
.card-cta .icon { transition: transform .15s ease; }
.card:hover .card-cta .icon { transform: translateX(3px); }

/* ---------- Network marks ---------- */
.mark {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: var(--mark-size); height: var(--mark-size);
  color: color-mix(in srgb, var(--mark) 70%, #101216);
  background: color-mix(in srgb, var(--mark) 12%, transparent);
  border-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  /* The deep purples and maroons sat at 1.7:1 against their own tint in
     the dark; lightening 75/25 is the smallest step that clears 3:1. */
  .mark { color: color-mix(in srgb, var(--mark) 75%, #ffffff); }
}
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .mark { background: var(--surface); color: var(--mark); }
}
.mark svg { display: block; width: 100%; height: 100%; }
.mark-sm { --mark-size: 28px; border-radius: 8px; }
.mark-md { --mark-size: 44px; }
.mark-lg { --mark-size: 64px; border-radius: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- Rules, CTA, steps ---------- */
.rules { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.rule-icon {
  width: 44px; height: 44px; padding: 9px; border-radius: 50%; margin-bottom: .75rem;
  background: var(--accent-soft); color: var(--accent);
}
.rule h3 { margin-bottom: .45rem; font-size: 1.3rem; }
.rule p { margin: 0; font-size: .94rem; color: var(--ink-soft); }

.cta-band {
  text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 3rem;
}
.cta-band h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
.cta-band p { color: var(--ink-soft); max-width: 52ch; margin-inline: auto; }
.cta-icon { width: 56px; height: 56px; color: var(--accent); margin-bottom: .5rem; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 2.5rem; position: relative; }
.steps::before {                         /* the line the numbered stops sit on */
  content: ""; position: absolute; left: 17px; top: 1rem; bottom: 1.5rem;
  width: 5px; border-radius: 3px; background: var(--accent); opacity: .35;
}
.steps > li { counter-increment: step; padding-left: 3.6rem; position: relative; margin-bottom: 2.25rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--surface); color: var(--accent); border: 4px solid var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
}
.steps h2 { font-size: 1.45rem; margin-bottom: .35rem; }
.steps p { color: var(--ink-soft); margin: 0; }

/* ---------- Callouts ---------- */
.callout {
  display: flex; gap: .65rem; align-items: flex-start;
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: .9rem 1.1rem; margin: 0 0 1.25rem;
  max-width: 68ch; font-size: .96rem; color: var(--ink-soft);
}
.callout > .icon { color: var(--accent); margin-top: .15em; width: 1.3em; height: 1.3em; }
.callout strong { color: var(--ink); }

/* =================================================================
   System pages
   ================================================================= */
.system-hero {
  background: var(--surface); border-bottom: 1px solid var(--line);
  border-top: 6px solid var(--tint, var(--accent));
  padding: clamp(1.75rem, 5vw, 3rem) 0 0;
}
.system-hero-inner { display: grid; gap: 2rem; align-items: start; }
.system-hero.has-finder .system-hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); }
.system-kicker {
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .6rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft);
}
.system-kicker .icon { width: 1.35em; height: 1.35em; }
.system-title { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.system-title h1 { margin: 0; }
.system-intro .lede { font-size: clamp(1.02rem, 1.8vw, 1.15rem); color: var(--ink-soft); max-width: 64ch; margin: 0; }
.finder-title {
  display: flex; align-items: center; gap: .45rem; font-size: 1.35rem; margin-bottom: .6rem;
}
.finder-title .icon { color: var(--accent); }

.factbar {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  margin: 1.75rem 0 0; padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line);
}
.factbar div { margin: 0; }
.factbar dt {
  display: flex; align-items: center; gap: .3rem;
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: .1rem;
}
.factbar dd { margin: 0; font-weight: 600; font-size: .96rem; }

.system-photo { margin: 0 auto; max-width: var(--wrap); padding: 1.75rem 1.25rem 0; }
/* height:auto overrides the 460 in the markup, which otherwise survives a
   narrow width and turns the banner into a tall sliver on a phone. */
.system-photo .photo { width: 100%; height: auto; aspect-ratio: 1000 / 460; max-height: 420px; object-fit: cover; border-radius: var(--radius); display: block; }
.system-photo figcaption { padding-top: .45rem; }

/* The route: a line in the network's colour, each section a station on it.
   The line and the stations are both placed from --line-x, so they cannot
   drift apart: the stations are centred on the line by construction. */
.route {
  --pad: 3.25rem; --line-x: 2.1rem; --line-w: 7px; --stn: 26px;
  position: relative; padding-left: var(--pad); padding-bottom: 2rem;
}
.route::before {
  content: ""; position: absolute; top: 3.1rem; bottom: 4.6rem;
  left: calc(var(--line-x) - var(--line-w) / 2); width: var(--line-w);
  border-radius: 4px; background: var(--tint, var(--accent));
}
.stop { position: relative; padding: 2.4rem 0 .5rem; }
.stop-title {
  position: relative; font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 1.1rem;
}
.stop-title::before {                     /* the station */
  content: ""; position: absolute; top: 50%; transform: translateY(-50%);
  left: calc(var(--line-x) - var(--pad) - var(--stn) / 2); width: var(--stn); height: var(--stn);
  border-radius: 50%; background: var(--bg); border: 6px solid var(--tint, var(--accent)); box-sizing: border-box;
}
.stop-end .stop-title::before {           /* the terminus */
  background: var(--tint, var(--accent)); box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--tint, var(--accent));
}
.sub-title { display: flex; align-items: center; gap: .4rem; font-size: 1.3rem; margin-bottom: .8rem; }
.sub-title .icon { color: var(--accent); }

.tickets { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; }
.ticket-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin-bottom: .7rem; }
.ticket-icon {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  color: color-mix(in srgb, var(--tint) 70%, #101216);
  background: color-mix(in srgb, var(--tint) 14%, transparent);
}
@media (prefers-color-scheme: dark) { .ticket-icon { color: color-mix(in srgb, var(--tint) 75%, #ffffff); } }
.ticket-icon .icon { width: 22px; height: 22px; }
.ticket-head h3 { margin: 0; flex: 1 1 8rem; min-width: 0; font-size: 1.25rem; }
.ticket-price {
  margin: 0 0 0 auto; flex: 0 1 auto; min-width: 0; text-align: right;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--accent);
}
.ticket-best { font-size: .88rem; margin-bottom: .5rem; background: var(--accent-soft); border-radius: 6px; padding: .3rem .6rem; display: inline-block; }
.ticket-best span {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: .8rem; letter-spacing: .05em; color: var(--accent); margin-right: .3rem;
}
.ticket-notes { margin: 0; font-size: .93rem; color: var(--ink-soft); }

.verified { display: flex; gap: .5rem; align-items: flex-start; margin-top: 1.5rem; font-size: .9rem; color: var(--ink-faint); max-width: 72ch; }
.verified .icon { margin-top: .2em; color: var(--accent); }
.verified-stale {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: .8rem 1rem; color: var(--ink-soft);
}
.stale-dot { color: var(--accent); font-size: 1.1em; line-height: 0; }

.tap-rule {
  display: flex; gap: 1rem; align-items: center; margin: 0; max-width: 62ch;
  padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line);
  border-left: 6px solid var(--tint, var(--accent)); border-radius: var(--radius); font-size: 1.02rem;
}
.tap-icon { width: 44px; height: 44px; color: var(--accent); }

.two-col { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.icon-list, .ticks { list-style: none; padding: 0; margin: 0; }
.icon-list li { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .8rem; color: var(--ink-soft); }
.icon-list .icon {
  width: 34px; height: 34px; padding: 7px; border-radius: 9px; margin-top: -.3rem;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
}
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .7rem; color: var(--ink-soft); }
.ticks li::before {
  content: ""; position: absolute; left: .15rem; top: .55em; width: 10px; height: 10px; border-radius: 50%;
  border: 3px solid var(--accent); box-sizing: border-box;
}
.tips { margin: 0; padding-left: 1.3rem; max-width: 72ch; }
.tips li { margin-bottom: .75rem; color: var(--ink-soft); padding-left: .25rem; }
.tips li::marker { font-family: var(--font-display); font-weight: 700; color: var(--accent); }

.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery .photo { width: 100%; height: auto; aspect-ratio: 640 / 427; object-fit: cover; display: block; background: var(--surface-2); }
.gallery figcaption { padding: .6rem .8rem .75rem; display: grid; gap: .15rem; }
.gallery-caption { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.photo-credit { margin: 0; font-size: .8rem; color: var(--ink-faint); }
.photo-credit a { color: inherit; }
.photo-credit .icon { width: 1em; height: 1em; }

.faq { margin: 0; max-width: 72ch; }
.faq > div { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.faq > div:last-child { border-bottom: 0; }
.faq dt { display: flex; gap: .5rem; align-items: flex-start; font-weight: 700; margin-bottom: .3rem; }
.faq dt .icon { color: var(--accent); margin-top: .2em; }
.faq dd { margin: 0 0 0 1.65rem; color: var(--ink-soft); }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0 0; }
.pills a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem;
  font-size: .92rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); text-decoration: none; color: var(--ink-soft);
}
.pills a:hover { border-color: var(--accent); color: var(--ink); }
.prose-section .pills { margin-bottom: 2rem; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare {
  width: 100%; border-collapse: collapse; min-width: 720px; table-layout: fixed;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.compare caption { caption-side: bottom; text-align: left; padding-top: .9rem; font-size: .86rem; color: var(--ink-faint); }
.compare th, .compare td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .94rem; }
.compare thead th {
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); white-space: nowrap;
}
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody th { font-weight: 600; }
.compare tbody th a { white-space: normal; }
.compare tbody th .dot { margin-right: .55rem; vertical-align: baseline; }
.compare .num { font-variant-numeric: tabular-nums; }
.compare .group-row th {
  background: var(--surface-2); font-family: var(--font-display); font-weight: 700;
  font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
}
.compare .is-stale { color: var(--accent); font-weight: 600; }
.compare col.c-network { width: 19%; } .compare col.c-city { width: 17%; } .compare col.c-model { width: 22%; }
.compare col.c-single { width: 20%; } .compare col.c-day { width: 10%; } .compare col.c-checked { width: 12%; }
.compare tbody td:nth-child(4) { white-space: normal; overflow-wrap: anywhere; }
.compare tbody td:nth-child(5), .compare tbody td:nth-child(6) { white-space: nowrap; }
.breakeven { min-width: 0; table-layout: auto; }
/* Unlike the comparison table, this one is small enough to always fit, so
   its headings wrap rather than pushing a column off the screen. */
.breakeven thead th { white-space: normal; }
.breakeven tbody td:nth-child(n) { white-space: normal; }
.breakeven .is-breakeven { background: var(--accent-soft); }
.breakeven .is-breakeven th, .breakeven .is-breakeven td { font-weight: 700; }
.credits-table td { overflow-wrap: anywhere; }
.credit-caption { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-faint); }
.scroll-hint { display: none; font-size: .86rem; color: var(--ink-faint); margin: 0 0 .6rem; }

/* ---------- City index ---------- */
.alpha { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.25rem; }
.alpha a {
  display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem;
  font-family: var(--font-board); font-weight: 800; font-size: 1.05rem;
  background: var(--board-bg); color: var(--board-fg); border-radius: 6px; text-decoration: none;
}
.alpha a:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.alpha-head {
  display: flex; align-items: center; gap: .75rem;
  margin: 2.5rem 0 .25rem; font-size: 2rem; color: var(--ink); scroll-margin-top: 5rem;
}
.alpha-head::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.alpha-head:first-child { margin-top: 0; }
.city-row { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.city-row:last-child { border-bottom: 0; }
.city-name { margin: 0; font-size: 1.3rem; }
.city-row .pills { margin-top: .5rem; }
@media (min-width: 720px) {
  .city-row { display: grid; grid-template-columns: 14rem 1fr; gap: 1rem; align-items: baseline; }
  .city-row .pills { margin-top: 0; }
}

/* ---------- Footer ---------- */
.site-footer { background: #0f1320; color: #c3c8d6; margin-top: 2rem; }
.site-footer .wrap { padding-top: 2.75rem; padding-bottom: 1.75rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr repeat(4, 1fr); }
/* The long caveat reads as a note under the columns, not as a sixth column. */
.footer-note { grid-column: 1 / -1; max-width: 80ch; padding-top: 1.25rem; border-top: 1px solid #262d3b; }
.site-footer .plain a { text-decoration: none; }
.site-footer .plain a:hover { text-decoration: underline; }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h2 {
  font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; color: #f4f1e8; margin-bottom: .75rem;
}
.site-footer p { font-size: .92rem; color: #c3c8d6; }          /* 10:1 on #0f1320 */
.site-footer a { color: #ffd27a; }                            /* 12:1 */
.site-footer .muted { color: #a9b1c2; }                       /*  8:1 */
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: .35rem; font-size: .92rem; }
.copyright { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid #262d3b; font-size: .85rem; color: #a9b1c2; }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  .home-hero-inner, .system-hero.has-finder .system-hero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { .scroll-hint { display: block; } }
@media (max-width: 720px) {
  body { font-size: 16.5px; }
  /* On a phone the nav wraps to two lines; pinned, it would hold a sixth
     of the screen for the whole visit. Let it scroll away instead. */
  .site-header { position: static; }
  html { scroll-padding-top: 1rem; }
  .header-inner { padding-block: .55rem; }
  .site-header nav { gap: .1rem .9rem; }
  .site-header nav a { font-size: .98rem; }
  .brand { font-size: 1.3rem; }
  .system-title { flex-direction: column; align-items: flex-start; gap: .7rem; }
  .mark-lg { --mark-size: 48px; border-radius: 11px; }
  .factbar { gap: .8rem 1.5rem; }
  .finder { padding: .9rem; }
  .finder-steppers { gap: .6rem; }
  .route { --pad: 2.4rem; --line-x: 1.2rem; --line-w: 6px; --stn: 22px; }

  /* The nav is one swipeable row rather than two wrapped lines; the fade
     on the right edge is the cue that there is more to swipe to. */
  .site-header nav {
    flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 1.1rem;
    scrollbar-width: none; padding-bottom: .1rem;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
            mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { white-space: nowrap; }

  /* Twenty-four cards stacked at full height made the home page over
     22,000px long on a phone. The summary is on each system's own page;
     here the card keeps the photo, the answer and the key fares. */
  .card-photo { aspect-ratio: 16 / 7; }
  .card-summary, .card-stats .stat-wide { display: none; }
  .card-body { padding: .9rem 1rem 1rem; }
  .card-head { margin-bottom: .6rem; }
  .card-verdict { margin-bottom: .7rem; }
  .card-cta { padding-top: .7rem; }

  .breakeven th, .breakeven td { padding: .6rem .6rem; font-size: .9rem; }

  /* The introduction reads badly squeezed into half the width. */
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .stop-title::before { border-width: 5px; }
  .steps > li { padding-left: 3.1rem; }
  .card-head { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .card-photo .photo, .card-cta .icon { transition: none; }
  .card:hover, .card:hover .card-photo .photo, .card:hover .card-cta .icon { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  /* Fares are the reason anyone prints this, so everything else gets out
     of the way, and link targets are spelled out. */
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-soft: #222;
    --ink-faint: #444; --line: #bbb; --accent: #000; --accent-soft: #fff;
  }
  .site-header, .site-footer, .skip, .filter, .filter-empty, .alpha, .stripe,
  .other-systems, .cta-band, .scroll-hint, .card-photo, .gallery, .stepper, .finder-city,
  .finder-go, .card-line, .home-hero-copy .hero-points { display: none; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; }
  .home-hero, .system-hero { background: #fff; color: #000; border: 0; }
  .home-hero h1, .home-hero h1 span, .home-hero .lede { color: #000; }
  .finder { background: #fff; color: #000; border: 1px solid #000; box-shadow: none; }
  .board, .card-verdict { background: #fff; color: #000; text-shadow: none; outline: 0; border: 1px solid #000; }
  .board-query, .board-detail, .card-verdict-q, .finder-notes, .finder-scope { color: #333; }
  .route::before, .stop-title::before, .steps::before { display: none; }
  .route { padding-left: 0; }
  .system-photo, .card, .ticket, .rule, .compare { break-inside: avoid; }
  .tickets, .two-col, .grid, .system-hero-inner, .home-hero-inner { display: block; }
  .ticket, .card { border: 1px solid #bbb; margin-bottom: .6rem; }
  .table-scroll { overflow: visible; }
  .compare { min-width: 0; font-size: 9pt; }
  .system-photo .photo { max-height: 220px; }
  .verified a[href^="http"]::after, .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
}
