/* ==========================================================================
   RESET & BROWSER OVERRIDES
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
  font-family: var(--font-secondary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent horizontal overflow scrolling only on mobile devices to allow desktop sticky position */
@media (max-width: 767.98px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(108, 93, 211, 0.25);
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg-dark);
  transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(108, 93, 211, 0.45);
}

/* Text Selection Override */
::selection {
  background-color: rgba(168, 85, 247, 0.3);
  color: var(--color-text-light);
}

/* Remove default focus styles, but retain outlines for keyboard accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Image Reset */
img,
svg {
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

/* Buttons Reset */
button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Hide focus rings on mouse-click, but show on keyboard tab */
*:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}
