/*
 * Watchtower's stylesheet: the prototype boards' tokens (OKLCH) and the B612 fonts, in plain CSS (decision 4).
 * Each token holds its light and its dark value; the system's light or dark setting picks one.
 */

@font-face { font-family: "B612"; font-weight: 400; font-display: swap; src: url("/assets/b612-latin-400-normal-efb36888.woff2") format("woff2"); }
@font-face { font-family: "B612"; font-weight: 700; font-display: swap; src: url("/assets/b612-latin-700-normal-e8f0f0de.woff2") format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 400; font-display: swap; src: url("/assets/b612-mono-latin-400-normal-b657f0ab.woff2") format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 700; font-display: swap; src: url("/assets/b612-mono-latin-700-normal-b64d2798.woff2") format("woff2"); }

:root {
  color-scheme: light dark;

  --font: "B612", "Segoe UI", sans-serif;
  --mono: "B612 Mono", ui-monospace, monospace;

  /* Surfaces and text */
  --panel: light-dark(oklch(0.93 0.01 240), oklch(0.16 0.012 240));
  --paper: light-dark(oklch(0.99 0.004 95), oklch(0.215 0.012 240));
  --ink: light-dark(oklch(0.2 0.012 250), oklch(0.93 0.008 95));
  --muted: light-dark(oklch(0.43 0.012 250), oklch(0.75 0.01 240));
  --hair: light-dark(oklch(0.85 0.008 250), oklch(0.34 0.01 240));
  --track: light-dark(oklch(0.9 0.008 250), oklch(0.32 0.01 240));
  --arc: light-dark(oklch(0.82 0.08 155), oklch(0.48 0.08 155));
  --cyan: light-dark(oklch(0.46 0.1 220), oklch(0.8 0.1 215));
  --ring: light-dark(oklch(0.46 0.1 220 / 0.4), oklch(0.8 0.1 215 / 0.4));

  /* Verdicts: each also has its own symbol shape and word, never color alone */
  --ok: light-dark(oklch(0.52 0.13 155), oklch(0.77 0.14 155));
  --ok-ink: light-dark(oklch(0.42 0.11 155), oklch(0.8 0.13 155));
  --warn: light-dark(oklch(0.64 0.15 62), oklch(0.81 0.14 75));
  --warn-ink: light-dark(oklch(0.44 0.12 60), oklch(0.85 0.13 80));
  --tint-warn: light-dark(oklch(0.95 0.05 80), oklch(0.3 0.05 75));
  --act: light-dark(oklch(0.54 0.19 27), oklch(0.72 0.17 25));
  --act-ink: light-dark(oklch(0.46 0.17 27), oklch(0.82 0.12 25));
  --tint-act: light-dark(oklch(0.955 0.03 27), oklch(0.3 0.06 25));
  --bg-on-act: light-dark(oklch(0.99 0.004 95), oklch(0.16 0.012 240));

  /* The departure board (split-flap counts) */
  --board: light-dark(oklch(0.18 0.012 262), oklch(0.12 0.01 262));
  --flap: oklch(0.25 0.012 262);
  --seam: oklch(0.12 0.008 262);
  --btext: oklch(0.96 0.01 90);
  --bmuted: oklch(0.77 0.012 90);
  --flap-act: oklch(0.78 0.15 30);
  --flap-warn: oklch(0.84 0.14 80);
  --flap-unk: oklch(0.8 0.02 260);

  /* The airfield (from M1) */
  --grass: light-dark(oklch(0.87 0.045 135), oklch(0.2 0.025 150));
  --fence: light-dark(oklch(0.38 0.07 140), oklch(0.74 0.09 140));
  --apron: light-dark(oklch(0.95 0.006 250), oklch(0.25 0.008 250));
  --apron-hair: light-dark(oklch(0.84 0.008 250), oklch(0.36 0.008 250));
  --bldg: light-dark(oklch(0.985 0.004 250), oklch(0.23 0.012 240));
  --gate: light-dark(oklch(0.955 0.006 250), oklch(0.27 0.012 240));
  --twy: light-dark(oklch(0.5 0.006 250), oklch(0.55 0.13 255));
  --rwy: light-dark(oklch(0.3 0.008 250), oklch(0.11 0.004 250));
  --rwy-mark: light-dark(oklch(0.97 0.004 95), oklch(0.93 0.01 95));
  --rwy-ok: light-dark(oklch(0.93 0.006 95), oklch(0.9 0.02 95));
  --rwy-act: light-dark(oklch(0.7 0.19 30), oklch(0.72 0.18 30));
  --rwy-line: light-dark(oklch(0.7 0.13 155), oklch(0.75 0.15 150));
  --gate-ok: light-dark(oklch(0.62 0.012 250), oklch(0.7 0.012 250));
  --gate-act: light-dark(oklch(0.54 0.19 27), oklch(0.72 0.17 25));
  --gate-line: light-dark(oklch(0.45 0.1 155), oklch(0.75 0.13 155));
  --fuel: light-dark(oklch(0.62 0.09 235), oklch(0.7 0.1 235));
  --sign: light-dark(oklch(0.2 0.01 250), oklch(0.1 0.006 250));
  --sign-ink: oklch(0.87 0.16 95);

  --page-gutter: 40px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base */

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Masthead */

.masthead {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px var(--page-gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.masthead__freshness {
  flex: 1 1 12rem;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
}

/* The quiet button's text, not its padding, lines up with the board's right edge. */
.masthead__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: -16px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}

.button:hover { background: color-mix(in oklch, var(--ink) 86%, var(--paper)); }
.button:active { background: color-mix(in oklch, var(--ink) 74%, var(--paper)); }
.button:disabled { opacity: 0.7; cursor: progress; }
.button--quiet { background: transparent; color: var(--ink); }
.button--quiet:hover { background: var(--paper); }
.button--quiet:active { background: var(--hair); }

/* The Glance */

.glance {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px var(--page-gutter) 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: 18px 22px;
  border-radius: 12px;
  background: var(--board);
  color: var(--btext);
}

.board__counts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.board__note {
  flex: 1 1 18rem;
  max-width: 60ch;
  font-size: 15px;
  color: var(--bmuted);
}

.flap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 76px;
  padding: 0 14px;
  border-radius: 5px;
  background: linear-gradient(to bottom, var(--flap) 0 49%, var(--seam) 49% 51%, var(--flap) 51% 100%);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 50px;
  line-height: 1;
}

.flap--word { font-size: 34px; letter-spacing: 0.04em; }
.flap--unknown { color: var(--flap-unk); }

.questions { display: flex; flex-direction: column; gap: 12px; }
.questions__title { font-size: 18px; }

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 12px;
  background: var(--paper);
}

.row {
  display: grid;
  grid-template-columns: auto minmax(14rem, 22rem) 8rem minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 18px;
  padding: 14px 20px;
}

.row + .row { border-top: 1px solid var(--hair); }

/* An outlined chip, as on the prototype board: the yellow-on-black sign colors belong to the airfield's places. */
.row__number {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 5px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.row__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row__name { font-size: 17px; font-weight: 700; }
.row__question { font-size: 14px; color: var(--muted); text-wrap: pretty; }
.row__sentence { font-size: 15px; max-width: 70ch; }

/* Baseline-aligned, so the word sits on the row's baseline; the glyph centers on it. */
.verdict {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.verdict--normal { color: var(--ok-ink); --glyph: var(--ok); }
.verdict--watch { color: var(--warn-ink); --glyph: var(--warn); }
.verdict--act { color: var(--act-ink); --glyph: var(--act); }
.verdict--unknown { color: var(--muted); }

.glyph { flex: none; align-self: center; }
.glyph__shape { fill: var(--glyph); }
.glyph__mark { fill: none; stroke: var(--paper); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.glyph--unknown { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* Sign-in */

.sign-in {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.sign-in__form {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border-radius: 12px;
  background: var(--paper);
}

.sign-in__form .wordmark { margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; }

.field input {
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--hair);
  border-radius: 6px;
  background: var(--panel);
  font-weight: 400;
  transition: border-color 150ms var(--ease-out);
}

.field input:hover { border-color: color-mix(in oklch, var(--hair), var(--ink) 30%); }
.field input:focus-visible { outline: 3px solid var(--ring); outline-offset: 0; border-color: var(--cyan); }

.alert {
  --glyph: var(--act);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--tint-act);
  color: var(--act-ink);
  font-size: 15px;
}

/* On the first line of a message that wraps, not between its lines. */
.alert > .glyph { align-self: flex-start; margin-top: 0.2em; }

/* Phone width: one column, the rows stack */

@media (max-width: 720px) {
  :root { --page-gutter: 16px; }

  .masthead__freshness { order: 3; flex-basis: 100%; }

  .row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 12px;
    padding: 14px 16px;
  }

  .row .verdict, .row__sentence { grid-column: 2; }
  .flap { height: 60px; min-width: 46px; font-size: 40px; }
  .flap--word { font-size: 28px; }
}
