/* ============================================================
   SITE RAIZ — base: reset, tipografia, grão, superfícies do navegador.
   Nenhuma cor, medida ou fonte solta: tudo vem de tokens.css (--s-*).
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  background: var(--s-fundo);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--s-topo) + var(--gap-2));
  scrollbar-color: var(--s-linha-forte) var(--s-poco);
  scrollbar-width: thin;
}

body {
  min-height: 100vh;
  background: var(--s-fundo);
  color: var(--s-texto);
  font-family: var(--s-fonte);
  font-size: var(--s-corpo);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss03";
  overflow-x: clip;
  caret-color: var(--s-acento-forte);
}

/* grão de filme da CASA: tira o digital chapado de toda superfície */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='170' height='170'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='170' height='170' filter='url(%23g)'/></svg>");
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; }
fieldset { border: 0; min-width: 0; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: var(--s-tracking-h);
  color: var(--s-texto);
  text-wrap: balance;
}
h1 { font-size: var(--s-h1); line-height: 1.06; letter-spacing: var(--s-tracking-h1); }
h2 { font-size: var(--s-h2); line-height: 1.08; }
h3 { font-size: var(--s-h3); line-height: 1.25; }
h4 { font-size: var(--s-h4); line-height: 1.3; }

p { color: var(--s-texto-2); text-wrap: pretty; }
strong { color: var(--s-texto); font-weight: 600; }

::selection { background: var(--s-acento-forte); color: var(--s-texto); }

:focus-visible {
  outline: 2px solid var(--s-acento);
  outline-offset: 3px;
  border-radius: var(--s-raio-foco);
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--s-poco); }
::-webkit-scrollbar-thumb {
  background: var(--s-linha-forte);
  border-radius: var(--s-pilula);
  border: 3px solid var(--s-poco);
}
::-webkit-scrollbar-thumb:hover { background: var(--s-acento-forte); }

/* marcador do topo: o topo ganha corpo quando ele sai da tela */
.sentinela { position: absolute; top: 0; left: 0; width: 1px; height: 8px; pointer-events: none; }

.pular {
  position: fixed;
  left: var(--gap-2);
  top: var(--gap-2);
  z-index: 400;
  padding: 12px 18px;
  border-radius: var(--s-pilula);
  background: var(--s-suspenso);
  border: 1px solid var(--s-linha-forte);
  color: var(--s-texto);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-200%);
  transition: transform var(--s-medio), opacity var(--s-medio);
}
.pular:focus-visible { opacity: 1; pointer-events: auto; transform: none; }

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

main:focus { outline: none; }

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

/* animação de seção fora da tela fica parada (site.js marca .em-pausa) */
.em-pausa, .em-pausa * { animation-play-state: paused !important; }
