/* ==========================================================================
   Calculadora Nucleo: base
   Fonte self-hosted, reset mínimo, tipografia e utilitários.
   Regra do projeto: nenhum valor de cor, espaço, raio ou tempo solto aqui.
   Tudo vem de css/tokens.css.
   ========================================================================== */

/* ---- Fonte: Inter variável, subconjunto latino (licença OFL, assets/fonts) ----
   Cobre á é í ó ú ñ ü ç ã õ ¿ ¡ e os símbolos usados na ferramenta. */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Fallback com a métrica da Inter, para o texto não pular quando ela carrega.
   Valores calculados sobre o arquivo da Inter e a métrica da Arial:
   largura média 105,71%, ascendente 91,65%, descendente 22,82%. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 105.71%;
  ascent-override: 91.65%;
  descent-override: 22.82%;
  line-gap-override: 0%;
}

/* ---- Reset mínimo ---- */
[hidden] { display: none !important; }   /* hidden vence qualquer display de componente */
*, *::before, *::after { box-sizing: border-box; }
html { hanging-punctuation: first last; }
body {
  min-block-size: 100dvh;
  font-variant-numeric: tabular-nums;     /* todo número da ferramenta é tabular */
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, picture, svg, video { display: block; max-inline-size: 100%; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:where(button, [role="button"], a, input, select, textarea, summary) { touch-action: manipulation; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
a { color: var(--accent); text-underline-offset: 0.18em; }
::selection { background: var(--accent-fill); color: var(--on-accent); }

/* ---- Escala tipográfica ---- */
.t-caption  { font-size: var(--t-caption); line-height: 1.35; }
.t-footnote { font-size: var(--t-footnote); line-height: 1.4; }
.t-callout  { font-size: var(--t-callout); line-height: 1.45; }
.t-body     { font-size: var(--t-body); line-height: 1.5; }
.t-subhead  { font-size: var(--t-subhead); line-height: 1.35; }
.t-title3   { font-size: var(--t-title3); line-height: 1.2; font-weight: var(--peso-titulo); letter-spacing: var(--tracking-titulo); }
.t-title2   { font-size: var(--t-title2); line-height: 1.12; font-weight: var(--peso-titulo); letter-spacing: var(--tracking-titulo); }
.t-title1   { font-size: var(--t-title1); line-height: 1.08; font-weight: var(--peso-titulo); letter-spacing: var(--tracking-titulo); }
.t-display  { font-size: var(--t-display); line-height: 1.02; font-weight: var(--peso-titulo); letter-spacing: var(--tracking-titulo); }
.t-hero-number {
  font-size: var(--t-hero-number);
  line-height: 1;
  font-weight: var(--peso-titulo);
  letter-spacing: var(--tracking-titulo);
  font-variant-numeric: tabular-nums;
}
.t-leve   { font-weight: var(--peso-leve); }
.t-texto  { font-weight: var(--peso-texto); }
.t-forte  { font-weight: var(--peso-titulo); }
.t-2      { color: var(--text-2); }
.t-accent { color: var(--accent); }
.t-upper  { text-transform: uppercase; letter-spacing: 0.08em; }

/* ---- Utilitários de layout ---- */
.pilha > * + * { margin-block-start: var(--pilha, var(--s-4)); }
.linha { display: flex; flex-wrap: wrap; align-items: center; gap: var(--linha, var(--s-3)); }
.medida { max-inline-size: var(--medida-leitura); }
.envoltorio {
  inline-size: 100%;
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Só para leitor de tela */
.sr-only {
  position: absolute !important;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Logo em vetor: herda a cor do tema */
.logo { color: var(--logo); fill: currentColor; block-size: auto; }
.logo--completo { inline-size: auto; }

/* Grão do KV por cima do ambiente */
.kv-ambiente > .kv-grain { z-index: 1; }
.kv-ambiente > :not(.kv-orb, .kv-grain) { position: relative; z-index: 2; }
