/* Nuvio Training.
 *
 * Designed for a shop floor: somebody in gloves, at a shared terminal, in a
 * plant that is either glaring or badly lit. Three things follow from that and
 * they drive everything below.
 *
 *   1. Nothing important is smaller than 18px, and the primary action on a
 *      page is 72px tall. A glove is about 20mm wide at the fingertip.
 *   2. No information is revealed by hovering. A shared terminal may have no
 *      mouse at all, and a gloved hand cannot hover.
 *   3. The page is not white. White glares under plant lighting; the ground
 *      is the grey of painted concrete, and white is kept for the surfaces
 *      that carry text.
 *
 * The colour system is not decoration - it is the one these people already
 * read. ISO 7010 safety colours mean things on a factory floor: green is a
 * safe condition, yellow is caution, red is stop. Green is used for exactly
 * one thing in this product, and it is the thing you are meant to walk
 * towards.
 */

:root {
  /* Painted concrete, not white. */
  --ground: #e6e9e6;
  /* The surfaces that carry text. */
  --panel: #ffffff;
  /* Deep machine enamel. A colour, deliberately, rather than a tinted black. */
  --ink: #1c2a33;
  --steel: #5c6b74;
  --rule: #c3cbcd;

  /* ISO safe condition. The Join button and nothing else. */
  --go: #00843d;
  --go-dark: #00652f;
  /* ISO caution. A state that needs attention, never decoration. */
  --caution: #f2c200;
  /* ISO stop. Cancelling and danger. */
  --stop: #c8102e;

  --gap: 1.5rem;
  --measure: 34rem;
}

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

html {
  /* 18px base. The floor for a gloved hand at arm's length under bad light. */
  font-size: 112.5%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Barlow, "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* A perfect fourth, from 18px. Headings are tight because they are short. */
h1,
h2,
h3 {
  margin: 0 0 0.6em;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.015em;
}
h1 {
  font-size: 2.37rem;
}
h2 {
  font-size: 1.78rem;
}
h3 {
  font-size: 1.33rem;
}
p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: var(--go);
}

/* Focus is never removed and is never subtle: a shared terminal is often
 * driven by keyboard, and the ring has to be findable under glare. */
:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}

/* ───────────────────────────────────────────────────────── the top bar */

.bar {
  background: var(--ink);
  color: var(--panel);
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.bar a {
  color: var(--panel);
}
.bar__company {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.33rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bar__who {
  color: #aebac1;
  font-size: 0.95rem;
}
.bar__end {
  margin-left: auto;
}

main {
  padding: 2.5rem 1.5rem 4rem;
  max-width: 62rem;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────── the next training slab
 *
 * The one bold thing on the whole product. A works notice board: the time
 * large on the left in condensed numerals, the job beside it, and a green
 * slab you can hit with a glove.
 *
 * Square corners and a hard bottom edge rather than a soft shadow - a painted
 * steel panel does not have a blur under it.
 */

.now {
  background: var(--panel);
  border-left: 10px solid var(--go);
  border-bottom: 3px solid var(--rule);
  padding: 1.6rem 1.8rem 1.8rem;
  margin: 0 0 2.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.8rem;
  align-items: start;
}
.now--shut {
  border-left-color: var(--steel);
}
/* On the home page the whole slab is a link to sign-in: a visitor who hits
 * the big green thing should land somewhere useful rather than nowhere. It
 * keeps the page's text colour so it does not read as a hyperlink - the
 * affordance is the button inside it. */
a.now {
  text-decoration: none;
  color: inherit;
}
.now--caution {
  border-left-color: var(--caution);
}

.now__clock {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 4.2rem;
  font-weight: 700;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.now__day {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--steel);
  letter-spacing: 0.04em;
}
.now__what {
  font-size: 1.78rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.3rem;
}
.now__detail {
  color: var(--steel);
  margin: 0 0 0.2rem;
  max-width: var(--measure);
}
.now__action {
  grid-column: 1 / -1;
  margin-top: 1.5rem;
}

/* ──────────────────────────────────────────────────────────── buttons */

.go,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

/* The one green thing. 72px, full width, unmissable. */
.go {
  background: var(--go);
  color: #fff;
  width: 100%;
  min-height: 4rem;
  font-size: 1.33rem;
  letter-spacing: 0.01em;
  border-bottom: 4px solid var(--go-dark);
}
.go:hover,
.go:focus {
  background: var(--go-dark);
}
.go:active {
  /* It depresses, like a panel button. */
  border-bottom-width: 1px;
  transform: translateY(3px);
}

.btn {
  background: var(--ink);
  color: #fff;
  min-height: 3rem;
  padding: 0 1.4rem;
  border-bottom: 3px solid #0d161c;
}
.btn:active {
  border-bottom-width: 1px;
  transform: translateY(2px);
}
.btn--quiet {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-bottom-width: 2px;
}
.btn--stop {
  background: var(--stop);
  border-bottom-color: #9b0c23;
}

/* A button that is deliberately dead, with the reason beside it. Never a
 * greyed shape with no explanation - on a shop floor that reads as broken. */
.shut {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 4rem;
  padding: 0 1.4rem;
  background: #eef1f1;
  border: 2px dashed var(--rule);
  color: var(--steel);
  font-size: 1.1rem;
}

/* ───────────────────────────────────────────────────── the later list
 *
 * Flat strips with a rule between, not cards. A notice board is a column of
 * paper, and the hierarchy against the slab above is carried by weight, not
 * by a second rounded box with the same shadow.
 */

.later {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--rule);
}
.later li {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 1.2rem;
  align-items: baseline;
  padding: 1.1rem 0.2rem;
  border-bottom: 1px solid var(--rule);
}
.later__clock {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.later__day {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--steel);
}
.later__what {
  font-weight: 600;
}
.later__note {
  color: var(--steel);
  font-size: 0.95rem;
}
.later__state {
  color: var(--steel);
  font-size: 0.95rem;
  text-align: right;
}

/* ────────────────────────────────────────────────────── the training room
 *
 * Tiles that grow to fill the width, because the number of people in a
 * training is not known in advance: a fixed grid leaves one person tiny in a
 * corner or four people off the bottom of the screen.
 *
 * Black behind the video rather than the page ground - a grey surround makes
 * a camera picture look washed out, and this is the one place in the product
 * where that matters.
 */

.stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.6rem;
  margin: 1.5rem 0;
}
.stage:empty {
  display: none;
}
.tile {
  position: relative;
  background: #0b1114;
  border-bottom: 3px solid var(--rule);
  aspect-ratio: 4 / 3;
  /* A single participant must not fill the screen: with one person in the
   * room a 4:3 tile at full width is taller than the viewport, and the
   * Leave button ends up below the fold. */
  max-height: 60vh;
  overflow: hidden;
}
.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tile__who {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.35rem 0.8rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ──────────────────────────────────────────────────────── notice strip */

.notice {
  padding: 1rem 1.3rem;
  margin: 0 0 2rem;
  background: var(--panel);
  border-left: 10px solid var(--caution);
  border-bottom: 3px solid var(--rule);
}
.notice--stop {
  border-left-color: var(--stop);
}
/* A safe condition. The room is connected, the thing is done. Yellow here
 * would read as caution, which is the opposite of what happened. */
.notice--go {
  border-left-color: var(--go);
}
.notice p {
  margin: 0;
}
.notice strong {
  display: block;
  font-size: 1.15rem;
}

/* ───────────────────────────────────────────────────────────── forms */

form {
  max-width: var(--measure);
}
.field {
  margin: 0 0 1.4rem;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.6rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--steel);
  border-radius: 0;
}
.field textarea {
  padding: 0.8rem 1rem;
  min-height: 7rem;
  line-height: 1.5;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
}
.field .hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--steel);
  font-size: 0.95rem;
  max-width: none;
}
.field--wrong input {
  border-color: var(--stop);
  border-width: 3px;
}
.field .wrong {
  display: block;
  margin-top: 0.35rem;
  color: var(--stop);
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border-bottom: 3px solid var(--rule);
  padding: 1.8rem;
  margin: 0 0 2rem;
}

/* ───────────────────────────────────────────────────────────── tables
 *
 * A roster is a table, not a list of cards. Plant paperwork is tabular and
 * people read it fast by column.
 */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
}
th,
td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rule);
}
th {
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}
tbody tr:last-child td {
  border-bottom: 0;
}
td.n {
  font-variant-numeric: tabular-nums;
}

/* A state word, carried by colour and weight rather than a pill. */
.state {
  font-weight: 600;
}
.state--go {
  color: var(--go);
}
.state--caution {
  color: #8a6f00;
}
.state--stop {
  color: var(--stop);
}
.state--off {
  color: var(--steel);
}

/* ────────────────────────────────────────────────────────── the home page
 *
 * The hero is the product's own output: a notice board with a real session on
 * it. Saying what it does is less convincing than showing the thing a plant
 * would put on the wall.
 */

.hero {
  padding: 3.5rem 1.5rem 3rem;
  max-width: 62rem;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3.16rem;
  max-width: 18ch;
}
.hero p {
  font-size: 1.2rem;
  color: var(--steel);
  max-width: 44ch;
}
.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.8rem;
}
.hero__actions .btn {
  min-height: 3.6rem;
  font-size: 1.15rem;
}

.points {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.points h3 {
  margin-bottom: 0.3rem;
  padding-top: 0.9rem;
  border-top: 3px solid var(--ink);
}
.points p {
  color: var(--steel);
  margin: 0;
}

.foot {
  border-top: 1px solid var(--rule);
  padding: 1.5rem;
  color: var(--steel);
  font-size: 0.95rem;
  text-align: center;
}

/* ───────────────────────────────────────────────────────── small screens */

@media (max-width: 40rem) {
  html {
    font-size: 106%;
  }
  .now {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .now__clock {
    font-size: 3.2rem;
  }
  .later li {
    grid-template-columns: 4.5rem 1fr;
  }
  .later__state {
    grid-column: 2;
    text-align: left;
  }
}

/* Somebody has asked their machine to stop moving things. The button still
 * depresses on press, because that is feedback for an action rather than
 * decoration, but nothing else moves. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* A plant terminal in a bright bay may be set to high contrast. */
@media (prefers-contrast: more) {
  :root {
    --steel: #3d4a52;
    --rule: #8d989b;
  }
}
