/* ============================================================================
   RETRIVIUM — base
   Reset and element defaults. Load after tokens.css, before components.css.
   ============================================================================ */

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

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

body {
  margin: 0;
  background: var(--color-ground);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, dl, dd, dt, figure, pre, ul, ol, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-weight: var(--weight-semi);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

a { color: inherit; text-underline-offset: 3px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

svg { display: block; }

img, video { max-width: 100%; height: auto; }

/* Focus. Visible on every interactive element, in both themes, including on
   the garnet action bar — the offset is what keeps it legible there. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Digits that sit in columns must not jitter. */
.tabular { font-variant-numeric: tabular-nums; }

/* Prose measure. Apply to any running text on Records / Concept / Instrumentation. */
.measure { max-width: var(--measure); }

/* Screen-reader-only, for the non-colour redundancy on state glyphs. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Wide content never makes the page scroll sideways. */
.scroll-x { overflow-x: auto; }

/* Reduced motion is honoured globally, not per component. The trace player
   must still be steppable by hand when this is on — see MOTION.md. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
