:root {
  --paper: #F5F2EA;
  --paper-raised: #FBF9F3;
  --ink: #1A1714;
  --ink-muted: #5C564D;
  --ink-faint: #6F6960;   /* 4.86:1 on paper, AA */
  --rule: #D2CAB8;
  --accent: #8B6914;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #232323;
    --paper-raised: #2C2C2C;
    --ink: #EAEAEA;
    --ink-muted: #A8A8A8;
    --ink-faint: #90908C; /* 4.91:1 on dark paper, AA */
    --rule: #424242;
    --accent: #C89A4A;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 6rem) 1.5rem 2rem;
  min-height: 78vh;
}

/* --- Identity (primary) --- */

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}

.identity {
  font-family: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.identity a {
  color: var(--accent);
  text-decoration: none;
}

.identity a:hover { text-decoration: underline; text-underline-offset: 3px; }

.lede {
  color: var(--ink-muted);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 60ch;
  margin: 0 0 3rem;   /* 3xl between identity and routes */
}

/* --- Routes (secondary; weakest container = background, no border) --- */

.routes {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (min-width: 640px) {
  .routes {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* column-drop above */
  }
}

.route {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  background: var(--paper-raised);
  border-radius: 4px;
  padding: 1.25rem 1.25rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 150ms ease-out;
}

.route:hover { background: var(--rule); }

.route-name {
  font-family: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  font-size: 1.125rem;
  font-weight: 600;
}

.route-desc {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.route-link {
  font-size: 0.875rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* --- Entity facts (tertiary) --- */

.entity {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

.entity h2 {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.entity p {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  max-width: 60ch;
  margin: 0 0 0.75rem;
}

.entity a { color: var(--accent); text-decoration: none; }
.entity a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* --- Footer (quaternary) --- */

footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
}

.fine {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: 0;
}

/* --- Accessibility --- */

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Touch targets: expand hit area without layout shift */
.route { min-height: 44px; }
.nav-pad { padding: 0.75rem 0.25rem; margin: -0.75rem -0.25rem; }

.route-soon {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-left: 0.5rem;
}
