/* ============================================================
   BOOKATOON — Base, reset e acessibilidade estrutural

   Etapa 2 da migração de @layer (docs/layer-proposal.md) — envolvido em
   @layer base. Os 2 !important que existiam aqui (kill-switch de
   data-motion="off" e o fallback de forced-colors) saíram para
   css/overrides.css / @layer overrides — dentro de layers, !important
   inverte a prioridade (a PRIMEIRA layer declarada vence entre
   !importants, não a última), então mantê-los em "base" faria o
   oposto do que o nome "overrides" promete.
   ============================================================ */
@layer base {

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

* {
  margin: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
  background-color: var(--bg-page);
  overflow-x: clip;
  /* Cursor ilustrado (--cursor-default/--cursor-hand em tokens.css) */
  cursor: var(--cursor-default);
}

/* Mãozinha em qualquer link/botão — sem isto, o cursor custom do
   body venceria o "dedinho" nativo do navegador em links que não
   têm "cursor: pointer" escrito explicitamente em algum outro CSS. */
a[href],
button:not(:disabled),
[role="button"],
select,
label[for] {
  cursor: var(--cursor-hand);
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-display);
  font-weight: 600;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p {
  max-width: var(--measure);
}

a {
  color: inherit;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* ---- Foco visível: grosso, colorido e bonito ---- */
:focus-visible {
  outline: 4px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: var(--z-skip);
  padding: 0.9rem 1.4rem;
  background: var(--ink);
  color: var(--branco);
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-decoration: none;
  border-radius: var(--r-md);
  border: var(--stroke) solid var(--ambar);
  transition: top var(--dur-micro) var(--ease-energy);
}

.skip-link:focus-visible {
  top: 1rem;
}

/* ---- Utilitários ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2.5rem, 74rem);
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2rem, 84rem);
}

/* ============================================================
   MOTION — sistema de revelação por scroll
   O conteúdo é visível por padrão; a classe .js-reveal só
   esconde quando o JS está ativo E o usuário aceita movimento.
   ============================================================ */

[data-reveal] {
  --reveal-y: 22px;
}

.motion-on [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-y)) scale(0.98);
  transition:
    opacity var(--dur-entrada) var(--ease-suave),
    transform var(--dur-entrada) var(--ease-energy);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-on [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Loops decorativos: só rodam com motion ligado e sem pausa */
.loop-anim {
  animation-play-state: paused;
}

.motion-on:not([data-decor-paused="true"]) .loop-anim {
  animation-play-state: running;
}

/* prefers-reduced-motion: experiência completa, sem deslocamentos */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

html[data-motion="off"] {
  scroll-behavior: auto;
}

} /* fim de @layer base — os 2 !important que estavam aqui (kill-switch
     de data-motion="off" e fallback de forced-colors) foram para
     css/overrides.css / @layer overrides */
