/*
------------------------------------------------------------------------------------------------------------------------
 ------------------------------------------------------------------------------------------------------------------------
Index CSS File
------------------------------------------------------------------------------------------------------------------------
*/

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/onest-regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./assets/fonts/onest-medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/onest-bold.ttf') format('truetype');
}

/*
------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------
HTML CSS File
------------------------------------------------------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  box-sizing: border-box;
}

/*
------------------------------------------------------------------------------------------------------------------------
Scrollbar Utility
------------------------------------------------------------------------------------------------------------------------
*/

/*
  Animated scrollbar fade using @property:
  1. @property registers --_scrollbar-opacity as animatable <number> with inherits: true
  2. transition on the host element smoothly interpolates the value on :hover / :not(:hover)
  3. pseudo-elements inherit the in-progress value every frame via color-mix()

  This is the ONLY reliable way to animate scrollbar colors — transitions declared
  directly on ::-webkit-scrollbar-* pseudo-elements are silently ignored by browsers.
*/

@property --_scrollbar-opacity {
  syntax: '<number>';
  initial-value: 0;
  inherits: true;
}

.mud-overflow-scrollbar {
  --_scrollbar-opacity: 0;
  --_scrollbar-track-color: var(--scrollbar-track-background-neutral);
  --_scrollbar-thumb-color: var(--scrollbar-thumb-background-neutral-default);
  transition: --_scrollbar-opacity 0.35s ease;
}

.mud-overflow-scrollbar:hover {
    --_scrollbar-opacity: 1;
  }

.mud-overflow-scrollbar::-webkit-scrollbar {
    width: var(--scrollbar-track-size);
    height: var(--scrollbar-track-size);
  }

.mud-overflow-scrollbar::-webkit-scrollbar-track {
    border-radius: var(--scrollbar-track-radius);
    background-color: color-mix(
      in srgb,
      var(--_scrollbar-track-color) calc(var(--_scrollbar-opacity) * 100%),
      transparent
    );
  }

.mud-overflow-scrollbar::-webkit-scrollbar-corner {
    background-color: color-mix(
      in srgb,
      var(--_scrollbar-track-color) calc(var(--_scrollbar-opacity) * 100%),
      transparent
    );
  }

.mud-overflow-scrollbar::-webkit-scrollbar-thumb {
    border-radius: var(--scrollbar-thumb-radius);
    background-color: color-mix(
      in srgb,
      var(--_scrollbar-thumb-color) calc(var(--_scrollbar-opacity) * 100%),
      transparent
    );
  }

.mud-overflow-scrollbar.mud-overflow-scrollbar--primary {
    --_scrollbar-track-color: var(--scrollbar-track-background-primary);
    --_scrollbar-thumb-color: var(--scrollbar-thumb-background-primary-default);
  }

.overlay--white {
  position: relative;
  overflow: hidden;
}

.overlay--white::before {
  content: '';
  position: sticky;
  display: block;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  margin-bottom: -32px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-neutral-background-base) 80%, transparent),
    transparent
  );
  pointer-events: none;
  z-index: 1002;
}

.overlay--white::after {
  content: '';
  position: sticky;
  display: block;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  margin-top: -32px;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--color-neutral-background-base) 80%, transparent),
    transparent
  );
  pointer-events: none;
  z-index: 1002;
}

/* Black fade for light backgrounds */
.overlay--black {
  position: relative;
  overflow: hidden;
}

.overlay--black::before {
  content: '';
  position: sticky;
  display: block;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  margin-bottom: -32px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-neutral-background-base-inverted) 50%, transparent),
    transparent
  );
  pointer-events: none;
  z-index: 1002;
}

.overlay--black::after {
  content: '';
  position: sticky;
  display: block;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  margin-top: -32px;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--color-neutral-background-base-inverted) 50%, transparent),
    transparent
  );
  pointer-events: none;
  z-index: 1002;
}

