/* ============================================================
 * TYPOGRAPHY — Inter Variable + escala iOS (HIG)
 * Body = 17px (norma Apple, decisao consciente vs 14/16 web)
 * Copyright (c) 2026 Mestre dos Cabos — chargexdev
 * ============================================================ */

/* Carregue Inter Variable via @fontsource ou Google Fonts:
   <link rel="preconnect" href="https://rsms.me/">
   <link rel="stylesheet" href="https://rsms.me/inter/inter.css">
*/

:root {
  /* ---------- Font families ---------- */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "Geist Mono", "SF Mono", "JetBrains Mono", ui-monospace,
               "Menlo", monospace;
  --font-rounded: "Nunito", "SF Pro Rounded", var(--font-sans);

  /* ---------- Escala tipografica (HIG iOS mapeado para web) ---------- */
  /* Formato: --text-{NOME}: <size> / <line-height>; weight separado */
  --text-large-title: 34px;   --lh-large-title: 41px;
  --text-title-1:     28px;   --lh-title-1:     34px;
  --text-title-2:     22px;   --lh-title-2:     28px;
  --text-title-3:     20px;   --lh-title-3:     25px;
  --text-headline:    17px;   --lh-headline:    22px;  /* weight 600 */
  --text-body:        17px;   --lh-body:        22px;  /* default — sempre 17 */
  --text-callout:     16px;   --lh-callout:     21px;
  --text-subheadline: 15px;   --lh-subheadline: 20px;
  --text-footnote:    13px;   --lh-footnote:    18px;
  --text-caption-1:   12px;   --lh-caption-1:   16px;
  --text-caption-2:   11px;   --lh-caption-2:   13px;

  /* ---------- Pesos ---------- */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;
}

/* ---------- Defaults ---------- */
html {
  font-size: 100%;  /* base 16px; tudo em rem para suportar Dynamic Type */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--label);
  background: var(--bg-system);

  /* Font features Apple-like */
  font-feature-settings: "cv11", "ss01", "ss03"; /* Inter: alt 1, single-storey a/g */
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;   /* aproxima tracking do SF Pro */
}

/* ---------- Utility classes ---------- */
.text-large-title { font-size: var(--text-large-title); line-height: var(--lh-large-title); font-weight: var(--fw-regular); letter-spacing: -0.025em; }
.text-title-1     { font-size: var(--text-title-1);     line-height: var(--lh-title-1);     font-weight: var(--fw-regular); letter-spacing: -0.022em; }
.text-title-2     { font-size: var(--text-title-2);     line-height: var(--lh-title-2);     font-weight: var(--fw-regular); letter-spacing: -0.020em; }
.text-title-3     { font-size: var(--text-title-3);     line-height: var(--lh-title-3);     font-weight: var(--fw-regular); letter-spacing: -0.018em; }
.text-headline    { font-size: var(--text-headline);    line-height: var(--lh-headline);    font-weight: var(--fw-semibold); }
.text-body        { font-size: var(--text-body);        line-height: var(--lh-body);        font-weight: var(--fw-regular); }
.text-callout     { font-size: var(--text-callout);     line-height: var(--lh-callout);     font-weight: var(--fw-regular); }
.text-subheadline { font-size: var(--text-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-regular); }
.text-footnote    { font-size: var(--text-footnote);    line-height: var(--lh-footnote);    font-weight: var(--fw-regular); color: var(--label-secondary); }
.text-caption-1   { font-size: var(--text-caption-1);   line-height: var(--lh-caption-1);   font-weight: var(--fw-regular); color: var(--label-secondary); }
.text-caption-2   { font-size: var(--text-caption-2);   line-height: var(--lh-caption-2);   font-weight: var(--fw-regular); color: var(--label-tertiary); }

/* ---------- Numeric (sempre tabular em colunas) ---------- */
.tabular-nums { font-variant-numeric: tabular-nums; }
.metric, .currency, .timestamp, table td.num, table th.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "lnum";
}

/* ---------- Code ---------- */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-feature-settings: "calt" 0;
}
