/* Base comum dos sites CODEX. Carregar depois de tokens.css. Valores só dos tokens. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/archivo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--line-strong); outline-offset: 2px; border-radius: var(--radius-sm); }

.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;
}

/* Ecrãs estreitos: desce um degrau na escala da marca, sem tamanhos novos. */
@media (max-width: 599px) {
  .display { font-size: 40px; line-height: 44px; letter-spacing: -0.01em; }
  .h1 { font-size: 28px; line-height: 34px; letter-spacing: 0; }
  .lead { font-size: 16px; line-height: 24px; }
}

/* Margem de página: space-4 em mobile, space-16 em ecrã largo. */
.wrap { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 900px) { .wrap { padding-inline: var(--space-16); } }

/* Idioma: o <html lang> decide o que se vê; sem JavaScript fica o PT. */
html:not([lang="en"]) [data-l="en"],
html[lang="en"] [data-l="pt"] { display: none !important; }

/* Rótulo de secção Q.0n */
.section-label { color: var(--accent); display: block; margin-bottom: var(--space-2); }

/* Seletor de idioma */
.lang-switch { display: flex; gap: var(--space-1); }
.lang-switch button {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); }
.lang-switch button:hover { color: var(--text); }
