*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  /* Firefox + standards spec — auto-adapts to light/dark via tokens. */
  scrollbar-width: thin;
  scrollbar-color: var(--pgsx-border) transparent;
}

/* WebKit (Chrome / Safari) doesn't honour `scrollbar-color`, so style the
   pseudo-elements directly. Track stays transparent; thumb picks up the
   theme's border colour so it sits subtly on either surface. */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

*::-webkit-scrollbar-thumb {
  background: var(--pgsx-border);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--pgsx-text-muted);
  background-clip: content-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--pgsx-bg);
  color: var(--pgsx-text-primary);
  font-family: var(--pgsx-font-body);
  font-size: var(--pgsx-text-base);
  line-height: var(--pgsx-leading-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--pgsx-duration-default) var(--pgsx-easing-standard);
}

a:hover {
  color: var(--pgsx-accent);
}

::selection {
  background: var(--pgsx-accent);
  color: var(--pgsx-accent-on);
}

button {
  font-family: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}
