/* Shared tokens, fonts, and resets.

   The look is daylight: a page that is nearly white with a breath of sky in
   it, text in deep blue ink instead of black, and one sunny color for the
   thing you press most. The clock face is the one loud element.

   Why these colors (sources in README.md, "Colors"):
   - Light surfaces. People tie light colors to positive feelings and dark and
     gray ones to negative feelings, and dark text on a light page is the
     easier one to read.
   - Blue ink and a blue clock. Blue is the color most people like, in every
     country surveyed.
   - Sun yellow for the main action. Yellow is the color people tie to joy.
   - Every pair of text and background meets the WCAG contrast levels, and
     no state is told apart by color alone. test/colors.test.js checks it.

   Type: the clock's numbers are Big Shoulders Display. Everything a person
   reads or presses is Oswald, and headings are Anton, the same pair the
   original timer uses. All three are served from /fonts (SIL Open Font
   License; the license files sit beside them).

   The colors below style the side panel and the plain pages. The colors of
   the clock itself are settings (public/js/shared/settings.js), because a
   paid account can change them. */

@font-face {
  font-family: "Oswald";
  src: url("/fonts/oswald-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("/fonts/oswald-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Oswald";
  src: url("/fonts/oswald-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Anton";
  src: url("/fonts/anton-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #f7fafd;    /* page background: white with a breath of sky */
  --sunken: #eaf1f9;   /* boxes set into the page */
  --field: #ffffff;    /* places to type */
  --key: #dfeaf6;      /* buttons */
  --key-up: #cddef1;   /* button, hovered or pressed */
  --line: #cfdbe8;     /* dividers */
  --edge: #74859f;     /* outlines of fields and switches */
  --ink: #14254f;      /* text: deep blue, never black */
  --muted: #4f6187;    /* secondary text */

  --sun: #ffd23f;      /* the main action */
  --sun-up: #ffc21a;   /* the main action, hovered */
  --sun-soft: #ffedb0; /* the Paid tag */
  --go: #087a68;       /* switched on, set, all good */
  --alert: #a35200;    /* problems and warnings */
  --stop: #cf2450;     /* on air, missing, errors */
  --focus: #1c6fe0;    /* keyboard focus outline */

  --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;  /* the clock's numbers */
  --font-head: "Anton", Impact, "Arial Narrow Bold", sans-serif;                /* headings */
  --font-ui: "Oswald", "Arial Narrow", sans-serif;                              /* everything else */

  --radius: 8px;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font: 400 15px/1.45 var(--font-ui);
}

/* The page stays unpainted until the app knows where it is running. The
   camera view must never paint a backdrop: Zoom mixes that page into the
   video, and anything opaque would cover the person. */
html.solid body,
body.notice,
body.setup {
  background: var(--paper);
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 2px;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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