/* ==========================================================================
   OFF PEAK — riso-print transit zine
   ========================================================================== */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-weight: 300 600;
  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 {
  --paper:       #e9e5da;
  --paper-2:     #f3f0e8;
  --paper-3:     #ded8c9;
  --ink:         #14242c;
  --ink-soft:    #4a5a60;
  --blue:        #1c4d84;
  --blue-deep:   #122f4c;
  --pink:        #ed3d68;
  --pink-deep:   #b81b42;
  --yellow:      #f0bd35;
  --green:       #2c7a59;
  --violet:      #6a4aa0;

  --rail-x: 26px;
  --radius: 3px;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-read: "Work Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --grain: radial-gradient(rgba(20, 36, 44, 0.045) 1px, transparent 1.1px);
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain);
  background-size: 5px 5px;
  color: var(--ink);
  font-family: var(--font-read);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

::selection { background: var(--pink-deep); color: var(--paper-2); }

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

button, a, input, select { outline-offset: 3px; }
:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(1180px, 100% - 2.6rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--pink-deep);
  color: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus { top: 1rem; }

/* ==========================================================================
   Masthead — the departure hall
   ========================================================================== */

.masthead {
  position: relative;
  background: var(--blue-deep);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.2px),
    linear-gradient(160deg, #16406b 0%, #10283f 100%);
  background-size: 6px 6px, cover;
  color: var(--paper-2);
  padding: clamp(2rem, 5vw, 3.6rem) 0 0;
  overflow: hidden;
}

.masthead__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}

.brand { position: relative; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.4rem, 15vw, 11.5rem);
  line-height: 0.78;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--paper-2);
}
.wordmark__dash {
  color: var(--pink);
  transform: translateY(-0.06em);
  padding-inline: 0.03em;
}
.wordmark__peak { color: var(--paper-2); }

.tagline {
  margin-top: 1.3rem;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  line-height: 1.45;
  color: #d8e2e8;
}
.imprint {
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
}

.board {
  border: 1px solid rgba(233, 229, 218, 0.28);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  background: rgba(9, 25, 38, 0.34);
}
.board__title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--yellow);
  padding-bottom: 0.55rem;
  border-bottom: 1px dashed rgba(233, 229, 218, 0.3);
}
.legend { list-style: none; margin: 0.7rem 0 0; padding: 0; }
.legend__row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0;
  font-size: 0.95rem;
}
.legend__row + .legend__row { border-top: 1px solid rgba(233, 229, 218, 0.1); }
.legend__swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cat, var(--paper));
  box-shadow: inset 0 0 0 2px rgba(9, 25, 38, 0.5);
}
.legend__name { font-weight: 500; }
.legend__count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #a9bcc7;
}
.board__note {
  margin-top: 0.9rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #9fb2bd;
}

.masthead__route {
  margin-top: clamp(1.6rem, 4vw, 3rem);
  height: 24px;
  transform: translateY(1px);
}
.masthead__route svg { width: 100%; height: 100%; display: block; }
.masthead__line {
  fill: none;
  stroke: var(--pink);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

[data-category="Culture"]  { --cat: var(--pink);   --cat-deep: #b0183f; }
[data-category="Food"]     { --cat: var(--yellow); --cat-deep: #7d5a00; }
[data-category="Movement"] { --cat: var(--blue);   --cat-deep: #163f6e; }
[data-category="People"]   { --cat: var(--green);  --cat-deep: #1f5f44; }
[data-category="Places"]   { --cat: var(--violet); --cat-deep: #573a86; }

/* ==========================================================================
   Controls — sticky ticket window
   ========================================================================== */

.controls {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  background-image: var(--grain);
  background-size: 5px 5px;
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 10px 24px -18px rgba(20, 36, 44, 0.7);
}
.controls__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.34fr) auto;
  gap: 1rem 1.2rem;
  align-items: end;
  padding-block: 0.85rem;
}

.field { display: flex; flex-direction: column; gap: 0.32rem; min-width: 0; }
.field > label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field__control { position: relative; display: flex; align-items: center; }

.field input,
.field select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-read);
  font-size: 0.98rem;
  padding: 0.62rem 0.75rem;
  min-height: 46px;
}
.field--search input { padding-left: 2.6rem; }
.field input::placeholder { color: #5f6d73; }
.field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.field__icon {
  position: absolute;
  left: 0.72rem;
  width: 19px; height: 19px;
  fill: none; stroke: var(--blue); stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.field__chevron {
  position: absolute;
  right: 0.7rem;
  width: 18px; height: 18px;
  fill: none; stroke: var(--ink); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.field select { padding-right: 2.2rem; cursor: pointer; }

.ticket-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.5rem 0.95rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.ticket-toggle:hover { transform: translateY(-1px); }
.ticket-toggle__punch {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px dashed var(--ink-soft);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.ticket-toggle__count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--paper-2);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  min-width: 1.7rem;
  text-align: center;
}
.ticket-toggle[aria-pressed="true"] {
  background: var(--pink-deep);
  color: var(--paper-2);
  border-color: var(--pink-deep);
}
.ticket-toggle[aria-pressed="true"] .ticket-toggle__punch {
  border-color: var(--paper-2);
  background: var(--paper-2);
}
.ticket-toggle[aria-pressed="true"] .ticket-toggle__count {
  background: var(--paper-2);
  color: var(--pink-deep);
}

/* ==========================================================================
   Results head
   ========================================================================== */

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.8rem, 4vw, 3rem) 0 1.2rem;
  border-bottom: 2px solid var(--ink);
}
.results-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.results-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ==========================================================================
   The route
   ========================================================================== */

.route { position: relative; padding-bottom: 4rem; }
.route.is-empty .rail { display: none; }

.rail {
  position: absolute;
  left: calc(var(--rail-x) - 12px);
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='72' viewBox='0 0 24 72'%3E%3Cpath d='M12 0 C8 8 16 16 12 24 C8 32 16 40 12 48 C8 56 16 64 12 72' fill='none' stroke='%231c4d84' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-position: center top;
}
.rail__progress {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 4px;
  height: 0;
  border-radius: 4px;
  background: var(--pink);
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.bus {
  position: absolute;
  left: -3px;
  top: 0;
  width: 30px;
  height: 30px;
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 3px 4px rgba(20, 36, 44, 0.35));
  z-index: 3;
}
.bus svg { width: 100%; height: 100%; }
.bus__disc { fill: var(--pink); }
.bus__body { fill: var(--paper-2); }
.bus__glass { fill: var(--blue-deep); }
.bus__strip { fill: var(--pink); }
.bus__wheel { fill: var(--ink); }

.stops { list-style: none; margin: 0; padding: 0; }

.stop {
  position: relative;
  padding: clamp(1.3rem, 2.6vw, 2rem) 0 clamp(1.3rem, 2.6vw, 2rem) 4.6rem;
  border-bottom: 1px dashed rgba(20, 36, 44, 0.28);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  scroll-margin-top: 8rem;
}
.stop.is-in { opacity: 1; transform: none; }
.stop::after {
  content: "";
  position: absolute;
  right: 0;
  top: clamp(1.3rem, 2.6vw, 2rem);
  bottom: clamp(1.3rem, 2.6vw, 2rem);
  left: 0;
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.2s ease;
  pointer-events: none;
}
.stop.is-current::after { background: rgba(28, 77, 132, 0.055); }

/* node on the line */
.stop__node {
  position: absolute;
  left: calc(var(--rail-x) - 11px);
  top: clamp(1.6rem, 3vw, 2.3rem);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--cat, var(--blue));
  z-index: 2;
  transition: transform 0.25s ease, background 0.25s ease;
}
.stop.is-current .stop__node {
  transform: scale(1.28);
  background: var(--cat, var(--blue));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--cat, var(--blue)) 26%, transparent);
}
.stop.is-saved .stop__node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ink);
}

.stop__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(120px, 17vw, 210px);
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: start;
}

.stop__open {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.stop__open:hover .stop__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.stop__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.stop__no { color: var(--cat-deep, var(--blue)); font-weight: 600; }
.stop__cat { color: var(--ink); }
.stop__read { margin-left: auto; color: var(--ink-soft); }

.stop__title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin-top: 0.5rem;
  text-wrap: balance;
}
.stop__summary {
  display: block;
  margin-top: 0.6rem;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}
.stop__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}
.stop__more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.stop__open:hover .stop__more svg { transform: translateX(4px); }

.stop__thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
}
.stop__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.18) brightness(1.02);
  mix-blend-mode: multiply;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.stop__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--cat, var(--blue)) 1.1px, transparent 1.4px);
  background-size: 4px 4px;
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
}
.stop__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat, var(--blue));
  mix-blend-mode: multiply;
  opacity: 0.34;
  z-index: 1;
  pointer-events: none;
}
.stop__open:hover ~ .stop__thumb img { transform: scale(1.05); }
.stop__thumb--empty { display: none; }

.stop.is-current .stop__title { color: var(--blue-deep); }
.stop:last-child { border-bottom-color: transparent; }

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state {
  margin: 3rem 0 1rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  text-align: center;
}
.empty-state__terminal {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.95rem;
  color: var(--pink-deep);
}
.empty-state__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  text-transform: uppercase;
  margin-top: 0.6rem;
}
.empty-state__text {
  max-width: 42ch;
  margin: 0.7rem auto 0;
  color: var(--ink-soft);
}
.empty-state__reset {
  margin-top: 1.3rem;
  padding: 0.7rem 1.3rem;
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-2);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.empty-state__reset:hover { background: var(--pink-deep); border-color: var(--pink-deep); }

/* ==========================================================================
   Colophon
   ========================================================================== */

.colophon {
  background: var(--ink);
  color: var(--paper-2);
  padding: 2.2rem 0 2.6rem;
}
.colophon__grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.2rem 2.5rem;
  align-items: start;
}
.colophon__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}
.colophon__note {
  max-width: 70ch;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #a9b8bf;
}

/* ==========================================================================
   Detail — the ticket stub / article
   ========================================================================== */

.detail-layer { position: fixed; inset: 0; z-index: 100; }
.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 26, 40, 0.82);
  background-image: radial-gradient(rgba(233, 229, 218, 0.14) 1px, transparent 1.4px);
  background-size: 5px 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.detail-layer.is-open .detail-backdrop { opacity: 1; }

.detail {
  position: absolute;
  inset: clamp(0px, 2.4vh, 2rem) clamp(0px, 3vw, 3rem);
  margin-inline: auto;
  width: min(820px, 100%);
  background: var(--paper-2);
  background-image: var(--grain);
  background-size: 5px 5px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 40px 90px -40px rgba(4, 14, 22, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 0.34s ease, transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail-layer.is-open .detail { opacity: 1; transform: none; }

.detail__stub {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 1.1rem;
  background: var(--ink);
  color: var(--paper-2);
}
.detail__stub-text {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
}
.detail__stub-line {
  flex: 1;
  height: 0;
  border-top: 1px dashed rgba(233, 229, 218, 0.4);
}

.detail__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.16s ease, color 0.16s ease;
}
.detail__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.detail__close:hover { background: var(--pink-deep); border-color: var(--pink-deep); color: var(--paper-2); }

.detail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0 2rem;
}

.detail__head {
  background: var(--cat-deep, var(--blue));
  color: var(--paper-2);
  padding: clamp(1.8rem, 5vw, 3rem) clamp(1.4rem, 5vw, 3.2rem) clamp(1.4rem, 4vw, 2.2rem);
}
.detail__head[data-category="Food"],
.detail[data-category="Food"] .detail__head { color: var(--paper-2); }

.detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 240, 232, 0.86);
}
.detail__stop { font-weight: 600; }
.detail__dot { opacity: 0.6; }

.detail__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.4vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin-top: 0.8rem;
  max-width: 20ch;
  text-wrap: balance;
}
.detail__byline {
  margin-top: 0.9rem;
  font-size: 0.95rem;
  opacity: 0.92;
}

.detail__figure {
  margin: clamp(1.4rem, 4vw, 2.4rem) clamp(1.4rem, 5vw, 3.2rem) 0;
}
.detail__photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  filter: grayscale(1) contrast(1.14);
  mix-blend-mode: multiply;
}
.detail__figure { position: relative; }
.detail__caption {
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.detail__body {
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1.4rem, 5vw, 3.2rem) 0;
  max-width: 72ch;
}
.detail__body p {
  font-size: clamp(1.04rem, 1.5vw, 1.16rem);
  line-height: 1.75;
  color: #22343c;
}
.detail__body p + p { margin-top: 1.15em; }
.detail__body p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.55em;
  line-height: 0.72;
  padding: 0.08em 0.12em 0 0;
  color: var(--cat-deep, var(--blue));
}

.detail__foot {
  margin: clamp(1.6rem, 4vw, 2.6rem) clamp(1.4rem, 5vw, 3.2rem) 0;
  padding-top: 1.4rem;
  border-top: 2px dashed rgba(20, 36, 44, 0.35);
}
.save-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 58px;
  padding: 0.7rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 2.4vw, 1.15rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}
.save-item:hover { transform: translateY(-1px); }
.save-item__punch {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px dashed var(--ink);
  transition: background 0.16s ease, border-color 0.16s ease;
}
.save-item__punch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.save-item[aria-pressed="true"] {
  background: var(--pink-deep);
  border-color: var(--pink-deep);
  color: var(--paper-2);
}
.save-item[aria-pressed="true"] .save-item__punch {
  border-style: solid;
  border-color: var(--paper-2);
  background: var(--paper-2);
  color: var(--pink-deep);
}
.save-item[aria-pressed="true"] .save-item__punch svg { transform: rotate(45deg); }
.save-item.is-pulsing .save-item__punch { animation: punch 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes punch {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
.detail__hint {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .masthead__grid { grid-template-columns: 1fr; align-items: start; }
  .board { order: 2; }
  .controls__grid { grid-template-columns: 1fr 1fr; }
  .ticket-toggle { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { width: min(1180px, 100% - 2rem); }

  :root { --rail-x: 19px; }

  .wordmark { font-size: clamp(3.6rem, 22vw, 6rem); }
  .tagline { font-size: 1rem; }

  .controls__grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .ticket-toggle { grid-column: auto; }

  .stop { padding-left: 3.1rem; }
  .stop__inner { grid-template-columns: 1fr; gap: 0.9rem; }
  .stop__thumb {
    order: -1;
    aspect-ratio: 16 / 9;
    max-height: 210px;
  }
  .stop__title { font-size: clamp(1.45rem, 8vw, 2rem); }

  .results-head { flex-direction: column; align-items: flex-start; gap: 0.3rem; }

  .detail {
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
  }
  .detail__close span { display: none; }
  .detail__close { padding: 0.5rem; }
  .detail__body { max-width: none; }
}

@media (max-width: 380px) {
  .wordmark { font-size: 3.2rem; }
}

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

/* Custom scrollbar inside the detail */
.detail__scroll { scrollbar-width: thin; scrollbar-color: var(--blue) var(--paper-3); }
.detail__scroll::-webkit-scrollbar { width: 12px; }
.detail__scroll::-webkit-scrollbar-track { background: var(--paper-3); }
.detail__scroll::-webkit-scrollbar-thumb { background: var(--blue); border: 3px solid var(--paper-3); border-radius: 8px; }
