/* The landing page's look for the app and the auth pages: its palette, fonts, spacing, radius and
   button, the same values as Views/Home/Partials/head.ejs and assets/site/system.css, so the app
   doesn't need the whole site system. Dark mode follows the .theme-dark class on <html> and the
   "dark" key in localStorage, which the landing page and the app share. */

:root {
  --p-bg: #f9fafb; --p-surface: #f4f5f7; --p-ink: #24262d; --p-muted: #707275;
  --p-accent: #7e3af2; --p-accent-ink: #ffffff; --p-action: #7e3af2; --p-action-ink: #ffffff;
  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-text: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.028em;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --t-label: 13px; --t-small: 14px; --t-body: 16px; --t-card: 18px; --t-h3: 24px;
  --t-stat: clamp(28px, .952vw + 24.29px, 38px);
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-btn: 8px;
  --btn-h: 44px; --btn-h-sm: 36px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 180ms;

  --card-bg: #ffffff;
  --ok: #0e9f6e; --warn: #c27803; --bad: #e02424; --info: #3f83f8; --teal: #0694a2;
  /* the lit lavender ground behind the earnings chart and the auth pages' panel */
  --ground-bg: #dcd7fe; --ground-surface: #edebfe; --ground-ink: #24262d; --ground-muted: #4c4f52; --ground-accent: #7e3af2;
}
html.theme-dark {
  --p-bg: #121317; --p-surface: #1a1c23; --p-ink: #e5e7eb; --p-muted: #9e9e9e;
  --p-accent: #ac94fa; --p-accent-ink: #121317; --p-action: #7e3af2; --p-action-ink: #ffffff;
  --card-bg: #1a1c23;
  --ok: #31c48d; --warn: #e3a008; --bad: #f98080; --info: #76a9fa; --teal: #16bdca;
  --ground-bg: #2d2552; --ground-surface: #3a3068; --ground-ink: #f4f5f7; --ground-muted: #c3bce6; --ground-accent: #ac94fa;
  color-scheme: dark;
}
:root {
  --bg: var(--p-bg); --surface: var(--p-surface); --ink: var(--p-ink); --muted: var(--p-muted);
  --accent: var(--p-accent); --accent-ink: var(--p-accent-ink);
  --action: var(--p-action); --action-ink: var(--p-action-ink);
  --line: color-mix(in oklab, var(--ink) 11%, transparent);
  --line-strong: color-mix(in oklab, var(--ink) 20%, transparent);
}

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* the logo mark, the landing page's ring */
.mark {
  display: inline-block; flex: none; width: 22px; height: 22px; background: var(--accent);
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 5.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9z'/%3E%3C/svg%3E");
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--btn-h); padding: 0 var(--s-5); border-radius: var(--r-btn); border: 1px solid transparent;
  font: 500 var(--t-body)/1 var(--font-text); letter-spacing: 0; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn--primary { background: var(--action); color: var(--action-ink); }
.btn--primary:hover { background: color-mix(in oklab, var(--action) 86%, var(--ink)); }
.btn--secondary { background: var(--card-bg); color: var(--ink); border-color: var(--line-strong); }
.btn--secondary:hover { background: color-mix(in oklab, var(--card-bg) 94%, var(--ink)); border-color: color-mix(in oklab, var(--ink) 35%, transparent); }
.btn--sm { height: var(--btn-h-sm); padding: 0 var(--s-4); font-size: var(--t-small); }

.t-stat {
  font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--t-stat);
  line-height: 1; letter-spacing: var(--display-tracking); font-variant-numeric: tabular-nums;
}

/* light and dark, a moon in light mode and a sun in dark */
.theme-btn .sun { display: none; }
html.theme-dark .theme-btn .sun { display: block; }
html.theme-dark .theme-btn .moon { display: none; }

/* ------------------------------------------------------------ the message popup (ShowMessage in Navigation.js) */
.msg {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: var(--s-4);
  background: rgb(18 19 23 / .5); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .15s var(--ease);
}
.msg.is-on { opacity: 1; }
.msg__card {
  width: min(440px, 100%); border-radius: var(--r-lg); background: var(--card-bg); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 24px 64px rgb(0 0 0 / .24);
  transform: translateY(8px) scale(.98); transition: transform .15s var(--ease);
  font-family: var(--font-text);
}
.msg.is-on .msg__card { transform: none; }
.msg__body { display: flex; gap: var(--s-4); padding: var(--s-5); }
.msg__ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; color: var(--c); background: color-mix(in oklab, var(--c) 14%, transparent); }
.msg__ico .icon { width: 22px; height: 22px; }
.msg__body > div { min-width: 0; }
.msg__body h2 { margin: 0; font-family: var(--font-text); font-size: 18px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; color: var(--c); }
.msg__body p { margin: 4px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.msg__foot {
  display: flex; justify-content: flex-end; padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--surface) 60%, var(--card-bg)); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
@media (prefers-reduced-motion: reduce) { .msg, .msg__card { transition: none; } }
