/* PIM Consultant Atlas: the departure board.
   Start dates read as departures. The language is the printed rail departures
   poster: signal yellow, black and white, one grotesk family set by weight.
   The title and its answer sit on a full-width yellow board, and tables read
   as timetables with a heavy first column.
   Colour jobs and measured contrast are recorded in src/siteconfig.py. */

:root {
  --signal: #FFD500;
  --on-signal: #111111;
  --ink: #111111;
  --ground: #FFFFFF;
  --muted: #4A4A4A;
  --rule: #111111;
  --hair: color-mix(in srgb, var(--ink) 22%, var(--ground));
  --type: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --measure: 64ch;
  --deck: #111111;
  color-scheme: light;
}

/* Night: the board stays lit; only the reading surface turns dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F2F2;
    --ground: #0B0B0B;
    --muted: #B5B5B5;
    --rule: #F2F2F2;
    --deck: #1E1E1E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F2F2F2;
  --ground: #0B0B0B;
  --muted: #B5B5B5;
  --rule: #F2F2F2;
  --deck: #1E1E1E;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--type);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}
a:hover { background: var(--signal); color: var(--on-signal); text-decoration-color: var(--on-signal); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--on-signal);
}

.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 2rem; } }

/* Header: the black lintel above the board. --------------------------------- */

header.site {
  background: #111111;
  color: #FFFFFF;
}
header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  min-height: 3.5rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
header.site a { color: #FFFFFF; text-decoration: none; }
header.site a:hover { background: var(--signal); color: #111111; }
header.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.mark { flex: none; display: block; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.15rem 1.1rem; font-size: 0.95rem; }
header.site nav a { padding: 0.15rem 0; }

.theme {
  font: 500 0.9rem/1 var(--type);
  color: #FFFFFF;
  background: transparent;
  border: 0;
  padding: 0.3rem 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.theme[aria-pressed="true"] { color: var(--signal); }

/* The board: title and answer on full-width signal yellow. -------------------
   The band is painted with an extended box shadow clipped to the element's own
   height, so it runs edge to edge without widening the page. */

main { padding: 0 0 4rem; }

.page > .wrap > h1,
.page > .wrap > h1 + .answer {
  background: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 0 0 100vmax var(--signal);
  clip-path: inset(0 -100vmax);
}
.page > .wrap > h1 + .answer a { color: var(--on-signal); }
/* Overlap the two bands by a pixel so no seam shows at fractional sizes. */
.page > .wrap > h1 { clip-path: inset(0 -100vmax -1px); }
.page > .wrap > h1 + .answer { clip-path: inset(-1px -100vmax 0); }

h1, h2, h3 { margin: 0; font-weight: 700; text-wrap: balance; }

h1 {
  font-size: clamp(2.2rem, 6.2vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 17ch;
  padding: clamp(2rem, 6vw, 4rem) 0 1.4rem;
}
/* Content pages carry long, specific titles; the poster size is for home. */
.page:not([data-page="/"]) h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  max-width: 24ch;
}
.answer {
  font-size: clamp(1.12rem, 2.1vw, 1.4rem);
  line-height: 1.42;
  font-weight: 500;
  max-width: 44ch;
  margin: 0 0 2.5rem;
  padding: 0 0 clamp(2rem, 5vw, 3.25rem);
}

/* Reading column. */
.page p, .page li { max-width: var(--measure); }
.page p { margin: 0 0 1em; }
.page ul, .page ol { padding-left: 1.25rem; margin: 0 0 1.2em; }
.page li { margin: 0.3rem 0; }
.page li::marker { font-weight: 700; }

/* Sections are divided the way a timetable divides its hours: a heavy rule. */
h2 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 3rem 0 1rem;
  padding-top: 0.75rem;
  border-top: 5px solid var(--rule);
}
h3 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}

strong { font-weight: 700; }
code { font-family: inherit; font-weight: 700; }

/* Timetables --------------------------------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0 2.25rem;
  font-size: 0.97rem;
  line-height: 1.4;
}
caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: 0.6rem;
}
thead th {
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid #111111;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--hair);
}
tbody tr:last-child > * { border-bottom: 2px solid var(--rule); }
/* The first column carries the weight a departure time carries. */
tbody th, tbody td:first-child {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
td.code, .code { font-weight: 700; }
@media (max-width: 40rem) {
  table { display: block; overflow-x: auto; }
}

/* A note is a footnote on the poster: smaller, under a thin rule. */
.note {
  max-width: var(--measure);
  margin: 1.5rem 0 2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
  font-size: 0.93rem;
}
.note p { margin: 0; }

blockquote {
  margin: 1.5rem 0;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 48ch;
}

ul.sources { font-size: 0.95rem; overflow-wrap: anywhere; }
.verified { color: var(--muted); font-size: 0.93rem; }

/* Home ---------------------------------------------------------------------
   The board holds the question, the answer and one departure line per part of
   the question. Below it, the rate benchmarks sit on a lit station board:
   signal yellow on black. The hiring guides run as a route with its stops. */

.board {
  background: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 0 0 100vmax var(--signal);
  clip-path: inset(0 -100vmax);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}
.board .answer { margin: 0 0 clamp(1.75rem, 4vw, 2.75rem); padding: 0; }

.lines { list-style: none; margin: 0; padding: 0; border-bottom: 5px solid #111111; }
.page .lines li { max-width: none; margin: 0; }
.lines a {
  display: grid;
  grid-template-columns: minmax(11rem, 22rem) 1fr 2rem;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 0.85rem 0;
  border-top: 5px solid #111111;
  color: #111111;
  text-decoration: none;
}
.lines .dest { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.lines .via { font-size: 1.02rem; font-weight: 500; }
.arrow { width: 2rem; height: 2rem; fill: currentColor; justify-self: end; }
.lines a:hover, .lines a:focus-visible {
  background: #111111;
  color: var(--signal);
  box-shadow: -0.75rem 0 0 #111111, 0.75rem 0 0 #111111;
}
.lines a:focus-visible { outline: 3px solid #111111; outline-offset: 0.75rem; }
.page .measured { margin: 0.75rem 0 0; font-size: 0.93rem; font-weight: 500; }

@media (max-width: 40rem) {
  .lines a { grid-template-columns: 1fr 1.6rem; }
  .lines .via { grid-column: 1; grid-row: 2; }
  .arrow { grid-column: 2; grid-row: 1 / span 2; width: 1.6rem; height: 1.6rem; }
}

section[id] { scroll-margin-top: 1rem; }

table.roles td:last-child { color: var(--muted); }
table.roles td:first-child { width: 40%; }

/* Team setups: three columns read like three platforms on one board. */
.page h3#teams { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin-top: 2.75rem; }
.teams {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem 1.5rem;
  margin: 1.5rem 0 0.5rem;
}
/* Three sizes side by side, or one under the other: never two and one. */
@media (min-width: 60rem) { .teams { grid-template-columns: repeat(3, 1fr); } }
.team { border-top: 5px solid var(--rule); }
.team h4 {
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: var(--signal);
  color: var(--on-signal);
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}
.page .team .fits { margin: 0.6rem 0 0.4rem; font-weight: 600; }
.team dl { margin: 0; }
.team dt {
  margin-top: 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hair);
  font-weight: 700;
  font-size: 0.93rem;
}
.team dd { margin: 0.2rem 0 0; font-size: 0.97rem; }
.page .team dd ul { margin: 0; padding-left: 1.1rem; }
.page .team dd li { margin: 0.15rem 0; }
.team dt:last-of-type + dd { color: var(--muted); font-size: 0.93rem; }

/* The lit board. */
.departures {
  background: var(--deck);
  color: #F2F2F2;
  box-shadow: 0 0 0 100vmax var(--deck);
  clip-path: inset(0 -100vmax);
  margin: 3.5rem 0;
  padding: 0.25rem 0 1.5rem;
}
.departures h2 { color: var(--signal); border-top-color: var(--signal); margin-top: 2.5rem; }
.departures p { color: #D6D6D6; }
.departures caption { color: #F2F2F2; }
.departures thead th {
  background: transparent;
  color: var(--signal);
  border-bottom: 2px solid var(--signal);
}
.departures th, .departures td { border-bottom-color: #3A3A3A; }
.departures tbody tr:last-child > * { border-bottom-color: var(--signal); }
.departures a { color: #FFFFFF; }
.departures a:hover { background: var(--signal); color: #111111; }
.departures .num { font-weight: 700; white-space: nowrap; }
.departures .status { color: var(--signal); font-weight: 700; white-space: nowrap; }
.departures a:focus-visible { box-shadow: none; }

/* The route: one line, a stop per decision, the guides that serve it. */
.route { list-style: none; padding: 0; margin: 1.75rem 0 0; }
.page .route > li { position: relative; max-width: none; margin: 0; padding: 0 0 2rem 2.6rem; }
.route > li::before {
  content: "";
  position: absolute;
  left: calc(0.6rem - 2.5px);
  top: 0.7rem;
  bottom: -0.4rem;
  width: 5px;
  background: var(--rule);
}
.route > li:last-child { padding-bottom: 0; }
.route > li:last-child::before { display: none; }
.route > li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.2rem;
  height: 1.2rem;
  border: 5px solid var(--rule);
  border-radius: 50%;
  background: var(--ground);
}
.route > li:first-child::after, .route > li:last-child::after { background: var(--signal); }
.route .stop { display: block; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.route ul { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.page .route ul li { margin: 0 0 0.7rem; }
.route ul a { font-weight: 700; }
.route ul span { display: block; color: var(--muted); font-size: 0.95rem; }

.kept {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 1.25rem;
}
.page .kept p { margin: 0; padding-top: 0.6rem; border-top: 3px solid var(--rule); }

/* Footer: the black base of the poster. ------------------------------------ */

footer.site {
  background: #111111;
  color: #D6D6D6;
  font-size: 0.92rem;
  padding: 2rem 0 3rem;
}
footer.site p { max-width: 70ch; margin: 0 0 0.6rem; }
footer.site a { color: #FFFFFF; }
footer.site a:hover { background: var(--signal); color: #111111; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--signal);
  color: #111111;
  padding: 0.6rem 0.9rem;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  header.site nav, .theme { display: none; }
  .page > .wrap > h1, .page > .wrap > h1 + .answer, .board, .departures { box-shadow: none; clip-path: none; }
}

/* Analytics consent banner */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--ground); color: var(--ink); border-top: 2px solid var(--ink); }
.consent[hidden] { display: none; }
.consent-in { display: flex; gap: 0.75rem 1.25rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 0.9rem; }
.consent-in p { margin: 0; max-width: 70ch; flex: 1 1 18rem; font-size: 0.95rem; }
.consent-btns { display: flex; gap: 0.5rem; }
.consent-btns button { font: inherit; font-size: 0.95rem; padding: 0.45rem 0.9rem; border: 2px solid var(--ink); background: var(--ground); color: var(--ink); border-radius: 0; cursor: pointer; }
.consent-btns #consent-yes { background: var(--ink); color: var(--ground); }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }
