:root {
  --scalar-custom-header-height: 52px;
  --portal-header-background: #1b355c;
  --portal-header-color: #ffffff;
  --portal-header-muted: #b8d8f8;
  --portal-page-background: #ffffff;
  --portal-text: #111827;
  --portal-link: #2985e7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --portal-page-background: #0f0f0f;
    --portal-text: #f3f4f6;
    --portal-link: #63bef7;
  }
}

body.light-mode {
  --portal-page-background: #ffffff;
  --portal-text: #111827;
  --portal-link: #2985e7;
}

body.dark-mode {
  --portal-page-background: #0f0f0f;
  --portal-text: #f3f4f6;
  --portal-link: #63bef7;
}

html,
body {
  margin: 0;
  background: var(--portal-page-background);
  color: var(--portal-text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--scalar-custom-header-height);
  padding: 0 16px;
  background: var(--portal-header-background);
  color: var(--portal-header-color);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.portal-brand-suffix {
  font-weight: 400;
  color: var(--portal-header-muted);
}

.portal-nav {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.portal-nav a {
  color: var(--portal-header-muted);
  text-decoration: none;
  white-space: nowrap;
}

.portal-nav a:hover {
  color: var(--portal-header-color);
}

.portal-brand:focus-visible,
.portal-nav a:focus-visible {
  outline: 2px solid var(--portal-header-muted);
  outline-offset: 3px;
  border-radius: 4px;
}

.portal-noscript {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 16px;
}

.portal-noscript a {
  color: var(--portal-link);
}

@media (max-width: 420px) {
  .portal-brand-suffix {
    display: none;
  }
}
