/* Mimms Museum palette (mimmsmuseum.org): deep blue #005587, link blue #006699, bright blue #2494d1,
   pale blue #e9f1f5, with the museum's orange #ff6900 faded almost to white (--orange-line) for rules,
   a soft peach (--orange) for small marks, and a muted --orange-ink for text (4.5:1 contrast); Roboto. */
:root {
  --bg: #e9f1f5;
  --card: #ffffff;
  --fg: #212121;
  --muted: #55636d;
  --line: #cfdde6;
  --accent: #005587;
  --accent-fg: #ffffff;
  --accent-soft: #dcebf4;
  --accent-2: #2494d1;
  --orange: #f2b48a;
  --orange-line: #fbe3d1;
  --orange-ink: #9c5a33;
  --band: linear-gradient(120deg, #00456e 0%, #005587 45%, #1d6f9b 100%);
  --band-fg: #ffffff;
  --shadow: 0 4px 16px -6px rgb(0 40 70 / 0.22);
  --display: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1a24;
    --card: #132838;
    --fg: #eef4f8;
    --muted: #a3b6c4;
    --line: #24425a;
    --accent: #5fb7ea;
    --accent-fg: #08141c;
    --accent-soft: #183549;
    --orange: #e9b896;
    --orange-line: #f6e3d5;
    --orange-ink: #f3cdb0;
    --band: linear-gradient(120deg, #06243a 0%, #0a3553 55%, #0f4466 100%);
    --shadow: 0 4px 16px -6px rgb(0 0 0 / 0.55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: 7rem; /* room for the player bar */
}
.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: .5rem 1rem; z-index: 10; }

/* Header: the museum's blue band, with a pale orange rule */
.site-header { padding: 2rem 0 1.75rem; margin-bottom: 1.5rem; background: var(--band); color: var(--band-fg); border-bottom: 4px solid var(--orange-line); }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lang { display: flex; gap: 2px; background: rgb(255 255 255 / .16); padding: 3px; border-radius: 999px; }
.lang button {
  border: 0; background: transparent; padding: .3rem .75rem; border-radius: 999px;
  font-size: .8rem; font-weight: 500; color: rgb(255 255 255 / .85); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: #fff; color: #005587; box-shadow: var(--shadow); }
.lang button { display: grid; place-items: center; padding: .35rem .6rem; }
.lang .flag { width: 1.9rem; height: auto; display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / .18); opacity: .7; }
.lang button[aria-pressed="true"] .flag, .lang button:hover .flag { opacity: 1; }
.brand { display: inline-block; line-height: 0; border-radius: 4px; }
.brand img { height: 3.6rem; width: auto; display: block; }
@media (max-width: 380px) { .brand img { height: 3rem; } }
.site-header h1 {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1.1; margin-top: .5rem; letter-spacing: -.01em;
}
.site-header .lede { color: rgb(255 255 255 / .86); }
.site-header :focus-visible { outline-color: var(--orange); }
.lede { color: var(--muted); margin-top: .5rem; font-size: 1.05rem; }

/* Controls */
.controls { display: grid; gap: 1rem; grid-template-columns: 1fr auto; align-items: end; margin-bottom: 1.75rem; }
@media (max-width: 560px) { .controls { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .segments { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 380px) { .segments { grid-template-columns: repeat(2, 1fr); } }
fieldset { border: 0; min-width: 0; }
legend, .goto label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .4rem; display: block; }
.segments {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  background: var(--line); padding: 4px; border-radius: 12px;
}
.seg {
  border: 0; background: transparent; padding: .55rem .4rem; border-radius: 9px;
  cursor: pointer; text-align: center; line-height: 1.2;
}
.seg strong { display: block; font-weight: 600; font-size: .95rem; }
.seg small { color: var(--muted); font-size: .72rem; }
.seg[aria-checked="true"] { background: var(--card); box-shadow: var(--shadow); outline: 2px solid var(--accent-2); outline-offset: -2px; }
.seg[aria-checked="true"] strong { color: var(--accent); }

.goto-row { display: flex; gap: 6px; }
.goto input {
  width: 5.5rem; padding: .6rem .75rem; border: 1px solid var(--line);
  background: var(--card); border-radius: 10px; font-size: 1.05rem;
}
.goto button, .btn {
  border: 0; background: var(--accent); color: var(--accent-fg); font-weight: 600;
  padding: .6rem 1rem; border-radius: 10px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }

/* Stop list */
.stops { list-style: none; display: grid; gap: .75rem; }
.stop-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.stop-card:hover { transform: translateY(-1px); border-color: var(--accent-2); }
.num {
  font-family: var(--display); font-size: 1.9rem; font-weight: 700; color: var(--orange-ink);
  min-width: 2.6rem; text-align: center; line-height: 1; white-space: nowrap;
}
.stop-card h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 500; line-height: 1.2; color: var(--accent); }
.stop-card .sub { color: var(--muted); font-size: .82rem; }
.stop-card .blurb { font-size: .92rem; margin-top: .25rem; }
.dur { color: var(--muted); font-size: .8rem; white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.dur .play-dot {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent-soft);
  display: grid; place-items: center;
}
.dur svg { width: 1.1rem; height: 1.1rem; fill: var(--accent); }
.stop-card.playing { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange), var(--shadow); }

/* Stop detail: photos at the top (several scroll sideways) */
.photos { display: flex; gap: .5rem; margin-bottom: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); }
.photos img {
  flex: 0 0 100%; width: 100%; height: auto; max-height: 60vh; object-fit: contain; scroll-snap-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.photos.many img { flex-basis: 88%; width: 88%; }
/* Stop detail */
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); text-decoration: none; font-size: .9rem; }
.back:hover { color: var(--fg); }
.detail-head { display: flex; gap: 1rem; align-items: flex-start; }
.detail-head .num { font-size: 2.6rem; width: auto; }
.detail-head h2 { font-family: var(--display); font-size: clamp(1.7rem, 6vw, 2.2rem); line-height: 1.15; font-weight: 700; color: var(--accent); }
.detail-head .sub { color: var(--muted); margin-top: .2rem; }
.big-play { margin: 1.5rem 0 .5rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.big-play .btn { padding: .85rem 1.4rem; font-size: 1.05rem; border-radius: 999px; }
.big-play svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.big-play .meta { color: var(--muted); font-size: .9rem; }

.transcript {
  margin-top: 1.5rem; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--accent-2);
  border-radius: var(--radius); padding: 1.25rem 1.25rem 1.5rem;
}
.transcript h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  font-weight: 600; margin-bottom: .75rem;
}
.transcript p { font-family: var(--display); font-size: 1.15rem; line-height: 1.65; }
.transcript p + p { margin-top: .8rem; }
.transcript p.title { font-weight: 700; color: var(--accent); }
.transcript p.line { padding-left: 4.6rem; text-indent: -4.6rem; }
.transcript .who {
  display: inline-block; width: 4.6rem; text-indent: 0;
  font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--orange-ink); vertical-align: .15em;
}

.pager { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
.pager a { flex: 1; text-decoration: none; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.pager a small { display: block; color: var(--muted); font-size: .75rem; }
.pager a.next { text-align: right; }
.pager .spacer { flex: 1; }

.notice { color: var(--muted); padding: 2rem 0; }
.notice.moved { padding: 0 0 1rem; color: var(--fg); }

/* Location gate */
.controls[hidden] { display: none; }
.gate {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem 1.25rem; box-shadow: var(--shadow);
}
.gate h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--accent); }
.gate p { margin-top: .6rem; }
.gate .gate-note { color: var(--muted); font-size: .9rem; }
.gate .gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.gate .status { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); }
.spinner {
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Player bar */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 3px solid var(--orange-line);
  padding: .65rem 0 calc(.65rem + env(safe-area-inset-bottom));
}
.player-inner { display: flex; align-items: center; gap: .75rem; }
.pp {
  flex: none; width: 3rem; height: 3rem; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); display: grid; place-items: center;
}
.pp svg { width: 1.4rem; height: 1.4rem; fill: var(--accent-fg); }
.pp .i-pause, .pp.is-playing .i-play { display: none; }
.pp.is-playing .i-pause { display: block; }
.player-body { flex: 1; min-width: 0; }
.now { display: block; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seek-row { display: flex; align-items: center; gap: .5rem; }
.t { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.4rem; }
.t:last-child { text-align: right; }
#seek { flex: 1; accent-color: var(--accent); min-width: 0; }
.speedbtn {
  flex: none; min-width: 2.9rem; height: 2.2rem; padding: 0 .4rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.skipbtn {
  flex: none; position: relative; width: 2.6rem; height: 2.6rem; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.skipbtn svg { width: 1.7rem; height: 1.7rem; fill: var(--fg); }
.skipbtn span { position: absolute; font-size: .55rem; font-weight: 600; top: 58%; left: 50%; transform: translate(-50%, -50%); }


@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
