/* BROWNOUT interface. Palette, faces, sizes and timings arrive as custom properties that hud.js sets on <html> from
   src/data/hud.js; this file only lays them out. State arrives as data-* attributes and the hidden attribute.
   Type floor: nothing here is set under 0.875rem, and rem itself never falls under the reader's own 1rem, so the
   smallest label is 14px or more at any window size. Layout floor: the instrument columns, the alarm lane and the
   dock are cells of one grid, so nothing overlaps in a half-screen window; the hotbar's strip is one row, however many slots there are. */

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

html, body { height: 100%; margin: 0; overflow: hidden; background: #000; }
html { font-size: var(--ui); }
body {
  color: var(--ink);
  font: var(--weight-read) var(--size-read)/1.35 var(--font-text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
[hidden] { display: none !important; }

#view { position: fixed; inset: 0; display: block; width: 100%; height: 100%; }
#hud, #overlay { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
#hud { z-index: 1; text-shadow: 0 0 .5em var(--shade), 0 0 .15em var(--shade); }
#overlay { z-index: 2; }
html[data-mode='boot'] #hud, html[data-mode='title'] #hud, html[data-mode='dead'] #hud { visibility: hidden; }

/* The page's own words before the game's code has run (index.html): the loading line, and the notice for a page that cannot start (the same
   notice the game shows when something breaks, ui/style/fault.css). The HUD has not set its tokens yet, so every value of the notice is written
   out here, the one place this file holds a palette, and each names after it the token (`tokens.`, data/hud.js) or the row (`look.`,
   FAULTS.text.look in data/faults.js) it copies: tests/boot.loading.test.mjs holds each equal to it, so that the two cannot drift. The loading
   line is not a notice and is as it was. */
.boot {
  position: fixed; inset: 0; z-index: 3; display: grid; align-content: center; justify-items: start; gap: 1rem; padding: 0 6vw;
  background: rgb(0 0 0 / 1); /* = tokens.black */
  color: rgb(233 230 220 / 1); /* = tokens.ink */
}
.boot h1 { margin: 0; font: 900 clamp(2rem, 9vw, 5rem) / .9 "Bahnschrift", "Arial Narrow", Arial, sans-serif; letter-spacing: -.02em; }
.boot p { margin: 0; max-width: 40rem; font-size: 1rem; line-height: 1.4; }
.boot .notice {
  display: grid;
  gap: .7rem; /* = look.gap */
  width: 31rem; /* = look.width */
  max-width: 100%;
  padding-top: 1.1rem; /* = look.pad-top */
  padding-right: 1.3rem; /* = look.pad-x */
  padding-bottom: 1.2rem; /* = look.pad-bottom */
  padding-left: 1.3rem; /* = look.pad-x */
  background: rgb(4 6 7 / 0.97); /* = tokens.dark-sheet */
  border-left-style: solid;
  border-left-width: 2px; /* = tokens.plate-rule */
  border-left-color: rgb(255 180 74 / 1); /* = tokens.lamp */
}
.boot .notice h1 {
  font-family: "Barlow Condensed", "Bahnschrift", "DIN Condensed", "Avenir Next Condensed", "Helvetica Neue", "Arial Narrow", "Roboto Condensed", "Liberation Sans Narrow", "Franklin Gothic Medium", Arial, sans-serif; /* = tokens.font-display */
  font-size: 1.75rem; /* = tokens.size-figure */
  font-weight: 600; /* = tokens.weight-label */
  font-stretch: condensed;
  line-height: 1; /* = look.head-line */
  letter-spacing: .04em; /* = look.head-track */
  text-transform: uppercase;
}
.boot .notice p {
  max-width: none; overflow-wrap: anywhere;
  font-family: "Barlow", "Bahnschrift", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif; /* = tokens.font-text */
}
.boot .notice .say {
  font-size: 1.1875rem; /* = tokens.size-say */
  font-weight: 500; /* = tokens.weight-say */
  line-height: 1.2; /* = look.say-line */
}
.boot .notice .read {
  font-size: 1rem; /* = tokens.size-read */
  font-weight: 400; /* = tokens.weight-read */
  line-height: 1.35; /* = look.read-line */
  color: rgb(233 230 220 / 0.68); /* = tokens.ink-dim */
}
.boot .notice .report {
  font-size: .875rem; /* = tokens.size-label */
  font-weight: 400; /* = tokens.weight-read */
  line-height: 1.35; /* = look.read-line */
  color: rgb(233 230 220 / 0.68); /* = tokens.ink-dim */
}

button {
  font: inherit;
  font-size: var(--size-label);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink-dim);
  padding: .6em 1.3em;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--fade), color var(--fade);
}
button:hover:not(:disabled), button:focus-visible:not(:disabled) { background: var(--ink); color: var(--black); outline: none; }
button:disabled { opacity: .4; cursor: default; }

.tag {
  display: block;
  font-size: var(--size-label);
  font-weight: var(--weight-label);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* The picture of a supply (ui/icons.js): a square the box that holds it sizes, in the text's own colour, so it is dim where the text is. */
.icon { display: block; flex: none; width: var(--icon-row); height: var(--icon-row); }
.icon > svg { display: block; width: 100%; height: 100%; }

.bar { position: relative; height: 3px; background: var(--rule); }
.bar > i {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .25s linear;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
