/* Design tokens. Every colour, size and radius used by the pages comes from here. */

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest. */
  --rail: #111418;
  --page: #181c21;
  --surface: #22272d;
  --raised: #2d333b;
  --line: #414953;

  /* Text. Each of these keeps at least 4.5:1 against --page and --surface. */
  --text: #edf0f3;
  --secondary: #bec6cf;
  --muted: #9aa6b2;

  --accent: #97e2c2;
  --on-accent: #10251c;
  --accent-dim: #2a4a3f;
  --danger: #ffa6a1;
  --focus: #b5d9ff;

  /* Spacing scale. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;

  --r-control: 8px;
  --r-card: 16px;

  --shadow-panel: -8px 0 32px rgb(0 0 0 / 28%);

  --rail-width: 224px;
  --rail-width-collapsed: 64px;
  --bar-height: 56px;
  --reading: 760px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Noto Sans SC", Roboto, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--page);
  color: var(--text);
  font: 15px / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

:is(.workbench-page, .account) {
  --rail: #20192b;
  --page: #281f36;
  --surface: #332641;
  --raised: #433154;
  --line: #655078;
  --text: #fff1fb;
  --secondary: #e5d4ed;
  --muted: #c8b4d5;
  --accent: #e0c7ff;
  --on-accent: #291b36;
  --accent-dim: #483257;
  --focus: #ffd2ea;
  --r-card: 14px;
  caret-color: var(--accent);
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="light"] :is(.workbench-page, .account) {
  --rail: #f1f8ed;
  --page: #f5fbef;
  --surface: #fbfff8;
  --raised: #e5efdf;
  --line: #8b9f8a;
  --text: #192e24;
  --secondary: #344f40;
  --muted: #465f51;
  --accent: #235943;
  --on-accent: #fff;
  --accent-dim: #d7ead8;
  --danger: #8e252a;
  --focus: #275b9b;
  background: linear-gradient(rgb(248 255 244 / 30%), rgb(248 255 244 / 30%)),
    var(--page) url('/static/yuan-day.webp') center bottom / cover fixed no-repeat;
}

:is(.workbench-page, .account) ::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.ui-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: var(--accent);
}

/* Components set `display` themselves; the hidden attribute must still hide them. */
[hidden] {
  display: none !important;
}

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

/* Anything that can take focus shows it. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Interactive targets are at least 44px on touch devices. */
button,
a.button,
input,
select {
  font: inherit;
  color: inherit;
}

button,
a.button {
  min-height: 44px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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