/* Shared foundations: fonts, colour tokens, type, buttons, form fields. */

@font-face {
  font-family: 'Anek Latin';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  src: url('../fonts/anek-latin-latin-ext-wdth-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Anek Latin';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  font-stretch: 75% 125%;
  src: url('../fonts/anek-latin-latin-wdth-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Indigo ink on cool paper, with marigold kept for the one thing that matters on a screen. */
  --paper: #f4f5fb;
  --surface: #ffffff;
  --ink: #14164a;
  --ink-soft: #4b4f7c;
  --ink-faint: #8185a8;
  --line: #d8dbee;
  --line-soft: #e8eaf6;
  --indigo: #3b43d6;
  --indigo-deep: #2a30a8;
  --indigo-wash: #e6e8fb;
  --marigold: #f5a524;
  --marigold-wash: #fff1d4;
  --leaf: #12805a;
  --leaf-wash: #dcf3e8;
  --seal: #c8322f;
  --seal-wash: #fbe4e3;

  /* Group colours for split results: a fixed order checked for colour-blind separation. */
  --group-1: #2a78d6;
  --group-2: #eb6834;
  --group-3: #1baf7a;
  --group-4: #eda100;
  --group-5: #e87ba4;
  --group-6: #008300;
  --group-7: #4a3aa7;
  --group-8: #e34948;

  --font: 'Anek Latin', 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Oriya', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --focus: 0 0 0 3px rgba(59, 67, 214, 0.35);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-stretch: 92%;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

a {
  color: var(--indigo);
  text-underline-offset: 0.15em;
}

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

[hidden] {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* ---- buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .btn:hover {
    background: var(--indigo-wash);
  }
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--indigo-deep);
    border-color: var(--indigo-deep);
  }
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 550;
}

@media (hover: hover) {
  .btn-quiet:hover {
    color: var(--ink);
  }
}

.btn-danger {
  border-color: var(--seal);
  color: var(--seal);
}

@media (hover: hover) {
  .btn-danger:hover {
    background: var(--seal-wash);
  }
}

.btn-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.92rem;
  border-radius: var(--radius-s);
}

.btn-large {
  min-height: 54px;
  padding: 0 26px;
  font-size: 1.15rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ---- form fields ------------------------------------------------------ */

.field {
  display: block;
  margin-bottom: 16px;
}

.field > span,
.label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.field small,
.hint {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  line-height: 1.3;
}

.textarea {
  resize: vertical;
  min-height: 88px;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-faint);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: var(--focus);
}

.check {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 10px 0 0;
  accent-color: var(--indigo);
}

.check small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.error-text {
  color: var(--seal);
  font-weight: 550;
}

/* ---- notices, dialogs, toasts ----------------------------------------- */

.notice {
  padding: 12px 14px;
  border-left: 4px solid var(--marigold);
  border-radius: var(--radius-s);
  background: var(--marigold-wash);
}

.notice-bad {
  border-left-color: var(--seal);
  background: var(--seal-wash);
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--ink);
  color: #fff;
  font-weight: 550;
  box-shadow: 0 6px 24px rgba(20, 22, 74, 0.28);
}

.toast-bad {
  background: var(--seal);
}

dialog.dialog {
  width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 22, 74, 0.35);
}

dialog.dialog-wide {
  width: min(94vw, 720px);
}

dialog.dialog::backdrop {
  background: rgba(20, 22, 74, 0.45);
}

.dialog-body {
  padding: 24px 24px 8px;
}

.dialog-body h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.dialog-body p {
  margin-bottom: 12px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 24px 22px;
}

.lost {
  max-width: 520px;
  margin: 18vh auto 0;
  padding: 0 20px;
}

.lost h1 {
  margin-bottom: 12px;
}

/* The mark: an unclosed ring. Also used as the response counter and quiz timer. */
.ring {
  display: block;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-linecap: round;
}

.ring .ring-track {
  stroke: var(--line);
}

.ring .ring-value {
  stroke: var(--indigo);
  transition: stroke-dashoffset 0.4s ease;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-stretch: 112%;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.wordmark svg {
  margin-right: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ---- SATORI logo ---------------------------------------------------------- */
/* Dark lettering on light backgrounds, white lettering on dark ones. */

.logo {
  display: block;
  width: auto;
  height: 28px;
}

.logo-text {
  fill: var(--logo-text, #0d1330);
}

.logo-arc {
  stroke: var(--logo-arc, #4a5368);
}

.play-top,
.signin-brand {
  --logo-text: #ffffff;
  --logo-arc: #5a6379;
}

.wordmark .logo {
  margin: 0;
}

.nav .wordmark .logo {
  height: 30px;
}

.play-top .wordmark .logo {
  height: 24px;
}

.signin-brand .wordmark .logo {
  height: 40px;
}

.welcome h1 .logo {
  height: 72px;
  max-width: 100%;
  margin: 12px 0 16px;
}

/* ---- SATORI-BUTTONS-1: one look for every button across SATORI ---------------
   Every button is the dark blue of "Use a sample" (the ink colour, so it also
   reads on a presenter's dark look), and turns SATORI orange when the pointer is
   on it, while it is pressed, and while it is switched on. Small row buttons
   (btn-quiet) are a dark-blue outline. Buttons that delete stay red.
   The :root and :not() parts only make these rules win over the older ones. */
:root .btn:not(.btn-danger):not(.btn-quiet) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink, #fff);
}
:root .btn.btn-quiet:not(.btn-danger) {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}
:root .btn:not(.btn-danger):not(:disabled):active,
:root .btn:not(.btn-danger)[aria-pressed='true'],
:root .btn:not(.btn-danger).is-on {
  border-color: #ec8a03;
  background: #ec8a03;
  color: #14164a;
}
@media (hover: hover) {
  :root .btn:not(.btn-danger):not(:disabled):hover {
    border-color: #ec8a03;
    background: #ec8a03;
    color: #14164a;
  }
}

/* SATORI-LOGO-EDGE-START: the logo drawing now has a small margin round the ring
   (logo.js), so the ring is never cut off at the edge. These heights are the old
   ones x 199/187, so the logo itself stays the same size on every page. */
.logo { height: 29.8px; overflow: visible; }
.nav .wordmark .logo { height: 31.9px; }
.play-top .wordmark .logo { height: 25.5px; }
.signin-brand .wordmark .logo { height: 42.6px; }
.welcome h1 .logo { height: 76.6px; margin: 9.7px 0 13.7px; }
.wordmark .logo { margin-left: -1px; }
.satori-top-logo svg,
.satori-count { overflow: visible; }
/* SATORI-LOGO-EDGE-END */
