/* ================================================================
   Base — fontes self-hosted, reset, tipografia global,
   foco visível e reduced motion (TASK-007, REQ-015, ACC-002/003).
   ================================================================ */

/* ---- fontes locais (REQ-015 — sem CDN) ---- */
/* Myriad Pro não será licenciada (decisão do cliente); Segoe UI é a
   tipografia definitiva de títulos/interface — ver docs/ui-redesign-verification.md §3.8/§4. */
@font-face {
  font-family: "Tenor Sans";
  src: url("/static/assets/fonts/TenorSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fira Code";
  src: url("/static/assets/fonts/FiraCode-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 300 700;
  font-display: swap;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---- títulos e textos ---- */
h1, h2, h3, h4 { font-family: var(--font-ui); color: var(--text); margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.2; font-weight: 600; }
h2 { font-size: var(--fs-h2); line-height: 1.25; font-weight: 600; }
h3 { font-size: var(--fs-body); line-height: 1.3; font-weight: 600; }
p  { margin: 0; }

.lead { font-family: var(--font-lead); font-size: var(--fs-body); color: var(--text-2); line-height: 1.6; }
.support { font-size: var(--fs-support); color: var(--text-3); }
.meta, code, kbd, pre { font-family: var(--font-code); font-size: var(--fs-meta); }

a { color: var(--slate); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--deep-teal); }

::selection { background: var(--sky); color: var(--ink); }

mark {
  background: color-mix(in srgb, var(--lime) 45%, #ffffff);
  color: var(--ink);
  border-radius: var(--rad-4);
  padding: 0 var(--sp-1);
}

kbd {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--rad-4);
  padding: 0 var(--sp-2);
  color: var(--text-2);
}

/* ---- scrollbar discreta ---- */
* { scrollbar-width: thin; scrollbar-color: var(--fog) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--fog); border-radius: var(--rad-full); border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- foco global visível (ACC-002) ---- */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--rad-4);
}
.app-sidebar :focus-visible { outline-color: var(--lime); }

/* ---- utilidades de acessibilidade ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---- reduced motion (ACC-003): remove deslocamento, mantém feedback ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--dur-80) !important;
    scroll-behavior: auto !important;
  }
}
