/* The whole visual style of Kairos. Colours are defined once as custom
   properties and redefined for a dark colour scheme, so that no rule below
   needs to know which scheme is in force. */

:root {
  --page: #f6f5f2;
  --panel: #ffffff;
  --sunken: #efeee9;
  --line: #dedbd2;
  --ink: #1b1a17;
  --faint-ink: #6c6862;
  --accent: #7a5c33;
  --accent-soft: #e8dcc8;
  --good: #3f6f4a;
  --warn: #9a6b1f;
  --bad: #9c3a2f;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(27 26 23 / 6%), 0 4px 14px rgb(27 26 23 / 4%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #16161a;
    --panel: #1e1e23;
    --sunken: #26262c;
    --line: #34343c;
    --ink: #eceae5;
    --faint-ink: #9b968e;
    --accent: #d2ab6e;
    --accent-soft: #3a3227;
    --good: #7fb98c;
    --warn: #d8ab5c;
    --bad: #e0857a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 22%);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1020px;
  margin: 0 auto;
  padding: 40px 16px 96px;
}

/* Headings and text */

h1, h2, h3 { margin: 0; font-weight: 620; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }

p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.lede { color: var(--faint-ink); max-width: 62ch; }
.faint { color: var(--faint-ink); }
.small { font-size: 13.5px; }
.tiny { font-size: 12.5px; }
.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  font-size: 12.5px;
}
.numeric { font-variant-numeric: tabular-nums; }

/* Layout */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.panel > h2 { margin-bottom: 4px; }
.panel > .lede { margin-bottom: 16px; }

/* Headline figures */

.figures { display: flex; flex-wrap: wrap; gap: 26px; }
.figure { min-width: 96px; }
.figure .value { font-size: 25px; font-weight: 620; font-variant-numeric: tabular-nums; }
.figure .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint-ink);
}

/* Tables */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--faint-ink);
  font-weight: 600;
  padding: 0 10px 8px 0;
  border-bottom: 1px solid var(--line);
}
td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
th.figure-column, td.figure-column { text-align: right; font-variant-numeric: tabular-nums; }
tr.leading td { background: var(--accent-soft); }
tr.leading td:first-child { border-radius: 6px 0 0 6px; }
tr.leading td:last-child { border-radius: 0 6px 6px 0; }

/* Bars */

.bar {
  position: relative;
  height: 7px;
  min-width: 70px;
  background: var(--sunken);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 999px; }
.bar.good > span { background: var(--good); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }

/* Controls */

button {
  font: inherit;
  font-weight: 560;
  color: var(--page);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
}
button:hover:not(:disabled) { opacity: 0.88; }
button:disabled { opacity: 0.45; cursor: default; }
button.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
button.quiet:hover:not(:disabled) { border-color: var(--faint-ink); }

input[type="number"], input[type="text"] {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  width: 92px;
}

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--faint-ink); }

/* Graded answer choices */

.choices { display: flex; flex-wrap: wrap; gap: 7px; }
.choice {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  background: var(--panel);
}
.choice:hover { border-color: var(--faint-ink); }
.choice.chosen {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
  font-weight: 560;
}
.choice input { display: none; }

.question {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.question:last-of-type { border-bottom: none; }
.question .prompt { font-weight: 560; margin-bottom: 9px; }

/* Notes and badges */

.note {
  background: var(--sunken);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 15px;
  font-size: 14px;
}
.note.settled { border-left-color: var(--good); }

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--faint-ink);
}
.badge.good { background: var(--good); color: var(--page); }
.badge.warn { background: var(--warn); color: var(--page); }

.scroll { max-height: 340px; overflow-y: auto; }

@media (max-width: 620px) {
  .page { padding: 24px 14px 72px; }
  h1 { font-size: 25px; }
  .figures { gap: 18px; }
}
