/* Kerbside — stories as stops on topic lines */

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

:root {
  --paper: #f4f1ea;
  --surface: #fbfaf6;
  --ink: #15171c;
  --ink-2: #464a53;
  --rule: #d8d2c4;
  --rule-strong: #b9b1a0;
  --focus: #15171c;

  /* Line colours: --c for strokes and fills, --c-ink for text on paper */
  --culture: #b0215a;   --culture-ink: #a01d52;
  --food: #e0552b;      --food-ink: #b23d14;
  --movement: #1f5fbf;  --movement-ink: #1c55ab;
  --people: #e3a72f;    --people-ink: #855600;
  --places: #23804d;    --places-ink: #1d6e42;

  --c: var(--ink);
  --c-ink: var(--ink);

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 999px;
}
.skip:focus { top: 12px; }

.label {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

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

.masthead { background: var(--paper); }
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -.02em;
  line-height: 1;
}
.wordmark__mark { width: 40px; height: 24px; }
.masthead__tag {
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
  padding-left: 24px;
  border-left: 1px solid var(--rule-strong);
}
.masthead__nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .9375rem;
}
.masthead__nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
}
.masthead__nav a:hover { background: rgb(21 23 28 / .07); }

.line-stripe { display: flex; height: 6px; }
.line-stripe span { flex: 1; }
.line-stripe span:nth-child(1) { background: var(--culture); }
.line-stripe span:nth-child(2) { background: var(--food); }
.line-stripe span:nth-child(3) { background: var(--movement); }
.line-stripe span:nth-child(4) { background: var(--people); }
.line-stripe span:nth-child(5) { background: var(--places); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
  padding-top: clamp(40px, 6vw, 88px);
  padding-bottom: clamp(56px, 7vw, 104px);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 28px;
}
.kicker__sep { color: var(--rule-strong); }

.lead__line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .9375rem;
  color: var(--c-ink);
  margin-bottom: 18px;
}
.lead__line .stop { width: 40px; height: 40px; font-size: .8125rem; border-width: 4px; }

.lead__title {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.5rem, 5.7vw, 5.75rem);
  line-height: .98;
  letter-spacing: -.025em;
  text-wrap: balance;
  max-width: 13ch;
}
.lead__dek {
  margin-top: 28px;
  max-width: 34ch;
  font-size: clamp(1.1875rem, 1.6vw, 1.5rem);
  line-height: 1.4;
  font-style: italic;
  color: var(--ink-2);
}
.lead__byline {
  margin-top: 20px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}
.lead__byline strong { color: var(--ink); font-weight: 600; }
.lead__actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #2c3039; }
.btn--primary:hover svg { transform: translateX(3px); }
.btn svg { transition: transform .18s var(--ease); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: rgb(21 23 28 / .07); }
.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding-inline: 12px;
  min-height: 44px;
}
.btn--quiet:hover { background: rgb(21 23 28 / .07); }

/* Network map */

.network {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 24px;
}
.network__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.network__note {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--ink-2);
}
.network__map {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0 16px;
}
.map-line path {
  fill: none;
  stroke: var(--c);
  stroke-width: 13;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-line .stn { fill: var(--surface); stroke: var(--c); stroke-width: 6; }
.map-line text {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
}
.map-line { transition: opacity .3s var(--ease); }
.map-xchg rect { fill: var(--surface); stroke: var(--ink); stroke-width: 5; }
.network__map[data-active] .map-line { opacity: .14; }
.network__map[data-active="Culture"]  .map-line[data-line="Culture"],
.network__map[data-active="Food"]     .map-line[data-line="Food"],
.network__map[data-active="Movement"] .map-line[data-line="Movement"],
.network__map[data-active="People"]   .map-line[data-line="People"],
.network__map[data-active="Places"]   .map-line[data-line="Places"] { opacity: 1; }

.network__key {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.key {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  text-align: left;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.15;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.key:hover { border-color: var(--ink); }
.key__bar {
  flex: none;
  width: 22px;
  height: 8px;
  border-radius: 4px;
  background: var(--c);
}
.key--all .key__bar {
  background: linear-gradient(90deg, var(--culture) 0 20%, var(--food) 20% 40%, var(--movement) 40% 60%, var(--people) 60% 80%, var(--places) 80%);
}
.key__text { display: grid; gap: 2px; min-width: 0; }
.key__count {
  font-weight: 500;
  font-size: .8125rem;
  color: var(--ink-2);
}
.key[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.key[aria-pressed="true"] .key__count { color: #d6d3cb; }

/* ---------- Stories ---------- */

.stories { padding-bottom: clamp(64px, 8vw, 128px); }

.stories__head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
  padding-top: clamp(40px, 5vw, 72px);
  /* Rule aligned to the content edges, not the gutters */
  background: linear-gradient(var(--ink), var(--ink)) no-repeat var(--gutter) 0 / calc(100% - var(--gutter) * 2) 1px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(2.25rem, 4.2vw, 3.75rem);
  line-height: 1;
  letter-spacing: -.02em;
}
.section-title:focus { outline: none; }
.stories__intro { color: var(--ink-2); max-width: 46ch; }

.controls {
  margin-top: 32px;
  background: var(--paper);
  border-block: 1px solid var(--rule);
  z-index: 10;
}
.controls__inner {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px 20px;
  padding-block: 16px;
}
.field { display: grid; gap: 6px; }
.field label {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field--search { flex: 1 1 320px; max-width: 460px; }
.field--select { flex: 0 1 220px; }
.field__box {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field__box:hover { border-color: var(--ink); }
.field__box:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(21 23 28 / .18);
}
.field__box > svg { width: 20px; height: 20px; margin-left: 16px; flex: none; color: var(--ink-2); }
.field input, .field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 45px;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0 16px 0 10px;
}
.field input::placeholder { color: #6b6e75; }
.field input:focus, .field select:focus { outline: none; }
.field input::-webkit-search-cancel-button { cursor: pointer; }
.field__hint {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 1px 7px;
  margin-right: 14px;
}
.field__box--select { padding-left: 16px; }
.field__box--select select { padding-left: 10px; padding-right: 40px; cursor: pointer; font-weight: 600; }
.select-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  background: var(--c);
  box-shadow: inset 0 0 0 2px var(--surface);
  outline: 2px solid var(--c);
}
.field__box--select[data-line="all"] .select-dot {
  background: conic-gradient(var(--culture) 0 20%, var(--food) 0 40%, var(--movement) 0 60%, var(--people) 0 80%, var(--places) 0);
  outline-color: transparent;
  box-shadow: none;
}
.field__box .chev {
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  margin: 0;
  pointer-events: none;
  color: var(--ink);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--rule-strong);
  background: var(--surface);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.toggle:hover { border-color: var(--ink); }
.toggle svg { width: 20px; height: 20px; }
.bm { fill: transparent; transition: fill .18s var(--ease); }
.toggle__count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(21 23 28 / .08);
  font-size: .8125rem;
  text-align: center;
}
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.toggle[aria-pressed="true"] .bm { fill: currentColor; }
.toggle[aria-pressed="true"] .toggle__count { background: rgb(255 255 255 / .18); }

.controls__status {
  margin-left: auto;
  align-self: center;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}

/* The route: list of stops */

.route {
  list-style: none;
  margin: 0;
  padding: 24px 0 0;
}

.item {
  --rail: 88px;
  --stop: 48px;
  --pad: 36px;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) 200px minmax(0, 1fr) auto;
  column-gap: 32px;
  padding-block: var(--pad);
  border-radius: 6px;
  transition: background-color .2s var(--ease);
}
/* Rail segment in this stop's line colour */
.item::before {
  content: "";
  position: absolute;
  left: calc(var(--rail) / 2 - 4px);
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--c);
}
.item:first-child::before { top: calc(var(--pad) + var(--stop) / 2); }
.item:last-child::before { bottom: auto; height: calc(var(--pad) + var(--stop) / 2); }
.item:only-child::before { display: none; }
/* Hairline across the content columns */
.item + .item::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--rail) + 32px);
  right: 0;
  border-top: 1px solid var(--rule);
}
.item:hover, .item:focus-within { background: rgb(255 255 255 / .55); }

.stop {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--stop, 48px);
  height: var(--stop, 48px);
  border-radius: 50%;
  background: var(--surface);
  border: 5px solid var(--c);
  font-family: var(--sans);
  font-weight: 700;
  font-size: .875rem;
  color: var(--ink);
}
.item .stop { justify-self: center; pointer-events: none; }

.item__meta {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 4px;
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}
.item__line {
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin-bottom: 6px;
}
.item__saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-weight: 600;
  font-size: .8125rem;
  color: var(--ink);
}
.item__saved svg { width: 14px; height: 14px; }

.item__main { max-width: 62ch; }
.item__title {
  font-family: var(--serif);
  font-weight: 650;
  font-size: clamp(1.5rem, 2.3vw, 2.125rem);
  line-height: 1.1;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.item__summary { margin-top: 12px; color: var(--ink-2); }
.item__author { margin-top: 12px; font-family: var(--sans); font-size: .9375rem; font-weight: 600; }

.item__action { align-self: center; }
.open {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.open svg { width: 18px; height: 18px; transition: transform .18s var(--ease); }
/* Whole row opens the story */
.open::after { content: ""; position: absolute; inset: 0; border-radius: 6px; }
.item:hover .open { background: var(--ink); color: var(--paper); }
.item:hover .open svg { transform: translateX(3px); }
.item:hover .item__title { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.open:focus-visible { background: var(--ink); color: var(--paper); }

/* Empty state */

.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin: 32px 0 0 88px;
  padding: 40px clamp(24px, 4vw, 48px);
  border: 1.5px dashed var(--rule-strong);
  border-radius: 6px;
  max-width: 720px;
}
.empty__sign { color: var(--ink); width: 120px; }
.empty__sign svg { display: block; width: 100%; }
.empty__title { font-weight: 650; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }
.empty__text { color: var(--ink-2); max-width: 48ch; }
.empty .btn { margin-top: 8px; }

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

.footer { background: var(--ink); color: var(--paper); }
.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: clamp(32px, 5vw, 80px);
  row-gap: 16px;
  padding-block: 0 clamp(48px, 6vw, 80px);
}
.footer__terminus {
  grid-column: 1 / -1;
  position: relative;
  height: 72px;
  margin-left: 40px;
}
.footer__terminus::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 44px;
  width: 8px;
  background: linear-gradient(var(--places), var(--movement));
}
.footer__terminus span {
  position: absolute;
  left: -16px;
  top: 40px;
  width: 40px;
  height: 8px;
  border-radius: 4px;
  background: var(--paper);
}
.footer__mark {
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 8.5rem);
  letter-spacing: -.035em;
  line-height: .9;
  grid-row: span 2;
}
.footer__note { font-size: 1.125rem; max-width: 40ch; align-self: end; }
.footer__meta { font-family: var(--sans); font-size: .9375rem; color: #c9c6be; }

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

.detail {
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  width: min(880px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: -24px 0 60px rgb(21 23 28 / .25);
}
.detail::backdrop { background: rgb(21 23 28 / .55); }
.detail[open] { animation: slide-in .38s var(--ease); }
.detail[open]::backdrop { animation: fade-in .3s var(--ease); }
@keyframes slide-in { from { transform: translateX(48px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.detail__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgb(244 241 234 / .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.save {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.save svg { width: 20px; height: 20px; }
.save:hover { background: rgb(21 23 28 / .07); }
.save[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.save[aria-pressed="true"] .bm { fill: currentColor; }

.article {
  padding: clamp(28px, 5vw, 56px) clamp(20px, 7vw, 88px) clamp(48px, 6vw, 80px);
}

/* Route strip: the stops on this story's line */
.route-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.route-strip__track {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(20px, 6vw, 56px);
  padding-left: 10px;
  min-height: 52px;
}
.route-strip__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: var(--c);
}
.route-strip .stop { --stop: 36px; border-width: 4px; font-size: .75rem; color: var(--ink-2); }
.route-strip .stop[aria-current="true"] { --stop: 52px; border-width: 6px; font-size: .9375rem; color: var(--ink); }
.route-strip__label {
  font-family: var(--sans);
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-ink);
  white-space: nowrap;
}

.article__kicker {
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink);
  margin-bottom: 14px;
}
.article__title {
  font-weight: 650;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.article__title:focus { outline: none; }
.article__dek {
  margin-top: 20px;
  font-size: clamp(1.1875rem, 2vw, 1.4375rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 36ch;
}
.article__byline {
  margin-top: 24px;
  padding-block: 14px;
  border-block: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .9375rem;
  color: var(--ink-2);
}
.article__byline strong { color: var(--ink); font-weight: 600; }

.article__body {
  margin-top: 32px;
  max-width: 64ch;
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  line-height: 1.68;
}
.article__body p + p { margin-top: 1.1em; }
.article__body p:first-child::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .86;
  font-weight: 700;
  padding: .07em .1em 0 0;
  color: var(--c-ink);
}

.article__end {
  position: relative;
  height: 40px;
  margin-top: 40px;
  max-width: 64ch;
}
.article__end::before {
  content: "";
  position: absolute;
  left: 0;
  right: 24px;
  top: 16px;
  height: 8px;
  border-radius: 4px;
  background: var(--c);
}
.article__end span {
  position: absolute;
  right: 12px;
  top: 0;
  width: 8px;
  height: 40px;
  border-radius: 4px;
  background: var(--ink);
}

.next { margin-top: 32px; }
.next__btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 20px;
  width: 100%;
  padding: 20px 24px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--surface);
  text-align: left;
  transition: border-color .18s var(--ease);
}
.next__btn:hover { border-color: var(--ink); }
.next__btn .stop { --stop: 48px; }
.next__label {
  display: block;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-ink);
}
.next__title {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 1.375rem;
  line-height: 1.2;
}
.next__arrow { display: flex; }
.next__arrow svg { width: 24px; height: 24px; transition: transform .18s var(--ease); }
.next__btn:hover .next__arrow svg { transform: translateX(3px); }

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

@media (min-width: 900px) {
  .controls { position: sticky; top: 0; }
}

@media (max-width: 1100px) {
  .item { grid-template-columns: var(--rail) 170px minmax(0, 1fr); }
  .item__action { grid-column: 3; margin-top: 20px; justify-self: start; }
  .network__key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .masthead__tag { display: none; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .stories__head { grid-template-columns: 1fr; gap: 16px; }
  .network__key { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__mark { grid-row: auto; }
}

@media (max-width: 680px) {
  body { font-size: 1.0625rem; }
  .masthead__inner { min-height: 64px; gap: 12px; }
  .wordmark { font-size: 1.5rem; }
  .wordmark__mark { width: 32px; height: 20px; }
  .masthead__nav a { padding: 10px 10px; }
  .masthead__nav a:first-child { display: none; }

  .hero { padding-top: 32px; gap: 40px; }
  .kicker { font-size: .8125rem; margin-bottom: 20px; }
  .lead__title { font-size: clamp(2.375rem, 11vw, 3rem); max-width: none; }
  .lead__dek { margin-top: 20px; }
  .lead__actions { margin-top: 28px; }
  .lead__actions .btn { flex: 1 1 auto; }

  .network { padding: 18px; }
  .network__key { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .controls__inner { gap: 12px; }
  .field--search { flex: 1 1 100%; max-width: none; }
  .field__hint { display: none; }
  .field--select { flex: 1 1 140px; }
  .toggle { flex: 0 0 auto; align-self: end; }
  .controls__status { margin-left: 0; flex-basis: 100%; }

  .item {
    --rail: 52px;
    --stop: 40px;
    --pad: 28px;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: 16px;
  }
  .item + .item::after { left: calc(var(--rail) + 16px); }
  .item .stop { font-size: .8125rem; border-width: 4px; }
  .item__meta {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 12px;
    padding-top: 0;
    min-height: var(--stop);
    font-size: .875rem;
  }
  .item__line { margin: 0; flex-basis: 100%; }
  .item__saved { margin: 0; }
  .item .stop { grid-row: 1; grid-column: 1; }
  .item__main { grid-column: 2; margin-top: 10px; }
  .item__action { grid-column: 2; margin-top: 18px; }

  .empty { margin-left: 0; }

  .detail { width: 100vw; box-shadow: none; }
  .detail__bar { padding-inline: 12px; }
  .wide-only { display: none; }
  .save { padding-inline: 14px; }
  .route-strip { flex-wrap: wrap; gap: 8px; }
  .route-strip__label { flex-basis: 100%; order: -1; }
  .next__btn { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .next__arrow { display: none; }
  .next__title { font-size: 1.1875rem; }
  .footer__terminus { margin-left: 26px; }
}

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