/* Sonic_Gio: reset and base styles. Phase 1. */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: inherit;
  font-size: inherit;
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--cream);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}

a:hover {
  color: var(--orange-hover);
}

ul, ol {
  list-style: none;
  padding: 0;
}

/* Display face helper */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--display-tracking);
}

/* Focus: visible on everything that can take it */
:focus {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--bg);
}

:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--bg);
}

/* Visually hidden, still read by screen readers */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion: one block, stops everything */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
