/* ============================================================
   Rail theme: the departure board.
   Near-black Solari board, sodium-vapor amber, boarding-pass stubs.
   The map is the lit window; the ticket is the receipt.
   ============================================================ */

body.theme-rail {
  --bg: #0b0e14;
  --bg-soft: #10141d;
  --surface: #151a24;
  --surface-2: #1b2130;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ece8df;
  --muted: #a6acb8;
  --faint: #6d7383;
  --accent: #eba33e;                 /* sodium-vapor amber */
  --accent-soft: rgba(235, 163, 62, 0.13);
  --signal: #6fbf8f;                 /* clear-signal green */
  --rail-line: #c07322;              /* route line on the light map */
  --nav-bg: rgba(11, 14, 20, 0.86);
  --dot-ring: rgba(11, 14, 20, 0.95);
  --dot-halo: rgba(235, 163, 62, 0.28);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;
  --radius: 14px;
}

/* faint departure-board seams running down the page */
body.theme-rail::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(235, 163, 62, 0.07), transparent 60%),
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(255, 255, 255, 0.014) 26px 27px);
}

body.theme-rail .brand span { color: var(--accent); }

/* ---------- hero ---------- */
.rail-hero .kicker { color: var(--accent); }
.rail-hero h1 { text-wrap: balance; }
.rail-hero h1 em { color: var(--accent); font-style: italic; }
.rail-hero .hero-sub { max-width: 620px; }

/* mono call-sign under the brand mark in the hero */
.railmark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.railmark::before {
  content: "";
  height: 1px;
  width: 46px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ---------- journeys ---------- */
.journeys { display: flex; flex-direction: column; gap: 92px; }

.journey-head { max-width: 760px; margin-bottom: 30px; }
.j-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 18px;
}
.journey-head h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); text-wrap: balance; }
.j-blurb {
  color: var(--muted);
  margin-top: 14px;
  font-size: 1.04rem;
  line-height: 1.7;
  max-width: 68ch;
}

.journey-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.journey-map { min-height: 380px; }
.journey-map .map { height: 100%; min-height: 380px; }

/* ---------- timelapse video ---------- */
.journey-media { display: flex; flex-direction: column; gap: 12px; }
.video-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #05070b;
}
.tl-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-wrap::after {
  /* subtle window vignette + top light bar, like a train window */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.32)),
    radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(0, 0, 0, 0.34));
}
.tl-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 30%, rgba(235, 163, 62, 0.08), transparent 65%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0 12px, transparent 12px 24px),
    var(--bg-soft);
}
.tl-fallback .tl-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.tl-fallback .tl-msg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
}
.video-cap {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
}
.video-cap .rec { color: #e2483d; font-size: 0.7rem; animation: rec-blink 1.6s steps(1) infinite; }
@keyframes rec-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0.25; } }

/* ---------- ticket stub ---------- */
.ticket {
  margin-top: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}
.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(0, 0, 0, 0.24);
  border-bottom: 1px dashed var(--border-strong);
}
.ticket-brand {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}
.ticket-code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.ticket-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px dashed var(--border-strong);
}
.ticket-totals .tt {
  padding: 18px 20px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ticket-totals .tt:first-child { border-left: none; }
.ticket-totals .tt b {
  font-family: var(--font-mono);
  font-size: 1.16rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.ticket-totals .tt span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.ticket-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.ticket-col { padding: 22px 22px 26px; }
.ticket-col + .ticket-col { border-left: 1px dashed var(--border-strong); }
.ticket-col h4 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}

/* train legs */
.legs { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.leg { display: grid; gap: 3px; }
.leg-train {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 540;
  color: var(--text);
}
.leg-route { font-size: 0.86rem; color: var(--muted); }
.leg-fig {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* stops */
.stops { list-style: none; display: flex; flex-direction: column; }
.stop {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  position: relative;
}
.stop:first-child { border-top: none; }
.stop-code {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.stop-city {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 540;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stop-city em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.stop-note { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }

/* ---------- footer accent ---------- */
body.theme-rail .footer-links a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .journey-grid { grid-template-columns: 1fr; }
  .journey-map, .journey-map .map { min-height: 320px; }
  .ticket-totals { grid-template-columns: repeat(2, 1fr); }
  .ticket-totals .tt:nth-child(3) { border-left: none; }
  .ticket-totals .tt:nth-child(n+3) { border-top: 1px dashed var(--border-strong); }
  .ticket-body { grid-template-columns: 1fr; }
  .ticket-col + .ticket-col { border-left: none; border-top: 1px dashed var(--border-strong); }
  .journeys { gap: 68px; }
}
@media (max-width: 480px) {
  .stop { grid-template-columns: 44px 1fr; }
}
