/* rypt-scalar.css - the Scalar API reference in the rypt brand.
 *
 * Every colour comes from /css/tokens.css, loaded first. Scalar's own theme rules sit in
 * cascade layers (scalar-base, scalar-theme), so these unlayered ones win without
 * !important. The L2 tokens already flip between light and dark (on data-theme, or on
 * prefers-color-scheme), so one block serves Scalar's .light-mode and .dark-mode alike.
 *
 * The brand rules hold here too: interaction is ink, never seal; brass marks paid tiers
 * only, so it is not used; no italics; methods and status codes are told apart by their
 * words, not by hue.
 */

:root {
  --bar-height: 3.5rem;
  --scalar-custom-header-height: var(--bar-height);
}

:root,
.light-mode,
.dark-mode {
  --scalar-font: var(--font-sans);
  --scalar-font-code: var(--font-mono);

  --scalar-color-1: var(--text);
  --scalar-color-2: var(--text-muted);
  --scalar-color-3: var(--text-muted);
  --scalar-color-accent: var(--interactive);
  --scalar-color-disabled: var(--text-disabled);
  --scalar-color-ghost: var(--text-subtle);

  --scalar-background-1: var(--bg-page);
  --scalar-background-2: var(--bg-surface);
  --scalar-background-3: var(--bg-sunken);
  --scalar-background-accent: var(--bg-hover);
  --scalar-border-color: var(--border);

  --scalar-link-color: var(--interactive);
  --scalar-link-color-hover: var(--interactive-hover);
  --scalar-button-1: var(--interactive);
  --scalar-button-1-hover: var(--interactive-hover);
  --scalar-button-1-color: var(--interactive-text);

  --scalar-color-green: var(--text);
  --scalar-color-red: var(--text);
  --scalar-color-yellow: var(--text);
  --scalar-color-blue: var(--text);
  --scalar-color-orange: var(--text);
  --scalar-color-purple: var(--text);

  --scalar-sidebar-background-1: var(--bg-page);
  --scalar-sidebar-color-1: var(--text);
  --scalar-sidebar-color-2: var(--text-muted);
  --scalar-sidebar-color-active: var(--text);
  --scalar-sidebar-item-hover-background: var(--bg-hover);
  --scalar-sidebar-item-hover-color: var(--text);
  --scalar-sidebar-item-active-background: var(--bg-sunken);
  --scalar-sidebar-border-color: var(--border);
  --scalar-sidebar-search-background: var(--bg-page);
  --scalar-sidebar-search-color: var(--text-muted);
  --scalar-sidebar-search-border-color: var(--border-control);
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
}

/* No italics anywhere: the brand forbids them and none of the faces ship one. */
#app,
#app * {
  font-style: normal;
}

/* The bar above the reference: back to the guides and the rest of rypt.dev, as the
   docs header has it. Scalar offsets its sidebar and content by
   --scalar-custom-header-height from 1000px up, so there the bar is fixed over that
   space; below 1000px its menu bar sticks just under ours, so ours stays in the flow. */
.bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  box-sizing: border-box;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 16px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}

.bar .wordmark {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.bar nav {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.bar nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.bar a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (min-width: 1000px) {
  .bar {
    position: fixed;
  }
}

/* At phone width the bar keeps the wordmark and the way back to the guides. */
@media (max-width: 40rem) {
  .bar nav a:not(:first-child) {
    display: none;
  }
}

.noscript {
  max-width: 40rem;
  margin: 2rem auto;
  padding: 0 16px;
  font-family: var(--font-serif);
}

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