/* css/fonts.css — fontes self-hosted (gerado por self-host-google-fonts.js).
   Só o subset "latin" (U+0000-00FF) — cobre 100% dos acentos do PT-BR.
   Substitui o <link rel=stylesheet> do fonts.googleapis.com (render-blocking
   de terceiro, ~1.4-1.7s de FCP medido no Emma Café Bistrot). */

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-400-normal-latin-ext.woff2?v=20260721') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-400-normal-latin.woff2?v=20260721') format('woff2');
  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;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-500-normal-latin-ext.woff2?v=20260721') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-500-normal-latin.woff2?v=20260721') format('woff2');
  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;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-700-normal-latin-ext.woff2?v=20260721') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/noto-sans-jp-700-normal-latin.woff2?v=20260721') format('woff2');
  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 metricas casadas — fecha o CLS do swap (2026-07-21) ───
   `font-display:swap` sempre pinta o texto primeiro com a fonte de fallback
   da pilha (`system-ui`) e troca pra Noto Sans JP assim que ela termina de
   baixar. Essa troca sozinha ja causava CLS 0,16-0,19 em /cardapio e
   /manifesto (blocos de texto longos), porque `system-ui`/Arial e Noto Sans
   JP tem metricas (altura de linha, largura media de caractere) diferentes.
   Esta familia "Noto Sans JP Fallback" usa `size-adjust`/`ascent-override`/
   `descent-override`/`line-gap-override` pra fazer a fonte local (Arial e
   equivalentes metricamente compativeis: Helvetica, Liberation Sans, Arimo)
   ocupar EXATAMENTE o mesmo espaco que a Noto Sans JP vai ocupar depois —
   a troca continua acontecendo, so que sem mover nenhum pixel.
   Valores RECALCULADOS em 2026-07-21 medindo os arquivos .woff2 CORRETOS
   (instancias estaticas reais 400/Regular, 500/Medium, 700/Bold — geradas
   via fontTools varLib.instancer a partir do variable font oficial do
   repositorio google/fonts, ver gotcha no context.md do performance-expert)
   contra Arial real (macOS, /System/Library/Fonts/Supplemental/). Os valores
   anteriores (xWidthAvg=439, iguais para 400/500/700) foram medidos em cima
   do arquivo Thin(100) ERRADO que os 3 pesos serviam por engano e ja NAO
   valem — substituidos por estes:
     Noto Sans JP 400: ascent=1160 descent=-288 lineGap=0 unitsPerEm=1000 xWidthAvg=467
     Noto Sans JP 500: ascent=1160 descent=-288 lineGap=0 unitsPerEm=1000 xWidthAvg=479
     Noto Sans JP 700: ascent=1160 descent=-288 lineGap=0 unitsPerEm=1000 xWidthAvg=495
     Arial Regular: ascent=1854 descent=-434 lineGap=67 unitsPerEm=2048 xWidthAvg=913
     Arial Bold:    ascent=1854 descent=-434 lineGap=67 unitsPerEm=2048 xWidthAvg=983
   Formula (identica ao pacote `fontaine`/Next.js font fallback):
     sizeAdjust = (xWidthAvg/unitsPerEm da Noto) / (xWidthAvg/unitsPerEm do Arial)
     ascent/descent/lineGap-override = valor da Noto / (unitsPerEm da Noto * sizeAdjust)
   400 e 500 usam Arial Regular como referencia (Arial nao tem face Medium
   propria, o navegador recai no Regular). 700 usa Arial Bold. ─── */
@font-face {
  font-family: 'Noto Sans JP Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial'), local('Helvetica'), local('Liberation Sans'), local('Arimo');
  size-adjust: 104.7553%;
  ascent-override: 110.7342%;
  descent-override: 27.4926%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Noto Sans JP Fallback';
  font-style: normal;
  font-weight: 500;
  src: local('Arial'), local('Helvetica'), local('Liberation Sans'), local('Arimo');
  size-adjust: 107.4471%;
  ascent-override: 107.9601%;
  descent-override: 26.8039%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Noto Sans JP Fallback';
  font-style: normal;
  font-weight: 700;
  src: local('Arial'), local('Helvetica'), local('Liberation Sans'), local('Arimo');
  size-adjust: 103.1292%;
  ascent-override: 112.4803%;
  descent-override: 27.9261%;
  line-gap-override: 0%;
}
