/* Design tokens, reset and the pieces shared by the landing page and the app. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3f5fb;
  --surface: #fff;
  --surface-2: #eceff8;
  --ink: #13203f;
  --mut: #56627f;
  --line: #d8dfef;

  /* Item types: roots are blue, compound words are orange. */
  --root: #2447b0;
  --word: #c64708;
  --on: #fff;

  /* Direction of a question: Dutch shown (answer in English) is blue, English shown (answer in Dutch) is green. */
  --nl: #2447b0;
  --en: #0b7a62;
  --banner-ink: #fff;

  --ok: #2c8a3c;
  --ok-ink: #fff;
  --bad: #bd2433;
  --bad-ink: #fff;
  --warn: #fff1c2;
  --warn-ink: #4a3600;
  --gold: #f0b429;
  --gold-ink: #3b2a00;

  /* Apprentice, Guru, Master, Enlightened, Burned */
  --g0: #df4d7a;
  --g1: #8650cf;
  --g2: #2d6ee0;
  --g3: #14a0b5;
  --g4: #4b5568;

  --salmon: #ffa99c;
  --salmon-ink: #4a1008;
  --sky: #a9ccff;
  --sky-ink: #0b1a40;
  --teal: #0f766e;
  --teal-ink: #fff;

  --shadow: 0 1px 2px rgba(19, 32, 63, 0.06), 0 8px 24px rgba(19, 32, 63, 0.06);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1222;
    --surface: #141d38;
    --surface-2: #1a2547;
    --ink: #e8edfb;
    --mut: #9aa6c6;
    --line: #27335c;
    --root: #6b8ff2;
    --word: #f4915a;
    --on: #0b1222;
    --nl: #2a4fc4;
    --en: #0e8a70;
    --ok: #4cc27d;
    --ok-ink: #08210f;
    --bad: #ff7a88;
    --bad-ink: #3a0610;
    --warn: #4a3b0c;
    --warn-ink: #ffe8a3;
    --g0: #f2709a;
    --g1: #a982ec;
    --g2: #5b8ff0;
    --g3: #3fc3d6;
    --g4: #8791a8;
    --salmon: #f08b84;
    --sky: #8ab4ff;
    --teal: #1aa090;
    --teal-ink: #04201c;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1222;
  --surface: #141d38;
  --surface-2: #1a2547;
  --ink: #e8edfb;
  --mut: #9aa6c6;
  --line: #27335c;
  --root: #6b8ff2;
  --word: #f4915a;
  --on: #0b1222;
  --nl: #2a4fc4;
  --en: #0e8a70;
  --ok: #4cc27d;
  --ok-ink: #08210f;
  --bad: #ff7a88;
  --bad-ink: #3a0610;
  --warn: #4a3b0c;
  --warn-ink: #ffe8a3;
  --g0: #f2709a;
  --g1: #a982ec;
  --g2: #5b8ff0;
  --g3: #3fc3d6;
  --g4: #8791a8;
  --salmon: #f08b84;
  --sky: #8ab4ff;
  --teal: #1aa090;
  --teal-ink: #04201c;
  --shadow: none;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 6px 0;
}

a {
  color: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

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

.mut {
  color: var(--mut);
  font-size: 15px;
}

.center {
  text-align: center;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
}

kbd {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  margin-left: 6px;
  color: var(--mut);
  background: var(--surface);
}

.boot {
  text-align: center;
  color: var(--mut);
  padding: 64px 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

.btn b {
  font-weight: 800;
  font-size: 14px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
}

.btn.solid {
  background: var(--ink);
  color: var(--bg);
}

.btn.solid b {
  background: rgba(127, 127, 127, 0.3);
}

.btn.salmon {
  background: var(--salmon);
  color: var(--salmon-ink);
}

.btn.sky {
  background: var(--sky);
  color: var(--sky-ink);
}

.btn.teal {
  background: var(--teal);
  color: var(--teal-ink);
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.link {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--mut);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}

/* Forms */
input[type="text"],
input[type="password"],
input[type="search"],
input:not([type]) {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface);
}

input::placeholder {
  color: var(--mut);
  opacity: 0.8;
}

/* Marks in mnemonics: the item's own word, and the words of its parts */
mark {
  background: var(--root);
  color: var(--on);
  padding: 1px 7px;
  border-radius: 5px;
}

mark.p {
  background: var(--word);
}

.panel.word mark,
.ibox.word mark {
  background: var(--word);
}

.panel.word mark.p,
.ibox.word mark.p {
  background: var(--root);
}

/* Stage colours, used by bars, legends and tiles */
.stack i.g0,
.sw.g0 {
  background: var(--g0);
}
.stack i.g1,
.sw.g1 {
  background: var(--g1);
}
.stack i.g2,
.sw.g2 {
  background: var(--g2);
}
.stack i.g3,
.sw.g3 {
  background: var(--g3);
}
.stack i.g4,
.sw.g4 {
  background: var(--g4);
}
