/*
  Kayru by Eikon — Base
  ------------------------------------------------------------------
  Reset enxuto, carregamento da Inter, tipografia base e foco
  visível. Depende de tokens.css já estar carregado antes deste
  arquivo.
*/

/* ---------------------------------------------------------------
   1. Fonte — Inter servida localmente (ver docs/05-DESIGN-SYSTEM.md
   para a justificativa de self-host em vez de Google Fonts).

   A Inter é uma fonte variável: um único arquivo por subconjunto
   cobre a faixa inteira de pesos, então Regular (400) e Semibold
   (600) do manual saem do mesmo binário. Declarar dois @font-face
   apontando para arquivos separados baixaria a mesma fonte duas
   vezes.

   Dois subconjuntos: `latin` cobre o essencial e `latin-ext` traz os
   acentos que o português precisa (ã, õ, ç, ú). O unicode-range faz
   o navegador buscar o segundo arquivo só quando a página tem esses
   caracteres.
   --------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter-latin.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;
}

@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/Inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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;
}

/* ---------------------------------------------------------------
   2. Reset enxuto
   --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Respeita a preferência do usuário por menos movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------
   3. Tipografia base
   --------------------------------------------------------------- */
body {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--font-size-title-lg);
}

h2 {
  font-size: var(--font-size-title-sm);
}

h3 {
  font-size: var(--font-size-lg);
}

small {
  font-size: var(--font-size-sm);
}

/* ---------------------------------------------------------------
   4. Foco visível — nunca outline:none sem substituto acessível.
   Todo elemento interativo mantém indicação de foco clara em
   navegação por teclado, usando a cor de marca safira (>= 3:1 de
   contraste não-textual sobre gelo e sobre branco, ver docs).
   --------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

/* Remove o outline padrão só quando :focus-visible existe e assume
   o indicador acima — nunca remove foco sem substituto. */
:focus:not(:focus-visible) {
  outline: none;
}

/* ---------------------------------------------------------------
   5. Utilitários mínimos
   --------------------------------------------------------------- */
.u-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.u-text-secondary {
  color: var(--color-text-secondary);
}

.u-text-center {
  text-align: center;
}

.u-flex {
  display: flex;
}

.u-flex-col {
  display: flex;
  flex-direction: column;
}

.u-items-center {
  align-items: center;
}

.u-justify-between {
  justify-content: space-between;
}

.u-gap-1 { gap: var(--space-1); }
.u-gap-2 { gap: var(--space-2); }
.u-gap-3 { gap: var(--space-3); }
.u-gap-4 { gap: var(--space-4); }
