/* Resets + global defaults shared by every page. */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.8;
  /* The serif defaults to old-style figures, where "1" looks like a small-cap
     "I" ("LEVEL ı"). Lining figures keep numbers legible; no effect on the
     pixel font. */
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
  /* Page-to-page navigation is a hard cut in a multi-page site; this makes
     each arrival ease in instead. Opacity only, so fixed children (HUD, the
     ambiance overlay) are unaffected. */
  animation: page-in 600ms ease;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  max-width: 100%;
  display: block;
}

h1, h2, h3, p {
  margin: 0;
}

button {
  font-family: inherit;
}

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

.screen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-3);
  text-align: center;
  position: relative;
}

.screen[hidden] {
  display: none;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
