@font-face { font-family: "Oswald"; src: url("assets/oswald.ttf") format("truetype"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("assets/work-sans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Literata"; src: url("assets/literata.ttf") format("truetype"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("assets/ibm-plex-mono.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --ink: #10141c;
  --paper: #eef1f0;
  --card: #ffffff;
  --muted: #475063;
  --rule: #cdd3d6;
  --blue: #1331c9;
  --yellow: #ffd23f;

  --cu: #b4125f;
  --fo: #c2410c;
  --mo: #1331c9;
  --pe: #6d28d9;
  --pl: #0b7a4a;

  --display: "Oswald", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
}
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.rail :focus-visible, .sheet-top :focus-visible { outline-color: var(--yellow); }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 14px; font-weight: 600;
}
.skip:focus { top: 8px; }

.shell { display: grid; grid-template-columns: 380px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Rail (control panel) ---------- */
.rail { background: var(--blue); color: #fff; }
.rail-inner {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 36px 34px 28px; display: flex; flex-direction: column; gap: 22px;
}
.wordmark { margin: 0; font: 700 128px/0.82 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.wordmark a { color: var(--yellow); text-decoration: none; display: block; }
.wordmark span { display: block; }
.tagline {
  margin: 0; font: 400 13px/1.55 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding-top: 14px; border-top: 3px solid var(--yellow);
}

.controls { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 400 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 0;
  background: #fff; color: var(--ink); font-size: 16px;
}
.field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.field input::placeholder { color: #5b6475; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 5px;
  border: 2px solid rgba(255,255,255,.55); border-radius: 999px; background: transparent; color: #fff;
  font-size: 14px; font-weight: 500;
}
.chip i {
  width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--c);
  display: grid; place-items: center; font: 700 11px/1 var(--display); font-style: normal; letter-spacing: .04em;
}
.chip:hover { border-color: #fff; }
.chip[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.chip[aria-pressed="true"] i { background: var(--ink); color: #fff; }

.saved-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 52px; padding: 0 14px;
  background: transparent; border: 2px solid #fff; color: #fff; text-align: left; font-weight: 600;
}
.saved-toggle:hover { background: rgba(255,255,255,.12); }
.saved-label { flex: 1; }
.saved-mark { width: 14px; height: 18px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); opacity: .55; }
.saved-count { font: 700 15px/1 var(--mono); min-width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; }
.saved-toggle[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.saved-toggle[aria-pressed="true"] .saved-mark { opacity: 1; }

.rail-foot { margin: auto 0 0; font: 400 12px/1.5 var(--mono); letter-spacing: .04em; opacity: .85; }

/* ---------- Main route ---------- */
.main { padding: 40px 56px 96px 48px; max-width: 1060px; }
.board { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 14px; margin-bottom: 36px; border-bottom: 3px solid var(--ink); }
.board h2 { margin: 0; font: 600 34px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.status { margin: 0; font: 400 13px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; }

.route { list-style: none; margin: 0; padding: 0; }
.stop {
  --line: var(--mo);
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 24px;
  padding-bottom: 28px;
}
.stop[data-cat="Culture"] { --line: var(--cu); }
.stop[data-cat="Food"] { --line: var(--fo); }
.stop[data-cat="Movement"] { --line: var(--mo); }
.stop[data-cat="People"] { --line: var(--pe); }
.stop[data-cat="Places"] { --line: var(--pl); }
.stop::before { content: ""; position: absolute; left: 32px; width: 8px; top: 36px; bottom: -36px; background: var(--line); }
.stop:last-child { padding-bottom: 0; }
.stop:last-child::before { display: none; }

.marker { position: relative; z-index: 1; }
.bullet {
  width: 72px; height: 72px; border-radius: 50%; background: var(--line); color: #fff;
  border: 6px solid var(--paper); box-shadow: 0 0 0 3px var(--line);
  display: grid; place-items: center; font: 700 26px/1 var(--display); letter-spacing: .04em;
}

.card {
  position: relative; background: var(--card); border-top: 8px solid var(--line);
  padding: 22px 28px 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: start;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.meta { grid-column: 1; margin: 0 0 10px; font: 400 12.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.meta .cat { color: var(--line); font-weight: 400; }
.meta .sep { margin: 0 6px; opacity: .6; }
.stop-title { grid-column: 1; margin: 0; font: 600 38px/1.06 var(--display); letter-spacing: .005em; }
.open { all: unset; cursor: pointer; }
.open::after { content: ""; position: absolute; inset: -8px 0 0 0; }
.open:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.card:has(.open:focus-visible) { outline: 3px solid var(--blue); outline-offset: 4px; }
.open:focus-visible { outline: none; }
.sum { grid-column: 1; margin: 12px 0 0; max-width: 56ch; font-size: 18px; line-height: 1.5; color: #2a3140; }

.mins { grid-column: 2; grid-row: 1 / span 3; text-align: right; line-height: 1; padding-left: 20px; border-left: 2px solid var(--rule); min-width: 92px; }
.mins b { display: block; font: 700 64px/0.9 var(--display); color: var(--line); }
.mins span { display: block; margin-top: 6px; font: 400 11.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.saved-tag {
  grid-column: 2; grid-row: 4; justify-self: end; margin-top: 16px; padding: 3px 9px 3px 7px; background: var(--yellow); color: var(--ink);
  font: 400 11.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; position: relative;
}
.saved-tag::before { content: ""; width: 8px; height: 11px; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); }

/* lead story */
.stop:first-child .stop-title { font-size: 60px; line-height: 1; }
.stop:first-child .card { padding: 28px 32px 32px; }
.stop:first-child .sum { font-size: 20px; }
.stop:first-child .mins b { font-size: 96px; }

/* empty state */
.empty { margin-left: 96px; padding: 40px; background: var(--card); border-top: 8px solid var(--ink); max-width: 640px; }
.empty-code { margin: 0; font: 700 80px/0.8 var(--display); color: var(--blue); }
.empty h3 { margin: 16px 0 6px; font: 600 36px/1.05 var(--display); text-transform: uppercase; }
.empty p { margin: 0 0 22px; color: var(--muted); }
.btn {
  height: 48px; padding: 0 22px; border: 2px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600;
}
.btn:hover { background: var(--blue); border-color: var(--blue); }

/* ---------- Detail sheet ---------- */
#layer:empty { display: none; }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(16, 20, 28, .62); display: flex; justify-content: flex-end; }
.sheet {
  --line: var(--mo);
  width: min(880px, 100%); height: 100%; overflow-y: auto; background: var(--paper); position: relative;
  box-shadow: -12px 0 0 rgba(0,0,0,.18);
}
.sheet[data-cat="Culture"] { --line: var(--cu); }
.sheet[data-cat="Food"] { --line: var(--fo); }
.sheet[data-cat="Movement"] { --line: var(--mo); }
.sheet[data-cat="People"] { --line: var(--pe); }
.sheet[data-cat="Places"] { --line: var(--pl); }
.sheet:focus { outline: none; }

.sheet-top {
  position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 24px; background: var(--ink); color: #fff;
}
.sheet-top button {
  height: 46px; padding: 0 18px; border: 2px solid #fff; background: transparent; color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 10px;
}
.sheet-top button:hover { background: rgba(255,255,255,.14); }
.sheet-top .save[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.sheet-top .save .saved-mark { opacity: 1; }

.sheet-head { background: var(--line); color: #fff; padding: 36px 48px 40px; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 24px; }
.sheet-head .bullet { background: #fff; color: var(--line); border-color: var(--line); box-shadow: 0 0 0 3px #fff; }
.sheet-head .kicker { margin: 4px 0 12px; font: 400 13px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.sheet-head h2 { margin: 0; font: 700 56px/1.02 var(--display); letter-spacing: .005em; }
.sheet-head .dek { margin: 18px 0 0; font-size: 20px; line-height: 1.45; max-width: 46ch; }
.byline { margin: 22px 0 0; font: 400 13px/1.6 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding-top: 14px; border-top: 2px solid rgba(255,255,255,.6); }

.article { padding: 44px 48px 72px 144px; }
.article p { margin: 0 0 1.35em; max-width: 60ch; font: 400 20px/1.72 var(--serif); }
.article p:first-child::first-letter { font: 700 3.6em/0.8 var(--display); float: left; margin: 0.08em 0.1em 0 0; color: var(--line); }
.article .end { display: flex; align-items: center; gap: 10px; margin-top: 32px; font: 400 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.article .end::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--line); }

@media (prefers-reduced-motion: no-preference) {
  .scrim { animation: fade .2s ease-out; }
  .sheet { animation: slide .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes fade { from { opacity: 0; } }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

/* ---------- Mobile / narrow ---------- */
@media (max-width: 1100px) {
  .main { padding: 36px 32px 80px 28px; }
  .stop:first-child .stop-title { font-size: 48px; }
  .stop-title { font-size: 32px; }
}

@media (max-width: 900px) {
  .shell { display: block; }
  .rail-inner { position: static; height: auto; overflow: visible; padding: 20px 18px 20px; gap: 14px; }
  .wordmark { font-size: 64px; line-height: .86; display: flex; align-items: baseline; }
  .wordmark a { display: flex; }
  .wordmark span { display: inline; }
  .tagline { padding-top: 10px; font-size: 11.5px; }
  .chips, .rail-foot { display: none; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field:first-child { grid-column: 1 / -1; }
  .saved-toggle { grid-column: 1 / -1; height: 48px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .main { padding: 24px 14px 64px 12px; }
  .board { margin-bottom: 26px; }
  .board h2 { font-size: 28px; }
  .stop { grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; padding-bottom: 20px; }
  .stop::before { left: 14px; width: 6px; top: 18px; bottom: -18px; }
  .bullet { width: 36px; height: 36px; border-width: 3px; box-shadow: 0 0 0 2px var(--line); font-size: 13px; letter-spacing: .02em; }
  .card { display: block; padding: 16px 16px 18px; border-top-width: 6px; }
  .card:hover { transform: none; box-shadow: none; }
  .meta { font-size: 11.5px; margin-bottom: 8px; }
  .stop-title, .stop:first-child .stop-title { font-size: 29px; line-height: 1.08; }
  .stop:first-child .stop-title { font-size: 36px; }
  .stop:first-child .card { padding: 18px 16px 20px; }
  .sum, .stop:first-child .sum { font-size: 16.5px; margin-top: 10px; }
  .mins { display: flex; align-items: baseline; gap: 6px; border: 0; padding: 0; margin-top: 14px; text-align: left; min-width: 0; }
  .mins b, .stop:first-child .mins b { display: inline; font-size: 26px; }
  .mins span { display: inline; margin: 0; }
  .saved-tag { margin-top: 12px; justify-self: start; }
  .empty { margin-left: 0; padding: 26px 20px; }

  .scrim { display: block; }
  .sheet { width: 100%; box-shadow: none; }
  .sheet-top { padding: 10px 12px; }
  .sheet-top button { height: 44px; padding: 0 12px; }
  .sheet-head { display: block; padding: 24px 18px 28px; }
  .sheet-head .bullet { width: 44px; height: 44px; border-width: 3px; font-size: 16px; margin-bottom: 16px; box-shadow: 0 0 0 2px #fff; }
  .sheet-head h2 { font-size: 38px; }
  .sheet-head .dek { font-size: 18px; }
  .article { padding: 28px 18px 56px; }
  .article p { font-size: 18.5px; line-height: 1.68; }
}
