/* GLOBAL CSS FILE - Contains global styles that shouldn't be reset */

html {
  --scrollbar-gutter: 0px;
  scrollbar-gutter: stable; /* This is needed to prevent the scrollbar from jumping */

  &.lenis-stopped {
    --scrollbar-gutter: var(--scrollbar-width);
  }
}

* {
  scrollbar-width: thin;
}

html.overflow-hidden {
  overflow: hidden;
  touch-action: none;
}

body {
  min-height: 100vh;
  overscroll-behavior: none;
  background-color: var(--color-primary);
  color: var(--color-secondary);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection styling */
*::selection {
  background-color: var(--color-contrast);
  color: var(--color-primary);
}

/* SVG icon colors */
svg.icon {
  path[fill],
  rect[fill],
  circle[fill] {
    fill: currentColor;
  }
  path[stroke],
  rect[stroke],
  circle[stroke] {
    stroke: currentColor;
  }
}

/* Hover states */
.link {
  @media (--hover) {
    &:hover {
      text-decoration: underline;
    }
  }
}

/* Focus states */
*:focus-visible {
  outline: 2px solid var(--color-contrast);
}

html.scrollbar-grabbing,
img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -o-user-select: none;
  user-select: none;
}

button {
  cursor: pointer;
}

html.screenshot {
  *:not(:has(canvas), canvas, :has(#orchestra), #orchestra, #orchestra *) {
    /* biome-ignore lint: it's all good */
    opacity: 0 !important;
  }
}
