/*
 * Car Line Market — public site. Direction "Dispatch".
 *
 * The subject is an operation: a queue of cars, worked in order, against a
 * dismissal time. So the page is built like the board that runs it — hairline
 * rules, a mono voice for labels and status, and the queue itself as the hero
 * rather than a coloured rectangle beside a headline.
 *
 * One family (Archivo) carries display and body; DM Mono carries labels,
 * statuses and anything that reads as instrumentation. Amber is reserved for
 * step markers — the painted line — and plum for emphasis and links. The ink
 * ramp, the plum and the amber are the app's own tokens from
 * `packages/ui/src/tokens.ts`, and the pass colours are the real entries from
 * `SUGGESTED_PASS_COLORS`, so the site and the product cannot drift apart.
 *
 * Classes are shared with support/trust/privacy — `wrap`, `card`, `lede`,
 * `meta`, `contact`, `facts`, `scroll-x` — so those pages inherit this without
 * their markup changing.
 */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  /* The ink ramp is tokens.ts's, verbatim. */
  --paper: #f5f3fa;
  --surface: #ffffff;
  --ink: #1a1526;
  --ink-2: #3d3550;
  --muted: #6b6280;
  --rule: #d6d1e4;
  --rule-soft: #e9e5f2;
  --primary: #5b2a86;
  --primary-lift: #7b44ad;
  --accent: #f0b429;
  --success: #2e9e6b;

  --radius: 8px;
  --measure: 62ch;

  --display: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14101c;
    --surface: #1d1728;
    --ink: #f2eff8;
    --ink-2: #cec7de;
    --muted: #a79ebb;
    --rule: #322842;
    --rule-soft: #261e33;
    --primary: #c39ae8;
    --primary-lift: #d5b4f0;
    --success: #57c08f;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.6;
}

:where(a):focus-visible,
:where(button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

/* A label, a status, a time — anything that reads as instrumentation rather
   than as prose. */
.mono {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- header ------------------------------------------------------------ */

header.site {
  border-bottom: 1px solid var(--rule);
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

nav.site {
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

nav.site a:hover {
  color: var(--primary);
}

/* ---- type -------------------------------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.125rem, 5.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1rem;
  max-width: var(--measure);
  color: var(--ink-2);
}

.lede {
  font-size: clamp(1.0625rem, 1.8vw, 1.125rem);
  line-height: 1.6;
  color: var(--ink-2);
}

a {
  color: var(--primary);
  text-underline-offset: 0.15em;
}

/* The other pages open with a bare <h1> inside .wrap, where the home page
   opens with the hero and its own padding. */
main.wrap > h1:first-child,
main .wrap > h1:first-child {
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

main.wrap > h1 + .lede,
main.wrap > h1 + p,
main .wrap > h1 + .lede,
main .wrap > h1 + p {
  margin-top: 1rem;
}

/* ---- hero -------------------------------------------------------------- */

.hero {
  border-bottom: 1px solid var(--rule);
}

.hero .wrap {
  padding-block: clamp(2.5rem, 6vw, 3.75rem);
}

.hero .mono {
  display: block;
  margin-bottom: 1.25rem;
}

.hero h1 {
  max-width: 16ch;
}

.hero .lede {
  margin: 1.375rem 0 0;
  max-width: 52ch;
}

/* Two columns once there is room for them: the headline set against the
   summary rather than above it, so the masthead fills its width instead of
   trailing off into half an empty page. */
@media (min-width: 56rem) {
  .hero .wrap {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0 3.5rem;
    align-items: end;
  }

  .hero .mono {
    grid-column: 1 / -1;
  }

  .hero .lede {
    margin: 0 0 0.4rem;
  }
}

/* ---- the board --------------------------------------------------------- */

/*
 * The queue, drawn the way the volunteers' own screen draws it.
 *
 * This is the hero of the page: it shows the product working rather than
 * describing it, and it is the only thing here that answers "what does this
 * look like on the day". It is an illustration and the caption says so — a
 * board implying a live feed from a school that has not launched would be a
 * lie told in CSS.
 */
.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.board caption {
  text-align: left;
  padding-bottom: 0.85rem;
}

.board th {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 1rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

.board td {
  padding: 0.9rem 1rem 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
  vertical-align: middle;
}

.board th:last-child,
.board td:last-child {
  padding-right: 0;
  text-align: right;
}

/*
 * On a phone the four columns stop being a table and become a stack.
 *
 * Left as a table it technically fits — no overflow — while "Silver Toyota
 * Sienna" breaks over three lines and "Handed over" over two, which is the
 * failure mode a width check does not catch. The markup stays a real table for
 * anything reading it as one; only the presentation changes.
 */
@media (max-width: 40rem) {
  .board thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .board tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    align-items: center;
    padding-block: 1rem;
    border-bottom: 1px solid var(--rule-soft);
  }

  .board td {
    border: 0;
    padding: 0;
  }

  .board td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .board td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .board td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    font-weight: 500;
    color: var(--ink);
  }

  .board td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 3;
    color: var(--muted);
  }
}

/* The pass at list size rather than windscreen size: colour and number
   together, with the word always present so colour is never the only signal. */
.pass {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}

.pass .word {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pass .number {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.state {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.state.done {
  color: var(--success);
}

.state.live {
  color: var(--primary);
}

/* ---- steps ------------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 48rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .steps li {
    padding-inline: 1.75rem;
    border-left: 1px solid var(--rule);
  }

  .steps li:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .steps li:last-child {
    padding-right: 0;
  }
}

.steps .mono {
  display: block;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.steps p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ---- sections ---------------------------------------------------------- */

section {
  padding-block: clamp(2.25rem, 5vw, 3.25rem);
}

section + section {
  border-top: 1px solid var(--rule);
}

/*
 * The money question, in a ruled box rather than a filled band.
 *
 * It is the first thing a treasurer asks, so it gets a hard edge and sits
 * alone. A fill would have made it decorative; an outline makes it look like
 * something entered in a ledger, which is closer to what it is.
 */
.band {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2rem);
}

.band .mono {
  display: block;
  margin-bottom: 0.625rem;
}

.band h2 {
  margin-bottom: 0.625rem;
}

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

/* ---- cards, shared with the other pages -------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.125rem, 3vw, 1.5rem);
  margin-block: 1.25rem;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2 + p,
.card h3 + p {
  margin-top: 0.5rem;
}

.card ol,
.card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  max-width: var(--measure);
  color: var(--ink-2);
}

.card li + li {
  margin-top: 0.55rem;
}

.card dl {
  margin: 0;
}

.card dt {
  font-weight: 600;
  margin-top: 1rem;
}

.card dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: var(--measure);
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.contact {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* `.facts` names the styled table, but privacy.html carries a bare <table> in a
   `.scroll-x` and nothing was reaching it — it rendered with browser defaults
   (border-collapse: separate, Times) inside the rest of this. Style both. */
.facts,
main table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}

.facts th,
.facts td,
main table th,
main table td {
  text-align: left;
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
  color: var(--ink-2);
}

.facts th,
main table th {
  font-weight: 600;
  color: var(--ink);
}

/* Only the label column of a key/value table may refuse to wrap; a real header
   row on a phone must be allowed to. */
.facts th {
  white-space: nowrap;
}

.scroll-x {
  overflow-x: auto;
}

/* ---- footer ------------------------------------------------------------ */

footer.site {
  border-top: 1px solid var(--rule);
  padding-block: 1.75rem 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
}

footer.site a {
  color: var(--muted);
}
