/* Base element styling and shared primitives. */

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

::selection {
  background: var(--color-selection);
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* We manage focus rings explicitly; never show the UA ring on mouse press. */
:focus:not(:focus-visible) {
  outline: none;
}

/* Set while the window is being resized: crossing a breakpoint changes
   layout properties that would otherwise animate, which reads as a glitch. */
:root[data-resizing] *,
:root[data-resizing] *::before,
:root[data-resizing] *::after {
  transition: none !important;
}

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

.icon--lg {
  width: 20px;
  height: 20px;
}

.icon--sm {
  width: 14px;
  height: 14px;
}

/* Solid-fill glyphs (pin, star when active) opt out of stroke rendering. */
.icon--filled {
  fill: currentColor;
  stroke: none;
}

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

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1;
  color: var(--color-text-2);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
}

mark {
  padding: 0 1px;
  color: var(--color-mark-text);
  background: var(--color-mark);
  border-radius: var(--radius-xs);
}

hr {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--color-border);
}

/* Scrollbars: present but quiet. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-clip: content-box;
  background-color: var(--color-border-strong);
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-3);
}
