@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/tour/fonts/eb-garamond.woff2) format("woff2");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/tour/fonts/eb-garamond-italic.woff2) format("woff2");
}

:root {
  --paper: #f6f3ec;
  --paper-2: #ece7dc;
  --ink: #1c1a17;
  --ink-2: #5d574d;
  --rule: #d6cfc1;
  --accent: #7a2e2a;
  --danger: #a3322b;
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151412;
    --paper-2: #211f1b;
    --ink: #ede8de;
    --ink-2: #a39c8f;
    --rule: #37332d;
    --accent: #c98b72;
    --danger: #e0766c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 19px/1.45 var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

/* Small letter-spaced sans labels, museum-signage style */
.eyebrow {
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 28px;
}
.masthead .name {
  font-size: 22px;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 36px 0 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.quiet { border-color: var(--rule); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: 0.4; cursor: default; }

.linkish {
  background: none;
  border: 0;
  padding: 8px 0;
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}

/* ---------- Keypad ---------- */
.prompt { font-style: italic; color: var(--ink-2); margin: 0 0 10px; text-align: center; }
.display {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-variant-numeric: lining-nums;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule);
  margin: 0 auto 8px;
  max-width: 16rem;
}
.display .caret {
  width: 1px;
  height: 48px;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.message { min-height: 1.5em; text-align: center; color: var(--danger); font-style: italic; margin: 0 0 8px; }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 18rem;
  margin: 0 auto;
}
.keypad button {
  aspect-ratio: 1.35;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 32px;
  font-variant-numeric: lining-nums;
  border-radius: 0;
  transition: background 0.12s;
  touch-action: manipulation;
}
.keypad button:active { background: var(--paper-2); }
.keypad .go { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.keypad .go:active { background: var(--accent); }
.keypad svg { width: 24px; height: 24px; vertical-align: middle; }

/* ---------- Stop list ---------- */
.stops { list-style: none; margin: 0; padding: 0; }
.stops a {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.stops .num { color: var(--accent); font-variant-numeric: lining-nums; }
.stops .t { font-style: italic; }
.stops .a { display: block; font-size: 15px; color: var(--ink-2); font-style: normal; }
.stops .d { font: 12px var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Stop view ---------- */
.plate {
  margin: 0 0 24px;
  background: var(--paper-2);
}
/* Keep the play button above the fold, even on small phones */
.plate img { display: block; width: 100%; max-height: 36vh; max-height: 36svh; object-fit: contain; }
.stop-num {
  font-size: clamp(40px, 12vw, 56px);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: lining-nums;
  margin: 8px 0 10px;
}
.stop-title { font-size: clamp(24px, 7.2vw, 30px); line-height: 1.15; font-style: italic; font-weight: 400; margin: 0 0 6px; }
.stop-artist { margin: 0; color: var(--ink-2); }

.player { margin: 28px 0 8px; display: flex; align-items: center; gap: 18px; }
.play {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  transition: transform 0.1s;
}
.play:active { transform: scale(0.96); }
.play svg { width: 26px; height: 26px; }
.track { flex: 1; min-width: 0; }
.times { display: flex; justify-content: space-between; font: 12px var(--sans); color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 6px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  background: transparent;
  margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(var(--ink), var(--ink)) 0 / var(--pct, 0%) 100% no-repeat, var(--rule);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--rule); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--ink);
  border: 0;
}
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 0; }

.pager { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* ---------- Now-playing bar ---------- */
.nowbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.nowbar .inner { max-width: 34rem; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.nowbar a { flex: 1; min-width: 0; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowbar .n { color: var(--paper-2); opacity: 0.7; margin-right: 8px; }
.nowbar button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid currentColor; background: transparent; display: grid; place-items: center; flex: none; }
.nowbar svg { width: 16px; height: 16px; }

.empty { text-align: center; color: var(--ink-2); font-style: italic; padding: 40px 0; }

/* Short screens (iPhone SE, 13 mini with browser chrome showing) */
@media (max-height: 700px) {
  .masthead { margin-bottom: 18px; padding-bottom: 10px; }
  .plate { margin-bottom: 14px; }
  .plate img { max-height: 28vh; max-height: 28svh; }
  .display { height: 64px; font-size: 52px; }
  .display .caret { height: 38px; }
  .keypad button { aspect-ratio: 1.6; }
  .player { margin-top: 20px; }
}
@media (max-height: 520px) {
  .masthead { margin-bottom: 12px; }
  .prompt { display: none; }
  .keypad { gap: 8px; }
  .keypad button { aspect-ratio: 1.9; font-size: 28px; }
  .plate img { max-height: 22vh; max-height: 22svh; }
  .stop-title { font-size: 22px; }
  .stop-artist { font-size: 16px; }
  .player { margin-top: 14px; }
}
