/* Wrong Train Support, in the junction-1 design: the same tokens, one
   typeface and the same components as the wrongtrain.com landing page
   (landing-page/junction), so the two sites read as one family. Light only,
   like the landing. Fonts are self-hosted: no third-party requests. */

@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin.1e4cea71d75e.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/assets/fonts/atkinson-hyperlegible-next-latin-ext.ca1969afa905.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Shared junction-1 tokens: same names and values as the landing page. */
:root {
  --ground: #F2F4F6;
  --ink: #10161D;
  --muted: #46515C;
  --rule: #C9D0D6;
  --panel: #FFFFFF;
  --board: #0B0E12;
  --board-ink: #E9EDF1;
  --board-muted: #AAB4BE;
  --board-rule: #2A3138;
  --says: #0C6B71;
  --means: #3A55CC;
  --gaps: #5A6672;
  --next: #2F49B8;
  --next-hover: #26399A;
  --says-b: #6FD0D4;
  --means-b: #8EA4FF;
  --next-b: #5B7CFF;
  /* Preview-only "not yet reviewed" marks. */
  --amber: #7D5810;
  --amber-soft: #EEE4CC;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --frame: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  /* Support only: the reading column, about 70 characters per line of 18px
     prose (spec: 65 to 75, checked by tests/e2e/measure.test.mjs). */
  --measure: 38rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
/* Keyboard focus scrolls a link 12px clear of the window edge, so its
   3px outline (3px out from the link) is never cut off at the top or the
   bottom of the window. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-block: 12px; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  /* As on the landing: a word too long for its line breaks rather than
     running off the page. */
  overflow-wrap: anywhere;
  /* A page shorter than the window keeps its footer at the bottom. */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
img { max-width: 100%; height: auto; }
::selection { background: var(--ink); color: var(--ground); }

a { color: var(--next); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
main { display: block; flex: 1 0 auto; padding-bottom: clamp(48px, 7vw, 80px); }
main:focus { outline: none; }

/* Skip link: the landing's rule. It sits exactly over the brand (same row,
   taller and wider) so it replaces it cleanly instead of half covering it.
   The brand (the mark, "Wrong Train", the rule and "Support") is about
   270px wide at the default font size and grows with it, so a 17.5rem
   (280px) minimum width covers all of it, and its 52px height reaches the
   bottom of the 48px brand row that starts 14px down. Below 1200px the
   left edge is the gutter; above, the centred frame. The link never gets wider than the
   frame (its label wraps instead). While the skip link has focus the brand
   is transparent (it keeps its place and stays focusable), so nothing
   shows half covered at any text size. */
.skip-link {
  position: absolute; left: max(var(--gutter), calc((100% - var(--frame)) / 2)); top: -100px; z-index: 10;
  display: inline-flex; align-items: center; min-height: 52px; line-height: 1.25;
  min-width: min(17.5rem, 100% - 2 * var(--gutter)); max-width: calc(100% - 2 * var(--gutter));
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.skip-link:focus ~ .site-header .brand { opacity: 0; }
@media (max-width: 21.873em) {
  .skip-link { padding: 10px 12px; font-size: 0.9375rem; }
}

/* The landing's frame: header, footer and content edges line up at the
   same x on both sites. */
.wrap { width: 100%; max-width: calc(var(--frame) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.preview-banner {
  background: var(--amber-soft); color: var(--ink); border-bottom: 1px solid var(--amber);
  padding: 8px var(--gutter); font-size: 0.9375rem; font-weight: 500; text-align: center;
}

/* Header: the landing's header row (mark, wordmark, links), plus the
   section name. No rule under it, as on the landing. */
.site-header { background: var(--ground); }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; color: var(--ink); text-decoration: none; }
.brand-img { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.brand-mark { font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
/* "Support" is plain muted text after a thin vertical rule, not a chip. */
.brand-tag { padding-left: 12px; border-left: 1px solid var(--rule); font-size: 1rem; font-weight: 500; line-height: 1.25; color: var(--muted); }
.site-nav ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  min-height: 48px;
}
/* A matching transparent rule on top keeps the text centred. */
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); font-size: 1rem; font-weight: 500; border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}
/* The current section loses its underline and gains a 3px blue rule, so it
   is marked by shape as well as color. */
.site-nav a[aria-current] { text-decoration: none; border-bottom-color: var(--next); }
/* The link that leaves the help center sits after the same thin rule. */
.site-nav .nav-main-site { display: flex; align-items: center; gap: 20px; }
.site-nav .nav-main-site::before { content: ""; height: 1.25em; border-left: 1px solid var(--rule); }

/* Type: one family, four weights. */
h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.125rem, 1.3rem + 2.8vw, 3.25rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.012em; margin: clamp(32px, 5vw, 56px) 0 16px; max-width: 22ch; }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem); font-weight: 700; line-height: 1.15; margin: 0 0 16px; max-width: 28ch; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.35; margin: 0 0 6px; }
h2 a { text-decoration-thickness: 2px; }
/* Title links (topic headings on /articles/, card titles, search result
   titles) are standalone navigation with a 44px target. The link's own box
   stays the size of its text, so the focus outline hugs the title and
   never crosses the kicker or description beside it. The extra height is
   an empty ::after layer 10px above and below the text: it belongs to the
   link, so it receives the pointer. */
.section > h2 > a, .card-title a, .search-results .result-title { display: inline-block; position: relative; }
.section > h2 > a::after, .card-title a::after, .search-results .result-title::after {
  content: ""; position: absolute; top: -10px; bottom: -10px; left: 0; right: 0;
}
.lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.5; max-width: 40rem; margin: 0 0 20px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; background: var(--panel); border: 1px solid var(--rule); padding: 0.05em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }

/* Labels and short metadata: the landing's sentence-case label, medium
   weight, muted. No small capitals, no monospace. */
.toc-label, .card-kicker, .card-meta, .search-results .result-kicker, .entry-meta .meta-label {
  font-size: 0.9375rem; line-height: 1.5; font-weight: 500; color: var(--muted);
}
/* The review line under an entry title: each field's label ("Applies to",
   "Version", "Effective", "Last reviewed") in the label style, its value in
   muted body text. It keeps to the reading column and wraps inside a long
   unbroken value. */
.entry-meta { font-size: 0.9375rem; line-height: 1.5; color: var(--muted); max-width: var(--measure); }
.entry-meta > span { min-width: 0; overflow-wrap: anywhere; }

/* Prose */
.prose { max-width: var(--measure); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin: 2.25rem 0 0.75rem; scroll-margin-top: 1rem; }
.prose h3 { margin: 1.75rem 0 0.5rem; scroll-margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.35rem; margin: 0 0 1em; }
.prose li + li { margin-top: 0.4rem; }
/* Callout: the landing's "what it says" line, teal, on a white panel. */
.note {
  border-left: 4px solid var(--says); background: var(--panel);
  padding: 12px 16px; margin: 1.25rem 0; border-radius: 0 8px 8px 0;
}
.note p { margin: 0; }

/* Breadcrumbs: every item, link or not, shares one centered 44px row. */
.breadcrumbs ol {
  list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center;
  font-size: 0.9375rem; color: var(--muted);
}
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin: 0 0.5rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs + h1, .breadcrumbs + .entry h1 { margin-top: 16px; }

/* Article and policy header */
.entry-header { border-bottom: 1px solid var(--rule); margin-bottom: 32px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 20px; }
.entry-meta .unreviewed { color: var(--amber); }

/* "On this page": a white panel with a thin rule, like the landing's sign. */
.toc {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
  padding: 16px 20px; margin: 0 0 32px; max-width: var(--measure);
}
.toc-label { margin: 0 0 4px; }
.toc ol { margin: 0; padding-left: 2em; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }

/* Side-by-side layouts follow the text size, not the window alone, as on
   the landing: each page's content frame (main > .wrap) is a size
   container, and a layout goes to two columns only when the frame is wide
   enough in its own em (18px at the default text size). At the default size
   the switch points are the frames of 960px and 1024px windows. From about
   a 20px default font the 1120px frame is never wide enough, so every page
   keeps one column (WCAG 1.4.4 and 1.4.10). */
main > .wrap { container: frame / inline-size; }

/* Wide screens: "On this page" moves to a right rail beside the text.
   Source order (header, contents, text) is unchanged. */
@container frame (min-width: 52.4em) {
  .entry.has-toc {
    display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(14rem, 17rem);
    justify-content: space-between; column-gap: 48px;
  }
  .entry.has-toc > .entry-header { grid-column: 1 / -1; }
  .entry.has-toc > .toc { grid-column: 2; grid-row: 2; align-self: start; margin: 0; }
  .entry.has-toc > .prose { grid-column: 1; grid-row: 2; }
}
/* Keep the rail in view while reading; it is capped at the window height
   and scrolls inside itself, with scroll padding so a focused link's
   outline is never clipped. */
@media (min-height: 45em) {
  @container frame (min-width: 52.4em) {
    .entry.has-toc > .toc { position: sticky; top: 24px; max-height: calc(100vh - 32px); overflow-y: auto; scroll-padding-block: 12px; }
  }
}

/* Home: the hero and the orientation board side by side on wide screens,
   like the landing's opening. Source order is unchanged. */
.opening { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 64px; padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 7vw, 80px); }
.hero h1 { margin: 0 0 16px; }
/* The orientation text sits on the landing's board: the mark's dark
   ground, with the board's own text and link colours. Links keep an
   underline; focus rings turn light so they show on the dark ground. */
.home-body {
  max-width: none; background: var(--board); color: var(--board-ink);
  border-radius: 20px; padding: clamp(20px, 3.5vw, 36px);
}
.home-body h2 { color: #FFFFFF; font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.7rem); margin: 28px 0 12px; }
.home-body a { color: var(--means-b); }
.home-body :focus-visible { outline-color: var(--board-ink); }
.home-body .note { margin-top: 0; background: transparent; border-left-color: var(--says-b); padding-left: 16px; }
.home-body ul { margin-bottom: 0; }
@container frame (min-width: 49.05em) {
  .opening { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* Search */
.search { margin: 28px 0 0; max-width: 40rem; }
/* Reserve the search box's space until search.js reveals it, so the page
   does not shift. assets/nojs.css collapses it when JavaScript is off. If
   JavaScript is on but the script never arrives, a zero-length animation
   with a 4 second delay collapses the space instead of leaving a blank gap.
   Under reduced motion animations are off, so the gap stays and nothing
   jumps. */
.search[hidden] { display: block; visibility: hidden; overflow: hidden; max-height: 20rem; animation: wt-search-collapse 0s linear 4s forwards; }
@keyframes wt-search-collapse { to { max-height: 0; margin: 0; } }
.search label { display: block; font-weight: 700; margin-bottom: 4px; }
.search .hint { margin: 0 0 12px; color: var(--muted); font-size: 1rem; }
.search-row { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px;
  font: inherit; line-height: 1.25; color: var(--ink); background: var(--panel);
  border: 2px solid var(--muted); border-radius: 8px;
}
.search-status { margin: 16px 0 4px; color: var(--muted); }
.search-status:empty { margin: 0; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-status, .search-results { overflow-wrap: anywhere; }
.search-results li { padding: 1px 0 12px; border-bottom: 1px solid var(--rule); }
.search-results .result-title { margin: 8px 0; font-weight: 700; }
.search-results .result-kicker { margin: 0; }
.search-results .result-excerpt { margin: 4px 0 0; color: var(--muted); font-size: 1rem; }
.browse-fallback { margin: 16px 0 0; color: var(--muted); }
.search-more { margin: 16px 0 0; color: var(--muted); }
.search + .section { margin-top: clamp(40px, 6vw, 64px); }

/* Buttons: the landing's primary button, the blue of the mark's dot,
   bordered so it survives forced colors. */
.search button, .button-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px;
  font-family: var(--sans); font-size: 1rem; font-weight: 700; line-height: 1.25;
  border: 2px solid var(--next); border-radius: 8px; cursor: pointer; text-decoration: none;
  text-align: center; text-wrap: balance;
}
.search button, .button-link { background: var(--next); color: #FFFFFF; }
.search button:hover, .button-link:hover { background: var(--next-hover); border-color: var(--next-hover); }
/* A paragraph that is only a link (the contact page's "Email Wrong Train
   about ..." actions) stays a link, bold, with a 44px target. */
.prose p.action { margin: 12px 0 16px; }
.prose p.action a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* Sections: a thin rule and generous space, inside the frame. */
.section { border-top: 1px solid var(--rule); padding: clamp(48px, 7vw, 80px) 0; }
.section:last-child { padding-bottom: 0; }
.entry + .section { margin-top: clamp(40px, 6vw, 64px); }

/* Cards. Each card is one column: kicker, title and description sit tight
   together from the top, so titles line up across a row. Cards in a row
   are the same height, and a count (card-meta) sits at the bottom. */
.cards {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
/* A list of exactly four cards is two by two where two columns fit. */
@container frame (min-width: 34.73em) {
  .cards:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wrap > .cards { margin-top: 32px; }
.card {
  display: flex; flex-direction: column;
  margin: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 12px;
  padding: clamp(18px, 3vw, 28px);
}
.card p { margin: 0; color: var(--muted); font-size: 1.0625rem; }
.card .card-kicker { margin: 0 0 6px; }
.card-title { margin: 0 0 4px; font-size: 1.125rem; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
.card .card-meta { margin: auto 0 0; padding-top: 12px; }

/* Standalone links get full-size targets (project target 44 by 44px). */
.link-list a, .toc a, .breadcrumbs a, .breadcrumbs [aria-current] {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px;
}
.toc a { min-height: 0; padding: 11px 0; }
.link-list { padding-left: 1.2rem; margin: 0; }
.link-list li { margin: 2px 0; }

/* Home: the contact callout and the policy list share the closing row. */
.home-closing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px 64px; border-top: 1px solid var(--rule); padding-top: clamp(48px, 7vw, 80px); }
@container frame (min-width: 49.05em) {
  .home-closing { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.home-closing > .section { border-top: 0; padding: 0; }
.contact-callout p { max-width: var(--measure); margin: 0 0 16px; }
.contact-callout p.action { margin: 0; }

.unclear-link {
  margin: 48px 0 0; padding-top: 16px; border-top: 1px solid var(--rule);
  color: var(--muted); max-width: var(--measure); font-size: 1rem;
}
.related + .unclear-link { margin-top: 0; }

/* Footer: the landing's, a 2px ink rule on the ground. */
.site-footer { border-top: 2px solid var(--ink); background: var(--ground); }
.footer-inner { display: grid; gap: 8px; padding-top: 32px; padding-bottom: 48px; }
.footer-owner { margin: 0; color: var(--ink); font-weight: 700; }
.footer-notice { margin: 0; max-width: var(--measure); color: var(--muted); font-size: 0.95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin-left: -8px; font-size: 1rem; font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  /* Transitions and animations are off. The only animation, the delayed
     search placeholder collapse, would move the content below it. */
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .search button, .button-link, .card, .toc, .home-body, .note { border: 2px solid CanvasText; }
  .home-body { background: Canvas; color: CanvasText; }
  .home-body h2, .home-body a { color: LinkText; }
  .home-body h2 { color: CanvasText; }
  /* Forced colors paint transparent borders, so hide the idle rules
     explicitly and keep only the current section's. */
  .site-nav a { border-top-color: Canvas; border-bottom-color: Canvas; }
  .site-nav a[aria-current] { border-bottom-color: CanvasText; }
  .note { border-left-width: 4px; }
}
@media print {
  :root {
    --ink: #000; --muted: #333; --next: #1a2a80; --ground: #fff; --panel: #fff; --rule: #999;
    --board: #fff; --board-ink: #000; --board-muted: #333; --means-b: #1a2a80; --says-b: #0C6B71;
  }
  .site-header, .site-footer nav, .footer-owner, .search, .browse-fallback, .skip-link, .unclear-link, .preview-banner { display: none; }
  body { background: #fff; color: #000; display: block; min-height: 0; }
  .entry.has-toc, .opening, .home-closing { display: block; }
  .home-body { border: 1px solid #999; }
}

/* Narrow screens: the header wraps into two rows (brand, then nav). The
   wordmark row keeps the 14px top padding and 48px height; the nav row is
   44px directly under it, and 6px of padding closes the header. The query
   matches the measured wrap point at the default font size; the em unit
   moves it with text-only zoom. */
@media (max-width: 46.375em) {
  .header-inner { row-gap: 0; padding-bottom: 6px; }
  .site-nav ul { min-height: 44px; }
}
/* Phones: the main-site link is also in the footer, so drop it from the
   header and keep the three help links on one row where they fit. */
@media (max-width: 480px) {
  .site-nav .nav-main-site { display: none; }
  .site-nav ul { gap: 0 16px; }
}

/* LinkedIn profile links in approved content (the founder's, on the contact page). */
.prose a.profile-link{ display:inline-flex; align-items:center; gap:10px; min-height:44px; font-weight:700; }
.profile-link .li-icon{ flex:none; width:20px; height:20px; }
