/*
 * Copied from asafarim-os packages/theme/theme.css (tokens, the charcoal top bar and the theme toggle) so
 * breinhap.asafarim.site looks like every other *.asafarim.site host. Keep it in sync with that file.
 */
/*
 * @asafarim/theme: the ASafariM OS look, shared by asafarim.site, id.asafarim.site and every app.
 * Load it before the page's own stylesheet; the page keeps only what is its own.
 *
 * Two themes. Light: a cool light-blue page, white cards, navy actions. Dark: charcoal, with light-blue
 * actions. The top bar (.os-topbar) is charcoal in both. The theme follows the system until someone
 * picks one with the toggle (theme.js), which sets data-theme="light|dark" on <html> and remembers it in
 * the asafarim-theme cookie, shared by every *.asafarim.site host.
 *
 * Tokens: --bg (page), --card and --card-2 (surfaces), --ink, --muted, --line, --accent (actions, links),
 * --accent-hover, --accent-ink (text on the accent), --accent-soft (tints), --bad/--bad-ink, --good,
 * --warn/--warn-bg, --shadow, the top bar's --top-*, and the ASafariM brand's --brand-a/--brand-b
 * (marks and logos keep them in both themes).
 */
:root {
  color-scheme: light;
  --bg: #d8e6f1;
  --card: #ffffff;
  --card-2: #eef4f9;
  --ink: #15212b;
  --muted: #4b5b69;
  --line: #b9cfdf;
  --accent: #0f4c6e;
  --accent-hover: #0b3a55;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 76, 110, 0.1);
  --bad: #b91c1c;
  --bad-ink: #ffffff;
  --good: #166534;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --shadow: 0 1px 2px rgba(21, 33, 43, 0.06), 0 6px 20px rgba(21, 33, 43, 0.07);
  --top-bg: #222222;
  --top-ink: #f4f4f4;
  --top-muted: #c2c2c2;
  --top-card: #2e2e2e;
  --top-line: #404040;
  --top-accent: #8bb9e2;
  --top-accent-ink: #0d1b26;
  --brand-a: #fbbf24;
  --brand-b: #ea580c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #262626;
    --card: #1c1c1c;
    --card-2: #303030;
    --ink: #f2f2f2;
    --muted: #b5b5b5;
    --line: #3d3d3d;
    --accent: #7fb0dc;
    --accent-hover: #a2c7ea;
    --accent-ink: #0d1b26;
    --accent-soft: rgba(127, 176, 220, 0.14);
    --bad: #f87171;
    --bad-ink: #1c1c1c;
    --good: #86efac;
    --warn: #fcd34d;
    --warn-bg: #3a2e0c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --top-bg: #161616;
  }
}
/* The same dark values, picked with the toggle (keep the two blocks equal; the package's test checks). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262626;
  --card: #1c1c1c;
  --card-2: #303030;
  --ink: #f2f2f2;
  --muted: #b5b5b5;
  --line: #3d3d3d;
  --accent: #7fb0dc;
  --accent-hover: #a2c7ea;
  --accent-ink: #0d1b26;
  --accent-soft: rgba(127, 176, 220, 0.14);
  --bad: #f87171;
  --bad-ink: #1c1c1c;
  --good: #86efac;
  --warn: #fcd34d;
  --warn-bg: #3a2e0c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --top-bg: #161616;
}

/*
 * The charcoal top bar. Inside it the page tokens become the bar's, so whatever sits in it (links, the
 * app switcher and user menu of @asafarim/app-sdk, which read --ink, --card, --line and --accent, menus
 * included) matches the bar without knowing about it.
 */
.os-topbar {
  --ink: var(--top-ink);
  --muted: var(--top-muted);
  --card: var(--top-card);
  --card-2: var(--top-card);
  --line: var(--top-line);
  --accent: var(--top-accent);
  --accent-hover: var(--top-ink);
  --accent-ink: var(--top-accent-ink);
  --accent-soft: rgba(139, 185, 226, 0.16);
  color-scheme: dark;
  background: var(--top-bg);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* The light/dark toggle (toggle.html, or <ThemeToggle /> from @asafarim/theme/react): a sun that sets into a moon. */
.os-theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.os-theme-toggle:hover {
  background: var(--card);
  border-color: var(--muted);
}
.os-theme-toggle:active {
  transform: scale(0.92);
}
.os-theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.os-theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  overflow: visible;
}
.os-theme-rays,
.os-theme-core {
  transform-origin: 12px 12px;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s;
}
.os-theme-bite {
  transform: translate(9px, -9px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Dark, by choice or by the system: the moon. */
:root[data-theme="dark"] .os-theme-rays {
  transform: rotate(-90deg) scale(0.3);
  opacity: 0;
}
:root[data-theme="dark"] .os-theme-core {
  transform: scale(1.5);
}
:root[data-theme="dark"] .os-theme-bite {
  transform: translate(0, 0);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .os-theme-rays {
    transform: rotate(-90deg) scale(0.3);
    opacity: 0;
  }
  :root:not([data-theme="light"]) .os-theme-core {
    transform: scale(1.5);
  }
  :root:not([data-theme="light"]) .os-theme-bite {
    transform: translate(0, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .os-theme-toggle,
  .os-theme-toggle * {
    transition: none !important;
  }
}

