/* =====================================================================
   base.css — reset enxuto + tipografia + elementos nativos
   Mobile-first: tudo aqui vale a partir de 390px.
   ===================================================================== */

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

* {
    margin: 0;
}

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

body {
    min-height: 100dvh;
    background-color: var(--fundo-app);
    color: var(--texto-padrao);
    font-family: var(--fonte-base);
    font-size: var(--texto-lg);
    line-height: var(--altura-normal);
    letter-spacing: var(--tracking-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* O atributo [hidden] do HTML vale `display: none` na folha do navegador,
   que perde para QUALQUER seletor de classe com `display`. Sem esta regra,
   `elemento.hidden = true` no JS não esconde nada em .botao, .tentativa,
   .julgamento e afins — foi exatamente o que aconteceu na tela de Revisar.
   Aqui o !important é o comportamento correto: [hidden] é uma afirmação
   sobre o documento, não uma sugestão de estilo. */
[hidden] {
    display: none !important;
}

/* ---------- Tipografia: hierarquia é o principal recurso visual ---------- */

h1,
h2,
h3,
h4 {
    font-family: var(--fonte-display);
    color: var(--texto-forte);
    font-weight: var(--peso-semi);
    line-height: var(--altura-apertada);
    letter-spacing: var(--tracking-apertado);
    text-wrap: balance;
}

h1 {
    font-size: var(--texto-2xl);
    font-weight: var(--peso-forte);
}

h2 {
    font-size: var(--texto-xl);
}

h3 {
    font-size: var(--texto-lg);
}

h4 {
    font-size: var(--texto-md);
    font-weight: var(--peso-medio);
}

p {
    text-wrap: pretty;
}

small {
    font-size: var(--texto-sm);
    color: var(--texto-suave);
}

strong,
b {
    font-weight: var(--peso-semi);
    color: var(--texto-forte);
}

a {
    color: var(--acento);
    text-decoration: none;
    font-weight: var(--peso-medio);
}

a:hover {
    color: var(--acento-hover);
    text-decoration: underline;
}

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

/* ---------- Formulários nativos ---------- */

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

button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

textarea {
    resize: vertical;
}

/* ---------- Foco: sempre visível, nunca removido ---------- */

:focus-visible {
    outline: none;
    box-shadow: var(--anel-foco);
    border-radius: var(--raio-sm);
}

/* ---------- Acessibilidade ---------- */

.visualmente-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Anime.js respeita esta preferência via JS; aqui cobrimos o CSS. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
