/* Layout: mobile-first single column; a strip-map motif (the line as a drawn route) ties the pages together.
   Estuary ink on a cool salt-white ground, one marsh-green accent for the line itself. */
:root {
  --ground: #f1f3f1;
  --surface: #ffffff;
  --ink: #142329;
  --muted: #56666b;
  --rule: #d5dcd9;
  --line: #1d6a5b;
  --line-soft: #dcebe6;
  --open: #23704a;
  --open-soft: #e1f0e7;
  --shut: #8f3a2f;
  --shut-soft: #f6e5e1;
  --wait: #7a5a12;
  --wait-soft: #f4ecd6;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Figtree", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e181b; --surface: #152327; --ink: #e5ecea; --muted: #9aaba9; --rule: #263739;
    --line: #5fb8a2; --line-soft: #173430; --open: #6fcf9b; --open-soft: #163226;
    --shut: #ec9b8d; --shut-soft: #3a1f1b; --wait: #e2c272; --wait-soft: #352c14;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0e181b; --surface: #152327; --ink: #e5ecea; --muted: #9aaba9; --rule: #263739;
  --line: #5fb8a2; --line-soft: #173430; --open: #6fcf9b; --open-soft: #163226;
  --shut: #ec9b8d; --shut-soft: #3a1f1b; --wait: #e2c272; --wait-soft: #352c14;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
a { color: inherit; }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--line); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- top bar ---------- */
.topbar { border-bottom: 1px solid var(--rule); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.brand { font-family: var(--display); font-size: 1.15rem; text-decoration: none; letter-spacing: 0.01em; }
.brand span { color: var(--line); }
.topbar a.back { font: 500 0.875rem/1 var(--body); color: var(--muted); text-decoration: none; }
.topbar a.back:hover { color: var(--ink); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.4rem, 10vw, 3.6rem); line-height: 1.02; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.375rem; line-height: 1.2; }
.eyebrow {
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--line);
}
.lede { font-size: 1.125rem; color: var(--muted); max-width: 36em; margin: 0; }

/* ---------- home hero ---------- */
.hero { padding-block: 40px 28px; display: grid; gap: 14px; }
.hero h1 em { font-style: normal; color: var(--line); }

/* ---------- the line (home) ---------- */
.route { list-style: none; margin: 0; padding: 0 0 8px; position: relative; }
.route::before {
  content: ""; position: absolute; left: 11px; top: 26px; bottom: 34px;
  width: 6px; background: var(--line); border-radius: 3px;
}
.route li { position: relative; }
.route a.stop {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 0; text-decoration: none; border-bottom: 1px solid var(--rule);
}
.route li:last-child a.stop { border-bottom: 0; }
.dot {
  width: 28px; height: 28px; border-radius: 50%; margin-top: 2px;
  background: var(--surface); border: 6px solid var(--line); position: relative; z-index: 1;
}
.route li.terminus .dot { background: var(--line); }
.stop-name { font-family: var(--display); font-size: 1.5rem; line-height: 1.15; display: block; }
.stop-sub { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.stop-count { font: 500 0.75rem/1.2 var(--mono); color: var(--muted); white-space: nowrap; margin-top: 8px; }
.route a.stop:hover .stop-name { color: var(--line); }
.route .arrow { color: var(--line); }

/* ---------- tips ---------- */
.section { padding-block: 28px; border-top: 1px solid var(--rule); }
.section > h2 { margin-bottom: 16px; }
.tips { display: grid; gap: 18px; margin: 0; }
.tips dt { font-weight: 600; }
.tips dd { margin: 2px 0 0; color: var(--muted); }

/* ---------- station header ---------- */
.station-head { padding-block: 28px 20px; display: grid; gap: 14px; }
.strip { display: flex; align-items: center; margin: 4px 0 2px; }
.strip a, .strip span.here {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; position: relative; height: 26px;
}
.strip a::before, .strip span.here::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--line);
}
.strip > :first-child::before { left: 50%; }
.strip > :last-child::before { right: 50%; }
.strip i {
  position: relative; display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ground); border: 3px solid var(--line);
}
.strip span.here i { width: 22px; height: 22px; background: var(--line); box-shadow: 0 0 0 4px var(--line-soft); }
.strip a:hover i { background: var(--line-soft); }
.strip-ends { display: flex; justify-content: space-between; font: 500 0.7rem/1 var(--mono); color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.head-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.95rem; }
.head-links a { color: var(--line); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- place cards ---------- */
.places { display: grid; gap: 14px; padding-bottom: 12px; }
.place {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  padding: 18px 18px 16px; display: grid; gap: 10px; min-width: 0;
}
.place-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.cat { font: 500 0.72rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.walk { font: 500 0.85rem/1.2 var(--mono); color: var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.walk.long { color: var(--wait); }
.place p { margin: 0; }
.place .entry { font-size: 0.95rem; color: var(--muted); }
.place .entry b { color: var(--ink); font-weight: 600; }

.status {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  font: 600 0.85rem/1.2 var(--body); padding: 6px 11px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink);
}
.status:empty { display: none; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.status.open { background: var(--open-soft); color: var(--open); }
.status.shut { background: var(--shut-soft); color: var(--shut); }
.status.soon { background: var(--wait-soft); color: var(--wait); }
.status.info { background: var(--line-soft); color: var(--line); }

.hours { border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 8px; font-size: 0.95rem; }
.hours .season { font: 500 0.72rem/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.hours table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours td { padding: 2px 0; vertical-align: top; }
.hours td:first-child { padding-right: 18px; color: var(--muted); white-space: nowrap; }
.hours .note { color: var(--muted); margin: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--rule); background: transparent;
  font: 600 0.95rem/1 var(--body); text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--line); border-color: var(--line); color: var(--ground); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--line); }
.btn.primary:hover { filter: brightness(1.08); }

/* ---------- prev/next ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-block: 20px 8px; }
.pager a {
  display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 12px;
  text-decoration: none; min-width: 0;
}
.pager a.next { text-align: right; grid-column: 2; }
.pager small { font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager span { font-family: var(--display); font-size: 1.15rem; line-height: 1.2; }
.pager a:hover { border-color: var(--line); }

/* ---------- footer ---------- */
footer { color: var(--muted); font-size: 0.875rem; padding-block: 24px 40px; border-top: 1px solid var(--rule); margin-top: 20px; }
footer p { margin: 0 0 8px; max-width: 40em; }

/* ---------- wider screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .wrap { max-width: 60rem; }
  .hero { padding-block: 64px 36px; }
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .tips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 32px; }
  .station-head { padding-block: 44px 28px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .pager a, .route a.stop .stop-name { transition: color .15s, border-color .15s, filter .15s; }
}
