* {
  @apply box-border;
}

html,
body,
#root {
  @apply m-0 h-full w-full p-0;
  color: var(--text);
  background: var(--bg-accent);
  font-family: var(--font-sans);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-normal);
  font-feature-settings: 'liga' 1, 'kern' 1, 'calt' 1;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  @apply relative;
  transition: background-color var(--dur-medium) var(--ease-smooth), color var(--dur-medium) var(--ease-smooth);
}

body.dialog-open {
  @apply overflow-hidden;
  overscroll-behavior: contain;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: 0;
  line-height: var(--leading-tight);
  margin: 0;
}

h1 { font-size: var(--font-4xl); }
h2 { font-size: var(--font-3xl); }
h3 { font-size: var(--font-xl); }
h4 { font-size: var(--font-lg); }

p {
  margin: 0;
  line-height: var(--leading-relaxed);
}

small {
  font-size: var(--font-sm);
  line-height: var(--leading-snug);
}

::selection {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}

/* --- custom scrollbar --- */
* {
  scrollbar-color: color-mix(in srgb, var(--muted) 34%, transparent) transparent;
  scrollbar-width: thin;
}

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

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

::-webkit-scrollbar-thumb {
  min-height: 44px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--primary) 38%, var(--muted) 22%);
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}
