/* Design tokens. Every later stylesheet reads these names; change a value here, not in the page.
   Block order matters: fonts, light, dark by device setting, then dark by the chosen setting.
   light-dark() is not used, because Safari before 17.5 drops the whole declaration. */

@font-face {
  font-family: "Inter";
  src: url("/static/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

/* Light, and the base for the values that do not change with the theme. */
:root,
[data-theme="light"] {
  /* Surfaces */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f4f4f5;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  /* Text */
  --text: #18181b;
  --text-strong: #18181b;
  --text-muted: #686872;
  /* For placeholders and disabled states only. It is 3:1 on the surfaces, which is enough for the edge of a control
     but not for words a person has to read: use --text-muted for those. */
  --text-faint: #8a8a93;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #ba1a16;
  --accent-line: #ba1a16;
  --accent-hover: #9f1612;
  --on-accent: #ffffff;
  --accent-soft: #fdecea;
  --link: #ba1a16;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #8f5a06;
  --warn-soft: #fef3c7;
  --bad: #c01c28;
  --bad-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  /* Pace */
  --pace-wait: #71717a;
  --pace-ok: #12883f;
  --pace-warn: #c26a05;
  --pace-bad: #dc2626;
  /* The text on a solid pace fill, such as a group's dot on the map */
  --on-pace-wait: #ffffff;
  --on-pace-ok: #ffffff;
  --on-pace-warn: #09090b;
  --on-pace-bad: #ffffff;

  /* The colours a Hue bulb flashes in for Identify, as swatches beside its button: the bulb's own colour, the same in
     either theme. */
  --bulb-blue: #2563eb;
  --bulb-magenta: #db2777;
  --bulb-cyan: #06b6d4;
  --bulb-purple: #7c3aed;
  --bulb-white: #ffffff;
  --bulb-yellow: #facc15;
  --bulb-orange: #f97316;
  /* What a sign shows, by its colour's name: Traffic's lights and the Signs board's bulbs. Red, amber and green are the
     pace colours, so they step with the theme; the rest are the bulb's own colour. Off is an unlit bulb, drawn hollow. */
  --sign-red: var(--pace-bad);
  --sign-amber: var(--pace-warn);
  --sign-green: var(--pace-ok);
  --sign-white: var(--bulb-white);
  --sign-blue: var(--bulb-blue);
  --sign-yellow: var(--bulb-yellow);
  --sign-cyan: var(--bulb-cyan);
  --sign-magenta: var(--bulb-magenta);
  --sign-orange: var(--bulb-orange);
  --sign-purple: var(--bulb-purple);
  --sign-off: transparent;
  /* An unlit bulb on the Signs board: dark glass, the same in either theme. */
  --bulb-unlit: #3f3f46;
  --on-bulb-unlit: #ffffff;
  /* Chart series, in a fixed order: blue, cyan, plum, periwinkle, violet, orchid. Chosen with the dataviz
     validator to stay clear of the ok, warn and bad hues and to be told apart with red-green colour blindness. */
  --series-1: #0056cf;
  --series-2: #089ac3;
  --series-3: #89217a;
  --series-4: #7978fb;
  --series-5: #6f2fb7;
  --series-6: #b474b7;
  --chart-grid: #e4e4e7;
  --chart-axis: #686872;
  /* Depth and logos */
  /* A small lift, such as the chosen button of a segmented control */
  --shadow-sm: 0 1px 2px rgb(24 24 27 / 0.12), 0 1px 1px rgb(24 24 27 / 0.06);
  --shadow-pop: 0 8px 24px rgb(24 24 27 / 0.12), 0 2px 6px rgb(24 24 27 / 0.08);
  --show-on-light: inline-block;
  --show-on-dark: none;
  /* The dim behind a dialog, a drawer or the search, the same in both themes */
  --scrim: rgb(0 0 0 / 0.5);
  --scrim-light: rgb(0 0 0 / 0.4);
  color-scheme: light;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  /* Shape and spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Touch targets: normal, large, and the stage screens */
  --touch: 44px;
  --touch-lg: 48px;
  --touch-stage: 64px;

  /* The app bar's height, and where anything that sticks or scrolls to a spot must start so the bar doesn't cover it */
  --appbar-h: 56px;
}

/* Dark, when the device is set to dark and no choice was made on this page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Surfaces */
    --bg: #09090b;
    --surface: #111113;
    --surface-raised: #18181b;
    --surface-sunken: #0c0c0e;
    --line: #27272a;
    --line-strong: #3f3f46;
    /* Text */
    --text: #fafafa;
    --text-strong: #fafafa;
    --text-muted: #a1a1aa;
    --text-faint: #71717a;
    /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
    --control-line: var(--text-faint);
    /* Accent and status */
    --accent: #d92d29;
    --accent-line: #d92d29;
    --accent-hover: #c8261f;
    --on-accent: #ffffff;
    --accent-soft: #2a1011;
    --link: #ec5a56;
    --ok: #4ade80;
    --ok-soft: #0d2616;
    --warn: #fbbf24;
    --warn-soft: #2e2108;
    --bad: #f87171;
    --bad-soft: #331214;
    --info: #60a5fa;
    --info-soft: #10213f;
    /* Pace */
    --pace-wait: #a1a1aa;
    --pace-ok: #4ade80;
    --pace-warn: #fbbf24;
    --pace-bad: #f87171;
    --on-pace-wait: #09090b;
    --on-pace-ok: #09090b;
    --on-pace-warn: #09090b;
    --on-pace-bad: #09090b;
    /* Chart series: the same hues, stepped for the dark surface */
    --series-1: #236ade;
    --series-2: #19a1c9;
    --series-3: #9e448e;
    --series-4: #8082f7;
    --series-5: #7844bb;
    --series-6: #ba75be;
    --chart-grid: #27272a;
    --chart-axis: #a1a1aa;
    /* Depth and logos */
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5), 0 1px 1px rgb(0 0 0 / 0.3);
    --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
    --show-on-light: none;
    --show-on-dark: inline-block;
    color-scheme: dark;
  }
}

/* Dark, when it was chosen. The same values as the block above. */
[data-theme="dark"] {
  /* Surfaces */
  --bg: #09090b;
  --surface: #111113;
  --surface-raised: #18181b;
  --surface-sunken: #0c0c0e;
  --line: #27272a;
  --line-strong: #3f3f46;
  /* Text */
  --text: #fafafa;
  --text-strong: #fafafa;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #d92d29;
  --accent-line: #d92d29;
  --accent-hover: #c8261f;
  --on-accent: #ffffff;
  --accent-soft: #2a1011;
  --link: #ec5a56;
  --ok: #4ade80;
  --ok-soft: #0d2616;
  --warn: #fbbf24;
  --warn-soft: #2e2108;
  --bad: #f87171;
  --bad-soft: #331214;
  --info: #60a5fa;
  --info-soft: #10213f;
  /* Pace */
  --pace-wait: #a1a1aa;
  --pace-ok: #4ade80;
  --pace-warn: #fbbf24;
  --pace-bad: #f87171;
  --on-pace-wait: #09090b;
  --on-pace-ok: #09090b;
  --on-pace-warn: #09090b;
  --on-pace-bad: #09090b;
  /* Chart series: the same hues, stepped for the dark surface */
  --series-1: #236ade;
  --series-2: #19a1c9;
  --series-3: #9e448e;
  --series-4: #8082f7;
  --series-5: #7844bb;
  --series-6: #ba75be;
  --chart-grid: #27272a;
  --chart-axis: #a1a1aa;
  /* Depth and logos */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.5), 0 1px 1px rgb(0 0 0 / 0.3);
  --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
  --show-on-light: none;
  --show-on-dark: inline-block;
  color-scheme: dark;
}

/* ---- Guest pages (data-surface="guest"): the haunt's own look, phone first. A larger type scale, rounder corners,
   Oswald headings. The site it follows is dark, so dark is the main look and is designed first; light is a paper look
   with the maroon for text. Custom properties inherit, so this works on <html> or on any element inside a page.
   A guest surface follows the page's theme: it is dark when the device is dark and no choice was made, or when
   data-theme="dark" is on <html> or any element around it. Its own data-theme, set on the surface itself, wins over
   both: "dark" makes it dark, "light" keeps it light whatever the page and the device say.
   These sit after the admin sets and are more specific where they must win (a guest block inside a dark page). */

/* Light guest: paper, with #3b0000 maroon text. */
[data-surface="guest"] {
  /* Surfaces */
  --bg: #f8f3ee;
  --surface: #fffdfa;
  --surface-raised: #ffffff;
  --surface-sunken: #f0e8df;
  --line: #e3d7ca;
  --line-strong: #cdbbaa;
  /* Text */
  --text: #3b0000;
  --text-strong: #3b0000;
  --text-muted: #6b4743;
  --text-faint: #8a6b66;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #ba1a16;
  --accent-line: #ba1a16;
  --accent-hover: #9f1612;
  --accent-bright: #e90000;
  --on-accent: #ffffff;
  --accent-soft: #fbe9e5;
  --link: #ba1a16;
  --ok: #137339;
  --ok-soft: #dcfce7;
  --warn: #8f5a06;
  --warn-soft: #fef3c7;
  --bad: #c01c28;
  --bad-soft: #fee2e2;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  /* The bands: red and maroon, with the text that goes on them */
  --band-red: #ba1a16;
  --band-maroon: #3b0000;
  --on-band: #ffffff;
  --on-band-muted: #f1d9d6;
  /* Pace */
  --pace-wait: #71717a;
  --pace-ok: #12883f;
  --pace-warn: #c26a05;
  --pace-bad: #dc2626;
  --on-pace-wait: #ffffff;
  --on-pace-ok: #ffffff;
  --on-pace-warn: #09090b;
  --on-pace-bad: #ffffff;
  /* Chart series */
  --series-1: #0056cf;
  --series-2: #089ac3;
  --series-3: #89217a;
  --series-4: #7978fb;
  --series-5: #6f2fb7;
  --series-6: #b474b7;
  --chart-grid: #e3d7ca;
  --chart-axis: #6b4743;
  /* Depth and logos */
  --shadow-pop: 0 8px 24px rgb(59 0 0 / 0.16), 0 2px 6px rgb(59 0 0 / 0.1);
  --show-on-light: inline-block;
  --show-on-dark: none;
  color-scheme: light;

  /* Type: headings in Oswald, a step up all the way, for reading on a phone in a queue */
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;

  /* Shape and touch */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --touch: 48px;
  --touch-lg: 56px;
}

/* Dark guest, when the device is set to dark and no choice was made on this page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-surface="guest"],
  :root:not([data-theme="light"]) [data-surface="guest"]:not([data-theme="light"]) {
    /* Surfaces: near-black with a warm cast */
    --bg: #0a0606;
    --surface: #130b0b;
    --surface-raised: #1b1010;
    --surface-sunken: #070404;
    --line: #2f1b1a;
    --line-strong: #4d2e2c;
    /* Text */
    --text: #f6efec;
    --text-strong: #f6efec;
    --text-muted: #c4aaa6;
    --text-faint: #7d6561;
    /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
    --control-line: var(--text-faint);
    /* Accent and status */
    --accent: #dc2420;
    --accent-line: #dc2420;
    --accent-hover: #ba1a16;
    --accent-bright: #e90000;
    --on-accent: #ffffff;
    --accent-soft: #2b0d0c;
    --link: #ff6b64;
    --ok: #4ade80;
    --ok-soft: #0d2616;
    --warn: #fbbf24;
    --warn-soft: #2e2108;
    --bad: #f87171;
    --bad-soft: #331214;
    --info: #60a5fa;
    --info-soft: #10213f;
    /* The bands */
    --band-red: #ba1a16;
    --band-maroon: #3b0000;
    --on-band: #ffffff;
    --on-band-muted: #f1d9d6;
    /* Pace */
    --pace-wait: #a1a1aa;
    --pace-ok: #4ade80;
    --pace-warn: #fbbf24;
    --pace-bad: #f87171;
    --on-pace-wait: #09090b;
    --on-pace-ok: #09090b;
    --on-pace-warn: #09090b;
    --on-pace-bad: #09090b;
    /* Chart series */
    --series-1: #236ade;
    --series-2: #19a1c9;
    --series-3: #9e448e;
    --series-4: #8082f7;
    --series-5: #7844bb;
    --series-6: #ba75be;
    --chart-grid: #2f1b1a;
    --chart-axis: #c4aaa6;
    /* Depth and logos */
    --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
    --show-on-light: none;
    --show-on-dark: inline-block;
    color-scheme: dark;
  }
}

/* Dark guest, when it was chosen. The same values as the block above. */
[data-theme="dark"] [data-surface="guest"]:not([data-theme="light"]),
[data-theme="dark"][data-surface="guest"] {
  /* Surfaces: near-black with a warm cast */
  --bg: #0a0606;
  --surface: #130b0b;
  --surface-raised: #1b1010;
  --surface-sunken: #070404;
  --line: #2f1b1a;
  --line-strong: #4d2e2c;
  /* Text */
  --text: #f6efec;
  --text-strong: #f6efec;
  --text-muted: #c4aaa6;
  --text-faint: #7d6561;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #dc2420;
  --accent-line: #dc2420;
  --accent-hover: #ba1a16;
  --accent-bright: #e90000;
  --on-accent: #ffffff;
  --accent-soft: #2b0d0c;
  --link: #ff6b64;
  --ok: #4ade80;
  --ok-soft: #0d2616;
  --warn: #fbbf24;
  --warn-soft: #2e2108;
  --bad: #f87171;
  --bad-soft: #331214;
  --info: #60a5fa;
  --info-soft: #10213f;
  /* The bands */
  --band-red: #ba1a16;
  --band-maroon: #3b0000;
  --on-band: #ffffff;
  --on-band-muted: #f1d9d6;
  /* Pace */
  --pace-wait: #a1a1aa;
  --pace-ok: #4ade80;
  --pace-warn: #fbbf24;
  --pace-bad: #f87171;
  --on-pace-wait: #09090b;
  --on-pace-ok: #09090b;
  --on-pace-warn: #09090b;
  --on-pace-bad: #09090b;
  /* Chart series */
  --series-1: #236ade;
  --series-2: #19a1c9;
  --series-3: #9e448e;
  --series-4: #8082f7;
  --series-5: #7844bb;
  --series-6: #ba75be;
  --chart-grid: #2f1b1a;
  --chart-axis: #c4aaa6;
  /* Depth and logos */
  --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
  --show-on-light: none;
  --show-on-dark: inline-block;
  color-scheme: dark;
}

/* ---- Stage screens (data-surface="stage"): the door and room screens, which run in dark rooms. They never follow the
   theme, so these two blocks are not inside a prefers-color-scheme query and no selector here mentions data-theme.
   They go last, and set every color, so a stage panel stays dark inside a light page, on <html> or on any element.
   The accent is a fill with its own text here, so --accent-line is its line form (a pressed or selected edge), and the
   focus ring has its own color. --text-strong is the brightest text, for the room's Next names. */

/* Dark stage: the door screen's palette. Its blues and greens are lifted a little where AA needed it. */
[data-surface="stage"][data-stage="dark"] {
  /* Surfaces */
  --bg: #101214;
  --surface: #181b1f;
  --surface-raised: #1f2328;
  --surface-sunken: #0b0d0f;
  --line: #2a2f36;
  --line-strong: #46505c;
  /* Text */
  --text: #e6e8eb;
  --text-strong: #ffffff;
  --text-muted: #8a929c;
  --text-faint: #6b737d;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #a8322a;
  --accent-line: #ec7a72;
  --accent-hover: #bf3b32;
  --on-accent: #ffffff;
  --accent-soft: #2a1311;
  --link: #ec7a72;
  --ok: #3fb27f;
  --ok-soft: #0f2a1f;
  --warn: #d7a13b;
  --warn-soft: #2a1f0a;
  --bad: #e8665c;
  --bad-soft: #321412;
  --info: #6ea8ff;
  --info-soft: #10213f;
  --focus-ring: #6ea8ff;
  /* Pace */
  --pace-wait: #8a929c;
  --pace-ok: #3fb27f;
  --pace-warn: #d7a13b;
  --pace-bad: #e8665c;
  --on-pace-wait: #101214;
  --on-pace-ok: #101214;
  --on-pace-warn: #101214;
  --on-pace-bad: #101214;
  /* Chart series */
  --series-1: #236ade;
  --series-2: #19a1c9;
  --series-3: #9e448e;
  --series-4: #8082f7;
  --series-5: #8a58c9;
  --series-6: #ba75be;
  --chart-grid: #2a2f36;
  --chart-axis: #8a929c;
  /* Depth and logos */
  --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4);
  --show-on-light: none;
  --show-on-dark: inline-block;
  color-scheme: dark;
}

/* Red stage: the room screen's palette, black and red with no bright fills, so a hidden tablet does not glow.
   The text reds are lifted a little from the room page's, to read at AA. DONE is a dark fill with red text. */
[data-surface="stage"][data-stage="red"] {
  /* Surfaces */
  --bg: #000000;
  --surface: #0b0303;
  --surface-raised: #120403;
  --surface-sunken: #060505;
  --line: #2a0f0b;
  --line-strong: #5a1e16;
  /* Text */
  --text: #d8624a;
  --text-strong: #f0573a;
  --text-muted: #857673;
  --text-faint: #964c3c;
  /* The edge of a control must read at 3:1 against the page, so it is the faint text color of the same surface. */
  --control-line: var(--text-faint);
  /* Accent and status */
  --accent: #1a0605;
  --accent-line: #e0654c;
  --accent-hover: #240907;
  --on-accent: #d8624a;
  --accent-soft: #1f0807;
  --link: #e0654c;
  --ok: #3f9f55;
  --ok-soft: #07160b;
  --warn: #d08a2a;
  --warn-soft: #1c1204;
  --bad: #e0604f;
  --bad-soft: #240a07;
  --info: #7f9bbf;
  --info-soft: #0a1220;
  --focus-ring: #f0573a;
  /* Pace */
  --pace-wait: #857673;
  --pace-ok: #3f9f55;
  --pace-warn: #d08a2a;
  --pace-bad: #e0604f;
  --on-pace-wait: #000000;
  --on-pace-ok: #000000;
  --on-pace-warn: #000000;
  --on-pace-bad: #000000;
  /* Chart series */
  --series-1: #236ade;
  --series-2: #19a1c9;
  --series-3: #9e448e;
  --series-4: #8082f7;
  --series-5: #8a58c9;
  --series-6: #ba75be;
  --chart-grid: #2a0f0b;
  --chart-axis: #b9604d;
  /* Depth and logos */
  --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.8), 0 2px 6px rgb(0 0 0 / 0.6);
  --show-on-light: none;
  --show-on-dark: inline-block;
  color-scheme: dark;
}

/* A dialog's ::backdrop sits outside the page's tree, and in Safari before 17.4 and Chrome before 122 it does not inherit
   custom properties, so the dim would vanish. The two values are declared on it again, the same as in the first block. */
::backdrop {
  --scrim: rgb(0 0 0 / 0.5);
  --scrim-light: rgb(0 0 0 / 0.4);
}
