/* RailSpotting documentation: the brand guide's tokens (branding/brand-guide.md), system fonts. */
:root {
  --header: #16191c; --focus: #e0a100; --accent: #0d5c63; --accent-ink: #ffffff;
  --bg: #f4f2ee; --surface: #ffffff; --surface-2: #ebe8e2;
  --ink: #1d1f22; --ink-2: #4d525a; --ink-3: #737982; --line: #d8d4cc;
  --warn-bg: #fff4d6; --tel: #f0a000; --det: #1f6feb; --talk: #b8389e;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4fb3bb; --accent-ink: #0b1416;
    --bg: #121416; --surface: #1b1e21; --surface-2: #24282c;
    --ink: #e9e7e3; --ink-2: #b4b2ad; --ink-3: #8c8a86; --line: #33383d;
    --warn-bg: #3a3014; --tel: #ffc233; --det: #6ea8ff; --talk: #e37fd0;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* header: near-black bar with the amber stripe */
.top { background: var(--header); border-bottom: 4px solid var(--focus); }
.top-in { max-width: 1180px; margin: 0 auto; height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { display: block; height: 32px; width: auto; }
.brand-sub { color: #b4b2ad; font-size: .9rem; border-left: 1px solid #3a4046; padding-left: 12px; white-space: nowrap; }
.top-links { margin-left: auto; display: flex; gap: 4px; }
.top-links a { color: #f1efe9; text-decoration: none; font-size: .9rem; padding: 6px 10px; border-radius: 6px; }
.top-links a:hover { background: #2a2f34; }

/* layout: pages on the left, the page in a card */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 16px; }
.side-narrow { display: none; }
.side-h { margin: 18px 0 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.side-h:first-of-type { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.side li a:hover { background: var(--surface-2); color: var(--ink); }
.side li a[aria-current="page"] { background: var(--focus); color: #16191c; font-weight: 600; }
.content { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 28px 36px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05); min-width: 0; }

/* type */
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 18px; }
h2 { font-size: 1.3rem; margin: 2em 0 .6em; padding-top: .3em; letter-spacing: .01em; border-top: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.6em 0 .4em; }
h1 + p, h2 + p { margin-top: 0; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }
li > ul, li > ol { margin: .25em 0 0; }
strong { font-weight: 650; }
blockquote { margin: 0 0 1.2em; padding: 12px 16px; background: var(--warn-bg); border-left: 4px solid var(--focus); border-radius: 0 6px 6px 0; color: var(--ink); }
blockquote p:last-child { margin-bottom: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: .86rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* tables scroll sideways on phones instead of squeezing */
table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.2em; font-size: .93rem; max-width: 100%; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }

/* home: intro and cards */
.hero { margin: -4px 0 24px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 10px; }
.hero p { font-size: 1.1rem; color: var(--ink-2); max-width: 46em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 1.5em; }
.card { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--bg); }
.card:hover { border-color: var(--accent); }
.card b { display: block; color: var(--accent); margin-bottom: 4px; }
.card span { color: var(--ink-2); font-size: .93rem; }
.signal { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .4em; vertical-align: baseline; }
.foot { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .9rem; }

/* phones: pages fold away above the content */
@media (max-width: 860px) {
  .wrap { grid-template-columns: 1fr; gap: 14px; padding-top: 14px; }
  .side { position: static; }
  .side-wide { display: none; }
  .side-narrow { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
  .side-narrow summary { cursor: pointer; font-weight: 600; }
  .side-narrow[open] summary { margin-bottom: 4px; }
  .content { padding: 20px 16px; }
  .top-in { height: 48px; }
  .brand-sub, .top-links a:not(:first-child) { display: none; }
  h1, .hero h1 { font-size: 1.55rem; }
}
