/* Backline.
 *
 * This is read backstage, in a cellar, on a phone, usually one-handed and
 * often in the dark. Every decision below comes from that or from the objects
 * it sits among: flight cases, aluminium extrusion, silver marker on black
 * gaffer tape, and a work light.
 *
 * Dark is the default because a white page in a blacked-out room ruins your
 * night vision and everyone's eyes for the next hour. Light is honoured for
 * the desk half of the job.
 */

@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('/static/fonts/Barlow-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/static/fonts/BarlowCondensed-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/static/fonts/BarlowCondensed-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Matte black paint under a tungsten work light, not a tinted near-black.
   * Venues are warm-dark, not blue-dark. */
  --case: #21201d;
  --ply: #2b2925;
  --edge: #46423a;
  --chalk: #e8e3d7;
  --dim: #948d80;
  /* The work light. The only colour in the interface, spent on where you are
   * and what you are touching. */
  --sodium: #f0a02b;
  --fault: #d8654a;

  --stencil: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, sans-serif;

  /* Touch targets. A gloved thumb, in the dark, with a show to run. */
  --tap: 3rem;
  --gap: 1.25rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --case: #edeae1;
    --ply: #f7f5ef;
    --edge: #c3bdaf;
    --chalk: #23211d;
    --dim: #6a655b;
    --sodium: #a35f00;
    --fault: #a13b22;
  }
}

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

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

/* hidden means hidden. The browser's own rule for it is ordinary specificity,
 * so any element with a display rule of its own — a label that is a flex
 * column, a table row that becomes a grid on a phone — ignores the attribute
 * unless this says otherwise. Every script that hides something relies on
 * this. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--case);
  color: var(--chalk);
  font: 400 17px/1.55 var(--body);
  display: flex;
  flex-direction: column;
}

/* ── The plate ───────────────────────────────────────────────────────────
 * Every flight case in every venue has a riveted plate on it with the name
 * stencilled across. The header is that plate.
 */

header {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--edge);
  background: var(--ply);
}

.wordmark {
  font: 700 1.5rem/1 var(--stencil);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--chalk);
  text-decoration: none;
  /* The gap the stencil bridge leaves. */
  padding-right: 0.22em;
}

.wordmark:hover {
  color: var(--sodium);
}

header nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

header nav a {
  font: 600 1.0625rem/1 var(--stencil);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

header nav a:hover {
  color: var(--chalk);
  border-bottom-color: var(--sodium);
}

/* The page takes the room it is given. A fixed narrow column made every list
 * on a desk monitor as cramped as one on a phone, which is the opposite of
 * what a wide screen is for. The things that must stay narrow to stay
 * readable — prose and forms — say so themselves below. */
main {
  flex: 1;
  width: 100%;
  max-width: min(72rem, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font: 600 1.375rem/1.2 var(--stencil);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

p {
  max-width: 60ch;
}

/* ── Forms ───────────────────────────────────────────────────────────────
 * Labels above fields, full width, nothing side by side. A column survives a
 * phone held in one hand; a grid does not.
 */

/* A form is a column whatever the window is doing. A text box the width of a
 * desk monitor is harder to use than one the width of a hand, not easier. */
form {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-width: 34rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--dim);
}

input,
select,
button {
  font: 400 1.0625rem/1 var(--body);
  min-height: var(--tap);
  padding: 0 0.85rem;
  border-radius: 2px;
  border: 1px solid var(--edge);
  background: var(--ply);
  color: var(--chalk);
  width: 100%;
}

select {
  /* Native chevrons vary; the extra room stops the label colliding with it. */
  padding-right: 2.25rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 1.35rem, calc(100% - 0.85rem) 1.35rem;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}

button {
  font: 700 1rem/1 var(--stencil);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--sodium);
  border-color: var(--sodium);
  color: #1a1814;
  cursor: pointer;
  margin-top: 0.5rem;
}

button:hover {
  filter: brightness(1.08);
}

/* Unmissable, because the alternative is losing your place in a dark room. */
:focus-visible {
  outline: 3px solid var(--sodium);
  outline-offset: 2px;
}

/* ── Modules ─────────────────────────────────────────────────────────────
 * A list of what is running, not a grid of cards. There will never be many,
 * and a row scans faster than a tile.
 */

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

.modules li {
  border-bottom: 1px solid var(--edge);
}

.modules a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--tap);
  padding: 0.75rem 0;
  color: var(--chalk);
  text-decoration: none;
}

.modules a:hover .name {
  color: var(--sodium);
}

.modules .name {
  font: 600 1.25rem/1.2 var(--stencil);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modules .version {
  color: var(--dim);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* ── Nothing here yet ────────────────────────────────────────────────────
 * An empty screen is an instruction, not an apology.
 */

/* An empty state is a sentence explaining what to do next, so it is capped
 * like any other prose rather than stretched across the window. */
.nothing {
  border: 1px dashed var(--edge);
  border-radius: 2px;
  padding: 1.5rem 1.25rem;
  color: var(--dim);
  max-width: 44rem;
}

.nothing strong {
  display: block;
  color: var(--chalk);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

/* ── Failure ─────────────────────────────────────────────────────────── */

.fault {
  border-left: 3px solid var(--fault);
  padding: 0.65rem 0 0.65rem 0.85rem;
  color: var(--chalk);
  margin: 0;
}

/* ── Sign out ────────────────────────────────────────────────────────────
 * Present, reachable, and not competing with anything.
 */

.signout {
  margin-top: 3rem;
}

.signout button {
  background: none;
  border-color: var(--edge);
  color: var(--dim);
  width: auto;
  padding: 0 1.25rem;
}

.signout button:hover {
  color: var(--chalk);
  border-color: var(--chalk);
  filter: none;
}

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

/* Something just went right: the quiet counterpart to .fault. */
.done {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--sodium);
  color: var(--chalk);
}

.account {
  margin-top: 2rem;
}

/* Which venue this is, at the top of the home page, and the way to another. */
.here {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  color: var(--dim);
}

.here strong {
  color: var(--chalk);
}

/* Choosing a venue: one big button each. */
.venues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: 34rem;
}

.venues form {
  margin: 0;
}

.venues button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font: 600 1.125rem/1 var(--body);
}
