/* ────────────────────────────────────────────────────────────────────────────
   NEREU · base
   Reset, tipografia, focus i utilitats. Només tokens (tokens.css): cap hex.
   ────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html { width: 100%; max-width: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0; min-height: 100dvh;
  font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-regular);
  color: var(--c-text); background: var(--c-bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none; width: 100%; max-width: 100%; overflow-x: clip;
}

h1, h2, h3, h4 { margin: 0; color: var(--c-text); }
h1 { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: -.015em; }
h2 { font-family: var(--font-ui); font-weight: var(--fw-bold); font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: -.005em; }
h3 { font-family: var(--font-ui); font-weight: var(--fw-bold); font-size: var(--fs-h3); line-height: var(--lh-h3); }
p { margin: 0; }
b, strong { font-weight: var(--fw-bold); }
small { font-size: var(--fs-sm); line-height: var(--lh-sm); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, video, canvas, svg { max-width: 100%; }
img, video { height: auto; }
a { color: var(--c-accent); text-underline-offset: 2px; }
a:hover { color: var(--c-accent-hover); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--sp-6) 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
h1, h2, h3, p, li, a, button, span, div, dd, dt, td, th { overflow-wrap: anywhere; }
::selection { background: var(--c-accent-subtle); color: var(--c-text); }

/* Focus visible sempre, mai amb el ratolí: 2 px de l'accent amb 2 px d'aire. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: var(--r-xs); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }

/* Checkboxes i ràdios natius amb el color de la casa (mai el blau del navegador). */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--c-accent); }

/* Xifres: columnes iguals i, on calgui, la família de les xifres. */
.num, .tnum { font-variant-numeric: tabular-nums; }
.xifra { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: var(--fw-display); }

/* Només per al lector de pantalla. */
.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;
}

/* Barres de desplaçament discretes a escriptori. */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--c-border-strong) transparent; }
}

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