/* Shared by both screens: the typeface, the palette and the note. */

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

:root {
  /* The night behind the notes on the TV; the text and the commands on the phone.
     Its three channels stand apart so that a shadow or a tint can thin it: #1b1b2a. */
  --night-rgb: 27, 27, 42;
  --night: rgb(var(--night-rgb));
  --night-raised: #2d2d44;
  --night-text: #f1f2f8;

  /* The one red: what cannot be undone easily, and what went wrong, on its ground. */
  --danger: #a3271d;
  --danger-ground: #fbecea;

  --display: "Ultra", "Rockwell Extra Bold", Rockwell, Georgia, serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serial: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", Menlo, monospace;
  --aside: Georgia, "Times New Roman", serif;

  /* How things move: fast at first, then settling. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* A note is printed in one ink on a paper of its hue.
     Each note sets its own pair from the colour of its child. */
  --note-ink: #2f3142;
  --note-paper: #e7e8ef;
}

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

html {
  /* The notes keep their own colours: no browser repaints them for a dark mode. */
  color-scheme: only light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

[hidden] {
  display: none !important;
}

/* In the page for screen readers, out of sight and out of the layout. The alert of a
   form of the phone is kept that way while it has nothing to say. */
.visually-hidden,
.form-error:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  /* Pulled back into its parent: at the end of a page it would add a pixel of scroll. */
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The note. --n is its unit: each screen sets it to its own scale. */
.note {
  position: relative;
  overflow: hidden;
  color: var(--note-ink);
  background: var(--note-paper);
  border-radius: calc(var(--n) * 0.7);
  /* A thick line, a gap, a thin line: the frame of a banknote. */
  box-shadow:
    inset 0 0 0 calc(var(--n) * 0.21) var(--note-ink),
    inset 0 0 0 calc(var(--n) * 0.7) var(--note-paper),
    inset 0 0 0 calc(var(--n) * 0.83) var(--note-ink);
}

.note__name,
.note__corner,
.note__digits {
  font-family: var(--display);
  font-weight: 400;
}

/* The two small voices of the foot; each screen gives them their size. */
.note__serial {
  font-family: var(--serial);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.note__unit {
  font-family: var(--aside);
  font-style: italic;
  white-space: nowrap;
}

/* The printed field inside the frame: what is engraved stops at the inner line. */
.note__field {
  position: absolute;
  top: calc(var(--n) * 0.83);
  right: calc(var(--n) * 0.83);
  bottom: calc(var(--n) * 0.83);
  left: calc(var(--n) * 0.83);
  overflow: hidden;
  pointer-events: none;
}

/* The rosette engraved behind the value: bands woven by js/lib/guilloche.js. */
.note__rosette {
  position: absolute;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.5;
  stroke-linejoin: round;
  opacity: 0.42;
  pointer-events: none;
}

/* The ring of microprint between the two bands: texture, not text to read.
   js/lib/note.js gives it its size, with the circle it follows. */
.note__microprint {
  fill: currentColor;
  stroke: none;
  font-family: var(--serial);
}
