/* Minimal reset and defaults built on tokens.css */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Scrollbar: one thin LED-blue line, no track, no glow. Full colour only under the pointer.
   WebKit rules do the look in Chrome and Safari; Firefox gets its thin version in the same colour. */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgb(49 187 238 / 0.55);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  background-color: var(--led-500);
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: rgb(49 187 238 / 0.7) transparent;
  }
}

/* In-page links glide instead of jumping */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-stretch: var(--stretch-body);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.surface-dark,
.surface-light {
  background: var(--bg);
  color: var(--fg);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: var(--weight-heading);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

p {
  margin: 0;
}

/* Keeps short compounds such as "e-mail" on one line */
.nowrap {
  white-space: nowrap;
}

/* Read by screen readers, not shown */
/* hidden must beat any component's own display (buttons are flex, stats are grid…) */
[hidden]:not([hidden="until-found"]) {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
