/* OpenTrains — public site. No scripts, no web fonts, no third-party requests. */

:root {
  color-scheme: light dark;
  --bg: #faf9f6;
  --ink: #111111;
  --muted: #6e6e73;
  --rule: rgba(0, 0, 0, 0.12);
  --accent: rgb(255, 2, 12);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111112;
    --ink: #ececec;
    --muted: #a1a1a6;
    --rule: rgba(255, 255, 255, 0.14);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

/* Header */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.wordmark {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Content */

main {
  margin-top: 5rem;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  margin-top: 1.25rem;
  background: var(--accent);
}

.meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0 0 3rem;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  margin: 0 0 2rem;
}

h2 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 3rem 0 0.75rem;
}

h2 .num {
  display: inline-block;
  min-width: 1.75rem;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--muted);
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

strong {
  font-weight: 600;
}

.callout {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border-left: 2px solid var(--accent);
}

.callout p:last-child {
  margin-bottom: 0;
}

.summary {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border-top: 1px solid var(--rule);
}

.summary li {
  padding: 0.75rem 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

th {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Footer */

.site-footer {
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

@media (max-width: 480px) {
  body {
    padding: 0 1.25rem;
  }

  main {
    margin-top: 3.5rem;
  }

  .site-header {
    flex-direction: column;
    gap: 0.75rem;
  }
}
