/* ==========================================================================
   Base: reset, typography, layout primitives
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Lock scrolling while the intro plays */
html.is-intro body { overflow: hidden; }

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}
p { text-wrap: pretty; }

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

::selection { background: var(--q-blue-500); color: var(--q-white); }

:focus-visible {
  outline: 2px solid var(--q-blue-300);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---- Layout primitives ------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

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

/* ---- Pixel rendering --------------------------------------------------- */

.pixelated,
.sprite { image-rendering: pixelated; shape-rendering: crispEdges; }

.sprite { overflow: visible; }
.sprite .px-W, .px-W { fill: var(--px-W); }
.sprite .px-S, .px-S { fill: var(--px-S); }
.sprite .px-L, .px-L { fill: var(--px-L); }
.sprite .px-B, .px-B { fill: var(--px-B); }
.sprite .px-D, .px-D { fill: var(--px-D); }
.sprite .px-N, .px-N { fill: var(--px-N); }
.sprite .px-K, .px-K { fill: var(--px-K); }
