/* ==========================================================================
   BASE.CSS — Reset moderno + elementos base + tipografia
   Carregar depois de tokens.css.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  color: var(--ink-600);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button { cursor: pointer; }

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a { color: inherit; text-decoration: none; }

:target { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ---- Tipografia -------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink-900);
  text-wrap: balance;
}

h1 { font-size: var(--step-5); font-weight: 800; letter-spacing: var(--tracking-tighter); }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; }
h4 { font-size: var(--step-0); font-weight: 700; letter-spacing: 0; }

p { text-wrap: pretty; }

strong { color: var(--ink-900); font-weight: 700; }

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

/* ---- Foco acessível ---------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -100px;
  z-index: var(--z-top);
  padding: 0.7rem 1.1rem;
  background: var(--brand-700);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--space-md); }

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