/* Reset enxuto e regras globais (DESIGN_SYSTEM 4.2, 4.5 e checklist da 8). */

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

* {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* Nada rola para o lado: um elemento largo demais nao estica o viewport do celular. */
  overflow-x: clip;
}

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

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

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

a {
  color: var(--action);
  text-underline-offset: 4px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Foco visivel em tudo que recebe teclado, offset de 2px (WCAG 2.4.13) */
:focus-visible {
  outline: 3px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--volt);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

/* Visivel so para leitor de tela */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Link de pular para o conteudo: aparece so no foco */
.pular {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-btn);
  background: var(--ink);
  color: var(--on-blue);
  font-weight: 800;
  text-decoration: none;
}
.pular:focus {
  top: var(--s-4);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Largura de leitura confortavel: 45-75 caracteres */
.medida {
  max-width: 65ch;
}

@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;
  }
}
