/*
 * main.css
 * Estilos estruturais globais. Nada específico de section aqui.
 *
 * Progressive enhancement: nenhum elemento é escondido por CSS
 * aguardando animação. O estado inicial (opacity 0 / deslocamento)
 * é aplicado pelo Anime.js em runtime — se o JS falhar, tudo continua visível.
 * Única exceção documentada: texto do Hero (ver sections/hero.css).
 *
 * A classe .js no <html> é adicionada por script inline no <head> (antes do
 * primeiro paint) e indica apenas que JavaScript está habilitado.
 */

html {
    scroll-behavior: smooth;
}

body {
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-body);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    /* Só existem as faces 400 e 600: nunca simular negrito artificial. */
    font-synthesis-weight: none;
}

/* Layout */

.container {
    width: min(
        calc(100% - (var(--container-padding) * 2)),
        var(--container-max-width)
    );

    margin-inline: auto;
}

.section {
    position: relative;
}

/* Typography */

h1,
h2,
h3,
h4 {
    font-weight: var(--font-weight-heading);
    line-height: var(--line-height-heading);
    text-wrap: balance;
}

/* Negrito inline usa a face DemiBold (não há 700). */
b,
strong {
    font-weight: var(--font-weight-demibold);
}

p {
    text-wrap: pretty;
}

/* Links & buttons */

a,
button {
    -webkit-tap-highlight-color: transparent;
}

button {
    background: none;
    color: inherit;
    cursor: pointer;
}

/* --color-focus pode ser sobrescrito por contexto (ex.: fundo escuro). */
:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
}

/* Utilities */

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

/* Visível apenas ao receber foco pelo teclado. */
.skip-link {
    position: fixed;
    top: var(--space-xs);
    left: var(--space-xs);
    z-index: calc(var(--z-header) + 1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    background: var(--color-background);
    color: var(--color-text);
    font-weight: var(--font-weight-body);
    transform: translateY(calc(-100% - var(--space-sm)));
}

.skip-link:focus {
    transform: none;
}

/* Aplicado pelo menu mobile enquanto aberto. */
.is-scroll-locked {
    overflow: hidden;
}

/* Accessibility: reduced motion */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
