/*
 * base.css: fontes, tokens, reset e tipografia.
 * Ordem de carga: base.css → components.css → sections.css
 */

/* ---------- Fontes (variáveis, subconjunto latino, hospedadas no site) ---------- */

@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-var-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Arial ajustada às medidas da Inter: o texto quase não se mexe quando a fonte chega (CLS). */
@font-face {
  font-family: "Inter Reserva";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  /* Cores: paleta do Eitan (ver CLAUDE.md) */
  --primary: #FFB300;
  --primary-hover: #E6A100;
  --on-primary: #25293C;
  --bg: #25293C;
  --surface: #2F3349;
  --border: #434968;
  --heading: #CFD3EC;
  --text: #B6BEE3;
  --muted: #7983BB;       /* 3,9:1 no fundo: só texto grande (24px+) e detalhes */
  --muted-text: #9AA3D2;  /* 5,8:1 no fundo e 5,0:1 na superfície: legendas e textos pequenos */

  /* WhatsApp: verde da marca, só no botão do WhatsApp */
  --whats: #25D366;
  --whats-hover: #1FBF5B;

  /* Tipografia */
  --font-titulo: "Sora", "Inter Reserva", system-ui, sans-serif;
  --font-texto: "Inter", "Inter Reserva", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-h3: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.6vw, 2.5rem);
  --fs-h1: clamp(2rem, 1.4rem + 3vw, 3.5rem);

  /* Espaçamento */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-secao: clamp(3rem, 2rem + 5vw, 6rem);

  /* Forma */
  --raio-sm: 0.5rem;
  --raio: 0.875rem;
  --raio-lg: 1.25rem;
  --sombra: 0 0.5rem 1.5rem rgb(15 18 30 / 0.35);

  /* Layout */
  --largura: 72rem;
  --header-h: 4rem;
  --header-h-rolado: 3.5rem;
  --barra-h: 4.25rem;

  --transicao: 0.2s ease;

  color-scheme: dark;
}

@media (min-width: 48rem) {
  :root {
    --header-h: 4.75rem;
    --header-h-rolado: 3.75rem;
  }
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-texto);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

img,
video {
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
}

/* ---------- Tipografia ---------- */

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--sp-4);
  color: var(--heading);
  font-family: var(--font-titulo);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--sp-4);
  text-wrap: pretty;
}

a {
  color: var(--primary);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--primary-hover);
}

strong {
  color: var(--heading);
  font-weight: 600;
}

.lead {
  font-size: var(--fs-md);
}

.legenda {
  color: var(--muted-text);
  font-size: var(--fs-sm);
}

/* Rótulo pequeno acima dos títulos de seção */
.sobretitulo {
  margin: 0 0 var(--sp-3);
  color: var(--primary);
  font-family: var(--font-titulo);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Foco e acessibilidade ---------- */

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--raio-sm);
}

.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pular {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--raio-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  transform: translateY(-200%);
}

.pular:focus {
  transform: none;
  color: var(--on-primary);
}

/* ---------- Layout ---------- */

.container {
  width: min(100% - 2rem, var(--largura));
  margin-inline: auto;
}

@media (min-width: 48rem) {
  .container {
    width: min(100% - 4rem, var(--largura));
  }
}

/* Quem pediu menos movimento vê o site sem animações */
@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;
  }
}

/* ---------- Transição entre páginas (melhoria progressiva: sem suporte, navega normal) ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}
