/* Fillerup route pages (scripts/seo). Same tokens as the app (src/style.css), light and dark. */

:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --border: #e2e0d8;
  --border-strong: #cfccc1;
  --text: #1d1f1e;
  --text-2: #55595a;
  --text-3: #6f7373;
  --accent: #1f6f5c;
  --accent-hover: #185a4b;
  --accent-soft: #e3efe9;
  --on-accent: #ffffff;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  /* Figure colors, validated as a pair (dataviz validator, light on #ffffff, dark on #1e2125). */
  --car: #0f8a6c;
  --truck: #6b5bd2;
  --gap: #c98a12;
  --route: #8c9091;
  --tick: rgb(29 31 30 / 0.5);
  --radius: 10px;
  --radius-sm: 7px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --surface: #1e2125;
    --surface-2: #262a2f;
    --border: #2f343a;
    --border-strong: #3d434a;
    --text: #e8e9e7;
    --text-2: #a9aeb0;
    --text-3: #959b9e;
    --accent: #5cc1a3;
    --accent-hover: #74d0b4;
    --accent-soft: #1d3530;
    --on-accent: #0d1f1a;
    --warn: #e7b65a;
    --warn-soft: #33291a;
    --car: #2ea482;
    --truck: #8b78ec;
    --gap: #d9a23b;
    --route: #7d8489;
    --tick: rgb(232 233 231 / 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 3px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip:focus {
  top: 8px;
}

/* ---- header, layout, footer ---------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  min-height: 44px;
}
.brand-mark {
  color: var(--accent);
  flex: none;
}
.bar-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}
.foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
}
.foot p {
  margin: 0 0 8px;
}

/* ---- text ---------------------------------------------------------------- */

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 0;
  padding: 0;
  font-size: 13px;
  color: var(--text-3);
}
.crumbs li + li::before {
  content: '›';
  margin-right: 4px;
}
h1 {
  font-size: clamp(26px, 6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 10px 0 6px;
}
h2 {
  font-size: 21px;
  line-height: 1.25;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 16px;
  margin: 18px 0 6px;
}
p {
  margin: 0 0 12px;
}
.lede-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 18px;
}
.prose p {
  font-size: 17px;
  line-height: 1.6;
}
.note,
.spec,
.arrive {
  color: var(--text-2);
  font-size: 14px;
}
.plans + .note {
  margin-top: 12px;
}
.sub {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
}

/* ---- facts --------------------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin: 0 0 20px;
}
.facts div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.facts dt {
  font-size: 12px;
  color: var(--text-2);
}
.facts dd {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
}
.fact-note {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---- buttons and links --------------------------------------------------- */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 18px 0 8px;
}
.cta-sub {
  flex: 1 1 240px;
  color: var(--text-2);
  font-size: 13px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.links {
  margin: 0 0 8px;
  padding-left: 20px;
}
.links li {
  margin: 4px 0;
}
.link-note {
  color: var(--text-3);
  font-size: 14px;
}

/* ---- plans and tables ---------------------------------------------------- */

.plans {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 4px;
}
.plan h3 {
  margin: 0 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-link {
  font-size: 14px;
}
.nostop {
  font-weight: 600;
}
.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
}
.table-wrap {
  overflow-x: auto;
  margin: 8px 0 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
caption {
  text-align: left;
  color: var(--text-2);
  font-size: 13px;
  padding-bottom: 6px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--border);
}
thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
tbody th {
  font-weight: 600;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
tbody th.num {
  text-align: right;
}
/* Headers of number columns may wrap ("Longest stretch without a station"); the numbers don't. */
thead th.num {
  white-space: normal;
}
.nw {
  white-space: nowrap;
}
.st-name {
  font-weight: 600;
}
.st-where {
  display: block;
  color: var(--text-2);
}

/* ---- figures ------------------------------------------------------------- */

.fig {
  margin: 8px 0 6px;
}
.fig-box {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fig-box svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fig svg path,
.fig svg rect {
  vector-effect: non-scaling-stroke;
}
.r-casing,
.r-line,
.r-gap,
.r-scale {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.r-casing {
  stroke: var(--surface);
  stroke-width: 7px;
}
.r-line {
  stroke: var(--route);
  stroke-width: 2.5px;
}
.r-gap {
  stroke: var(--gap);
  stroke-width: 5px;
}
.r-scale {
  stroke: var(--text-3);
  stroke-width: 2px;
  stroke-linecap: butt;
}
.m-ring,
.m-ring-sq,
.m-car,
.m-truck,
.m-end {
  fill: none;
}
.m-ring {
  stroke: var(--surface);
  stroke-width: 15px;
  stroke-linecap: round;
}
.m-ring-sq {
  stroke: var(--surface);
  stroke-width: 14px;
  stroke-linecap: square;
}
.m-car {
  stroke: var(--car);
  stroke-width: 11px;
  stroke-linecap: round;
}
.m-truck {
  stroke: var(--truck);
  stroke-width: 9px;
  stroke-linecap: square;
}
.m-end {
  stroke: var(--text);
  stroke-width: 10px;
  stroke-linecap: round;
}
/* Labels over a figure: placed at a point in percent, growing away from the nearer edge. */
.fl {
  position: absolute;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  padding: 1px 4px;
  border-radius: 4px;
  pointer-events: none;
}
.fl-r.fl-t {
  transform: translate(-8px, calc(-100% - 9px));
}
.fl-r.fl-b {
  transform: translate(-8px, 9px);
}
.fl-l.fl-t {
  transform: translate(8px, calc(-100% - 9px));
}
.fl-l.fl-b {
  transform: translate(8px, 9px);
}
.fl-end {
  font-weight: 650;
}
.fl-gap {
  color: var(--warn);
  font-weight: 650;
  font-size: 12px;
}
.fl-scale {
  font-size: 11px;
  color: var(--text-3);
  background: none;
  transform: translate(-4px, calc(-100% - 4px));
}
.rug-box {
  position: relative;
  height: 64px;
}
.rug-box svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fl-rug {
  top: 70%;
  transform: translate(-50%, -50%);
}
/* On phones the label is wider than most shaded stretches and would hide their neighbours; the
   sketch above and the table below carry it. */
@media (max-width: 599px) {
  .fl-rug {
    display: none;
  }
}
.g-tick {
  fill: none;
  stroke: var(--tick);
  stroke-width: 1px;
}
.g-base {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1px;
}
.g-wash {
  fill: var(--gap);
  fill-opacity: 0.2;
}
.rug-axis {
  position: relative;
  height: 20px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ax {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.ax-0 {
  left: 0;
  transform: none;
}
.ax-end {
  right: 0;
  transform: none;
}
.rug-unit {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin: 0 0 8px;
}
.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0 4px;
  padding: 0;
  font-size: 13px;
  color: var(--text-2);
}
.sw {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  vertical-align: -1px;
  flex: none;
}
.sw-car {
  border-radius: 50%;
  background: var(--car);
}
.sw-truck {
  border-radius: 1px;
  background: var(--truck);
}
.sw-end {
  border-radius: 50%;
  background: var(--text);
}
.sw-gap {
  width: 18px;
  height: 5px;
  border-radius: 3px;
  background: var(--gap);
  vertical-align: 2px;
}

/* ---- method -------------------------------------------------------------- */

.method {
  color: var(--text-2);
  font-size: 14px;
}
.method h2 {
  color: var(--text);
}
.method ul {
  padding-left: 20px;
}
.method li {
  margin: 6px 0;
}

@media (forced-colors: active) {
  .m-car,
  .m-truck,
  .m-end,
  .r-line,
  .r-gap,
  .g-tick {
    stroke: CanvasText;
  }
  .sw {
    forced-color-adjust: none;
  }
}
